Skip to content

Commit d0bfb84

Browse files
Stumbleclaude
authored andcommitted
cluster: make example presets build-from-local, add gravity_cli Makefile target
Two ergonomics fixes discovered while following the cluster deployment docs end-to-end on a fresh machine: 1. Every cluster.toml under cluster/example/ ships with source = { github = "Galxe/gravity-sdk", rev = "main" } This instructs deploy.sh to re-clone gravity-sdk and cargo-build it a second time inside the runtime dir, even when the user has already built the binaries in target/quick-release from the top-level Makefile. The result is a long re-build, extra disk usage, and ENOSPC on machines with modest free space. Change all five examples to source = { project_path = "../" }, matching cluster/cluster.toml.example and what the presets were clearly intended to be used for (the 1_node preset is literally named gravity-devnet-one). Anyone wanting github-source deploys can still flip the line back. 2. The top-level Makefile had targets for gravity_node / bench / kvstore but none for gravity_cli — yet init.sh, genesis.sh, and deploy.sh all require gravity_cli and fail with "gravity_cli not found! Please build it first." So the cluster docs instruction of "make BINARY=gravity_node MODE=quick-release" does not actually produce a working setup. Add a gravity_cli target, and a cluster convenience target that builds both gravity_node and gravity_cli in one invocation. The cluster docs can now say `make cluster MODE=quick-release` and work out of the box. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 1caeeb8 commit d0bfb84

6 files changed

Lines changed: 23 additions & 14 deletions

File tree

Makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ BINARY ?= gravity_node
22
FEATURE ?=
33
MODE ?= release
44

5-
BIN_DIRS := gravity_node bench kvstore
5+
BIN_DIRS := gravity_node gravity_cli bench kvstore
66
BIN_PATHS := $(addprefix bin/, $(BIN_DIRS))
77

88
ifeq ($(MODE),release)
@@ -15,13 +15,22 @@ endif
1515

1616
CARGO_FEATURES := $(if $(FEATURE),--features $(FEATURE),)
1717

18-
.PHONY: all $(BIN_DIRS) clean
18+
.PHONY: all cluster $(BIN_DIRS) clean
1919

2020
all: $(BINARY)
2121

22+
# Convenience target: build everything the cluster/ scripts need.
23+
# `make init`, `make genesis`, and `make deploy` all require gravity_cli in
24+
# addition to gravity_node, so this target is the one-shot build for anyone
25+
# following the cluster deployment or local-devnet docs.
26+
cluster: gravity_node gravity_cli
27+
2228
gravity_node:
2329
RUSTFLAGS="--cfg tokio_unstable" cargo build -p gravity_node $(CARGO_FLAGS) $(CARGO_FEATURES)
2430

31+
gravity_cli:
32+
cargo build -p gravity_cli $(CARGO_FLAGS) $(CARGO_FEATURES)
33+
2534
bench:
2635
cargo build -p bench $(CARGO_FLAGS) $(CARGO_FEATURES)
2736

cluster/example/1_node/cluster.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ waypoint_path = "./output/waypoint.txt"
1313
[[nodes]]
1414
id = "node1"
1515
role = "genesis"
16-
source = { github = "Galxe/gravity-sdk", rev = "main" }
16+
source = { project_path = "../" }
1717
host = "127.0.0.1"
1818
validator_port = 6180
1919
vfn_port = 6190

cluster/example/1_node_distinct_roles/cluster.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ waypoint_path = "./output/waypoint.txt"
1212
[[nodes]]
1313
id = "node1"
1414
role = "genesis"
15-
source = { github = "Galxe/gravity-sdk", rev = "main" }
15+
source = { project_path = "../" }
1616
host = "127.0.0.1"
1717
validator_port = 6180
1818
vfn_port = 6190

cluster/example/3_node/cluster.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ waypoint_path = "./output/waypoint.txt"
1313
[[nodes]]
1414
id = "node1"
1515
role = "genesis"
16-
source = { github = "Galxe/gravity-sdk", rev = "main" }
16+
source = { project_path = "../" }
1717
host = "127.0.0.1"
1818
validator_port = 6180
1919
vfn_port = 6190
@@ -27,7 +27,7 @@ reth_p2p_port = 12024
2727
[[nodes]]
2828
id = "node2"
2929
role = "genesis"
30-
source = { github = "Galxe/gravity-sdk", rev = "main" }
30+
source = { project_path = "../" }
3131
host = "127.0.0.1"
3232
validator_port = 6181
3333
vfn_port = 6191
@@ -41,7 +41,7 @@ reth_p2p_port = 12025
4141
[[nodes]]
4242
id = "node3"
4343
role = "genesis"
44-
source = { github = "Galxe/gravity-sdk", rev = "main" }
44+
source = { project_path = "../" }
4545
host = "127.0.0.1"
4646
validator_port = 6182
4747
vfn_port = 6192

cluster/example/3_node_1_vfn/cluster.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ waypoint_path = "./output/waypoint.txt"
1313
[[nodes]]
1414
id = "node1"
1515
role = "genesis"
16-
source = { github = "Galxe/gravity-sdk", rev = "main" }
16+
source = { project_path = "../" }
1717
host = "127.0.0.1"
1818
validator_port = 6180
1919
vfn_port = 6190
@@ -27,7 +27,7 @@ reth_p2p_port = 12024
2727
[[nodes]]
2828
id = "node2"
2929
role = "genesis"
30-
source = { github = "Galxe/gravity-sdk", rev = "main" }
30+
source = { project_path = "../" }
3131
host = "127.0.0.1"
3232
validator_port = 6181
3333
vfn_port = 6191
@@ -41,7 +41,7 @@ reth_p2p_port = 12025
4141
[[nodes]]
4242
id = "node3"
4343
role = "genesis"
44-
source = { github = "Galxe/gravity-sdk", rev = "main" }
44+
source = { project_path = "../" }
4545
host = "127.0.0.1"
4646
validator_port = 6182
4747
vfn_port = 6192
@@ -55,7 +55,7 @@ reth_p2p_port = 12026
5555
[[nodes]]
5656
id = "vfn1"
5757
role = "vfn"
58-
source = { github = "Galxe/gravity-sdk", rev = "main" }
58+
source = { project_path = "../" }
5959
host = "127.0.0.1"
6060
vfn_port = 6193
6161
rpc_port = 8548

cluster/example/3_node_distinct_roles/cluster.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ waypoint_path = "./output/waypoint.txt"
1212
[[nodes]]
1313
id = "node1"
1414
role = "genesis"
15-
source = { github = "Galxe/gravity-sdk", rev = "main" }
15+
source = { project_path = "../" }
1616
host = "127.0.0.1"
1717
validator_port = 6180
1818
vfn_port = 6190
@@ -26,7 +26,7 @@ reth_p2p_port = 12024
2626
[[nodes]]
2727
id = "node2"
2828
role = "genesis"
29-
source = { github = "Galxe/gravity-sdk", rev = "main" }
29+
source = { project_path = "../" }
3030
host = "127.0.0.1"
3131
validator_port = 6181
3232
vfn_port = 6191
@@ -40,7 +40,7 @@ reth_p2p_port = 12025
4040
[[nodes]]
4141
id = "node3"
4242
role = "genesis"
43-
source = { github = "Galxe/gravity-sdk", rev = "main" }
43+
source = { project_path = "../" }
4444
host = "127.0.0.1"
4545
validator_port = 6182
4646
vfn_port = 6192

0 commit comments

Comments
 (0)