Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- chore: upgrade drand client
- chore: upgrade go-state-types with big.Int{} change that means an empty big.Int is now treated as zero for all operations ([filecoin-project/lotus#12936](https://github.com/filecoin-project/lotus/pull/12936))
- feat: expose `ChainGetMessagesInTipset` in the Lotus Gateway API ([filecoin-project/lotus#12947](https://github.com/filecoin-project/lotus/pull/12947))
- feat: add `Agent` to the `Filecoin.Version` response ([#12904](https://github.com/filecoin-project/lotus/issues/12904)) that will be used to identify the node type.

# UNRELEASED v.1.32.0

Expand Down
3 changes: 3 additions & 0 deletions api/api_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ type APIVersion struct {

// Seconds
BlockDelay uint64

// Agent type, as reported to other nodes, e.g. "lotus"
Agent string
}

func (v APIVersion) String() string {
Expand Down
3 changes: 3 additions & 0 deletions build/buildconstants/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ func BuildTypeString() string {

var Devnet = true

// The agent string used by the node and reported to other nodes in the network.
const UserAgent = "lotus"

// Used by tests and some obscure tooling
/* inline-gen template
const TestNetworkVersion = network.Version{{.latestNetworkVersion}}
Expand Down
6 changes: 5 additions & 1 deletion build/openrpc/gateway.json
Original file line number Diff line number Diff line change
Expand Up @@ -12117,7 +12117,8 @@
{
"Version": "string value",
"APIVersion": 131840,
"BlockDelay": 42
"BlockDelay": 42,
"Agent": "string value"
}
],
"additionalProperties": false,
Expand All @@ -12126,6 +12127,9 @@
"title": "number",
"type": "number"
},
"Agent": {
"type": "string"
},
"BlockDelay": {
"title": "number",
"type": "number"
Expand Down
3 changes: 2 additions & 1 deletion documentation/en/api-v0-methods-miner.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ Response:
{
"Version": "string value",
"APIVersion": 131840,
"BlockDelay": 42
"BlockDelay": 42,
"Agent": "string value"
}
```

Expand Down
3 changes: 2 additions & 1 deletion documentation/en/api-v0-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ Response:
{
"Version": "string value",
"APIVersion": 131840,
"BlockDelay": 42
"BlockDelay": 42,
"Agent": "string value"
}
```

Expand Down
3 changes: 2 additions & 1 deletion documentation/en/api-v1-unstable-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ Response:
{
"Version": "string value",
"APIVersion": 131840,
"BlockDelay": 42
"BlockDelay": 42,
"Agent": "string value"
}
```

Expand Down
1 change: 1 addition & 0 deletions node/impl/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func (a *CommonAPI) Version(context.Context) (api.APIVersion, error) {
APIVersion: v,

BlockDelay: buildconstants.BlockDelaySecs,
Agent: buildconstants.UserAgent,
}, nil
}

Expand Down
3 changes: 2 additions & 1 deletion node/modules/lp2p/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"go.uber.org/fx"

"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/build/buildconstants"
"github.com/filecoin-project/lotus/node/modules/dtypes"
"github.com/filecoin-project/lotus/node/modules/helpers"
)
Expand Down Expand Up @@ -51,7 +52,7 @@ func Host(mctx helpers.MetricsCtx, buildVersion build.BuildVersion, lc fx.Lifecy
libp2p.Peerstore(params.Peerstore),
libp2p.NoListenAddrs,
libp2p.Ping(true),
libp2p.UserAgent("lotus-" + string(buildVersion)),
libp2p.UserAgent(buildconstants.UserAgent + "-" + string(buildVersion)),
}
for _, o := range params.Opts {
opts = append(opts, o...)
Expand Down