There are a handful of things that could go wrong. Once at least 2/3 of the validators listed in genesis.json are online your blockchain validator nodes will start writing blocks (and logging output) Clone repos on those machines and add the associated private keys in the priv_validator.json files Once installed you can do something like pm2 start node-chat.js -name blockchatĬreate two more droplets on Digital Ocean OR figure out how to work with Docker, or Docker Swarm (it isn't overly easy - but can save you money) so you can have 3 containers in the same droplet. Also note that you need a node process manager so the app can run all the time. Once your other validators are online you would see output in the console here. That is because 2/3 of all validators must be online before it starts writing blocks. If you are creating 3 validators (or more) this will look frozen like it isn't doing anything. Run your chat-node via node chat-node.js. Again make sure this file is never added to version control. If you have any issues, just make sure that ports 4667 are exposed to the outside world.Ĭopy the data from one of your priv_validator.json files into the the repo you just clone in a file named priv_validator.json. Clone this repository: īy default Digital Ocean exposes all ports. SSH into your new Digital Ocean Droplet.I usually choose a One Click App and pick Docker - you should just make sure it has Node on it.Īdd your SSH keys to Digital Ocean or create a root password. I recommend Digital Ocean.Ĭreate a new Droplet (and don't forget to use the free credits above). You will need a hosting service like AWS or Digital Ocean that can run the Lotion app with all the proper ports/etc.This tells lotion who our validators are and information about our app. Let genesis = require.resolve('./genesis.json') Make sure the code is bringing in the genesis file in the chat-node.js Now that we have private keys for 3 nodes/machines, and we have our genesis file, we have everything we need to start a blockchain network in a realistic scenario. Grab the public key data from each validator json file and put it in the genesis.json file in the validators array.If you did these steps correctly your project folder now looks similar to this: Run node chat-node.js again and repeat the process to create priv_validator3.json But we DO want the priv_validator.json - so copy it from the new app path like we did before and this time name it priv_validator2.json Run node chat-node.js to generate a new genesis and priv-validator.json - this time we don't want the new genesis file. Eventually we will delete them from this repo. We need to copy the priv_validator to our repo so we can add these to the genesis as well as use them for our validator servers.
0 Comments
Leave a Reply. |