Skip to content

Conversation

@Winter-Soren
Copy link

Adds a Python implementation for GossipSub interoperability testing, enabling cross-language compatibility testing between Python (py-libp2p), Go (go-libp2p), and Rust (rust-libp2p) implementations using the Shadow network simulator.

What's Added

  • Python Implementation (py-libp2p/main.py) - Full Shadow-compatible GossipSub node
  • Docker Environment - Complete setup for running Shadow simulator on macOS
  • Test Compositions - Support for python-and-go, python-and-rust, and all-three scenarios

Key Features

  • ✅ Deterministic ED25519 peer ID generation (compatible with Go/Rust)
  • ✅ Shadow simulator hostname resolution (node{id} pattern)
  • ✅ Structured JSON logging to stdout
  • ✅ All script instructions supported (connect, publish, subscribe, etc.)
  • ✅ Message ID calculation matching Go/Rust implementations

Testing

The Python implementation follows the exact same Shadow compatibility requirements as the existing Go and Rust implementations, ensuring seamless interoperability testing across all three language implementations.

@Winter-Soren Winter-Soren changed the title added go/rust compatible python implementation of gossipsub interop feat: go/rust compatible python implementation of gossipsub interop Nov 12, 2025
@@ -0,0 +1,69 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's move this change to a separate PR.

Copy link
Author

@Winter-Soren Winter-Soren Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I will move it to a separate PR!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should commit the uv.lock file as well

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll add uv.lock file!

@MarcoPolo
Copy link
Contributor

Did you actually run this and get successful results?

@Winter-Soren
Copy link
Author

Did you actually run this and get successful results?

Hi @MarcoPolo
I haven’t run the tests yet because I’m facing build issues with the Shadow simulator. I’m currently moving toward a Docker-based setup without the Shadow simulator. Once this is done, I hope we can arrive at a successful conclusion.

@MarcoPolo
Copy link
Contributor

Shadow is different from docker. These tests are only expected to run within shadow. What are the build issues? Are you building on a released version of Shadow? Shadow only works on linux amd64.

@Winter-Soren
Copy link
Author

Shadow is different from docker. These tests are only expected to run within shadow. What are the build issues? Are you building on a released version of Shadow? Shadow only works on linux amd64.

I am using macOS, where I am creating a Docker container with Ubuntu 24.04 and attempting to build the released version of Shadow by following the documentation. I have attached a screenshot below that shows the issue occurring during the build.
Could you guide me further on this build issue? For now, I am proceeding without the Shadow simulator.

image

@MarcoPolo
Copy link
Contributor

MarcoPolo commented Dec 21, 2025 via email

@Winter-Soren
Copy link
Author

I am using macOS, where I am creating a Docker container with Ubuntu 24.04 and attempting to build the released version of Shadow by following the documentation. I have attached a screenshot below that shows the issue occurring during the build. Could you guide me further on this build issue? For now, I am proceeding without the Shadow simulator.
You need to run this on an amd64 linux. Docker won't work.

Thank you for the clarification, I'll get start with Shadow Simulator on amd64 linux device along with my team and get back to you!

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.

3 participants