Setup: NEO Private Net w/gas on OSX

in #neo7 years ago (edited)

UPDATE: While this tutorial still works, please instead see my updated post for a more efficient dev flow.

https://steemit.com/neo/@z0yo/quick-setup-neo-private-net-w-gas


This is a quick consolidated tutorial on starting up a NEO private net with gas on your local Mac OSX with Docker and neo-python

Docker

Download and Install Docker Community Edition for Mac

Open Docker.app

Confirm it’s running in your taskbar

Click on the Docker icon in your taskbar and wait until the status shows a green circle with the message “Docker is running”, as shown in the image below

Open up a terminal window and type “docker run hello-world”

If the output is as shown above, your Docker installation was successful and can move on to the next step

Python 3.5

Check to see if your already have Python 3.5 installed. Open a terminal and type

python --version


If you see Python 2.7.X, try running

python3 --version

as you may have Python 2 and 3 installed on your system.

If you see Python 3.5.4 you are good to go, and can move onto the next step

If not, you can download and install Python 3.5.4

It’s important to note that neo-python is not compatible with Python 3.6, so please install version 3.5.4

LevelDB

Install using brew

brew install leveldb

neo-python

Pull down a local copy

git clone https://github.com/CityOfZion/neo-python.git


Navigate into the directory

cd neo-python


Create a virtual environment to install the project dependencies

python3 -m venv venv
source venv/bin/activate


The result should look similar to this


Install the project dependencies by running the following

pip install -U setuptools pip wheel
pip install -e .

It may take a while to install, but just wait for it to complete.

neo-privnet-with-gas

Pull the latest image from Docker hub

docker pull metachris/neo-privnet-with-gas


Start the container

docker run -d --name neo-privnet-with-gas -p 20333-20336:20333-20336/tcp -p 30333-30336:30333-30336/tcp metachris/neo-privnet-with-gas


Check to make sure the container is running

docker ps

Confirm setup

Navigate to your local neo-python directory if you aren’t already in there

Download the pre-made wallet

wget https://s3.amazonaws.com/neo-experiments/neo-privnet.wallet


Run

python prompt.py -c protocol.privnet.json

or, depending on your local python setup:

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 neo-privnet.wallet


Enter the wallet password

coz


Check the wallet balance

wallet

The wallet should have the 100m NEO and ~60k 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, and would like see more of these in the future, you can donate at:

NEO/GAS/NEP5 tokens: AR8rRBxgWw5siKsp1dUmfTLy6QQTjcqoqB

ETH/ERC20 tokens: 0x575970777095575fDd12d9cD3B105b41D8DD1344

NANO/XRB: xrb_3rpmim57tqbrb8hhjfzm1x5uk135yhmgqoj7j7wsufpo53e3ad5k93ggy1cd

LTC: M8nZ7FwJXSMAkAfiGmTKjbB7MWpdwsp52d

BTC: 3LcA1ztxFjghexRNWPyGXA59VFU3gF4PTz

BCH: 1LXLiF7SjWGday6gm61hzbYHKbSAMevwXo

Sort:  

Upvoted ☝ Have a great day!