forest
forest copied to clipboard
Properly set user agent
So node operators know what version people are running.
Right now what's set in forest is rust-libp2p/0.2.0
which is the default value in IdentifyConfig
in crate libp2p-identify
:
/// Defaults to `rust-libp2p/<libp2p-identify-version>`.
pub agent_version: String,
For reference, lotus's user agents look like this:
- Peers using lotus:
--- lotus-1.13.0+mainnet+git.7a55e8e89: 410
--- lotus-1.13.0+mainnet+git.5e3f1a15d.1635672001: 140
--- lotus-1.13.0+mainnet+git.7a55e8e89.dirty: 83
--- lotus-1.13.0+mainnet+git.5e3f1a15d.1635672227: 47
--- lotus-1.12.0+mainnet+git.6d8a6c480: 37
...
We should match this scheme.
our compile-time version string is already comparable, maybe it can be used?
https://github.com/ChainSafe/forest/blob/main/forest/build.rs#L27
our compile-time version string is already comparable, maybe it can be used?
https://github.com/ChainSafe/forest/blob/main/forest/build.rs#L27
Yes we can use similar code than for version
. I think that for some scripts, tools to work at PL the user agent strictly have to conform to this syntax:
<clientname>-<version>+<network>+<gitrevision>
Closed by #2790