cardano-nodeshould be on your
genesis.json. This command can be re-run at any time and it will re-generate the
genesis.jsonbased on the
genesis.spec.json(which we can edit by hand) and any keys placed in the three sub-directories.
genesis.spec.jsonto our liking and re-generate the
createcommand, it generated an example genesis template for us in
GenDelegsis the mapping from genesis keys to genesis delegates. The representation in the JSON file is between key hashes.
initialFunds. This is a mapping from the initial addresses to the initial values at those address. So we need a command to get the address corresponding to an initial UTxO verification key:
initialFundsfrom the generated file we see
genesis.spec.jsonand set the
maxLovelaceSupplythere, or we specify the initial supply when we re-generate the genesis file. Either way, it will be split equally between all the utxo keys.
maxLovelaceSupplyis set to this same supply. If you edit this manually note that it has to be at least as big as the sum total from our
initialFunds, but it can be bigger to allow for monetary expansion later for stake rewards.
startTime, which is the agreed time of slot zero. By default the
createcommand filled this in to be 30s into the future, but you can also specify this manually with
--start-time UTC_TIMEor edit it manually afterwards. It needs to be set to a time in the near future or near past. It cannot be too far in the past otherwise the system would start having missed a very large number of slots.
create, and all the others are for the manual method.
createcommand can also create all the necessary keys for you. The optional
--gen-utxo-keysflags can be used to specify the number of keys of each kind to generate.
createwill read the
genesis.spec.jsonand produce the
genesis.jsonby filling in the:
genesis.json, KES and VRF operational keys and issued ourselves operational certificates, we are close to being able to run our nodes.
configuration.yamlfile between both nodes we run.
genesis.json, so the start time is probably now some time in the past. It is a bit nicer if we set the start time to be shortly in the future and then start up our nodes. That way they will all wait for the start time and then make blocks from the beginning.
genesis.jsonwhich will set the start time to be 30 seconds into the future, and then we can start our nodes. This assumes you did not do any manual tweaking of the generated
genesis.json, as it will be overwritten.
genesis.json. In the default we generated, that was given as 42. The network "magic" number is used as a simple sanity check (not a security measure of course) when nodes connect to each other, to stop nodes accidentally connecting to nodes running different blockchains, e.g. testnet vs mainnet. We have the same sanity check when we connect to the local node. So we have to specify
--testnet-magic 1097911063, otherwise it defaults to mainnet and then the handshake would fail.
CARDANO_NODE_SOCKET_PATH. Typically one only runs one node on a machine, and so it would make sense to set this for the whole terminal session:
genesis.jsonfile we started with.
genesis.jsonof course. So let's try it. Obviously you will have to adjust this command to use the right address(es) from your
build-rawcommand because a more convenient command is not available yet, and because for spending a Genesis UTxO we have to use the low level command to select the exact UTxO to spend.
initial-txincommand. The TxOut uses "TxOut+Lovelace" syntax. We'll build that by taking the address from the
address buildcommand from the previous section and adding "+500000000" for the value we want to move to that address.
CARDANO_NODE_SOCKET_PATHlike the other commands that need to talk to a local node. And as mentioned above in the section on querying the node, we have to specify
--testnet-magic 1097911063, otherwise it defaults to mainnet and then the handshake with the node would fail.