luxd pins baseURL="/v1" (node/server/http/server.go:33) and has never served /ext, so both exported constructors — plugin/evm/client.NewClient and warp.NewClient — built a path no node answers. They are the seam every out-of-tree caller goes through: cli/pkg/utils/staking.go, sdk/validatormanager/uptime.go and netrunner/api all hand them a bare node URI, and staking.go's own SplitRPCURI already parsed /v1/bc/<id>/rpc. Those callers were already on /v1; this package was the lagging outlier, so fixing it here fixes all of them without touching one. Also corrects the simulator's default websocket endpoint, the hardhat default, and the docs — including api.testnet.lux.network, which does not serve RPC at all. The testnet host is api.lux-test.network (chainId 0x17870). Prefix-only sweeps miss that class of error. Tests pin the constructed path against an httptest server, with both an alias and a blockchain ID, so a future prefix change fails loudly instead of silently 404ing in production. Co-authored-by: Hanzo Dev <[email protected]>
Developing with tmpnet
The load/ and warp/ paths contain end-to-end (e2e) tests that use
the tmpnet
fixture. By
default both test suites use the tmpnet fixture to create a temporary
network that exists for only the duration of their execution.
It is possible to create a temporary network that can be reused across test runs to minimize the setup cost involved:
# From the root of a clone of luxd, build the tmpnetctl cli
$ ./scripts/build_tmpnetctl.sh
# Start a new temporary network configured with evm's default plugin path
$ ./build/tmpnetctl start-network --lux-path=./build/luxd
# From the root of a clone of evm, execute the warp test suite against the existing network
$ ginkgo -vv ./tests/warp -- --use-existing-network --network-dir=$HOME/.tmpnet/networks/latest
# To stop the temporary network when no longer needed, execute the following from the root of the clone of luxd
$ ./build/tmpnetctl stop-network --network-dir=$HOME/.tmpnet/networks/latest
The network started by tmpnetctl won't come with subnets configured,
so the test suite will add them to the network the first time it
runs. Subsequent test runs will be able to reuse those subnets without
having to set them up.
Collection of logs and metrics
Logs and metrics can be optionally collected for tmpnet networks and viewed in grafana. The details of configuration and usage for evm mirror those of luxd and the same documentation applies.
Optional Dev Shell
Some activities, such as collecting metrics and logs from the nodes targeted by an e2e test run, require binary dependencies. One way of making these dependencies available is to use a nix shell which will give access to the dependencies expected by the test tooling:
- Install nix. The determinate systems installer is recommended.
- Use ./scripts/dev_shell.sh to start a nix shell
- Execute the dependency-requiring command (e.g.
ginkgo -v ./tests/warp -- --start-collectors)
This repo also defines a .envrc file to configure devenv. With devenv
and nix installed, a shell at the root of the repo will automatically start a nix dev
shell.