Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
duniter
duniter
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 191
    • Issues 191
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 2
    • Merge Requests 2
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • nodes
  • typescript
  • duniterduniter
  • Issues
  • #1424

Closed
Open
Opened Dec 07, 2020 by Vincent Texier@vtexierDeveloper

[GVA] Add request to get network peers with enough info to make a real p2p client

I have made a python helper to help client keep a list of consensus blockchain nodes.

See : https://forum.duniter.org/t/fonction-daide-pour-avoir-un-vrai-client-python-p2p/7821

The BMA API needs two requests to get all info of nodes (network/ws2p/heads, network/peers).

GVA should be able to provide one request only.

Response should be a paginated list of nodes, a Node is an object with Head document and Peer document together.

Node {
    Head: {
        version: int,
        signature: str,
        api: str,
        pubkey: str,
        blockstamp: BlockUID {
            number: int,
            hash: str
        },
        ws2pid: str,
        software: str,
        software_version: str,
        pow_prefix: str,
        free_member_room: int,
        free_mirror_room: int
    },
    Peer: {
        version: int,
        currency: str,
        pubkey: str,
        block_uid: BlockUID {
            number: int,
            hash: str
        },
    endpoints: [str, ...],
    signature: str
    }
}

To not bind the Node object to the ws2p protocol Head document, we can put Head relevant information directly in the Node properties:

Node {
    pubkey: str,
    blockstamp: BlockUID {
        number: int,
        hash: str
    },
    software: str,
    software_version: str,
    Peer: {
        version: int,
        currency: str,
        pubkey: str,
        block_uid: BlockUID {
            number: int,
            hash: str
        },
    endpoints: [str, ...],
    signature: str
    }
}

With the drawback that we do not have the Head signature anymore.

Edited Dec 07, 2020 by Vincent Texier
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
1.9
Milestone
1.9
Assign milestone
Time tracking
None
Due date
None
Reference: nodes/typescript/duniter#1424