ethresearch / sharding-p2p-poc

Proof of Concept of Ethereum Serenity Peer-to-Peer Layer on libp2p PubSub System
40 stars 19 forks source link

Add RPCs which will be useful for testing #10

Closed mhchia closed 5 years ago

mhchia commented 6 years ago

This rpc should be able to list a node's peers in shard

Usage:

$ ./sharding-p2p-poc -client listshardpeer 0
[peer0, peer1, ...]
mhchia commented 5 years ago

Should add RPCs again:

jrhea commented 5 years ago

@mhchia what do you want returned for listshardpeer?

A list of peers with dups removed?

$ ./sharding-p2p-poc -port=10000 -rpcport=13000 -client listshardpeer 2 3 
[PEER_1,PEER_2]

A JSON object that contains a list of peers for each shard?

$ ./sharding-p2p-poc -port=10000 -rpcport=13000 -client listshardpeer 2 3 
{"shardCollations_2":[PEER_1,PEER_2],"shardCollations_3":[PEER_2,PEER_3]}
mhchia commented 5 years ago

@jrhea

I'd prefer

$ ./sharding-p2p-poc -port=10000 -rpcport=13000 -client listshardpeer 2 3 
{"2":[PEER_1,PEER_2],"3":[PEER_2,PEER_3]}

in this case, since listtopicpeer does roughly the same thing as your second example already. Thank you:)

mhchia commented 5 years ago

Fixed by #104