Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.subnet-cli.pk
rpc/__pycache__/
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ Before validation staking expires, any wallet can not stake to a validator again

Validator version distributions: [mainnet](https://explorer-xp.avax.network/validators), [testnet](https://explorer-xp.avax-test.network/validators)

[Renew Numbers Validators](https://app.asana.com/0/1202305127727547/1202919355642524/f) (internal task)
Renew Numbers Validators (see internal task tracker)

## Import Existing L1 in Avalanche CLI

Expand Down Expand Up @@ -461,7 +461,7 @@ Notes

1. When upgrading node, you need to upgrade EVM and plugins as well.

> [jpop32 — 05/12/2021](https://discord.com/channels/578992315641626624/757576823570825316/841775940706762762)
> [Community discussion — 05/12/2021](https://discord.com/invite/numprotocol)
> Plugin is the part of the installation. And it has to be upgraded along with the main executable, yes.

Since `avalanchego v1.9.6`, there are two breaking changes
Expand Down Expand Up @@ -950,4 +950,4 @@ Make a Full Node instance to be an Archive Node instance:
--data '{"method":"debug_traceTransaction","params":["0x7d2dec6c3e7ce2a387d988a0603ce7de6d487d6aeaf6b58eabdb123161cee0a2"],"id":1,"jsonrpc":"2.0"}'
```

[Discord discussion](https://discord.com/channels/578992315641626624/905684871731634196/1026850988042244247)
[Discord discussion](https://discord.com/invite/numprotocol)
1 change: 1 addition & 0 deletions api/env.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set -euo pipefail
URL="127.0.0.1:9650"
1 change: 1 addition & 0 deletions api/health.health.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail

curl -X POST --data '{
"jsonrpc":"2.0",
Expand Down
1 change: 1 addition & 0 deletions api/info.getNetworkID.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail

source env.sh

Expand Down
1 change: 1 addition & 0 deletions api/info.getNetworkName.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail

source env.sh

Expand Down
1 change: 1 addition & 0 deletions api/info.getNodeID.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail
#
# Pre-running a node on Chainstake
#
Expand Down
1 change: 1 addition & 0 deletions api/info.getVMs.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail

source env.sh

Expand Down
1 change: 1 addition & 0 deletions api/info.isBootstrapped.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail
#
# Note: The bootstrapping process takes approximately 50–100 hours and requires 100 GB of space.
# https://chainstack.com/avalanche-subnet-tutorial-series-running-a-local-avalanche-node-on-fuji-testnet/
Expand Down
1 change: 1 addition & 0 deletions api/info.peers.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail

# Snow
echo "========== Snow nodes information =========="
Expand Down
1 change: 1 addition & 0 deletions api/metrics.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
set -euo pipefail

curl -X POST 127.0.0.1:9650/ext/metrics
1 change: 1 addition & 0 deletions api/platform.getBlockchainStatus.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail
#
# {
# "id": "fdesjrz477ot2iuUKdrGUephzHEfMN6AayMaWGXxhnZfkGRYr",
Expand Down
1 change: 1 addition & 0 deletions api/platform.getBlockchains.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail

source env.sh

Expand Down
1 change: 1 addition & 0 deletions api/platform.getCurrentValidators.mainnet.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail
#
# Note: The bootstrapping process takes approximately 50–100 hours and requires 100 GB of space.
# https://chainstack.com/avalanche-subnet-tutorial-series-running-a-local-avalanche-node-on-fuji-testnet/
Expand Down
1 change: 1 addition & 0 deletions api/platform.getCurrentValidators.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail
#
# Note: The bootstrapping process takes approximately 50–100 hours and requires 100 GB of space.
# https://chainstack.com/avalanche-subnet-tutorial-series-running-a-local-avalanche-node-on-fuji-testnet/
Expand Down
1 change: 1 addition & 0 deletions api/platform.getPendingValidators.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail
#
# Note: The bootstrapping process takes approximately 50–100 hours and requires 100 GB of space.
# https://chainstack.com/avalanche-subnet-tutorial-series-running-a-local-avalanche-node-on-fuji-testnet/
Expand Down
1 change: 1 addition & 0 deletions api/platform.getSubnets.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail
#
# Note: The bootstrapping process takes approximately 50–100 hours and requires 100 GB of space.
# https://chainstack.com/avalanche-subnet-tutorial-series-running-a-local-avalanche-node-on-fuji-testnet/
Expand Down
1 change: 1 addition & 0 deletions api/platform.getValidatorsAt.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail

SUBNET_ID="$1"

Expand Down
1 change: 1 addition & 0 deletions api/platform.validatedBy.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail

BLOCKCHAIN_ID="$1"

Expand Down
1 change: 1 addition & 0 deletions api/platform.validates.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail

SUBNET_ID="$1"

Expand Down
1 change: 1 addition & 0 deletions chains/backup-validator.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh
set -eu

# Backup Avalanche validator

Expand Down
21 changes: 21 additions & 0 deletions chains/devnet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# DEVELOPMENT ONLY

> ⚠️ **WARNING**: This directory contains devnet (development network) configuration files. Do NOT use these files for production (mainnet/testnet) deployments.

## Chain ID

- **Devnet chain ID**: `10509`
- **Testnet chain ID**: `10508`
- **Mainnet chain ID**: `10507`

Verify the chain ID in deployment scripts before proceeding. Using the wrong genesis file could result in funds allocated to the wrong address or network.

## Token Allocation

The devnet genesis allocates a large token balance for development and testing purposes only. This allocation is intentionally disproportionate and must never be used in production.

## Files

| File | Description |
|------|-------------|
| `genesis.json` | Devnet genesis configuration (DEVELOPMENT ONLY, chain ID 10509) |
2 changes: 2 additions & 0 deletions chains/install-subnet-cli.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash
set -euo pipefail
VERSION=0.0.2 # Populate latest here

GOARCH=$(go env GOARCH)
Expand Down
11 changes: 10 additions & 1 deletion chains/update-validator-mainnet.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail

AVALANCHEGO_PREVIOUS_VERSION="1.10.7"
AVALANCHEGO_VERSION="1.10.11"
Expand All @@ -24,8 +25,16 @@ download_sunbet_evm() {

update_subnet_evm() {
echo "Step: update_subnet_evm"
EXPECTED_CHECKSUM="$(curl -sL https://github.com/ava-labs/subnet-evm/releases/download/v${SUBNET_EVM_VERSION}/subnet-evm_${SUBNET_EVM_VERSION}_checksums.txt | grep "subnet-evm_${SUBNET_EVM_VERSION}_linux_amd64.tar.gz" | awk '{print $1}')"
ACTUAL_CHECKSUM="$(sha256sum subnet-evm_${SUBNET_EVM_VERSION}_linux_amd64.tar.gz | awk '{print $1}')"
if [ "${EXPECTED_CHECKSUM}" != "${ACTUAL_CHECKSUM}" ]; then
echo "ERROR: Checksum mismatch for subnet-evm tarball. Aborting installation."
echo " Expected: ${EXPECTED_CHECKSUM}"
echo " Actual: ${ACTUAL_CHECKSUM}"
exit 1
fi
echo "Checksum verified: ${ACTUAL_CHECKSUM}"
cp subnet-evm-${SUBNET_EVM_VERSION}/subnet-evm ~/.avalanchego/plugins/${VM_ID}
sha256sum subnet-evm-${SUBNET_EVM_VERSION}/subnet-evm ~/.avalanchego/plugins/${VM_ID}
}

show_validator_files() {
Expand Down
11 changes: 10 additions & 1 deletion chains/update-validator-testnet.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail

AVALANCHEGO_PREVIOUS_VERSION="1.10.7"
AVALANCHEGO_VERSION="1.10.11"
Expand All @@ -24,8 +25,16 @@ download_sunbet_evm() {

update_subnet_evm() {
echo "Step: update_subnet_evm"
EXPECTED_CHECKSUM="$(curl -sL https://github.com/ava-labs/subnet-evm/releases/download/v${SUBNET_EVM_VERSION}/subnet-evm_${SUBNET_EVM_VERSION}_checksums.txt | grep "subnet-evm_${SUBNET_EVM_VERSION}_linux_amd64.tar.gz" | awk '{print $1}')"
ACTUAL_CHECKSUM="$(sha256sum subnet-evm_${SUBNET_EVM_VERSION}_linux_amd64.tar.gz | awk '{print $1}')"
if [ "${EXPECTED_CHECKSUM}" != "${ACTUAL_CHECKSUM}" ]; then
echo "ERROR: Checksum mismatch for subnet-evm tarball. Aborting installation."
echo " Expected: ${EXPECTED_CHECKSUM}"
echo " Actual: ${ACTUAL_CHECKSUM}"
exit 1
fi
echo "Checksum verified: ${ACTUAL_CHECKSUM}"
cp subnet-evm-${SUBNET_EVM_VERSION}/subnet-evm ~/.avalanchego/plugins/${VM_ID}
sha256sum subnet-evm-${SUBNET_EVM_VERSION}/subnet-evm ~/.avalanchego/plugins/${VM_ID}
}

show_validator_files() {
Expand Down
21 changes: 21 additions & 0 deletions genesis/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Genesis Files

This directory contains historical and reference genesis configurations for the Numbers Network. The canonical genesis files reside in `chains/<network>/`.

## Chain IDs

| Network | Chain ID |
|---------|----------|
| Mainnet | `10507` |
| Testnet | `10508` |
| Devnet | `10509` |

## Files

| File | Network | Chain ID | Description |
|------|---------|----------|-------------|
| `genesis.json` | Testnet | 10508 | Base testnet genesis configuration |
| `genesis-nativecoin-feemgr.json` | Testnet | 10508 | Testnet genesis with native coin minter and fee manager |
| `genesis-nativecoin-feemgr-feerecv.json` | Testnet | 10508 | Testnet genesis with native coin minter, fee manager, and fee receiver |

> ⚠️ These files use the **testnet** chain ID (10508). For production deployments, always use the genesis files in `chains/mainnet/`. Verify the chain ID before deploying.
41 changes: 32 additions & 9 deletions rpc/rpc_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import requests
import json
from requests.exceptions import ConnectionError, Timeout, SSLError


MAINNET_RPC_URL = "https://mainnetrpc.num.network"
Expand All @@ -11,14 +12,24 @@


def test_connectivity(rpc_url):
payload = {
"jsonrpc": "2.0",
"method": "web3_clientVersion",
"params": [],
"id": 1
}
try:
response = requests.get(rpc_url)
response = requests.post(rpc_url, json=payload, verify=True)
if response.status_code == 200:
print("Node is reachable, HTTP Status Code: 200")
else:
print(f"Node is not reachable, HTTP Status Code: {response.status_code}")
except Exception as e:
print(f"Connection failed, Error: {str(e)}")
except SSLError as e:
print(f"TLS/SSL error: {str(e)}")
except ConnectionError as e:
print(f"Connection failed: {str(e)}")
except Timeout as e:
print(f"Request timed out: {str(e)}")


def test_functionality(rpc_url):
Expand All @@ -30,11 +41,17 @@ def test_functionality(rpc_url):
}

try:
response = requests.post(rpc_url, json=payload)
response = requests.post(rpc_url, json=payload, verify=True)
response_data = response.json()
print("RPC request successful, Response Data:", response_data)
except Exception as e:
print(f"RPC request failed, Error: {str(e)}")
except SSLError as e:
print(f"TLS/SSL error: {str(e)}")
except ConnectionError as e:
print(f"RPC request failed, Connection error: {str(e)}")
except Timeout as e:
print(f"RPC request timed out: {str(e)}")
except ValueError as e:
print(f"RPC response parse error: {str(e)}")


def test_chain_id(rpc_url, chain_id):
Expand All @@ -45,11 +62,17 @@ def test_chain_id(rpc_url, chain_id):
}

try:
response = requests.post(rpc_url, json=payload)
response = requests.post(rpc_url, json=payload, verify=True)
response_data = response.json()
print("RPC request successful, Response Data:", response_data)
except Exception as e:
print(f"RPC request failed, Error: {str(e)}")
except SSLError as e:
print(f"TLS/SSL error: {str(e)}")
except ConnectionError as e:
print(f"RPC request failed, Connection error: {str(e)}")
except Timeout as e:
print(f"RPC request timed out: {str(e)}")
except ValueError as e:
print(f"RPC response parse error: {str(e)}")


if __name__ == '__main__':
Expand Down
2 changes: 2 additions & 0 deletions subnet-cli/install-subnet-cli.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash
set -euo pipefail
VERSION=0.0.2 # Populate latest here

GOARCH=$(go env GOARCH)
Expand Down
3 changes: 2 additions & 1 deletion subnet-cli/subnet-cli-add-subnet-validator-mainnet.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# Validator ID source: https://app.asana.com/0/1202305127727547/1202919355642524/f
set -euo pipefail
# Validator ID source: see internal task tracker

NODE_ID="NodeID-BXTBUqX8gitUDtVam4fhRWGD1SfeHGoBx"
SUBNET_ID="2gHgAgyDHQv7jzFg6MxU2yyKq5NZBpwFLFeP8xX2E3gyK1SzSQ"
Expand Down
3 changes: 2 additions & 1 deletion subnet-cli/subnet-cli-add-subnet-validator-testnet.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# Validator ID source: https://app.asana.com/0/1202305127727547/1202919355642524/f
set -euo pipefail
# Validator ID source: see internal task tracker

NODE_ID="NodeID-A2Z8m7egVLhKf1Qj14uvXadhExM5zrB7p"
SUBNET_ID="81vK49Udih5qmEzU7opx3Zg9AnB33F2oqUTQKuaoWgCvFUWQe"
Expand Down
1 change: 1 addition & 0 deletions subnet-cli/subnet-cli-create-vmid.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail
#
# https://docs.avax.network/subnets/create-a-fuji-subnet-subnet-cli#build-binary

Expand Down
1 change: 1 addition & 0 deletions subnet-cli/subnet-cli-status-blockchain.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail

# Numbers devnet
BLOCKCHAIN_ID="$1"
Expand Down
1 change: 1 addition & 0 deletions subnet-cli/subnet-cli-wizard-mainnet.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail
#
# --node-ids: If you have multiple nodes, use comma to separate them.
# Ex: NodeID-8CGJYaRLChC79CCRnvd7sh5eB9E9L9dVF,NodeID-24WK7qiKXAumya1kKEktwj2ubBbRyq5UW
Expand Down
1 change: 1 addition & 0 deletions subnet-cli/subnet-cli-wizard.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail
#
# --node-ids: If you have multiple nodes, use comma to separate them.
# Ex: NodeID-8CGJYaRLChC79CCRnvd7sh5eB9E9L9dVF,NodeID-24WK7qiKXAumya1kKEktwj2ubBbRyq5UW
Expand Down