Quick Setup: NEO Private Net w/gas

z0yo(30)
Published in
#neo
Words
287
Reading
2 min
9y
Listen to this post
~2 min

This is a quick tutorial on starting up a NEO private net w/GAS on either PC or Mac with Docker and neo-python, without locally installing python.

Install Docker

Create folder for smart contract code

Open a terminal

Very important: Navigate to, or create a folder to hold your smart contract code. We will be linking this folder to be shared with the docker container, so that you can access your smart contract files from within the container.

For example:

Start the docker container

We will be using neo-privnet-with-gas. It contains the neo private net instance with the NEO/GAS already in a wallet.

Run the command

docker run -d --name neo-privnet-with-gas -p 20333-20336:20333-20336/tcp -p 30333-30336:30333-30336/tcp -v "$(pwd)":/opt/neo-python/smartContracts metachris/neo-privnet-with-gas

Check to make sure the container is running

docker ps

SSH into the docker container by running

docker exec -it neo-privnet-with-gas /bin/bash

Navigate to the neo-python folder

cd opt/neo-python

In this folder you should see the smartContracts folder. It is linked to the local directory on your host machine.

Download the pre-made wallet

curl https://s3.amazonaws.com/neo-experiments/neo-privnet.wallet -o main.wallet

Jack into the聽matrix neo privnet container

python3 prompt.py -c protocol.privnet.json

You should now be in the neo command line. This will be where you interact with your private neo net.

Open the pre-made wallet

open wallet main.wallet

Enter the wallet password

coz

Rebuild the wallet

wallet rebuild

Check the wallet balance

wallet

The wallet should have the 100m NEO and ~6k GAS

Congrats! You are now officially set up, and have taken the first step on your way to start writing your own dapps and smart contracts!

If you found this tutorial helpful, please donate at:

NEO/GAS/NEP5 tokens: AR8rRBxgWw5siKsp1dUmfTLy6QQTjcqoqB
ETH/ERC20 tokens: 0x575970777095575fDd12d9cD3B105b41D8DD1344
NANO/XRB: xrb_3rpmim57tqbrb8hhjfzm1x5uk135yhmgqoj7j7wsufpo53e3ad5k93ggy1cd
LTC: M8nZ7FwJXSMAkAfiGmTKjbB7MWpdwsp52d
BTC: 3LcA1ztxFjghexRNWPyGXA59VFU3gF4PTz
BCH: 1LXLiF7SjWGday6gm61hzbYHKbSAMevwXo
Quick Setup: NEO Private Net w/gas | Ecency