Giter Club home page Giter Club logo

spectrum's Introduction

Spectrum

光谱logo2(1).png

Spectrum is an Ethereum-compatible project. It uses a new consensus and new block reward for SmartMesh ecosystem devices and IOT. 

Warning

We suggest that the GasPrice should not be less than 18Gwei, otherwise the transaction may not be packaged into the block.

Build the source

Building Spectrum requires both a Go (version 1.9.2 or later) and a C compiler. You can install them using your favourite package manager.

Ubuntu:

1)Install git
	$ apt-get install git
	$ apt-get install golang
2)Install golang in the directory of {GOHOME}
	$ cd {GOHOME}
	$ tar -zxvf go1.9.2.linux-amd64.tar
	$ mkdir {GOHOME}/gopath
	$ export GOAPTH={GOHOME}/gopath 
	$ export GOROOT=${GOHOME}/go 
	$ export PATH=$GOROOT/bin:$PATH
3)download the source on the git
	$ cd {GOPATH}
	$ mkdirs src\github.com\SmartMeshFoundation\
	$ cd src\github.com\SmartMeshFoundation\
	$ git clone https://github.com/SmartMeshFoundation/Spectrum.git
4)compile the source code
	$ cd Spectrum
	$ make smc
5)run the program
	$ ./build/bin/smc console

Mac

1)download the latest *Spectrum* source code from the github 

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

2)Install by using source code

    	$ cd Spectrum
    	$ make smc

	If any error happens during the compiling and prompt message shows " lacking of the header file that is related to the Mac OS", you may try to install the xcode command-line tool before executing above commands:

        $ xcode-select --install

3) startup

    	$ build/bin/smc console

Windows

1)First of all, you need to install a package management software for Windows named "chocolatey". Please refer to https://chocolatey.org for Installation method.
2)Install git, golang, mingw by using chocolatey
	c:\Users\xxx> choco install git
	c:\Users\xxx> cholo install golang 
	c:\Users\xxx> cholo install mingw

3)Set environment variables {GOPATH} of golang:
	c:\Users\xxx> mkdir {GOPATH}
	c:\Users\xxx> set "GOPATH={GOPATH}"
	c:\Users\xxx> set "Path={GOPATH}\bin;%Path%"
4)download the source on the git: 
	c:\Users\xxx> cd {GOPATH}
	{GOPATH}> mkdir src\github.com\SmartMeshFoundation\
	{GOPATH}> cd src\github.com\SmartMeshFoundation\
	...\SmartMeshFoundation> git clone https://github.com/SmartMeshFoundation/Spectrum.git
5)compile source code:
	...\SmartMeshFoundation> cd Spectrum
	...\SmartMeshFoundation> go install -v ./cmd/...
6)run the program:
	c:\Users\xxx> smc console

Encrypt your nodekey

 $ ./build/bin/smc security --passwd

Decrypt your nodekey

 $ ./build/bin/smc security --unlock

Run fast node to test smc

$ ./build/bin/smc console

Create new account

> personal.newAccount()

View the miner nodes

  • tribe.getStatus()
  • then you will see the following message:
{
  "epoch": 5760,
  "number": 39601,
  "signerLevel": "None",
  "signerLimit": 17,
  "signers": [
    {
      "address": "0x3a5fbac6ca913599c5fde8c1638db58d01de8a48",
      "score": 3
    },
    {
      "address": "0xad4c80164065a3c33dd2014908c7563eff88ab49",
      "score": 3
    },
    {
      "address": "0xc22d53456abd14da347517a4b47ea24866b8e3ae",
      "score": 3
    },
    {
      "address": "0x7b06dd132c089034157f1e1aacda75787df1e0c5",
      "score": 3
    },
    {
      "address": "0x00ab501f3fe4b2f71651764699ec5752598e679f",
      "score": 3
    }
  ],
  "totalSinner": 2,
  "volunteerLimit": 70,
  "volunteers": []
}

that tell you there are two miners in the testnet.

View the block mining history in console

  • tribe.getHistory(11,false)

  • then you will see the following message (console format):

[{
    🔨: "39708 -> 0x7B06dd132c089034157f1E1AAcda75787DF1e0c5"
}, {
    🔨: "39707 -> 0xc22D53456ABd14Da347517a4B47ea24866B8E3Ae"
}, {
    🔨: "39706 -> 0xAd4c80164065a3c33dD2014908c7563eFf88Ab49"
}, {
    🔨: "39705 -> 0x3a5fBaC6CA913599C5fde8c1638dB58d01De8A48"
}, {
    🔨: "39704 -> 0x00aB501f3Fe4b2f71651764699EC5752598E679f"
}]

that tell the block number and miner's account that generate that block.

get your own miner account

every node has it's own miner account, you can run getMiner() function to get that account:

> tribe.getMiner() 

then you will see below messages:
{
    address: "0x00ab501f3fe4b2f71651764699ec5752598e679f",
    balance: 2001223531052513000,
    level: "Signer"
}
that will show your miner account and the balance of miner account in Wei unit.

becoming a miner

if you want to become a miner, you will send 1 smt to the miner account, after this transfer,
you will run miner.start() to join into the miners group.

> miner.start()

spectrum's People

Contributors

cc14514 avatar smartmeshfoundation avatar caizhihong0526 avatar cytl5yy avatar rectinajh avatar liangchuan avatar

Watchers

James Cloos avatar TheDev avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.