@@ -67,6 +67,7 @@ const (
67
67
enablePubSubKwd = "enable-pubsub-experiment"
68
68
enableIPNSPubSubKwd = "enable-namesys-pubsub"
69
69
enableMultiplexKwd = "enable-mplex-experiment"
70
+ agentVersionSuffix = "agent-version-suffix"
70
71
// apiAddrKwd = "address-api"
71
72
// swarmAddrKwd = "address-swarm"
72
73
)
@@ -180,6 +181,7 @@ Headers.
180
181
cmds .BoolOption (enablePubSubKwd , "Instantiate the ipfs daemon with the experimental pubsub feature enabled." ),
181
182
cmds .BoolOption (enableIPNSPubSubKwd , "Enable IPNS record distribution through pubsub; enables pubsub." ),
182
183
cmds .BoolOption (enableMultiplexKwd , "DEPRECATED" ),
184
+ cmds .StringOption (agentVersionSuffix , "Optional suffix to the AgentVersion presented by `ipfs id` and also advertised through BitSwap." ),
183
185
184
186
// TODO: add way to override addresses. tricky part: updating the config if also --init.
185
187
// cmds.StringOption(apiAddrKwd, "Address for the daemon rpc API (overrides config)"),
@@ -410,6 +412,11 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
410
412
return fmt .Errorf ("unrecognized routing option: %s" , routingOption )
411
413
}
412
414
415
+ agentVersionSuffixString , _ := req .Options [agentVersionSuffix ].(string )
416
+ if agentVersionSuffixString != "" {
417
+ version .SetUserAgentSuffix (agentVersionSuffixString )
418
+ }
419
+
413
420
node , err := core .NewNode (req .Context , ncfg )
414
421
if err != nil {
415
422
log .Error ("error from node construction: " , err )
0 commit comments