Spectrum Chain installation for Linux
This article introduces the basic environment installation of Spectrum chain development in Linux environment, including Ubuntu and CentOS. At the same time, it also provides a way to create a Docker image. It is recommended to use the docker environment to avoid installation failures due to environmental differences, and rapid deployment.
Install
1. System environment
- 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 distributions.
2. Tool installation
2.1 Installation dependency
- 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(No need to install Golang separately)
$ docker pull golang
$ docker run -i -t golang /bin/bash
$ go version
go version go1.11 linux/amd642.2 Install Golang
- Version check
$ go version- Version support
Golang1.9.2 — Golang1.11 has been tested and supported.
Before installing the project, check if Golang is installed. If you have installed or used Golang Docker image, please 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.gz2. Setting environment variables
Run
$ export GOROOT=/usr/local/go
$ export PATH=$GOROOT/bin:$PATHYou can also add environment variables to the profile file, add the above environment variables to the $HOME/.profile file, and execute source $HOME/.profile.
- Check the version again
Run
$ go versionResults are as follows
go version go1.9.2 linux/amd64The Golang installation process is as follows

3. Spectrum chain installation
3.1 Download source file
$ git clone https://github.com/SmartMeshFoundation/Spectrum.git3.2 Build
$ cd Spectrum
$ make smc3.3 Get result
Done building.
Run "/your_path/Spectrum/build/bin/smc" to launch smc.The Spectrum chain installation process is as follows

Run
1. Run fast node to test smc
$ /your_path/Spectrum/build/bin/smc consoleNote: /your_path/ indicates the system path where the Spectrum project code is located.
Run the Spectrum chain as follows

2. Create new account
> personal.newAccount()Create new account as follows

3. View the miner nodes
> tribe.getStatus()View the miner nodes as follows:

4. View the block mining history in console
> tribe.getHistory(11,false)View the block mining history in console as follows

Summary
Completing the above installation process means that the Spectrum chain infrastructure has been successfully installed and can be used for the next development work.
When you execute the /your_path/Spectrum/build/bin/smc console command, you may download a large amount of Spectrum chain data synchronously, which may take tens of minutes to several hours (depending on the network).
In addition, please ensure that the system environment has enough space to complete the download and update of data. The data storage path is ~/.spectrum/smc/chaindata/. To remove the project, delete the data file synchronously. The operation command is: rm -rf ~/.spectrum.

