Skip to content

Implement peer-to-peer communication between nodes #5

@devduart

Description

@devduart

Summary

Build a simple P2P network so nodes can share blocks and synchronize blockchain state.

Tasks

  • Define a list of known peers (IP + port)
  • Add endpoint POST /receive-block to accept new blocks from peers
  • On new block mined, broadcast to all peers
  • Add /sync endpoint to compare chains and adopt the longest valid one
  • Handle duplicate or invalid blocks gracefully

Optional

  • Use WebSocket or HTTP long polling for real-time communication
  • Add GET /peers to monitor network

Goal

Simulate a decentralized blockchain by allowing multiple instances to stay in sync.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions