Skip to content

Commit

Permalink
Merge pull request #2 from scorum/update-genesis
Browse files Browse the repository at this point in the history
Update genesis - change num of supervisors and validators
  • Loading branch information
maximkadocnikov authored Nov 2, 2023
2 parents 136e8b5 + a17fb59 commit f69ffcb
Show file tree
Hide file tree
Showing 2 changed files with 166 additions and 33 deletions.
27 changes: 17 additions & 10 deletions generate.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env bash
# Script generates genesis.json with DEVNET validators
# The ouput of the script is
# Script generates genesis.json with DEVNET validators and supervisors
# The output of the script is
# - genesis.json - the genesis file itself
# - accounts.txt - validator accounts: name, address, public key, mnemonic
# - accounts.txt - validator and supervisor accounts: name, address, public key, mnemonic
# - keyring - keyring directory

set -e
Expand All @@ -16,12 +16,17 @@ if [[ -z "${CHAIN_ID}" ]]; then
CHAIN_ID="devnet-1"
fi

if [[ -z "${ACCOUNTS}" ]]; then
ACCOUNTS="validator1 validator2 validator3 validator4"
if [[ -z "${VALIDATORS}" ]]; then
VALIDATORS="validator1"
fi

if [[ -z "${SUPERVISORS}" ]]; then
SUPERVISORS="orion pulsar aurora meteor nebula quasar supernova eclipse comet galaxy"
fi

echo "CHAIN_ID is set to $CHAIN_ID"
echo "ACCOUNTS is set to $ACCOUNTS"
echo "VALIDATORS is set to $VALIDATORS"
echo "SUPERVISORS is set to $SUPERVISORS"

out=output
keys=keys
Expand All @@ -39,14 +44,14 @@ function join_by { local IFS="$1"; shift; echo "$*"; }
scorumd config output json --home=${homed}

function addKeys() {
for account in ${ACCOUNTS}
for account in ${VALIDATORS} ${SUPERVISORS}
do
echo $PASSWORD$'\n'$PASSWORD | scorumd keys add ${account} --keyring-backend=file --home=${homed} --keyring-dir ${keyring}/${account} >> accounts.txt 2>&1
done
}

