BYOB - Bring Your Own Blockchain
If you want to have full control over your blockchain deployment, e.g., if you want to reset the state repeatedly or need more funds than a faucet can provide for a single account, you will need to run your own blockchain. For this purpose, we provide a Docker image which runs in standalone mode. This means that the blockchain doesn't act as a parachain but as an independent chain. There is no need to run a Relay Chain and register the KILT chain as a parachain. This greatly simplifies the setup.
You only need to start the Docker image:
docker run --rm -it -p 9944:9944 -p 9933:9933 kiltprotocol/mashnet-node:latest --dev --ws-external --rpc-external
You should see output similar to the following:
2022-05-05 13:25:12 KILT Node
2022-05-05 13:25:12 āļø version 1.6.2
2022-05-05 13:25:12 ā¤ļø by KILT <info@kilt.io>, 2019-2022
2022-05-05 13:25:12 š Chain specification: Development
2022-05-05 13:25:12 š· Node name: subdued-chair-0035
2022-05-05 13:25:12 š¤ Role: AUTHORITY
2022-05-05 13:25:12 š¾ Database: RocksDb at /tmp/substrateufCNUV/chains/development/db/full
2022-05-05 13:25:12 ā Native runtime: mashnet-node-10620 (mashnet-node-0.tx3.au4)
2022-05-05 13:25:13 šØ Initializing Genesis block/state (state: 0xb4a2ā¦94b3, header-hash: 0x09fcā¦3a2b)
2022-05-05 13:25:13 š“ Loading GRANDPA authority set from genesis on what appears to be first startup.
2022-05-05 13:25:14 Using default protocol ID "sup" because none is configured in the chain specs
2022-05-05 13:25:14 š· Local node identity is: 12D3KooWMCqWaxXTQbmG9feCe4cMzjCzUKfm5T6VvGDmh8X5QHe9
2022-05-05 13:25:14 š¦ Highest known block at #0
2022-05-05 13:25:14 ć½ļø Prometheus exporter started at 127.0.0.1:9615
2022-05-05 13:25:14 Listening for new connections on 0.0.0.0:9944.
2022-05-05 13:25:19 š¤ Idle (0 peers), best: #0 (0x09fcā¦3a2b), finalized #0 (0x09fcā¦3a2b), ⬠0 ⬠0
2022-05-05 13:25:20 Accepted a new tcp connection from 172.17.0.1:56636.
2022-05-05 13:25:23 š Starting consensus session on top of parent 0x...
2022-05-05 13:25:23 š Prepared block for proposing at 1 (3 ms) [hash: 0x...; parent_hash: 0x09fcā¦3a2b; extrinsics (1): [0xae1aā¦0701]]
2022-05-05 13:25:23 š Pre-sealed block for proposal at 1. Hash now 0x..., previously 0x....
Congratulations! You are running your own KILT blockchain. š
The blockchain exposes a WebSocket endpoint on port 9944
and an RPC endpoint on port 9933
.
You can test that by calling an RPC endpoint using curl.
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "system_name", "params":[]}' http://127.0.0.1:9933/
This should give you {"jsonrpc":"2.0","result":"KILT Node","id":1}
as a response.
In addition, you can also connect to the exposed WebSocket endpoints using your script.
Simply replace the WebSocket address with ws://127.0.0.1:9944
.
Please note that we connect to the port 9944
as we are using the WebSocket protocol for our SDK and not bare HTTP.
The --dev
parameter provides a pre-funded account which you can use as a faucet, and that has the following mnemonic: receive clutch item involve chaos clutch furnace arrest claw isolate okay together
.
You can create the account with the following SDK function:
// Creates an ed25519 key by default which is required to access the funds.
const devFaucet = Crypto.makeKeypairFromUri(faucetSeed)
With the new devFaucet
, you can transfer funds to other accounts and test all the KILT features that require tx fee payment.