Setting up a local simnet
Learn how to run your own local "simnet" node.
For local development and testing, we can configure a local "simnet", or a fake network on our local computer.
cargo run --bin melsimnet -- create -s 1. -s 2. -s 3. -s 4.
Running this command will generate several (4 in this case) files and scripts to run the staker nodes in your custom local network. This means that staker 1 will have voting power equivalent to 1 SYM and staker 2 will have 2 SYM, etc.
Let's go through what this all means:
run-staker-*.sh- run an individual staker node
run-all.sh- run all of the staker nodes on a custom local network
staker-*.yaml*- defines the config for an individual staker node (explained below)
genesis.yaml- defines the genesis config for the custom local network (explained below)
After running some (or all) of the nodes, you'll be able to interact with the nodes via wallet client/daemon, melscan, even direct HTTP calls.
This is only needed to start our own custom network,
melnodeaccepts a YAML config file similar to the following:
network: custom02 # anything from custom02..custom08
# specifies the "initial stash" of money in the genesis block
# what address gets the initial supply of money
# how many units (in millionths)
# additional data in the UTXO, as a hex string
# specifies all the stakers with consensus power.
# we need to specify ourselves in order to produce any blocks; "Mel-crypttool generate-ed25519" (install via cargo) can generate a keypair for us
e_post_end: 100000 # essentially never end the stake
syms_staked: 10000 # does not matter
# Initial fee pool
If we want to run a local custom staker node,
melnodeaccepts a YAML config file:
# secret key; must correspond to "stakes.dead[...]beef.pubkey" in the network config
# address for staker-network communication, this can be arbitrary
# must be same as "listen"
# where block rewards are sent
# vote for this fee multiplier (higher values charge more fees)