Skip to content

Commit b7f99ee

Browse files
authored
Merge pull request #729 from anoma/init-mainnet-genesis
Mainnet genesis generation
2 parents 31b65b1 + ab1a4bb commit b7f99ee

File tree

28 files changed

+106
-1
lines changed

28 files changed

+106
-1
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,4 +697,6 @@ MigrationBackup/
697697

698698
# End of https://www.toptal.com/developers/gitignore/api/osx,macos,vs,pycharm,python,venv
699699

700-
*.pem
700+
*.pem
701+
702+
namada.*.tar.gz

scripts/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Building Mainnet genesis archive
2+
3+
- Run `./scripts/make-mainnet-genesis.sh`
4+
- It will output the genesis files in an archive called `namada.a26cb3db6ea69843b6e86ce.tar.gz`.
5+
16
# Pregenesis flow validation scripts
27

38
A set of scripts used by CI to validate the pre-genesis file submissions.

scripts/make-mainnet-genesis.sh

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/bin/bash
2+
3+
REPO="anoma/namada"
4+
RELEASE="latest"
5+
OUTPUT_FILE="binaries.tar.gz"
6+
EXTRACT_DIR="binaries"
7+
8+
OS=$(uname -s)
9+
ARCH=$(uname -m)
10+
11+
if [[ "$OS" == "Linux" && "$ARCH" == "x86_64" ]]; then
12+
FILE_NAME="namada-v1.0.0-Linux-x86_64.tar.gz"
13+
TARGET_FILE="namada-v1.0.0-Linux-x86_64/namadac"
14+
elif [[ "$OS" == "Darwin" && "$ARCH" == "arm64" ]]; then
15+
FILE_NAME="namada-v1.0.0-Darwin-arm64.tar.gz"
16+
TARGET_FILE="namada-v1.0.0-Darwin-arm64/namadac"
17+
else
18+
echo "Error: Unsupported OS or architecture ($OS-$ARCH)."
19+
exit 1
20+
fi
21+
22+
URL="https://github.com/$REPO/releases/$RELEASE/download/$FILE_NAME"
23+
echo "Downloading $FILE_NAME from $URL..."
24+
curl -L -o "$OUTPUT_FILE" "$URL"
25+
26+
# Verify the download
27+
if [[ $? -eq 0 ]]; then
28+
echo "File downloaded successfully: $OUTPUT_FILE"
29+
else
30+
echo "Error: Failed to download the file."
31+
exit 1
32+
fi
33+
34+
# Extract the specific file
35+
mkdir -p "$EXTRACT_DIR"
36+
echo "Extracting $TARGET_FILE from $OUTPUT_FILE to $EXTRACT_DIR..."
37+
tar --strip-components=1 -xzf "$OUTPUT_FILE" -C "$EXTRACT_DIR" "$TARGET_FILE"
38+
39+
# Verify extraction
40+
if [[ $? -eq 0 ]]; then
41+
echo "Extraction completed successfully. $TARGET_FILE is in $EXTRACT_DIR."
42+
rm $OUTPUT_FILE
43+
else
44+
echo "Error: Failed to extract $TARGET_FILE. Ensure the file exists in the archive."
45+
rm $OUTPUT_FILE
46+
exit 1
47+
fi
48+
49+
GENESIS_TEMPLATE_PATH="genesis"
50+
WASM_DIR="wasm"
51+
WASM_CHECKSUMS_PATH="$WASM_DIR/checksums.json"
52+
53+
TIMEOUT_CONSENSUS_COMMIT="6s"
54+
CHAIN_PREFIX="namada"
55+
GENESIS_TIME="2024-12-3T15:00:00.000000000+00:00"
56+
57+
echo "Building genesis files..."
58+
59+
./binaries/namadac utils init-network --templates-path $GENESIS_TEMPLATE_PATH --wasm-dir $WASM_DIR --consensus-timeout-commit $TIMEOUT_CONSENSUS_COMMIT --wasm-checksums-path $WASM_CHECKSUMS_PATH --chain-prefix $CHAIN_PREFIX --genesis-time $GENESIS_TIME
60+
61+
CHECKSUM="a26cb3db6ea69843b6e86ce"
62+
FILE="namada.$CHECKSUM.tar.gz"
63+
64+
if [ -e "$FILE" ]; then
65+
echo "Genesis file correctly created."
66+
rm -rf "binaries"
67+
exit 0
68+
else
69+
echo "Genesis file invalid."
70+
rm -rf "binaries"
71+
exit 1
72+
fi

