AtomOne
Endpoints & Sync
Project InfoChecking
Configured RPC, API, gRPC
A catalogue entry does not prove current uptime. Open RPC / API Monitoring for a fresh chain-ID-verified check and scanner timestamp before production use. โ
atomone-testnet-grpc.bonynode.online:443State Sync
Trust data and optional Wasm are verified before stop. Existing data, config and validator state are restored if any later step fails.
set -euo pipefail
export LC_ALL=C
NODE_HOME="$HOME/.atomone"
SERVICE="atomoned"
CHAIN_ID="atomone-testnet-1"
SNAP_RPC="https://atomone-testnet-rpc.bonynode.online:443"
PEERS="a58ec8e362a2a0053b6cf81a3d051f3fd7f8592f@atomone-testnet-peer.bonynode.online:62656"
WORK_DIR=$(mktemp -d)
STATE_BACKUP="$WORK_DIR/priv_validator_state.json"
CONFIG_BACKUP="$WORK_DIR/config.toml"
DATA_BACKUP="$NODE_HOME/data.backup.$(date -u +%Y%m%dT%H%M%SZ)"
FAILED_DATA="$NODE_HOME/data.failed.$(date -u +%Y%m%dT%H%M%SZ)"
NODE_STOPPED=0
DATA_MOVED=0
CONFIG_CHANGED=0
rollback() {
trap - ERR INT TERM
if [ "$DATA_MOVED" -eq 1 ]; then
if [ -e "$NODE_HOME/data" ]; then mv "$NODE_HOME/data" "$FAILED_DATA"; fi
mv "$DATA_BACKUP" "$NODE_HOME/data"
fi
if [ "$CONFIG_CHANGED" -eq 1 ]; then cp -p "$CONFIG_BACKUP" "$NODE_HOME/config/config.toml"; fi
if [ "$NODE_STOPPED" -eq 1 ]; then sudo systemctl start "$SERVICE" || true; fi
rm -rf "$WORK_DIR"
exit 1
}
trap rollback ERR INT TERM
command -v jq >/dev/null
command -v curl >/dev/null
command -v python3 >/dev/null
test -s "$NODE_HOME/data/priv_validator_state.json"
test -f "$NODE_HOME/config/config.toml"
test ! -e "$DATA_BACKUP"
test ! -e "$FAILED_DATA"
# Verify chain-id, trust height and trust hash before stopping the node.
STATUS_JSON=$(curl --fail --silent --show-error --proto "=https" --max-time 15 "$SNAP_RPC/status")
[ "$(jq -er '.result.node_info.network' <<<"$STATUS_JSON")" = "$CHAIN_ID" ]
LATEST_HEIGHT=$(jq -er '.result.sync_info.latest_block_height' <<<"$STATUS_JSON")
[[ "$LATEST_HEIGHT" =~ ^[0-9]+$ ]] && [ "$LATEST_HEIGHT" -gt 1000 ]
BLOCK_HEIGHT=$((LATEST_HEIGHT - 1000))
TRUST_HASH=$(curl --fail --silent --show-error --proto "=https" --max-time 15 "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -er '.result.block_id.hash')
[[ "$TRUST_HASH" =~ ^[A-Fa-f0-9]{64}$ ]]
cp -p "$NODE_HOME/data/priv_validator_state.json" "$STATE_BACKUP"
cp -p "$NODE_HOME/config/config.toml" "$CONFIG_BACKUP"
sudo systemctl stop "$SERVICE"
NODE_STOPPED=1
mv "$NODE_HOME/data" "$DATA_BACKUP"
DATA_MOVED=1
mkdir -p "$NODE_HOME/data"
install -m 0600 "$STATE_BACKUP" "$NODE_HOME/data/priv_validator_state.json"
CONFIG_CHANGED=1
python3 - "$NODE_HOME/config/config.toml" "$PEERS" "$SNAP_RPC" "$BLOCK_HEIGHT" "$TRUST_HASH" <<'PY'
import os
import re
import sys
import tempfile
path, peers, rpc, height, trust_hash = sys.argv[1:]
targets = {
('p2p', 'persistent_peers'): f'persistent_peers = "{peers}"',
('p2p', 'seeds'): 'seeds = ""',
('statesync', 'enable'): 'enable = true',
('statesync', 'rpc_servers'): f'rpc_servers = "{rpc},{rpc}"',
('statesync', 'trust_height'): f'trust_height = {height}',
('statesync', 'trust_hash'): f'trust_hash = "{trust_hash}"',
}
section = ''
seen = set()
output = []
with open(path, encoding='utf-8') as handle:
for line in handle:
section_match = re.match(r'^\s*\[([^]]+)\]\s*$', line)
if section_match:
section = section_match.group(1).strip()
key_match = re.match(r'^\s*([A-Za-z0-9_-]+)\s*=', line)
target = (section, key_match.group(1)) if key_match else None
if target in targets:
output.append(targets[target] + '\n')
seen.add(target)
else:
output.append(line)
missing = set(targets) - seen
if missing:
raise SystemExit('Required config keys were not found: ' + ', '.join(f'{s}.{k}' for s, k in sorted(missing)))
directory = os.path.dirname(path)
fd, temporary = tempfile.mkstemp(prefix='.config.toml.', dir=directory, text=True)
try:
os.fchmod(fd, os.stat(path).st_mode & 0o777)
with os.fdopen(fd, 'w', encoding='utf-8') as handle:
handle.writelines(output)
handle.flush()
os.fsync(handle.fileno())
os.replace(temporary, path)
directory_fd = os.open(directory, os.O_RDONLY)
try:
os.fsync(directory_fd)
finally:
os.close(directory_fd)
finally:
if os.path.exists(temporary):
os.unlink(temporary)
PY
sudo systemctl start "$SERVICE"
NODE_STOPPED=0
trap - ERR INT TERM
rm -rf "$WORK_DIR"
echo "Previous node data retained at $DATA_BACKUP until the state-synced node is verified healthy."
sudo journalctl -u "$SERVICE" -n 100 -fWasm
No reviewed Wasm archive is currently published.