function gentx() {
for account in ${ACCOUNTS}
for account in ${VALIDATORS}
do
addr=$(echo $PASSWORD | scorumd keys show ${account} -a --home=${homed} --keyring-backend=file --keyring-dir ${keyring}/${account})
rm -rf ${homed}
Expand All @@ -63,12 +68,12 @@ function gentx() {

function genesis() {
rm -rf ${homed}
moniker=`echo $ACCOUNTS | awk '{print $1}'`
moniker=`echo $VALIDATORS | awk '{print $1}'`

# add genesis accounts
scorumd init "${moniker}" --staking-bond-denom sp --chain-id=${CHAIN_ID} --home=${homed}

for account in ${ACCOUNTS}
for account in ${VALIDATORS} ${SUPERVISORS}
do
addr=$(echo $PASSWORD | scorumd keys show ${account} -a --keyring-backend=file --home=${homed} --keyring-dir ${keyring}/${account})

Expand All @@ -93,6 +98,8 @@ genesis
sed -i -e 's/"stake"/"sp"/g' ${homed}/config/genesis.json
# set inflation fields to 0, because there will be another reward mechanism
sed -i 's/"\(inflation[^"]*\)": "[0-9.]\+",/"\1": "0",/g' ${homed}/config/genesis.json
# set min_commission_rate to 1
sed -i 's/"min_commission_rate": "[0-9.]\+"/"min_commission_rate": "1"/' ${homed}/config/genesis.json

cp ${homed}/config/genesis.json genesis.json

Expand Down
172 changes: 149 additions & 23 deletions genesis/devnet/genesis.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"genesis_time": "2023-09-25T12:11:40.372400437Z",
"genesis_time": "2023-11-01T02:49:17.85359025Z",
"chain_id": "devnet-1",
"initial_height": "1",
"consensus_params": {
Expand Down Expand Up @@ -33,35 +33,77 @@
"accounts": [
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "scorum17d04td4zr9zrt3v8lhf6gxhk39vtmfaevs43xx",
"address": "scorum17p5a9kmaex38cjvdz5zuneclttxkkankhp9k09",
"pub_key": null,
"account_number": "0",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "scorum1x4fg9hudc9tnlfz7kfeuf57c4gnv4ude5cz0jc",
"address": "scorum13l65gqkrw32wqft53qautykv9hsf86l25r0m5f",
"pub_key": null,
"account_number": "0",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "scorum1p68lhsf5dlfyalezg5au4qdxed03ttp4g72s2x",
"address": "scorum1z4hf2yntw04l24gnkdfgpgsy75htcq5q87auw6",
"pub_key": null,
"account_number": "0",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "scorum1c02zn9efas4cxwsr05k4ajs235w58d0ams6ssp",
"address": "scorum1g7ttlf4t4xd7cl8aqsvjc62znvprszp29z5fc8",
"pub_key": null,
"account_number": "0",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "scorum1d5le2eu7dedwhzjwrka7sda7rn6g5tyvyuurlt",
"address": "scorum1q5gxy7x5432gsyjn88tqfkvrhuepz6exx0a0vf",
"pub_key": null,
"account_number": "0",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "scorum10sf35cdu0fh5aguqz68u68flnrc66znk6tltfr",
"pub_key": null,
"account_number": "0",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "scorum1d3jd7ef935r6s8fj0avutksffnqf6eu7c287z0",
"pub_key": null,
"account_number": "0",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "scorum1hwvh23eem5aw3cdl8tfazhdc0ntzx0jpuuauyy",
"pub_key": null,
"account_number": "0",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "scorum1vm7eplpzzqkmf2y2j3ru4epf9p3rfermfk9mek",
"pub_key": null,
"account_number": "0",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "scorum126n48zxkmpwww003g7uaxwe242jrmh4cwx9rn2",
"pub_key": null,
"account_number": "0",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "scorum17l5m8g75v0jxsg550nuqa4n6y2xcgsvgvk7dax",
"pub_key": null,
"account_number": "0",
"sequence": "0"
Expand Down Expand Up @@ -90,7 +132,85 @@
},
"balances": [
{
"address": "scorum1p68lhsf5dlfyalezg5au4qdxed03ttp4g72s2x",
"address": "scorum1q5gxy7x5432gsyjn88tqfkvrhuepz6exx0a0vf",
"coins": [
{
"denom": "scr",
"amount": "1000000000000"
},
{
"denom": "sp",
"amount": "1000000000000"
}
]
},
{
"address": "scorum1z4hf2yntw04l24gnkdfgpgsy75htcq5q87auw6",
"coins": [
{
"denom": "scr",
"amount": "1000000000000"
},
{
"denom": "sp",
"amount": "1000000000000"
}
]
},
{
"address": "scorum1g7ttlf4t4xd7cl8aqsvjc62znvprszp29z5fc8",
"coins": [
{
"denom": "scr",
"amount": "1000000000000"
},
{
"denom": "sp",
"amount": "1000000000000"
}
]
},
{
"address": "scorum126n48zxkmpwww003g7uaxwe242jrmh4cwx9rn2",
"coins": [
{
"denom": "scr",
"amount": "1000000000000"
},
{
"denom": "sp",
"amount": "1000000000000"
}
]
},
{
"address": "scorum1vm7eplpzzqkmf2y2j3ru4epf9p3rfermfk9mek",
"coins": [
{
"denom": "scr",
"amount": "1000000000000"
},
{
"denom": "sp",
"amount": "1000000000000"
}
]
},
{
"address": "scorum1d3jd7ef935r6s8fj0avutksffnqf6eu7c287z0",
"coins": [
{
"denom": "scr",
"amount": "1000000000000"
},
{
"denom": "sp",
"amount": "1000000000000"
}
]
},
{
"address": "scorum10sf35cdu0fh5aguqz68u68flnrc66znk6tltfr",
"coins": [
{
"denom": "scr",
Expand All @@ -103,7 +223,7 @@
]
},
{
"address": "scorum1x4fg9hudc9tnlfz7kfeuf57c4gnv4ude5cz0jc",
"address": "scorum13l65gqkrw32wqft53qautykv9hsf86l25r0m5f",
"coins": [
{
"denom": "scr",
Expand All @@ -116,7 +236,7 @@
]
},
{
"address": "scorum1d5le2eu7dedwhzjwrka7sda7rn6g5tyvyuurlt",
"address": "scorum1hwvh23eem5aw3cdl8tfazhdc0ntzx0jpuuauyy",
"coins": [
{
"denom": "scr",
Expand All @@ -129,7 +249,7 @@
]
},
{
"address": "scorum1c02zn9efas4cxwsr05k4ajs235w58d0ams6ssp",
"address": "scorum17p5a9kmaex38cjvdz5zuneclttxkkankhp9k09",
"coins": [
{
"denom": "scr",
Expand All @@ -142,7 +262,7 @@
]
},
{
"address": "scorum17d04td4zr9zrt3v8lhf6gxhk39vtmfaevs43xx",
"address": "scorum17l5m8g75v0jxsg550nuqa4n6y2xcgsvgvk7dax",
"coins": [
{
"denom": "scr",
Expand Down Expand Up @@ -213,19 +333,19 @@
"max_change_rate": "0.010000000000000000"
},
"min_self_delegation": "1",
"delegator_address": "scorum17d04td4zr9zrt3v8lhf6gxhk39vtmfaevs43xx",
"validator_address": "scorumvaloper17d04td4zr9zrt3v8lhf6gxhk39vtmfae7clr2g",
"delegator_address": "scorum17p5a9kmaex38cjvdz5zuneclttxkkankhp9k09",
"validator_address": "scorumvaloper17p5a9kmaex38cjvdz5zuneclttxkkank9f0yrt",
"pubkey": {
"@type": "/cosmos.crypto.ed25519.PubKey",
"key": "JEssWD6+KzYeq6d9i7F/MhwrK74X/Wc5j406BYsiU5o="
"key": "qoYpJJ/LJ9wPL2ExE9wNqVzdQlJOrnZIJP3vwfNeaXo="
},
"value": {
"denom": "sp",
"amount": "100000000000"
}
}
],
"memo": "[email protected]:26656",
"memo": "[email protected]:26656",
"timeout_height": "0",
"extension_options": [],
"non_critical_extension_options": []
Expand All @@ -235,7 +355,7 @@
{
"public_key": {
"@type": "/cosmos.crypto.secp256k1.PubKey",
"key": "ArkcBETDi54g1tVYgmWe+vwUJbM1M0F7s0b8yoW7ZEwx"
"key": "AkMJa0Tw4jV7sGQYCR3IQx+C+OMPec3vkoGo8cjPJrIo"
},
"mode_info": {
"single": {
Expand All @@ -254,7 +374,7 @@
"tip": null
},
"signatures": [
"glFjiE0P/cXregi2nJigmfXumimA+2M19D2EVXWTG5tkAUwCOVH22l5VvdPUhwIzOGi1/BsqXBMQaC6E6hzbsA=="
"q0ne20QmQruJtBDnoH8+RfNHANBZPAg/IEL/C9jHyXFkr2UI7O1zr7VzDEN7jC/b3cMER5fEwEC++h4/pqXJ7Q=="
]
}
]
Expand Down Expand Up @@ -368,11 +488,17 @@
"scorum": {
"params": {
"supervisors": [
"scorum17d04td4zr9zrt3v8lhf6gxhk39vtmfaevs43xx",
"scorum1x4fg9hudc9tnlfz7kfeuf57c4gnv4ude5cz0jc",
"scorum1p68lhsf5dlfyalezg5au4qdxed03ttp4g72s2x",
"scorum1c02zn9efas4cxwsr05k4ajs235w58d0ams6ssp",
"scorum1d5le2eu7dedwhzjwrka7sda7rn6g5tyvyuurlt"
"scorum17p5a9kmaex38cjvdz5zuneclttxkkankhp9k09",
"scorum13l65gqkrw32wqft53qautykv9hsf86l25r0m5f",
"scorum1z4hf2yntw04l24gnkdfgpgsy75htcq5q87auw6",
"scorum1g7ttlf4t4xd7cl8aqsvjc62znvprszp29z5fc8",
"scorum1q5gxy7x5432gsyjn88tqfkvrhuepz6exx0a0vf",
"scorum10sf35cdu0fh5aguqz68u68flnrc66znk6tltfr",
"scorum1d3jd7ef935r6s8fj0avutksffnqf6eu7c287z0",
"scorum1hwvh23eem5aw3cdl8tfazhdc0ntzx0jpuuauyy",
"scorum1vm7eplpzzqkmf2y2j3ru4epf9p3rfermfk9mek",
"scorum126n48zxkmpwww003g7uaxwe242jrmh4cwx9rn2",
"scorum17l5m8g75v0jxsg550nuqa4n6y2xcgsvgvk7dax"
],
"gas_limit": {
"int": "1000000"
Expand Down Expand Up @@ -410,7 +536,7 @@
"max_entries": 7,
"historical_entries": 10000,
"bond_denom": "sp",
"min_commission_rate": "0.000000000000000000"
"min_commission_rate": "1"
},
"last_total_power": "0",
"last_validator_powers": [],
Expand Down

0 comments on commit f69ffcb

Please sign in to comment.