-
Notifications
You must be signed in to change notification settings - Fork 44
Create new genesis block
To start new blockchain network, you have to start from genesis block.
This document will guide you to create new genesis block and run headless node with your own genesis block.
- Dotnet
- (Optional) Node.js
- LTS version recommended
git clone https://github.com/planetarium/NineChronicles.Headless
cd NineChronicles.Headless
git submodule update --init --recursive
All of following steps are optional. You can select some of them or skip all preps.
Activation key is the key to activate new 9c address in NineChronicles game.
You can make activation key whenever you want, so you can skip this step if you don't want include activation keys inside genesis block.
dotnet run --project ./.Lib9c.Tools tx create-activation-keys 10 > activationKey.csv # change [10] to your number of new activation keys
dotnet run --project ./.Lib9c.Tools tx create-pending-activations activationKey.csv > PendingActivation
You have to sign to the initial currency mining Tx. when you create new genesis block.
If you want to specify initial minter, you have to create a private key else Headless
will create new address to mint.
You need Planet CLI Tools to create address and export private key.
- Install platnet cli
npm install -g @planetarium/cli # or, dotnet tool install -g Libplanet.Tools
- Create initial minter address
Check and keep your initial minter's address.
planet key create Passphrase: ***** # Keep this and DO NOT FORGET IT Retype passphrase: ***** Key ID Address ---------------- ---------------- 12345678-1234... 0x1234567890a...
- Export private key using address
Do not expose your private key to anywhere. Keep this for later use.
planet key export 12345678-1234... # Use Key ID Passphrase: ***** 1234567890abcdef... # This is the private key
If you don't want admin for your network, skip this step.
planet key create
Passphrase: *****
Retype passphrase: *****
Key ID Address
---------------- ----------------
12345678-1234... 0x1234567890a...
Keep admin address and passphrase for later use.
The sample config is prepared for accessibility.
cp config.json.example config.json
And edit config file as you want. Please check README to get config structure.
dotnet run --project ./NineChronicles.Headless.Executable genesis config.json
The new genesis block will be generated and saved to genesis-block
file.
If you do not provide curerncy
config, the initial_deposit.csv
file will also be created.
Run your local headless node using new genesis block.
dotnet run --project ./NineChronicles.Headless.Executable/ \
-V=100260/6ec8E598962F1f475504F82fD5bF3410eAE58B9B/MEUCIQCG2yQNyXu3ovuUBNMEQiqx1vdo.FCMet9FoayFiIL89QIgXGRTU84nrcmLL4ud2j9ogrGt7ScmqaD97N.4rrtraXE=/ZHUxNjpXaW5kb3dzQmluYXJ5VXJsdTU2Omh0dHBzOi8vZG93bmxvYWQubmluZS1jaHJvbmljbGVzLmNvbS92MTAwMjYwL1dpbmRvd3MuemlwdTk6dGltZXN0YW1wdTEwOjIwMjItMDctMjhl \
-G=[PATH/TO/GENESIS/BLOCK] \
--store-type=memory \
--store-path= [PATH/TO/BLOCK/STORAGE] \
--workers=1000 \
--host=localhost \
--port=43210 \
--miner-private-key=[PRIVATE_KEY_OF_BLOCK_MINER]