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
$ apt-get install git$ apt-get install wget
$ 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
$ 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
$ go version
go version go1.9.2 linux/amd64
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.
Run
Execute command
$ /your_path/Spectrum/build/bin/smc console
Note: /your_path/
represents the system path where the spectrum project code resides
Create an Account
> personal.newAccount()
View nodes
> tribe.getStatus()
View history
> tribe.getHistory(11,false)
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 console
a 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
.