Run Local Network
This guide helps you create a local Greenfield Blockchain network for testing and other development-related purposes.
Prerequisites
A computer running a Unix-like operating system (e.g., macOS, Linux) Basic familiarity with the command line Step 1: Install dependencies
The first step is to install the necessary dependencies, which include Golang
, Git
. Here are the steps to install them:
- Install
Golang
by following the instructions for your operating system on the official Golang website. - Install
Git
by following the instructions for your operating system on the official Git website.
Build the Greenfield CLI tools by running the following command in your terminal:
git clone --branch "$(curl -s https://api.github.com/repos/bnb-chain/greenfield/releases/latest | jq -r '.tag_name')" https://github.com/bnb-chain/greenfield.git
cd greenfield
make build
Quickly Setup a Local Cluster Network
- Start
SIZE=3 # The number of nodes in the cluster.
bash ./deployment/localup/localup.sh all ${SIZE}
- Stop
bash ./deployment/localup/localup.sh stop
- Send Tx
./build/bin/gnfd tx bank send validator0 0x32Ff14Fa1547314b95991976DB432F9Aa648A423 500000000000000000000BNB --home ./deployment/localup/.local/validator0 --keyring-backend test --node http://localhost:26750 -b block
- Restart the chain without state initialization
bash ./deployment/localup/localup.sh stop
bash ./deployment/localup/localup.sh start ${SIZE}
Quickly Setup Fullnode
- Start
SIZE=3 # The number of nodes in the cluster.
bash ./deployment/localup/localup_fullnode.sh all ${SIZE}
- Stop
bash ./deployment/localup/localup_fullnode.sh stop
Reference
The Greenfield chain is built using the cosmos-sdk
and Tendermint
core. There are various official configuration documents that can be referred to. These include: