Contract interaction - part 1
- Please follow instructions in Vest-in-chain wiki
- IMPORTANT !!! Make sure you have always some amount of ETH on your account (0.5 ETH recommended) as all active validators take their turn in sending statistics into the notary function in Lition Registry contract so you need to have some ETH for gas fee. Please check your ETH balance on regular basis !
Node start-up - part 2
You must finish all the steps from part 1 before you can start with part 2
Follow these steps to setup your server and start up the node:
- install docker, you can follow this tutorial for example, but feel free to install it any way you prefer.
masterbranch of lition-maker
git clone https://gitlab.com/lition/lition-maker
- go to lition maker folder
- run setup script
./setup.sh- our recommendation is to use screen or something similar to run your node
Important !!! You can also run a command with parameters instead of manually typing it, see readme and example at the end of this part
_ __ __ | | | \ / | | | | \ / | | | | \/ | | | | |\ /| | | | | | \ / | | | |_____| | \/ | | |_________| |_| Version Built on Lition 1.0-testing Please select an option: 1) Create Network 2) Join Network as a validator 3) Join Network 4) Exit
Now you need to select number 2
Please enter node name: please specify you node name - can be any string (not possible to change it later)
Please select ethereum network: [Enter for default -> Ropsten] 1) Ropsten 2) Mainnet
Please enter IP Address of existing node: Specify IP address of creator or other node on this sidechain. For Lition Energy sidechain it is bcenergymainnetc.lition.io.
Please enter Node Manager Port of existing node[Default:22003]: Press Enter for default or specify different port of Node Manager for IP from step before. For Lition Energy sidechain it is 22003.
Please enter IP Address of this node: please specify IP address of your node
Please enter RPC Port of this node[Default:22000]: Please enter Network Listening Port of this node[Default:22001]: Please enter Constellation Port of this node[Default:22002]: Please enter Node Manager Port of this node[Default:22003]: Please enter WS Port of this node[Default:22004]:
You can use default values by pressing Enter or use ports that you would like to.
Please enter private key of this node(Empty->new key is generated): Specify your mining private key from metamask for account you used in Part 1 How to export key from metamask
Please enter existing chainId to connect to: Specify chain ID you would like to connect to. For Lition Energy sidechain it is 3.
Please enter an Infura key: Specify only the alphanumeric key of a valid Mainnet Infura URL.
Node start-up (setup.sh) by command example
- Instead of manually typing all the required information, you can run a command instead, see example below:
./setup.sh join_as_validator -n DemoValidator --oip bcenergymainnet.lition.io --onm 22003 --tip <YOUR SERVER IP ADDRESS> -r 22000 -w 22001 -c 22002 --nm 22003 --ws 22004 -pk <YOUR MINING PRIVATE KEY> --ethnet mainnet --chainId 1 --infura abcXXXXXXXXXXX 2>&1 | tee ~/log
Node successful start-up
- After you run manually ./setup.sh or run it as a command, it automatically calls
startMiningon Lition Registry contract to let the other nodes know that your node is up and your are ready to take part in mining process.
- You would be never voted as a validator by other nodes without calling
startMining, that's why the node waits until it is processed
- Please note that this might take quite some time as
startMiningis processed on Ethereum network so in edge cases it might take even few hours, but usually it is just a few minutes.
- Once you see message the Node is running, everything is setup and your node is running
Node start-up possible fails
As we all know sometimes unexpected things happens in software:
If you see this message "mv: cannot stat 'datadir/keystore/*': No such file or directory", it may be due to the fact that your server doesn't have enough memory. Check the memory consumption and try to increase it.
You might successfully boot-up your node, but other nodes from some reason did not receive AccountMining event emitted by
startMiningfunction that you just automatically called. As a result, you were not voted as validator and therefore you cannot take part in mining process and earn rewards...
If this should happen, you will simply notice that even though you vested in chain and joined network as a validator, you are simply not receiving any rewards + after some time you will see on the terminal message:
As of block: ... you are not registered as validator on geth level. Please control this by attaching to the rpc port of your node and call istanbul.GetValidators(). In case your node is running for more than 10 minutes and you are not voted as validator, please call StartMining on Lition SicechainManger here: https://www.lition.io/sidechainmanager/ and you will be automatically voted as validator by other nodes.
You can validate that it is really what happened by Reloading Users details in the left panel and see if
Miningparameter is set to true
To understand what all parameters in the left panel mean, please check Chain-and-User-details-parameters wiki
Important !!! It might be caused just by some delay, so please give it at least 15 minutes to recover by itself and continue with following steps after this timeout in case the issue did not disappear
If you see this message, please do not shut down your node, leave it running, go to the Interact with sidechain section in Lition sidechain manager
Click on Mining
- And manually call
startMiningeven if the manager says: Your address is currently mining.
startMiningis confirmed, you should see on terminal that your node received AccountMining event with your account as all other nodes did and they will vote you as a validator.
Node shut-down possible fails
- Same logic applies also for the node shut-down.
- When your node is shutting down, it automatically calls
stopMiningfunction on Lition Registry contract.
- In case something unexpected happens and
stopMiningis not called or other nodes did not receive AccountMining event with your account, you might end up in a situation when you are still registered as active validator in Lition Registry contract but in reality you are not mining anymore
- It is no big deal as you are going to be automatically removed from the list of active validators in Lition contract and unvoted by nodes after 2 notary windows during which you did not mine no block, but still you can and you should take care of this process by yourself and call
stopMiningmanually in Lition sidechain manager.
- Go to the Interact with sidechain section in Lition sidechain manager
- Click on Mining
- And manually call
stopMiningeven if the manager says: Your address is currently not mining.
- If you must shut down your node or it just crashed from some reason, do not use ./setup.sh script again to boot it up - it would override the saved state (blocks, your private keys in keystore if you added some, etc...)
- For restart, please enter the directory with saved state - it is the
Node nameparameter that you specified during setup and run ./start.sh script without any parameters. In case of this example it is DemoValidator
cd DemoValidator/ ./start.sh