Set up a Localnet (raw)
How to set up a local MultiversX Testnet on a workstation.
Prerequisites
First, clone mx-chain-go and mx-chain-proxy-go in a directory of your choice.
$ mkdir mytestnet && cd mytestnet
$ git clone git@github.com:multiversx/mx-chain-go.git
$ git clone git@github.com:multiversx/mx-chain-proxy-go.git
Then, run the prerequisites
command.
$ cd mx-chain-go/scripts/testnet
$ ./prerequisites.sh
This will install some packages and also clone the mx-chain-deploy-go repository, as a sibling of the previously cloned mx-chain-go
.
Depending on your Linux distribution, you may need to run the following commands as well:
sudo apt install tmux
sudo apt install gnome-terminal
Configure the Testnet
The variables that dictate the structure of the Testnet are located in the file scripts/testnet/variables.sh
. For example:
export TESTNETDIR="$HOME/MultiversX/testnet"
export SHARDCOUNT=2
...
You can override the default variables by creating a new file called local.sh
, as a sibling of variables.sh
. For example, in order to use a different directory than the default one:
local.sh
export TESTNETDIR="$HOME/Desktop/mytestnet/sandbox"
export USETMUX=1
export NODETERMUI=0
Once ready with overriding the desired parameters, run the config
command.
$ ./config.sh
After that, you can inspect the generated configuration files in the specified folder:
$HOME/Desktop/mytestnet/sandbox
├── filegen
│ ├── filegen
│ └── output
│ ├── delegationWalletKey.pem
│ ├── delegators.pem
│ ├── genesis.json
│ ├── genesisSmartContracts.json
│ ├── nodesSetup.json