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.
clone master branch of lition-maker git clone https://gitlab.com/lition/lition-maker
go to lition maker folder cd lition-maker
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
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. ⚠Warning please be sure that you properly secure RPC Port and WS Port, so only you or your Dapp can connect to them!⚠
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 0.
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:
After you run manually ./setup.sh or run it as a command, it automatically calls startMining on 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 startMining is 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, you might successfully boot-up your node, but other nodes from some reason did not receive AccountMining event emitted by startMining function 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 Mining parameter is set to true
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 startMining even if the manager says: Your address is currently mining.
After startMining is 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 stopMining function on Lition Registry contract.
In case something unexpected happens and stopMining is 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 stopMining manually in Lition sidechain manager.
And manually call stopMining even 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 name parameter that you specified during setup and run ./start.sh script without any parameters. In case of this example it is DemoValidator