Public Repository

Last pushed: a month ago
Short Description
Private network of the NEO blockchain, with 100M NEO and lots of GAS to play with (and neoscan*)
Full Description

Supported tags

The version numbers relate to the respective neo-cli release.

  • 2.8.0, latest
  • 2.7.6
  • 2.7.4
  • 2.7.3
  • 2.7.1

Info

Docker base image from neo-privatenet-docker.

  • 100M NEO and lots of GAS
  • Ready-to-use wallet and WIF key
  • RPC is enabled on the nodes (dotnet neo-cli.dll --rpc)
  • Easy to combine with neoscan for this private network. See here for more details.
  • neo-python already installed inside
  • See also: https://hub.docker.com/r/cityofzion/neo-python/
  • Maintainers: @metachris

Pull the latest image from Docker hub: docker pull cityofzion/neo-privatenet

You can start the container with this command: docker run --rm -d --name neo-privatenet -p 20333-20336:20333-20336/tcp -p 30333-30336:30333-30336/tcp cityofzion/neo-privatenet

To open a bash in the container, use docker exec -it neo-privatenet /bin/bash

Protip: You can force-stop and delete this container with docker rm -f neo-privatenet, and all your Docker containers (running and stopped) with this command: docker rm -f $(docker ps -aq) (careful!).

Wallet

You can use the keypair with the initial NEO and GAS by importing the WIF key.

  • WIF key: KxDgvEKzgSBPPfuVfw67oPQBSjidEiqTHURKSDL1R7yGaGYAeYnr
  • Address: AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y
  • Script hash (for use with CheckWitness): b'#\xba\'\x03\xc52c\xe8\xd6\xe5"\xdc2 39\xdc\xd8\xee\xe9'

How to use it with neo-python

  • Make sure to delete any old private-net chain: rm -rf Chains/privnet
  • Open the prompt on the private net: python prompt.py -p

Now you can just download the ready-to-use wallet file:

Or you can create a new wallet and import the WIF key:

  • Create or open a wallet: create wallet privnet1
  • Import the WIF key: import wif <wif-key>

Finally, make sure the wallet is fully synced by triggering a rebuild:

  • wallet rebuild

After the rebuild, you'll see the synced balances when you enter the command wallet.

How to use it with neo-gui or neo-gui-developer:

  • Update your protocol.json file and config.json file in the project root.
  • Remove the old chain directory
  • Remove the old peers.dat
  • Start the GUI
  • Perhaps you also need to rebuild Index, Wallet -> Rebuild Index

Getting shell access to the container

docker exec -it neo-privatenet /bin/bash

Once inside the container, check the running screens:

screen -ls
screen -d -r node1

JSON-RPC

The container exposes the port 30333 for JSON-RPC calls:

curl -X POST \
    http://localhost:30333 \
    -H 'Content-Type: application/json' \
    -d '{ "jsonrpc": "2.0", "id": 5, "method": "getversion", "params": [] }'

{"jsonrpc":"2.0","id":5,"result":{"port":20333,"nonce":1616105457,"useragent":"\/NEO:2.7.1\/"}}

Troubleshooting

Once the Docker container is running, you should see it with docker ps. You should also be able to open a TCP connection to port 20333 with telnet:

$ telnet localhost 20333
Trying ::1...
Connected to localhost.
Escape character is '^]'.
��version'3�$��    ZmO�z�
                      /NEO:2.7.1//

If that works, make sure new blocks are being generated. The easiest way is to refer to the documentation above about "Getting shell access to the container". Open a shell and attach to the node1 screen: screen -d -r node1. There you should see new blocks being generated roughly all 15 seconds.

More / Running neoscan with your private net

If you need light wallet functionality, you have two choices: NeonDB (legacy) or neoscan. If you're using neon-js, for example, you'll probably want one of these.

To setup neoscan with this private network container:

$ wget https://raw.githubusercontent.com/slipo/neo-scan-docker/master/docker-compose.yml -O docker-compose-neoscan.yml
$ docker-compose -f docker-compose-neoscan.yml up

See here for more information.

Docker Pull Command
Owner
cityofzion