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 melwallet-client, melminter, or even direct HTTP calls.
./run-all.sh
Should produce logs like:
[2024-05-11T14:28:09Z INFO melnode] melnode v0.20.7 initializing...
[2024-05-11T14:28:09Z DEBUG melnode::storage::storage] about to sqlite
[2024-05-11T14:28:09Z DEBUG melnode::storage::storage] sqlite initted
[2024-05-11T14:28:09Z DEBUG melnode::storage::storage] about to mesha
[2024-05-11T14:28:09Z DEBUG melnode::args] node storage opened
[2024-05-11T14:28:09Z INFO melnode] bootstrapping with [127.0.0.1:2000]
[2024-05-11T14:28:09Z DEBUG melnode::node] starting to listen at 127.0.0.1:2000
[2024-05-11T14:28:19Z DEBUG melnode::staker] starting consensus for 1...
[2024-05-11T14:28:19Z WARN melnode::staker] mempool not at the right height, trying again
[2024-05-11T14:28:29Z DEBUG melnode::staker] starting consensus for 1...
[2024-05-11T14:28:29Z DEBUG melstf::state] changing fee multiplier 100 by 1
[2024-05-11T14:28:29Z DEBUG melnode::staker] proposed state has 0 transactions
[2024-05-11T14:28:32Z DEBUG melnode::staker] 1/127.0.0.1:5000 DECIDED on a block with 240 bytes within 3.155822014s
[2024-05-11T14:28:32Z DEBUG melstf::state] applied a batch of 0 txx to #<c99d36b369d0fc1bd494b84db635c5964e8359fafff00a1732d19090c3595e41> => #<c99d36b369d0fc1bd494b84db635c5964e8359fafff00a1732d19090c3595e41>
[2024-05-11T14:28:32Z DEBUG melstf::state] changing fee multiplier 100 by 1
[2024-05-11T14:28:32Z DEBUG melnode::storage::storage] applied block 1 / 64e3f33aa793f118ef09fa8aa72a7f6b7b5831dba1f8052d8ac1506e04883a09 in 5.01ms (history insertion 2.42ms)
[2024-05-11T14:28:32Z DEBUG melnode::staker] 1/127.0.0.1:5000 COMMITTED the newly decided block within 3.164806678s
melwallet-cli, melminter
To use melwallet or melminter on your local simnet, first set the MELBOOTSTRAP environment variable to a hard-coded block height and header hash to bootstrap clients on this network:
This is only needed to start our own custom network, melnode accepts a YAML config file similar to the following:
network:custom02# anything from custom02..custom08# specifies the "initial stash" of money in the genesis blockinit_coindata:# what address gets the initial supply of moneycovhash:t5xw3qvzvfezkb748d3zt929zkbt7szgt6jr3zfxxnewj1rtajpjx0# how many units (in millionths)value:1000000# denominationdenom:MEL# additional data in the UTXO, as a hex stringadditional_data:""# 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
stakes:deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef:pubkey:4ce983d241f1d40b0e5b65e0bd1a6877a35acaec5182f110810f1276103c829ee_start:0e_post_end:100000# essentially never end the stakesyms_staked:10000# does not matter# Initial fee poolinit_fee_pool:10000
Custom staker configuration
If we want to run a local custom staker node, melnode accepts a YAML config file:
# secret key; must correspond to "stakes.dead[...]beef.pubkey" in the network configsigning_secret: 5b4c8873cbdb089439d025e9fa817b1df1128231699131c245c0027be880d4d44ce983d241f1d40b0e5b65e0bd1a6877a35acaec5182f110810f1276103c829e
# address for staker-network communication, this can be arbitrarylisten:127.0.0.1:20000# must be same as "listen"bootstrap:127.0.0.1:20000# where block rewards are sentpayout_addr:t5xw3qvzvfezkb748d3zt929zkbt7szgt6jr3zfxxnewj1rtajpjx0# vote for this fee multiplier (higher values charge more fees)target_fee_multiplier:10000