Skip to content
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

Programmatically set agentVersion in Identify #686

Closed
jacobheun opened this issue Jun 30, 2020 · 1 comment · Fixed by #1296
Closed

Programmatically set agentVersion in Identify #686

jacobheun opened this issue Jun 30, 2020 · 1 comment · Fixed by #1296
Labels
exp/beginner Can be confidently tackled by newcomers good first issue Good issue for new contributors help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature status/ready Ready to be worked

Comments

@jacobheun
Copy link
Contributor

Overview

When handling Identify requests we are just sending a static, constant agentVersion of 'js-libp2p/0.1.0'. This is unhelpful and should be dynamic. The agentVersion can be set to any string. What we should be doing is specifying the package name and package version in the agentVersion. This can enable us to better identify applications on the network and see how the public network is upgrading over time.

Proposed Changes

  • Specify a default agentVersion of js-libp2p/<libp2p.version> ex: (js-libp2p/0.28.3)
  • When used in another application, such as a js-ipfs daemon, specify an agentVersion of <package.name>/<package.version> ex: (ipfs/0.47.0)
  • When running in Node.js, append the node version. ex: (js-libp2p/<libp2p.version> UserAgent=<process.version>)
  • When running in browser, append the browser UserAgent. ex: (js-libp2p/<libp2p.version> UserAgent=<navigator.userAgent>)

go-libp2p already does this for Identify, without the UserAgent information. At a minimum we should include the app name and version name, but the UserAgent would also be useful.

@jacobheun jacobheun added kind/enhancement A net-new feature or improvement to an existing feature exp/novice Someone with a little familiarity can pick up status/ready Ready to be worked labels Jun 30, 2020
@vasco-santos
Copy link
Member

This was partially on #800 we should add the UserAgent though

@vasco-santos vasco-santos added the help wanted Seeking public contribution on this issue label Jun 24, 2021
@vasco-santos vasco-santos added good first issue Good issue for new contributors exp/beginner Can be confidently tackled by newcomers and removed exp/novice Someone with a little familiarity can pick up labels Nov 12, 2021
achingbrain added a commit that referenced this issue Jul 15, 2022
If no `agentVersion` is provided for the Identify protocol, the default `AGENT_VERSION` will now be set to
* `js-libp2p/<libp2p.version> UserAgent=<process.version>` when running in Node.js
* `js-libp2p/<libp2p.version> UserAgent=<navigator.userAgent>` when running in the browser (also when running in a webworker)

Fixes #686
Supersedes #1240

Co-authored-by: Kevin Westphal <westphal@consider-it.de>
Co-authored-by: Kevin <56823591+6d7a@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/beginner Can be confidently tackled by newcomers good first issue Good issue for new contributors help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature status/ready Ready to be worked
Projects
None yet
2 participants