The idiots guide to building a private Neo blockchain network

Xyz Zyx
supercryptocurrency
2 min readOct 2, 2019

Pre-requisites:

an AWS account

basic programming knowledge

know how to use bash

Log into your AWS account, click on Services > EC2 > Launch Instance

Select the t2.micro (free! if this is your first and only instance)

Find your Public instance’s IP and for Gods Sake, allocate an Elastic IP to it

Step 1: Install Docker

sudo yum update -y
sudo yum install -y docker
sudo service docker start
sudo usermod -a -G docker ec2-user

Step 2: Check and deploy our Docker NEO network image

docker info #just a check
docker pull cityofzion/neo-privatenet
docker run --rm -d --name neo-privatenet --expose=20331-20334 --expose=30333-30336 -p 20333-20336:20333-20336/tcp -p 30333-30336:30333-30336/tcp cityofzion/neo-privatenet

write “docker ps” -> you should see your image running

Add port 30331–30334 to your security group

Step 4: Connect from your neo-prompt!

Open command prompt on local:

ubuntu
sudo -i
cd <location of neo-python>
source venv/bin/activate

Remember how we made note of the public IP in the last article? Let’s use that here:

np-prompt -p <server IP>

Congratulations!

You must restarted weekly. To restart it, use:

docker stop neo-privatenet

You can use a cron job to do so

example:

5 4 * * sun

(meaning: “At 04:05 on Sunday.”)

#!/bin/bash
while :
do
if nmap -sP 192.168.1.222 | grep ‘Host is up’; then
echo “my computer is turned ON”
curl http://192.168.1.222:7999/1/detection/pause
sleep 60
else
echo “my computer is turned OFF”
sleep 180
curl http://192.168.1.111:7999/1/detection/start
fi

echo “listening to computer status changes…”
sleep 60
done

if you liked this post, you can click the clap button

--

--