libp2p / libp2p/py-libp2p

Implement go-libp2p interop tests (echo protocol)

Open
#1,136 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
624
Forks
256
Avg merge
1d 34m
Merged PRs (30d)
47

Description

Summary

Implement interop tests between py-libp2p and go-libp2p using the echo protocol, following the existing pattern from nim-libp2p interop tests.

Motivation

  • Interop testing ensures py-libp2p works correctly with other libp2p implementations
  • go-libp2p is the reference implementation, making this high-value testing
  • The framework already exists (nim interop), just needs to be extended for Go
  • Improves confidence in py-libp2p's cross-implementation compatibility

Current State

tests/interop/go_libp2p/test_go_basic.py contains only a placeholder test:

def test_go_libp2p_placeholder():
    assert True, "Placeholder test for go-libp2p interop tests"

No actual interop testing is performed.

Proposed Implementation

Following the nim-libp2p structure, create:

tests/interop/go_libp2p/
conftest.py # Pytest fixtures to build/start Go server
go_echo_server.go # Simple Go echo server using go-libp2p
test_echo_interop.py # Python tests connecting to Go server
scripts/
setup_go_echo.sh # Build script for Go binary

Test Flow

  1. Build step - Build script compiles the Go echo server binary

  2. Test setup - Pytest fixture starts the Go server as a subprocess

  3. Interop test - Python test uses py-libp2p to connect and test the echo protocol

  4. Teardown - Server is stopped after tests complete

References

Are you planning to do it yourself in a pull request?

Yes

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing tests/interop/nim_libp2p with the placeholder in tests/interop/go_libp2p/test_go_basic.py, then review the referenced go-libp2p echo example. Add the named Go server, pytest fixtures, echo interop tests, and setup script so the server builds, the Python client exchanges echo messages, and teardown completes cleanly.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, python
Domain
networking, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.