-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: store remote agent and protocol version during identify #943
fix: store remote agent and protocol version during identify #943
Conversation
These values were not being stored during identify.
I did have a couple of questions about this - why is Why are they stored as |
I tracked it down to #724 . I am not sure, probably to be similar to Go? We did try to follow go whenever possible for storing stuff in the stores.
Because we persist the metadataBook content as Uint8Array, as a Datastore Value. In this case, we considered that anything could be stored as metadata, including a serialized protobuf |
test/identify/index.spec.js
Outdated
await pWaitFor(() => connection.streams.length === 0) | ||
await connection.close() | ||
|
||
const remotePeer = PeerId.createFromB58String('12D3KooWHFKTMzwerBtsVmtz4ZZEQy2heafxzWw6wNn5PPYkBxJ5') |
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.
Can we do not have the peerId hardcoded?
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.
It's taken from https://github.com/libp2p/js-libp2p/blob/master/test/fixtures/browser.js#L6 where it's also hardcoded?
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 thought I would have been able to get it from remoteLibp2p but that var does't appear to be set anywhere in the tests?
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 was meaning, probably more bullet proof to extract the id from the multiaddr
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.
Aha, have updated it.
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
These values were not being stored during identify.