mirror of
https://github.com/hanzoai/node.git
synced 2026-11-23 04:04:09 +00:00
src/ and genesis/ move unchanged into chain/. The validator binary is now hanzo-chain; hanzod is the per-machine daemon (HIP-1330 workstream a). Co-authored-by: Hanzo Dev <[email protected]>
54 lines
2.3 KiB
YAML
54 lines
2.3 KiB
YAML
# Hanzo CI/CD — hanzo-chain and hanzod. All real config is here; .github/workflows/cicd.yml is
|
|
# triggers and an import of hanzoai/ci.
|
|
|
|
test:
|
|
# Locked, so the gate resolves the same tree the Dockerfile does.
|
|
# lux-node is locked via ssh://[email protected]/lux-rs/node.git; hand the fetch
|
|
# to git CLI and add the ssh:// -> https:// rewrite alongside hanzoai/ci's
|
|
# https:// rewrite, matching Dockerfile without mutating Cargo.lock.
|
|
- name: build
|
|
run: |
|
|
set -e
|
|
if [ -n "${GIT_TOKEN:-}" ]; then
|
|
cfg="${RUNNER_TEMP:-/tmp}/gitconfig-cargo"
|
|
[ -n "${GIT_CONFIG_GLOBAL:-}" ] && [ -f "$GIT_CONFIG_GLOBAL" ] && cp "$GIT_CONFIG_GLOBAL" "$cfg" || : > "$cfg"
|
|
GIT_CONFIG_GLOBAL="$cfg" git config --global --add \
|
|
url."https://x-access-token:${GIT_TOKEN}@github.com/".insteadOf "ssh://[email protected]/"
|
|
export GIT_CONFIG_GLOBAL="$cfg" GIT_CONFIG_NOSYSTEM=1
|
|
fi
|
|
CARGO_NET_GIT_FETCH_WITH_CLI=true cargo build --release --locked
|
|
test -s target/release/hanzod
|
|
test -s target/release/hanzo-chain
|
|
|
|
# A validator that cannot state its own identity cannot join a committee, so
|
|
# the smoke is: publish a line, then answer for the chain it was issued.
|
|
- name: smoke
|
|
run: |
|
|
set -e
|
|
d=$(mktemp -d)
|
|
./target/release/hanzo-chain --data "$d" --publish > "$d/committee"
|
|
test -s "$d/committee"
|
|
./target/release/hanzo-chain --network mainnet --data "$d" \
|
|
--committee "$d/committee" --peers 127.0.0.1:9631 \
|
|
--rpc 127.0.0.1:9630 --mesh 127.0.0.1:9631 &
|
|
pid=$!
|
|
trap 'kill $pid 2>/dev/null || true' EXIT
|
|
for i in $(seq 1 30); do
|
|
got=$(curl -fsS --max-time 2 -X POST http://127.0.0.1:9630/v1/chain/hanzo/rpc \
|
|
-H 'content-type: application/json' \
|
|
-d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}' 2>/dev/null || true)
|
|
case "$got" in *0x9063*) echo "hanzo-chain answers for chain 36963"; exit 0;; esac
|
|
sleep 1
|
|
done
|
|
echo "hanzo-chain never answered for its chain" >&2
|
|
exit 1
|
|
|
|
images:
|
|
- name: hanzo-chain
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
repo: ghcr.io/hanzoai/node
|
|
# Both, because the fleet runs both and a single-arch image deploys on half
|
|
# of it. Each is built on a runner of its own architecture.
|
|
platforms: [linux/amd64, linux/arm64]
|