wasm/checksums.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"tx_become_validator.wasm": "tx_become_validator.c6629064a1c3bde8503212cfa5e9b954169a7f162ad411b63a71db782fe909d7.wasm",
3+
"tx_bond.wasm": "tx_bond.490cf419bdbffe616c6aa6c72d38064e350ee65fb04d92472ccf285aec6844b6.wasm",
4+
"tx_bridge_pool.wasm": "tx_bridge_pool.473ee80e6e714f6097ec713c88f527b38da6479354075c879b66b9f53e813cb0.wasm",
5+
"tx_change_consensus_key.wasm": "tx_change_consensus_key.0295796e5ff47aeecb95b68c2fe308693e5f84b251126f26d03309e5f4f5da55.wasm",
6+
"tx_change_validator_commission.wasm": "tx_change_validator_commission.b745bc2b87bf8acd07e2f3409c77eee06c9b5206d2a77a2f23bb8e593c70cbfe.wasm",
7+
"tx_change_validator_metadata.wasm": "tx_change_validator_metadata.1b5a323c140b54700f280cde8b9aac1c12555f9c119e936432ddfa8f194d23ac.wasm",
8+
"tx_claim_rewards.wasm": "tx_claim_rewards.b6a1f7e069360650d2c6a1bdd2e5f4e18bb748d35dad02c31c027673fa042d8c.wasm",
9+
"tx_deactivate_validator.wasm": "tx_deactivate_validator.5120581194f1e6a122d2eec3f886e9cf5f079f56540d96193d3c1f9804c4d936.wasm",
10+
"tx_ibc.wasm": "tx_ibc.cecb1f1b75cd649915423c5e68be20c5232f94ab57a11a908dc66751bbdc4f72.wasm",
11+
"tx_init_account.wasm": "tx_init_account.26f90ec6676444cd6191d7555fd48861372f901c46e5178c59a897b411616918.wasm",
12+
"tx_init_proposal.wasm": "tx_init_proposal.33ee28597cf0f6a11dfe6e23e9aedf2eb04dabb44069cbe317768f4d982d80be.wasm",
13+
"tx_reactivate_validator.wasm": "tx_reactivate_validator.fbe97ce1136225bdbf8e388bab833a8c51e80bc1b8d94f7d3f8e49b3fad08543.wasm",
14+
"tx_redelegate.wasm": "tx_redelegate.7d5ad1877643f7d9b32a511ef93a11e8503426baee0f5986d29e3f63a2355d58.wasm",
15+
"tx_resign_steward.wasm": "tx_resign_steward.b63738a98927be05fd27f00d208e8703031e45b579d42f776d27234c48a48523.wasm",
16+
"tx_reveal_pk.wasm": "tx_reveal_pk.f1fc74460bd9bbd17140c88dfc0543440f066ffb84849c35c2bb0e331e51cf1c.wasm",
17+
"tx_transfer.wasm": "tx_transfer.6d753db0390e7cec16729fc405bfe41384c93bd79f42b8b8be41b22edbbf1b7c.wasm",
18+
"tx_unbond.wasm": "tx_unbond.36e774350b865752c9d309d518223abf0a60374bae15a1f73dfe4721b5887048.wasm",
19+
"tx_unjail_validator.wasm": "tx_unjail_validator.2e17680cec3e97ff5a6d4db2ba4a376a15f6da143abce690affd800645c6db80.wasm",
20+
"tx_update_account.wasm": "tx_update_account.12faf164aef7b6f91ed918db39f00e19fd3fc527a63f3b2589f43bf30bbaf24b.wasm",
21+
"tx_update_steward_commission.wasm": "tx_update_steward_commission.d7e34efc128d6a1c84691200f72f83ad9f696e1766f8ce083894f26343fc395f.wasm",
22+
"tx_vote_proposal.wasm": "tx_vote_proposal.faad78023b9391596981ac9a536070a3d7d469d5c6e20c2855b2cfca63c38f59.wasm",
23+
"tx_withdraw.wasm": "tx_withdraw.8a9df03a1a8f5e9e606e14a97fdfb2097dba062da1b3b2158bbfa7deabeeadfb.wasm",
24+
"vp_implicit.wasm": "vp_implicit.fb4462b86ff8969826fb66dfa0397cd795df9de9769f7a414d368200a8342951.wasm",
25+
"vp_user.wasm": "vp_user.abb163de1f532c740ee6bb69ccc69a5a55505b5c92979d1f256527833b8dfeca.wasm"
26+
}

0 commit comments

Comments
 (0)