Spectrum Chain Development--linux Environment construction

Source: Internet
Author: User
Tags install go docker run

This article mainly introduces the installation of the basic environment of Spectrum chain development in Linux environment, including Ubuntu and CentOS environment. It also provides a way to create a docker image. It is recommended to install in a Docker environment to avoid installation success due to environmental differences and to deploy quickly.

Installation

System environment (the following environment has been tested)

    • Ubuntu:ubuntu 16.04.4 LTS

    • Centos:centos Linux Release 7.5.1804

    • Docker:version 18.06.1-ce-mac73 (26764)

Note: The installation process may be slightly different for different Linux release versions

Tool installation

Installation dependencies

    • Ubuntu
$ apt-get install git$ apt-get install wget
    • Centos
$ yum install git$ yum install wget$ yum -y install gcc automake autoconf libtool make
    • Docker (with Golang mirroring, no need to manually install go)
$ docker pull golang$ docker run -i -t golang /bin/bash$ go versiongo version go1.11 linux/amd64

Install Go

Version check

$ go version

Version support

    • After testing, Golang1.9.2-Golang1.11 can be
    • Before you install the project, check to see if the required Golang are installed or if you have installed or used the Golang Docker image, ignore the next step "Download and install"

Download and install

Download and Unzip

$ wget -c -t 3 https://dl.google.com/go/go1.9.2.linux-amd64.tar.gz$ tar -C /usr/local -xzf go1.9.2.linux-amd64.tar.gz

Setting environment variables

    • Perform
$ export GOROOT=/usr/local/go$ export PATH=$GOROOT/bin:$PATH
    • Environment variables can also be added to the profile file, the above environment variables are added to the $HOME/.profile file, while the executionsource $HOME/.profile

Check version

    • Perform
$ go version
    • Results
go version go1.9.2 linux/amd64
    • Golang installation process such as: install.png

Spectrum installation

Download the source file

$ git clone https://github.com/SmartMeshFoundation/Spectrum.git

Compile

$ cd Spectrum$ make smc

Compile results

    • The result of the compilation is that the success
Done building.Run "/your_path/Spectrum/build/bin/smc" to launch smc.
    • Compile process such as: build.png

Run

Execute command

$ /your_path/Spectrum/build/bin/smc console

Note: /your_path/ represents the system path where the spectrum project code resides

    • Operating procedures such as: Run.png

Create an Account

> personal.newAccount()
    • Create an account such as: New.png

View nodes

> tribe.getStatus()
    • View nodes such as: Status.png

View history

> tribe.getHistory(11,false)
    • View history such as: History.png

Other

    • Completing the above installation process indicates that the spectrum chain infrastructure has been successfully installed and can proceed with the next development work.
    • /your_path/Spectrum/build/bin/smc consolea large number of spectrum chain data may be downloaded synchronously when the command is executed, which can take from 10 minutes to several hours (depending on the network).
    • In addition, make sure that the system environment has enough space to complete the download and update of the data. Data storage path is ~/.spectrum/smc/chaindata/ , if you want to remove items, please synchronize the deletion of data files, the action command is: rm -rf ~/.spectrum .
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.