diff --git a/.github/workflows/check-versions.yml b/.github/workflows/check-versions.yml new file mode 100644 index 0000000..9598c2b --- /dev/null +++ b/.github/workflows/check-versions.yml @@ -0,0 +1,51 @@ +name: Check Version Consistency + +on: + push: + paths: + - '.versions.env' + - 'README.md' + - 'chains/update-validator-*.sh' + pull_request: + paths: + - '.versions.env' + - 'README.md' + - 'chains/update-validator-*.sh' + +jobs: + check-versions: + name: Verify README versions match .versions.env + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + + - name: Load canonical versions + run: | + # shellcheck source=.versions.env + . .versions.env + echo "AVALANCHEGO_VERSION=${AVALANCHEGO_VERSION}" >> "$GITHUB_ENV" + echo "SUBNET_EVM_VERSION=${SUBNET_EVM_VERSION}" >> "$GITHUB_ENV" + + - name: Check README references canonical versions + run: | + FAIL=0 + + if ! grep -qF "avalanchego: v${AVALANCHEGO_VERSION}" README.md; then + echo "ERROR: README.md does not reference avalanchego v${AVALANCHEGO_VERSION} (from .versions.env)" + FAIL=1 + fi + + if ! grep -qF "subnet-evm: v${SUBNET_EVM_VERSION}" README.md; then + echo "ERROR: README.md does not reference subnet-evm v${SUBNET_EVM_VERSION} (from .versions.env)" + FAIL=1 + fi + + if [ "$FAIL" -eq 1 ]; then + echo "" + echo "Update README.md or .versions.env so the versions are consistent." + exit 1 + fi + + echo "OK: README.md versions match .versions.env" diff --git a/.versions.env b/.versions.env new file mode 100644 index 0000000..8ce95b9 --- /dev/null +++ b/.versions.env @@ -0,0 +1,2 @@ +AVALANCHEGO_VERSION=1.14.1 +SUBNET_EVM_VERSION=0.8.0 diff --git a/chains/install-subnet-cli.sh b/chains/install-subnet-cli.sh index 9b01c83..4ea6098 100755 --- a/chains/install-subnet-cli.sh +++ b/chains/install-subnet-cli.sh @@ -1,3 +1,8 @@ +# DEPRECATED: subnet-cli (ava-labs/subnet-cli) has been replaced by the +# Avalanche CLI (ava-labs/avalanche-cli). This script is kept for historical +# reference only. Use the `avalanche` CLI instead. +# See the "Import Existing L1 in Avalanche CLI" section in the README. + VERSION=0.0.2 # Populate latest here GOARCH=$(go env GOARCH) diff --git a/chains/update-validator-mainnet.sh b/chains/update-validator-mainnet.sh index f740697..48a339a 100755 --- a/chains/update-validator-mainnet.sh +++ b/chains/update-validator-mainnet.sh @@ -1,8 +1,10 @@ #!/bin/bash -AVALANCHEGO_PREVIOUS_VERSION="1.10.7" -AVALANCHEGO_VERSION="1.10.11" -SUBNET_EVM_VERSION="0.5.6" +# Set AVALANCHEGO_PREVIOUS_VERSION to the version currently installed on your node. +AVALANCHEGO_PREVIOUS_VERSION="1.10.11" +# Source canonical version constants (AVALANCHEGO_VERSION, SUBNET_EVM_VERSION) +# shellcheck source=../.versions.env +. "$(dirname "$0")/../.versions.env" # Numbers Mainnet VM_ID="qeX7kcVMMkVLB9ZJKTpvtSjpLbtYooNEdpFzFShwRTFu76qdx" SUBNET_ID="2gHgAgyDHQv7jzFg6MxU2yyKq5NZBpwFLFeP8xX2E3gyK1SzSQ" diff --git a/chains/update-validator-testnet.sh b/chains/update-validator-testnet.sh index 6f2c22d..0a57fe0 100755 --- a/chains/update-validator-testnet.sh +++ b/chains/update-validator-testnet.sh @@ -1,8 +1,10 @@ #!/bin/bash -AVALANCHEGO_PREVIOUS_VERSION="1.10.7" -AVALANCHEGO_VERSION="1.10.11" -SUBNET_EVM_VERSION="0.5.6" +# Set AVALANCHEGO_PREVIOUS_VERSION to the version currently installed on your node. +AVALANCHEGO_PREVIOUS_VERSION="1.10.11" +# Source canonical version constants (AVALANCHEGO_VERSION, SUBNET_EVM_VERSION) +# shellcheck source=../.versions.env +. "$(dirname "$0")/../.versions.env" # Numbers Testnet VM_ID="kmYb53NrmqcW7gfV2FGHBHWXNA6YhhWf7R7LoQeGj9mdDYuaT" SUBNET_ID="81vK49Udih5qmEzU7opx3Zg9AnB33F2oqUTQKuaoWgCvFUWQe" diff --git a/rpc/requirements.txt b/rpc/requirements.txt new file mode 100644 index 0000000..d20e75c --- /dev/null +++ b/rpc/requirements.txt @@ -0,0 +1,2 @@ +requests>=2.28.0 +websockets>=10.0 diff --git a/rpc/rpc_test.py b/rpc/rpc_test.py index c3561e8..468ee9a 100644 --- a/rpc/rpc_test.py +++ b/rpc/rpc_test.py @@ -41,13 +41,18 @@ def test_chain_id(rpc_url, chain_id): payload = { "jsonrpc": "2.0", "method": "eth_chainId", - "id": chain_id, + "id": 1, } try: response = requests.post(rpc_url, json=payload) response_data = response.json() print("RPC request successful, Response Data:", response_data) + returned_chain_id = int(response_data['result'], 16) + assert returned_chain_id == chain_id, ( + f"Chain ID mismatch: expected {chain_id}, got {returned_chain_id}" + ) + print(f"Chain ID verified: {returned_chain_id}") except Exception as e: print(f"RPC request failed, Error: {str(e)}") diff --git a/subnet-cli/README.md b/subnet-cli/README.md new file mode 100644 index 0000000..6df9469 --- /dev/null +++ b/subnet-cli/README.md @@ -0,0 +1,13 @@ +# ⚠️ DEPRECATED — subnet-cli + +> **This directory and all scripts within it are deprecated.** +> +> `subnet-cli` (`ava-labs/subnet-cli`, v0.0.2, 2022) has been superseded by the +> **Avalanche CLI** (`ava-labs/avalanche-cli`). The scripts here are kept for +> historical reference only and **should not be used for new operations**. + +## Migration + +Use the `avalanche` CLI instead. +See the **"Import Existing L1 in Avalanche CLI"** section in the top-level +[README](../README.md) for the current workflow. diff --git a/subnet-cli/install-subnet-cli.sh b/subnet-cli/install-subnet-cli.sh index 9b01c83..4ea6098 100755 --- a/subnet-cli/install-subnet-cli.sh +++ b/subnet-cli/install-subnet-cli.sh @@ -1,3 +1,8 @@ +# DEPRECATED: subnet-cli (ava-labs/subnet-cli) has been replaced by the +# Avalanche CLI (ava-labs/avalanche-cli). This script is kept for historical +# reference only. Use the `avalanche` CLI instead. +# See the "Import Existing L1 in Avalanche CLI" section in the README. + VERSION=0.0.2 # Populate latest here GOARCH=$(go env GOARCH)