pokt-network / pocket

Official implementation of the Pocket Network Protocol v1
https://pokt.network
MIT License
63 stars 33 forks source link

[P2P] Peer discovery debug CLI sub-commands #730

Open bryanchriswhite opened 1 year ago

bryanchriswhite commented 1 year ago

Objective

Extend the debug CLI to expose sub-commands for driving peer discovery in the P2P module (analogous to how it currently supports driving consensus). This will facilitate both manual and automated testing efforts.

Origin Document

Based on a discussion between @dylanlott and myself about end-to-end test planning for peer discovery. It has been made clear in discussions past (probably in documentation somewhere as well) that we want to prioritize supporting robust manual testing/investigation of these dynamic systems (before they get a chance to run away from us).

Goals

Deliverable

CLI UX - peer & p2p subcommands

The following commands should send/broadcast debug messages into the network, resulting in nodes to print to their respective logs, similar to the debug subcommand's behavior.

peer discovery status # background router only
peer discovery start  # background router only
peer discovery stop   # background router only
peer list [--all | --staked | --unstaked]
peer forget (--all | <forgetter peer ID>)
peer connections
peer interrogate <peer ID>
peer disconnect <peer ID>

p2pCmd persisten flags:

NOTE: p2p commands MAY interact with a remote/standalone node rather than utilize the CLI's own P2P module

p2p send [--trace] <peer ID> <text message>
p2p broadcast [--trace] <text message>

Non-goals / Non-deliverables

General issue deliverables

Testing Methodology


Creator: @bryanchriswhite

Olshansk commented 1 year ago

@bryanchriswhite We haven't merged in the P2P subcommand in yet, so do you think this was closed prematurely?

Olshansk commented 1 year ago

Per my comment above, reopening until it's merged or told otherwise.