Getting Started
Setting Up a Node
Preparations:
Install Go v1.10 or higher, Git, and the C compiler(if you have not installed GO, Git or C compiler please follow README).
Clone the go-seele repository to the GOPATH directory :
`
go get -u -v github.com\seeleteam\go-seele...
`
In
seeleteam\go-seele\cmd\node, run:go build; if you are running this for the first time a node executable object will appear.Something you may need to know before running a node:
If you run into the error related to "genesis block hash mismatch", follow the solution located here.
If you want to run a light node, just replace node1.json with light_node1.json. Of course, don't forget to start a full node before you do this.
Unless otherwise stated, the nodes mentioned below refer to the full node.
Get an account:
You will need an account to send transactions, deploy contracts and start mining on the mainnet. See How to create an account to create your own account. However, if you just want to run a seele node locally or in a test environment, you can skip this step. Some default accounts are provided for testing.
Running a Node:
In go-seele/cmd/node:
On Windows:
Running a Single Node:
In the cmd window, run:
node start -c .\config\node1.jsonBy default this will start the miner, not metrics. You can add flags
-m stopto not start the miner, or-t trueto start metrics.
Running Multiple Nodes:
In one cmd window, run:
node start -c .\config\node1.jsonIn a second cmd window, run:
node start -c .\config\node2.json
On Linux & Mac:
Running a Single Node:
On terminal, run:
./node start -c ./config/node1.jsonBy default this will start the miner, not metrics. You can add flags
-m stopto not start the miner, or-t trueto start metrics.
Running Multiple Nodes:
In one terminal window, run:
./node start -c ./config/node1.jsonIn another terminal window, run:
./node start -c ./config/node2.jsonImportant note: under seeleteam/go-seele/cmd/node/config, there are 4 node configurations (with filename node*.json) that can be used as examples. To use your own account to interact with the mainnet, make sure you use the correct coinbase, p2p private key and shard information in one of these json files. For details, see How to customize your node configurations.
If you want to have a quickstart in a test or private blockchain environment, you can use the default node configurations and accounts. For example:
./node start -c ./config/node1.json --accounts ./config/accounts.jsonNote that seeleteam/go-seele/cmd/node/config/accounts.json only contains test accounts, do not use them if you are going to connect to the Seele mainnet.
The node configuration and test accounts are shown as follows. To modify it for your own account, see How to customize my node configurations.
node1.json:
accounts.json:
Domain
Parameter
Explanation
basic
name
Name of node
version
Version of node
dataDir
System file path of node, used to store data
address
Address to start RPC server
coinbase
Coinbase used to mine
algorithm
consensus algorithm of the network
p2p
privateKey
Private key for the p2p module, not used as an account
staticNodes
A static node. When the node is started, it will be connected to search for more nodes.
address
The p2p server will listen on the TCP connection, which is used as the UDP address for the Kad protocol.
networkID
Used to indicate the network type. For example, 1 is testnet, 2 is mainnet.
log
isDebug
If IsDebug is true, the log will be on the debug level, otherwise it will be on the info level.
printLog
If PrintLog is true, then all logs will be printed on the console, otherwise it will be written and stored in a file.
httpServer
address
HTTP RPC's service address.
crossorgins
Sent to the client's cross-origin resource sharing origin. Note that CORS is a type of forced safety measure by the browser, which is irrelevant to the client's custom HTTP.
whiteHost
Whitelist of permitted hosts.
wsserver
address
Address of Websocket RPC server.
genesis
timestamp
Timestamp of the genesis block.
difficult
Difficulty level: should be difficult near the beginning in order for easier block creation.
shard
Number of shards in the genesis block.
Help:
Use "node -h" for a list of available commands.
Use "node [command] --help" for more information about a command. </a>
Create a Full Node Client:
Preparations:
Install go v1.10 or higher and the C compiler (if you haven't install GO, Git or C compiler please follow README).
In
seeleteam\go-seele\cmd\client, run:go build. If you are running this for the first time, a client executable object will appear.
Running a Full Node Client:
On Windows:
In the command window, run:
client
On Mac & Linux:
In the command window, run:
./client
Help:
Create a Light Node Client:
Preparations:
Install go v1.10 or higher and the C compiler.
In
seeleteam\go-seele\cmd\client\light, run:go build. If you are running this for the first time, a client executable object will appear.
Running a Light Node Client:
On Windows:
In the command window, run:
light
On Mac & Linux:
In the command window, run:
./light
Help:
Some common-used commands:
0. Get an account
How to create an account will help you get a Seele account.
1. Transfer
Of course, you need an account with money in it to transfer money (for example, 10 fans) to A.
Use the following example need to add the
--accountsparameter when you need to start the node, In seeleteam/go-seele/cmd/node: command:node start -c ./config/node1.json --accounts ./config/accounts.json
Query the transfer result with the tx
Hash.
The result of "failure": falserow, indicating that the transfer was successful. By the way, if tx is not packed by the miner or the miner is packing, you may seeget error when call rpc leveldb: not found. Don't worry, just wait for servals seconds, or you can use client gettxbyhash to query tx status.
Confirm the A balance.
2. Deploy contract
For the sake of convenience, use A to deploy the
simple_storage.solcontract. Using the contract simulator will help you to get the contract binary data.
If you display get error when call rpc balance is not enough, account:0xb4153ca4090a11af1984cdf20b0d0cbed5ff97a1, balance:10, amount:0, fee:123, that's right, I deliberately, quickly fill the money.
Query the contract deploy result
The result of "failure": falserow, which indicates the deploy contract was successful. The result of "contract": "0xc3e7b32db87dd5b8d70a78666518c6395d0f0092" row is the contract address.
3. Call contract
Sendtx
sendtxto call the contract
Query the result
Call
callthe contract, thecallcommand is separate from the blockchain and is suitable for querying data without changing the state.
How to customize your node configurations
Under seeleteam/go-seele/cmd/node/config, you can find four node*.json files. You can create your own Seele node by customizing any one of them.
After creating your account (How to create an account), replace "coinbase" field with your public key.
Modify the "shard" field with the correct shard number associated with your account.
Create another private-public key pair. Replace "privateKey" field in "p2p" section with your private key. This private key is used for p2p network only and should be different from the private key you use to mine and send transactions. Do not use private keys associated with your coinbase or any other transaction accounts here!
You could connect to some static nodes in the network by configuration. The format of "staticNodes" field is ["ip:port",...], for example, ["127.0.0.1:8057"].
If "isDebug" and "printLog" fields are true, the display is in debug mode and log mode when you run the Seele node. Default values should be false.
The "networkID", "difficult" and "timestamp" field for nodes in the same network should be the same. Nodes with different values in these field can not connect to each other.
GCC install newbie guide
Install Document: https://gcc.gnu.org/install/
Download Link: https://gcc.gnu.org/install/binaries.html
Or you can go directly to the website to download the release installer. (Recommended)
Start Metrics
If you want to start the metrics, it is necessary to install InfluxDB first.
Download Link: https://portal.influxdata.com/downloads
After downloading Influxdb, go to the Influxdb folder and update Influxdb.conf:
Then, start the influxdb with influxdb.conf.
And in another cmd window, use the influxdb client to create the database "influxdb".
Finally, start the node with -t true.
Q&A
genesis block hash mismatch
If the log looks like the following:
Windows:
Linux:
You can just delete the .seele/node1 folder and restart. The absolute path to the .seele folder is in the logs printed above.
Last updated
Was this helpful?