Testing
Wallet
Development node features can be tested by using the demo wallet.
Two-node interaction
The preset genesis allows to run a block-authoring node and a listening node very easily.
- In a terminal at the root of the repository, run the authoring node using
./target/release/griffin-solochain-node --chain local --port 30333 --rpc-port 9945 --rpc-methods Unsafe --alice
If you get a NetworkKeyNotFound
error, you can run once ./target/release/griffin-solochain-node
and then re-run the previous command.
- At the start, the node will signal its identity,
2024-11-14 16:02:00 🏷 Local node identity is: 12D3KooWKzwi7xW6d7dKNwDU6YGXCgC52BLd1VDyjvHWrqcG1uz3
- In a new terminal, run the listening node:
./target/release/griffin-solochain-node --base-path /tmp/hola --chain local --port 30334 --rpc-port 9944 --validator --rpc-methods Unsafe --name hola --node-key 0000000000000000000000000000000000000000000000000000000000000002 --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/<AUTHORING_NODE_IDENTITY>
where <AUTHORING_NODE_IDENTITY>
should be replaced by the appropriate id.
- The wallet will talk to the node having
--rpc-port
equal to 9944.
It might be necessary to delete the nodes’ DBs (through the purge-chain
command or manually, e.g., by erasing the /tmp/hola
folder for the listening node) if this is not first time the node is run locally.
Custom genesis
The --chain
flag can be used to set a custom genesis through a JSON. A sample file is located here, and the example above also works when replacing --chain local
by --chain examples/genesis.json
.