---
# System prepended metadata

title: Portal Network interop testing

---

# Portal Network interop testing

As of now, there are 3 portal network clients - Trin, Fluffy, and Ultralight. Automatic cross-client integration tests are non-existent and all of the testings is done manually. This is of course time consuming and not sustainable. How do we know that the PR that has been just merged didn't break any interop functionality? We don't :(.

What we would like is to run an automatic integration test between portal clients on every client version release or anytime when a PR is merged to the main GitHub branch.

### What is Hive

[Hive](https://github.com/ethereum/hive) is a system for running integration tests against Ethereum clients.

In hive, integration tests are called 'simulations'. A simulation is controlled by a program (the 'simulator') written in any language. The simulator launches clients and contains test logic. It reports test results back to hive, where they are aggregated for display in a web browser.

Hive first builds simulator and client images using docker.
Once all images are built, the simulator program is launched in a docker container. The HIVE_SIMULATOR environment variable contains the HTTP server URL of the hive controller. The hive simulation API can be accessed at this URL. The simulator launches clients and reports test results through the API.

When the simulator requests a client instance, the hive controller launches a new docker container using the built client image. The client is now expected to launch its network endpoints for RPC and p2p communication.

When the client has finished starting, the simulator program communicates with it on the RPC and p2p endpoints. More than one client may be launched, and the clients can also communicate with each other.

During the simulation run, information about 'test suites' and their test cases must be provided by the simulator via the simulation API. The hive controller collects this information in a JSON file. It also collects client logs as well as the output of the simulator program.

To learn more about Hive, start [here](https://github.com/ethereum/hive/tree/master/docs).

### Welcome to portal-hive

We can leverage Hive's [simulation API](https://github.com/ethereum/hive/blob/master/docs/simulators.md#simulation-api-reference) and instead of eth clients, run tests between portal network clients. The only requirement is that every portal client needs its docker image. To view test results and logs in a web browser, we can use the [hiveview](https://github.com/ethereum/hive/tree/master/cmd/hiveview) tool.

#### Portal Network simulator

Because every simulation in Hive runs in a docker container, we can write our own in any language, leveraging the HTTP simulation API provided by hive.

There is a simulation library - [hivesim](https://pkg.go.dev/github.com/ethereum/hive/hivesim) which helps write simulators in Go, it is a wrapper for the Hive Simulation API.

For example, we can write our simulators in Rust and a simulation API wrapper in Rust (hivesim-rs ?) can also be useful to create simulators for eth clients, not only portal network clients!

#### Initial tests

- test interop OFFER/ACCEPT and FINDCONTENT/CONTENT
- add more complicated tests, runnning > 2 nodes and test POKE.
