mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-06-28 21:39:25 +00:00
Expose DHT addresses
This commit is contained in:
parent
e9d6c5c0b9
commit
aa28578ca7
@ -61,6 +61,7 @@ proc getDebug(
|
||||
"addrs": node.switch.peerInfo.addrs.mapIt($it),
|
||||
"spr": nodeSpr.toURI,
|
||||
"announceAddresses": node.discovery.announceAddrs,
|
||||
"dhtAddresses": node.discovery.dhtAddrs,
|
||||
"table": table,
|
||||
"nat": {
|
||||
"reachability": reachabilityStr(storage[].autonatService),
|
||||
|
||||
@ -106,6 +106,7 @@ components:
|
||||
- repo
|
||||
- spr
|
||||
- announceAddresses
|
||||
- dhtAddresses
|
||||
- table
|
||||
- storage
|
||||
properties:
|
||||
@ -124,6 +125,10 @@ components:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/MultiAddress"
|
||||
dhtAddresses:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/MultiAddress"
|
||||
table:
|
||||
$ref: "#/components/schemas/PeersTable"
|
||||
storage:
|
||||
|
||||
@ -43,7 +43,7 @@ type Discovery* = ref object of RootObj
|
||||
providerRecord*: ?SignedPeerRecord
|
||||
# record to advertice node connection information, this carry any
|
||||
# address that the node can be connected on
|
||||
dhtRecord*: ?SignedPeerRecord # record to advertice DHT connection information
|
||||
dhtAddrs*: seq[MultiAddress] # UDP discovery addresses, exposed for debugging
|
||||
isStarted: bool
|
||||
store: Datastore
|
||||
|
||||
@ -191,12 +191,10 @@ proc announceDirectAddrs*(
|
||||
info "Updating announce and DHT records", tcpAddrs, udpAddrs
|
||||
|
||||
d.announceAddrs = tcpAddrs
|
||||
d.dhtAddrs = udpAddrs
|
||||
d.providerRecord = SignedPeerRecord
|
||||
.init(d.key, PeerRecord.init(d.peerId, tcpAddrs))
|
||||
.expect("Should construct signed record").some
|
||||
d.dhtRecord = SignedPeerRecord
|
||||
.init(d.key, PeerRecord.init(d.peerId, udpAddrs))
|
||||
.expect("Should construct signed record").some
|
||||
|
||||
if not d.protocol.isNil:
|
||||
let spr = SignedPeerRecord
|
||||
|
||||
@ -585,6 +585,7 @@ proc initDebugApi(
|
||||
"repo": $conf.dataDir,
|
||||
"spr": nodeSpr.toURI,
|
||||
"announceAddresses": node.discovery.announceAddrs,
|
||||
"dhtAddresses": node.discovery.dhtAddrs,
|
||||
"table": table,
|
||||
"storage": {"version": $storageVersion, "revision": $storageRevision},
|
||||
"nat": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user