This repository has been archived by the owner on Jan 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
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
cryptoAtwill
committed
Dec 5, 2023
1 parent
4a93e42
commit 28d02f5
Showing
13 changed files
with
220 additions
and
28 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,34 @@ | ||
# Spin up fendermint local network | ||
This will guide you through how to setup a 4-node fendermint network on local machine for debugging. | ||
|
||
### Create validators | ||
The validators are already created, their credential information are stored in `abci*`. If you want to use your own set | ||
of validators, just regenerate the private key file on your own and replace the files. | ||
|
||
### Fund validators | ||
Fund your validators in subnet `/r314159`. | ||
|
||
### Create subnet | ||
Create subnet with the following command, make sure you have `ipc-cli` installed. | ||
```shell | ||
<PATH TO IPC>/ipc-cli subnet create --parent /r314159 --min-validator-stake 0.04 --min-cross-msg-fee 0 --min-validators 4 --bottomup-check-period 10 | ||
``` | ||
Note down the subnet id from the command output. | ||
|
||
### Join subnet | ||
Ask your validators join the subnet with: | ||
```shell | ||
SUBNET=<SUBNET ID FROM PREVIOUS COMMAND> IPC_PATH=<YOUR IPC CLI FOLDER>/ipc-cli bash ./join_subnet.sh | ||
``` | ||
make sure you have `jq` installed. | ||
|
||
### Generate genesis | ||
Generate the genesis with: | ||
```shell | ||
$FENDERMINT_CLI genesis --genesis-file ./genesis.json ipc from-parent -s /r314159/${SUBNET} --parent-endpoint "https://api.calibration.node.glif.io/rpc/v1" --parent-gateway ${GATEWAY} --parent-registry ${REGISTRY} | ||
``` | ||
|
||
### Generate keys | ||
```shell | ||
FENDERMINT_CLI=<PATH TO YOUR FENDERMINT CLI> | ||
``` |
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,11 @@ | ||
{ | ||
"address": "81F978E13973206FB4A187AAB8A5382A8ABB0CA8", | ||
"priv_key": { | ||
"type": "tendermint/PrivKeySecp256k1", | ||
"value": "9O9FpE6Vxz1/4hiph5nwI3Efjq+DbGsRNBFR4VIyvFc=" | ||
}, | ||
"pub_key": { | ||
"type": "tendermint/PubKeySecp256k1", | ||
"value": "AnqEW8YfDUpE43r2T7fhmOqmn8Fg0g7kdysPe1+E82XR" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"address": "3d02c104c7372c2ac5602e7cb74214534393ed75", | ||
"pubkey": "047a845bc61f0d4a44e37af64fb7e198eaa69fc160d20ee4772b0f7b5f84f365d1b2315f429b2e3330db91f5b9d5d031f653d2e8612af6a0d23b703ca4670566ea" | ||
"pubkey": "047a845bc61f0d4a44e37af64fb7e198eaa69fc160d20ee4772b0f7b5f84f365d1b2315f429b2e3330db91f5b9d5d031f653d2e8612af6a0d23b703ca4670566ea", | ||
"t4": "t410fhubmcbghg4wcvrlafz6loqquknbzh3lv4ceo4oa" | ||
} |
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,11 @@ | ||
{ | ||
"address": "AEB8FA34690678C9C6AC021473743FD240AFDA1E", | ||
"priv_key": { | ||
"type": "tendermint/PrivKeySecp256k1", | ||
"value": "o3YfH/X6J1hm9W6WItZrnI8AN6FTQjmD5aTNGHm/9iY=" | ||
}, | ||
"pub_key": { | ||
"type": "tendermint/PubKeySecp256k1", | ||
"value": "AztaVzCIoD8zrxzTXBM7KNbOQT6RCEu18fXcOMASCQJ/" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"address": "768ab98c39f200facd2e5e305e191ffb6e6523c6", | ||
"pubkey": "043b5a573088a03f33af1cd35c133b28d6ce413e91084bb5f1f5dc38c01209027f8ba342d9ba2677f1eed005d769e0ed43ec9e5dabddeb769df3299d86b3718beb" | ||
"pubkey": "043b5a573088a03f33af1cd35c133b28d6ce413e91084bb5f1f5dc38c01209027f8ba342d9ba2677f1eed005d769e0ed43ec9e5dabddeb769df3299d86b3718beb", | ||
"t4": "t410fo2fltdbz6iapvtjolyyf4gi77nxgki6glk2xyti" | ||
} |
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,11 @@ | ||
{ | ||
"address": "603758F52C195FDB54FB5E2C8A64A747EAF0E9A5", | ||
"priv_key": { | ||
"type": "tendermint/PrivKeySecp256k1", | ||
"value": "Zzl/f+cE07K2LKVUv1qPiAxc9tflnxup0qrj0WQWLqI=" | ||
}, | ||
"pub_key": { | ||
"type": "tendermint/PubKeySecp256k1", | ||
"value": "A4rF21nBH7H9RTZRtmpDbGCLwwLwM8UcOoiuQGr1iWKM" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"address": "20c343ab93f4f6842aa19f5cccfbc02c8aa697ed", | ||
"pubkey": "048ac5db59c11fb1fd453651b66a436c608bc302f033c51c3a88ae406af589628c69e48e2b0f76247111de69333d8ed264367f3370948bc6794f4b3ab9390de22d" | ||
"pubkey": "048ac5db59c11fb1fd453651b66a436c608bc302f033c51c3a88ae406af589628c69e48e2b0f76247111de69333d8ed264367f3370948bc6794f4b3ab9390de22d", | ||
"t4": "t410fedbuhk4t6t3iikvbt5omz66afsfknf7nv3647tq" | ||
} |
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,11 @@ | ||
{ | ||
"address": "5BD6F62DB9A25FBF0E4F84C36127279234207A00", | ||
"priv_key": { | ||
"type": "tendermint/PrivKeySecp256k1", | ||
"value": "WOoNLSdlm7resE7tH9EqrFjV71rDsjcbKupNYrx33LE=" | ||
}, | ||
"pub_key": { | ||
"type": "tendermint/PubKeySecp256k1", | ||
"value": "A9YAdP3V1WBw2IMezQjG9Gy5HY1BwrjChMYQsi4jYTnK" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"address": "01222dc6bfaaa372ce992e6f49d808e4bb9bd02b", | ||
"pubkey": "04d60074fdd5d56070d8831ecd08c6f46cb91d8d41c2b8c284c610b22e236139caaf7fc91585806c61c209a167df2084455343227836c18fe59ab958c7623f48ed" | ||
"pubkey": "04d60074fdd5d56070d8831ecd08c6f46cb91d8d41c2b8c284c610b22e236139caaf7fc91585806c61c209a167df2084455343227836c18fe59ab958c7623f48ed", | ||
"t4": "t410faerc3rv7vkrxftuzfzxutwai4s5zxublbolynay" | ||
} |
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,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
${FENDERMINT_CLI}/fendermint key from-eth -s ./abci0/private_key -n abci0 -o ./abci0 | ||
${FENDERMINT_CLI}/fendermint key from-eth -s ./abci1/private_key -n abci1 -o ./abci1 | ||
${FENDERMINT_CLI}/fendermint key from-eth -s ./abci2/private_key -n abci2 -o ./abci2 | ||
${FENDERMINT_CLI}/fendermint key from-eth -s ./abci3/private_key -n abci3 -o ./abci3 | ||
|
||
${FENDERMINT_CLI}/fendermint key into-tendermint --secret-key ./abci0/abci0.sk --out ./abci0/validator.json | ||
${FENDERMINT_CLI}/fendermint key into-tendermint --secret-key ./abci1/abci1.sk --out ./abci1/validator.json | ||
${FENDERMINT_CLI}/fendermint key into-tendermint --secret-key ./abci2/abci2.sk --out ./abci2/validator.json | ||
${FENDERMINT_CLI}/fendermint key into-tendermint --secret-key ./abci3/abci3.sk --out ./abci3/validator.json | ||
|
||
chmod 600 ./abci0/validator.json | ||
chmod 600 ./abci1/validator.json | ||
chmod 600 ./abci2/validator.json | ||
chmod 600 ./abci3/validator.json | ||
|
||
rm ./abci0/abci0.* | ||
rm ./abci1/abci1.* | ||
rm ./abci2/abci2.* | ||
rm ./abci3/abci3.* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
"genesis_time": "1970-01-14T06:53:27Z", | ||
"chain_id": "1236677877404273", | ||
"initial_height": "1", | ||
"consensus_params": { | ||
"block": { | ||
"max_bytes": "22020096", | ||
"max_gas": "-1", | ||
"time_iota_ms": "1000" | ||
}, | ||
"evidence": { | ||
"max_age_num_blocks": "100000", | ||
"max_age_duration": "172800000000000", | ||
"max_bytes": "1048576" | ||
}, | ||
"validator": { | ||
"pub_key_types": [ | ||
"secp256k1" | ||
] | ||
} | ||
}, | ||
"validators": [], | ||
"app_hash": "", | ||
"app_state": { | ||
"accounts": [], | ||
"base_fee": "1000", | ||
"chain_name": "/r314159/t410f6c5hpqeqau4idqe7mund4tilojxdihutnmk7enq", | ||
"ipc": { | ||
"gateway": { | ||
"active_validators_limit": 100, | ||
"bottom_up_check_period": 10, | ||
"majority_percentage": 60, | ||
"min_collateral": "40000000000000000", | ||
"msg_fee": "0", | ||
"subnet_id": "/r314159/t410f6c5hpqeqau4idqe7mund4tilojxdihutnmk7enq" | ||
} | ||
}, | ||
"network_version": 18, | ||
"power_scale": 3, | ||
"timestamp": 1148007, | ||
"validators": [ | ||
{ | ||
"power": "10000000000000000", | ||
"public_key": "BHqEW8YfDUpE43r2T7fhmOqmn8Fg0g7kdysPe1+E82XRsjFfQpsuMzDbkfW51dAx9lPS6GEq9qDSO3A8pGcFZuo=" | ||
}, | ||
{ | ||
"power": "10000000000000000", | ||
"public_key": "BDtaVzCIoD8zrxzTXBM7KNbOQT6RCEu18fXcOMASCQJ/i6NC2bomd/Hu0AXXaeDtQ+yeXavd63ad8ymdhrNxi+s=" | ||
}, | ||
{ | ||
"power": "10000000000000000", | ||
"public_key": "BIrF21nBH7H9RTZRtmpDbGCLwwLwM8UcOoiuQGr1iWKMaeSOKw92JHER3mkzPY7SZDZ/M3CUi8Z5T0s6uTkN4i0=" | ||
}, | ||
{ | ||
"power": "10000000000000000", | ||
"public_key": "BNYAdP3V1WBw2IMezQjG9Gy5HY1BwrjChMYQsi4jYTnKr3/JFYWAbGHCCaFn3yCERVNDIng2wY/lmrlYx2I/SO0=" | ||
} | ||
] | ||
} | ||
} |
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,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
$IPC_PATH subnet join \ | ||
--from "0x$(cat ./abci0/wallet.json | jq -r '.address')" \ | ||
--subnet /r314159/${SUBNET} \ | ||
--collateral 0.01 \ | ||
--public-key "$(cat ./abci0/wallet.json | jq -r '.pubkey')" | ||
|
||
$IPC_PATH subnet join \ | ||
--from "0x$(cat ./abci1/wallet.json | jq -r '.address')" \ | ||
--subnet /r314159/${SUBNET} \ | ||
--collateral 0.01 \ | ||
--public-key "$(cat ./abci1/wallet.json | jq -r '.pubkey')" | ||
|
||
$IPC_PATH subnet join \ | ||
--from "0x$(cat ./abci2/wallet.json | jq -r '.address')" \ | ||
--subnet /r314159/${SUBNET} \ | ||
--collateral 0.01 \ | ||
--public-key "$(cat ./abci2/wallet.json | jq -r '.pubkey')" | ||
|
||
$IPC_PATH subnet join \ | ||
--from "0x$(cat ./abci3/wallet.json | jq -r '.address')" \ | ||
--subnet /r314159/${SUBNET} \ | ||
--collateral 0.01 \ | ||
--public-key "$(cat ./abci3/wallet.json | jq -r '.pubkey')" |