@cryptotaxi247 / kubo / commits / 7fdcbce1f

Change Reporter to BandwidthCounter in IpfsNode

Roman Proskuryakov committed Dec 12, 2019 at 12:42 UTC 7fdcbce1f1e7791634c98d058fa7c6227bf1a6a4
2 files changed +11 -11
core/core.go
+10 -10
@@ -67,16 +67,16 @@ type IpfsNode struct {
67 PNetFingerprint libp2p.PNetFingerprint `optional:"true"` // fingerprint of private network
68
69 // Services
70 - Peerstore pstore.Peerstore `optional:"true"` // storage for other Peer instances
71 - Blockstore bstore.GCBlockstore // the block store (lower level)
72 - Filestore *filestore.Filestore `optional:"true"` // the filestore blockstore
73 - BaseBlocks node.BaseBlocks // the raw blockstore, no filestore wrapping
74 - GCLocker bstore.GCLocker // the locker used to protect the blockstore during gc
75 - Blocks bserv.BlockService // the block service, get/add blocks.
76 - DAG ipld.DAGService // the merkle dag service, get/add objects.
77 - Resolver *resolver.Resolver // the path resolution system
78 - Reporter metrics.Reporter `optional:"true"`
79 - Discovery discovery.Service `optional:"true"`
70 + Peerstore pstore.Peerstore `optional:"true"` // storage for other Peer instances
71 + Blockstore bstore.GCBlockstore // the block store (lower level)
72 + Filestore *filestore.Filestore `optional:"true"` // the filestore blockstore
73 + BaseBlocks node.BaseBlocks // the raw blockstore, no filestore wrapping
74 + GCLocker bstore.GCLocker // the locker used to protect the blockstore during gc
75 + Blocks bserv.BlockService // the block service, get/add blocks.
76 + DAG ipld.DAGService // the merkle dag service, get/add objects.
77 + Resolver *resolver.Resolver // the path resolution system
78 + Reporter *metrics.BandwidthCounter `optional:"true"`
79 + Discovery discovery.Service `optional:"true"`
80 FilesRoot *mfs.Root
81 RecordValidator record.Validator
82
core/node/libp2p/transport.go
+1 -1
@@ -31,7 +31,7 @@ func Security(enabled, preferTLS bool) interface{} {
31 }
32 }
33
34 -func BandwidthCounter() (opts Libp2pOpts, reporter metrics.Reporter) {
34 +func BandwidthCounter() (opts Libp2pOpts, reporter *metrics.BandwidthCounter) {
35 reporter = metrics.NewBandwidthCounter()
36 opts.Opts = append(opts.Opts, libp2p.BandwidthReporter(reporter))
37 return opts, reporter