Personal private blockchain for NEO dApp development!
Fast and easy to start from the ground:
- Install docker and docker-compose for your platform:
- Linux Docker - docker-compose
- Mac Docker and docker-compose
- Windows Docker and docker-compose
- Download the latest version of neo-local
- or clone the repo:
git clone https://github.com/CityOfZion/neo-local.git
- or clone the repo:
- Move to the folder neo-local
- Start all with the command
make start
on linux/Mac anddocker-compose up
on Windows - Wait some seconds and you will have neo-python prompt available
- You can also start your browser and go to neo-local-faucet and claim some NEO and GAS to a wallet
That will make a private NEO blockchain just for you to develop your dApp or smart-contract
To stop neo-local, exit from neo-python prompt and do the following command (Linux/Mac):
make stop
or on Windows
docker-compose down
Within the neo-local you'll find the following services:
- neo-local-faucet (dev faucet)
- neo-cli (block producer node)
- neo-python (development CLI)
- (block explorer)
- neo-scan-sync (block explorer)
- postgres (database for neo-scan)
After running neo-local (see Quick start) you will land in the neo-python prompt.
Block producer node is available on localhost
port 20333
.
Or by RPC on localhost
port 30333
.
There are also two folders shared with the neo-python running container. Everything you put there is available to be used inside the container.
neo-local/
├── wallets/
├── smart-contracts/
Only one neo-cli node is started as block producer. The version of that node can be customized by you. You should check what versions are supported. That information is shown in a commented line inside the ".env" file.
To change the default version you just need to edit the ".env" file
neo-local/
├── .env
and change the variables above
# neo-cli version
# Other supported versions: 2.10.2
NODE1_NEO_CLI_VERSION=2.10.2
If you want to monitor your node, you can use this little script that makes two RPC calls querying the version of the node and the blockcount. It will keep looping and showing you the results in a table.
neo-local/
├── privnet/
│ ├── watch_nodes_sync.sh
Run it like this
./privnet/watch_nodes_sync.sh
And if you want to change a consensus node version when all is already running?
Well, you can do that without disrupting your blockchain in a snap of time.
To make that happen you need to run a script inside the privnet folder:
neo-local/
├── privnet/
│ ├── change_neo-cli_node_version.sh
The script accepts 2 arguments:
-
The first argument is the name of the node container.
Example:neo-cli-privatenet-1
-
The second argument is the version of the neo-cli desired to be installed
This is a possible example:
./privnet/change_neo-cli_node_version.sh neo-cli-privatenet-1 2.10.2
Note: This works for upgrading or downgrading the version.
Sometimes is good to start fresh from the genesis block.
You can do that changing the variables on the .env
file
neo-local/
├── .env
Inside that file you have a variable called BOOTSTRAP.
There are two possible values:
_genesis
means starting from block zero_1600kBlocks
starts with 1600 blocks (default)
Note: A genesis chain doesn't have GAS claimed yet. You will need GAS to deploy smart-contracts.
Have a bug or a feature request? Please first read the issue guidelines and search for existing and closed issues. If your problem or idea is not addressed yet, please open a new issue.
- Open-source MIT