Skip to content

Conversation

@jmalicevic
Copy link
Contributor

This PR integrates the e2e framework of CometBFT into beacon-kit.

Users can launch networks ,defined in manifests (examples are in testing/networks: single.toml, simple.toml, ci.toml ).

These nodes are launched together with a geth node and a node generating load using polycli.

One way to launch them is using make build-cmt-e2e followed by :
make test-cmt-e2e-single-no-build; make test-e2e-simple-no-build or test-e2e-ci-no-build to run the different predefined manifests.

Monitoring the network is also enabled using make start-monitoring and make stop-monitoring.

Using these commands the nodes are started, load is generated and the defined tests are ran. One can also manually start and observe the network behavior by running the following commands after a successful build:
build/bin/runner -f testing/networks/MANIFEST.toml setup - sets the corresponding folder structure and monitoring files properly.
build/bin/runner -f testing/networks/MANIFEST.toml start - where MANIFEST should be replaced by the name of the manifest you want to test.
build/bin/runner -f testing/networks/MANIFEST.toml load - starts the node that has polycli enabled and starts generating load until interrupted. Currently polycli parameters can be edited in testing/networks/MANIFEST/compose.yml or directly in the code in testing/runner/setup.go .

build/bin/runner -f testing/networks/MANIFEST.toml stop - stops the network.
build/bin/runner -f testing/networks/MANIFEST.toml cleanup - cleans up the files generated in the previous steps.

make start-monitoring sets up the folder structure to monitor the nodes and exposes CometBFT metrics in a grafana dashboard.

make stop-monitoring kills the container exposing metrics.

A GitHub workflow file launches the e2e testing framework on pushes to main.

There are simple tests that connect to beacon-kit via Node-API and test for simple things. Inspired by existing tests in e2e_api`

All of the above is launched in docker containers locally.

Note that all files under testing/cmt_e2e/runner are mainly copies of cometbft/e2e/runner with minor changes to support launching a Geth node and supporting polycli.

The following items are missing from this work:

  • Ideally geth should be specified in a toml file rather than hard coded in runner/setup.go
  • We should integrate polycli cli options so they can be added directly with load. For now they can be edited in runner/setup.go or after the setup in compose.yml
  • We should import cometbft/generator to generate random testate manifests
  • Support for different initial heights needs to be added
  • Beacon-kit node api ports are hacked into runner/setup.go . There is a more elegant way of doing it but it would require importing cometbft/test/e2e/package in addition to runner.

greg-szabo and others added 30 commits May 29, 2025 00:42
Co-authored-by: Jasmina Malicevic <[email protected]>
Signed-off-by: Greg Szabo <[email protected]>
Introduce runner and override makeConfig
Added geth node to docker network
Added load to geth using polycli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants