-
Notifications
You must be signed in to change notification settings - Fork 145
Conversation
b40c001
to
3d53534
Compare
ed1f54e
to
b1b9bd3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, your factory approach looks like what I was suggesting. 👍
Will fix the CI tomorrow and this PR should be ready by the time. 🙏 |
7dd08b6
to
3311c2f
Compare
Node
for py-libp2pNode
for py-libp2p
Should be ready now. |
To avoid package name conflicts with py-libp2p
Along with - configs.py: configs for libp2p protocols standard - utils.py: identity generation and protocol id helpers for now - And the incomplete tests
- Add `Node` service. - Add tests for `dial_peer`.
Generate the testing nodes with the factory.
- Add `NodeFactory.create_batch` - Add `try/finally` to the fixture `nodes` to ensure nodes are close even when the generator is closed
And modify tox.ini
Along with the deps in setup.py
a24c445
to
2dc564c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just some questions and nit.
muxer_opt=muxer_protocol_ids, | ||
sec_opt=security_protocol_ops, | ||
peerstore_opt=None, # let the function initialize it | ||
disc_opt=None, # no routing required here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: is this a temporary thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will be used for a while because we will use discv5 instead of the Kademlia in libp2p for the discovery.
|
||
MULTIPLEXING_PROTOCOL_ID = "/mplex/6.7.0" | ||
|
||
PUBSUB_PROTOCOL_ID = "/eth/serenity/gossipsub/1.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be GOSSIPSUB_PROTOCOL_ID
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually mean "the protocol id of pubsub we use here". Given this context, does PUBSUB_PROTOCOL_ID
make sense?
tests/libp2p/bcc/test_node.py
Outdated
) | ||
assert nodes[0].peer_id in nodes[1].host.get_network().connections | ||
assert nodes[1].peer_id in nodes[0].host.get_network().connections | ||
# Test: Reuse the old connection when connecting again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: The wording here sounds like it is reconnecting after disconnecting. What about
# Test: Second dial to a connected peer does not open a new connection
- Change `PUBSUB_PROTOCOL_ID` to `GOSSIPSUB_PROTOCOL_ID` - Reword the description of a test
What was wrong?
libp2p
conflicts with the dependency libp2p/py-libp2p.How was it fixed?
Node
to contain the components in py-libp2p we need.To-Do
Node
.Cute Animal Picture