-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
KaoImin
committed
Dec 6, 2023
1 parent
e633e06
commit 632507a
Showing
3 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Axon Keypair Generator | ||
|
||
This is a simple tool to generate keypair used for Axon. | ||
|
||
## Usage | ||
|
||
### Generate Keypair | ||
|
||
```bash | ||
cd devtools/keypair & cargo run -- -n number_of_keypair_to_generate -p path_to_save_private_keys | ||
``` | ||
Example Output: | ||
|
||
```bash | ||
$ cargo run -- -n 1 | ||
{ | ||
"keypairs": [ | ||
{ | ||
"index": 0, | ||
"net_private_key": "0x0000000000000000000000000000000000000000000000000000000000000000", | ||
"public_key": "0x020044def250d1d27c0f7c0eeee6c8b964756d5ad7936fcefaf3f086245ddb9c9c", | ||
"address": "0x83fec4b12b26a70195ccabb67ce0cd692856eaf1", | ||
"peer_id": "QmbZEzvonMiPiioRpYeVWxngjN42FHC3EHXjeo2C7o2NDZ", | ||
"bls_private_key": "0x1111111111111111111111111111111111111111111111111111111111111111", | ||
"bls_public_key": "0x81ca54f01e3b433c209ae1d165e6362669e13170f89712dbc52c3572901d025ecc206a43c4b25f58388189f74587a7d" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
The arguments are described in the following table: | ||
|
||
| name | short | default value | | ||
|--|--|--| | ||
| number | n | 4 | | ||
| private-key-path | p | current_path/private-binary/ | | ||
|
||
### Update Config and Spec File | ||
|
||
Firstly, update the `validator_list` in [chain-spec](../chain/specs/single_node/chain-spec.toml) file. Replace the `bls_pub_key`, `pub_key` and `address` with the value generated by the keypair generator.For example: | ||
|
||
```toml | ||
[[params.verifier_list]] | ||
bls_pub_key = "0x81ca54f01e3b433c209ae1d165e6362669e13170f89712dbc52c3572901d025ecc206a43c4b25f58388189f74587a7d" | ||
pub_key = "0x020044def250d1d27c0f7c0eeee6c8b964756d5ad7936fcefaf3f086245ddb9c9c" | ||
address = "0x83fec4b12b26a70195ccabb67ce0cd692856eaf1" | ||
propose_weight = 1 | ||
vote_weight = 1 | ||
``` | ||
|
||
Then, update the `bootstraps` in [config](../chain/config.toml) file. Fill the generated `peer_id` to the `multi_address` For example: | ||
|
||
```toml | ||
[[network.bootstraps]] | ||
multi_address = "/ip4/127.0.0.1/tcp/8001/p2p/QmbZEzvonMiPiioRpYeVWxngjN42FHC3EHXjeo2C7o2NDZ" | ||
``` | ||
Finally, set the `net_privkey_file` and `bls_privkey_file` with the generated private key file path in [config](../chain/config.toml) file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters