blind-peer 3.8.2 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +11 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -224,13 +224,14 @@ class BlindPeer extends ReadyResource {
|
|
|
224
224
|
wakeupGcTickTime = null,
|
|
225
225
|
replicationLagThreshold = 100,
|
|
226
226
|
topK = {},
|
|
227
|
-
adminRouter = null
|
|
227
|
+
adminRouter = null,
|
|
228
|
+
activeCorestore = false
|
|
228
229
|
} = {}
|
|
229
230
|
) {
|
|
230
231
|
super()
|
|
231
232
|
|
|
232
233
|
this.rocks = typeof rocks === 'string' ? new RocksDB(rocks) : rocks
|
|
233
|
-
this.store = store || new Corestore(this.rocks, { active:
|
|
234
|
+
this.store = store || new Corestore(this.rocks, { active: activeCorestore })
|
|
234
235
|
this.swarm = swarm || null
|
|
235
236
|
const ipBanNs = this.store.namespace('ip-ban-lists')
|
|
236
237
|
this.ipBanLists = ipBanListKeys.map((key) => new IpBanList(ipBanNs, { key }))
|
|
@@ -1065,6 +1066,14 @@ class BlindPeer extends ReadyResource {
|
|
|
1065
1066
|
this.set(self.rocks.stats.writeBatches)
|
|
1066
1067
|
}
|
|
1067
1068
|
})
|
|
1069
|
+
|
|
1070
|
+
new promClient.Gauge({
|
|
1071
|
+
name: 'blind_peer_corestore_active',
|
|
1072
|
+
help: 'Whether the corestore is active (1) or passive (0)',
|
|
1073
|
+
collect() {
|
|
1074
|
+
this.set(self.store.active ? 1 : 0)
|
|
1075
|
+
}
|
|
1076
|
+
})
|
|
1068
1077
|
}
|
|
1069
1078
|
}
|
|
1070
1079
|
}
|