File tree 2 files changed +19
-0
lines changed
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ var (
105
105
ConnGaterKey = special {12 } // libp2p option
106
106
DAGStoreKey = special {13 } // constructor returns multiple values
107
107
ResourceManagerKey = special {14 } // Libp2p option
108
+ UserAgentKey = special {15 } // Libp2p option
108
109
)
109
110
110
111
type invoke int
@@ -227,6 +228,8 @@ var LibP2P = Options(
227
228
Override (SmuxTransportKey , lotus_lp2p .SmuxTransport ()),
228
229
Override (RelayKey , lotus_lp2p .NoRelay ()),
229
230
Override (SecurityKey , lotus_lp2p .Security (true , false )),
231
+ Override (DefaultTransportsKey , lp2p .DefaultTransports ),
232
+ Override (UserAgentKey , modules .UserAgent ),
230
233
231
234
// Host
232
235
Override (new (lotus_lp2p.RawHost ), lotus_lp2p .Host ),
Original file line number Diff line number Diff line change
1
+ package modules
2
+
3
+ import (
4
+ "github.com/filecoin-project/boost/build"
5
+ "github.com/filecoin-project/lotus/node/modules/lp2p"
6
+ "github.com/libp2p/go-libp2p"
7
+ )
8
+
9
+ func simpleOpt (opt libp2p.Option ) func () (opts lp2p.Libp2pOpts , err error ) {
10
+ return func () (opts lp2p.Libp2pOpts , err error ) {
11
+ opts .Opts = append (opts .Opts , opt )
12
+ return
13
+ }
14
+ }
15
+
16
+ var UserAgent = simpleOpt (libp2p .UserAgent ("boost-" + build .UserVersion ()))
You can’t perform that action at this time.
0 commit comments