Installing a New ZPB Node on a Linux System V1.0
Complete the following steps to install the ZPB node:
-
Install the Go package (ver 1.12.1+) by following the official docs (https://golang.org/doc/install) .
Remember to set your $GOPATH, $GOBIN, and $PATH environment variables, for example:
mkdir -p $HOME/go/bin
echo "export GOROOT=/usr/local/go" >> ~/.bash_profile
echo "export GOPATH=$HOME/go" >> ~/.bash_profile
echo "export GOBIN=$GOPATH/bin" >> ~/.bash_profile
echo "export PATH=$PATH:$GOROOT/bin:$GOBIN" >> ~/.bash_profile
source ~/.bash_profile -
Download the zebid, zebicli, genesis.json, and seed_nodes.txt from here:
Download Files - Copy zebicli and zebid to the following location: ~go/bin/
-
Grant execute permissions, choose custom node name for your node and initiate:
chmod +x zebid
chmod +x zebicli
zebid init <custom_node_name> --chain-id zpb-mainnet-1 -
Replace the existing genesis.json file at ~/.zebid/config:
cd ~/.zebid/config/
rm genesis.json && wget https://raw.githubusercontent.com/zebidata/ZPB/master/genesis.json
-
Copy the contents of seed_nodes.txt to the "seeds" section in “~/.zebid/config/config.toml”
NOTE: Seed Nodes will give list of peer nodes.
-
Run the following commands to configure your Zebi CLI to eliminate the need for
chain-id flag every time
zebicli config chain-id zpb-mainnet-1
zebicli config output json
zebicli config indent true
zebicli config trust-node true -
Generate Private key file and Certificate file:
cd ~/.zebid/config/ && mkdir ssl_certs && cd ssl_certs/ && openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem
NOTE: Please give custom information to configure SSL Certificate.
-
Start the Rest server in background:
nohup zebicli rest-server ~/.zebid/config/ssl_certs/cert.pem ~/.zebid/config/ssl_certs/key.pem --chain-id zpb-mainnet-1 --trust-node --laddr tcp://0.0.0.0:1317 > rest_log.out &
NOTE: Change 1317 port number to run the rest server in custom port number
-
Create an account with username and password.
curl --insecure -XPOST -s https://0.0.0.0:1317/Acc --data-binary '{"name":"<username>", "type":"add", "pass":"<password>", "mneumonic":""}'
- To add additional peer nodes, edit config.toml - (~/.zebid/config/config.toml) and add “<node_id>@<ip>:<peer_listening_port>” to “persistent_peers”. It is a comma separated list of as many peers you want to add.
- Run “zebid start --minimum-gas-prices=<amount>” to connect to ZPB. (For example, -- amount = 500.0zebi. Please ensure that you use the same format with stake as prefix to the actual amount.) You should now be able to see new blocks streaming in. (OR) If you want to run the command in background and do not want to see new blocks streaming into you newly setup node, enter: “nohup zebid start --minimum-gas-prices=<amount> >logs.txt &” Now, the new blocks streaming into your newly setup node will not be visible in log.
NOTE: It is important that you store the mnemonic and keystore file created in a very safe place. Keystore file which contains your private key in an encrypted form, is required to sign your transactions. If for some reason you lose your private key or the keystore, you can recover the same using your saved mnemonic. If you lose your mnemonic, then you can never recover your account’s private key and you will never be able to perform any kind of transactions on ZPB.
<username> - Provide custom username for your account<password> - Provide custom password you want to set for your account.
Your new node set-up is done and you can execute the Zebi CLI commands.
To verify, execute:
>zebicli version