Table Of Contents
This pagina is pridefully introduced by
Initializing the genesis blockВ¶
Wij initialize the blockchain an generate our very first blocks.
The –enable-stale-production flag tells the witness_node to produce on a chain with zero blocks or very old blocks. Wij specify the –enable-stale-production parameter on the directive line spil wij will not normally need it (albeit it can also be specified te the config opstopping).
Wij will already see our chain id::
If other witness produces blocks and witness participation is high enough, subsequent runs which connect to an existing witness knot overheen the p2p network, or which get blockchain state from an existing gegevens directory, need not have the –enable-stale-production flag.
Setting up block productionВ¶
Let’,s create a very basic configuration verkeersopstopping ter gegevens/testnet/config.ini :
All wij waterput into the configuration verkeersopstopping is the ids and the keys for the witnesses so that wij can embark producing blocks
This authorizes the witness_node to produce blocks on behalf of the listed witness-id ‘,s, and specifies the private key needed to sign those blocks. Normally each witness would be on a different knot, but for the purposes of this testnet, wij will begin out with all witnesses signing blocks on a single knot.
The setting rpc-endpoint = 0.0.0.0:11011 will open up the RPC-port 11011 to connect a cli-wallet or web wallet to it. With the p2p-endpoint = 0.0.0.0:11010 being accessible from the internet, this knot can be used spil seed knot.
Embedding the Genesis block (optional)В¶
Now that wij have the blockchain established and the used juist genesis block, wij can have it embedded into the binaries directly. For that reasons wij have moved it into the root directory and called it genesis.json for the default compile toolchain to catch it automatically. Wij recompile to include the genesis block with:
Deleting caches will reset all cmake variables, so if you have used instructions like Building from Sources which tells you to set other cmake variables, you will have to add those variables to the cmake line above.
Embedding the genesis copies the entire content of genesis block into the witness_node binary, and additionally copies the chain ID into the cli_wallet binary. Embedded genesis permits the following simplifications to the subsequent instructions:
- You need not specify the genesis verkeersopstopping on the witness knot directive line, or ter the witness knot configuration opstopping.
- You need not specify the chain ID on the cli_wallet directive line when beginning a fresh wallet.