You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+47-20Lines changed: 47 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -106,6 +106,8 @@ type providerOutput struct {
106
106
Addrs []string
107
107
ConnectionMaddrs []string
108
108
DataAvailableOverBitswapBitswapCheckOutput
109
+
DataAvailableOverHTTPHTTPCheckOutput
110
+
Sourcestring
109
111
}
110
112
```
111
113
@@ -116,48 +118,73 @@ The `providerOutput` type contains the following fields:
116
118
-`Addrs`: The multiaddrs of the provider from the DHT.
117
119
-`ConnectionMaddrs`: The multiaddrs that were used to connect to the provider.
118
120
-`DataAvailableOverBitswap`: The result of the Bitswap check.
121
+
-`DataAvailableOverHTTP`: The result of the HTTP check.
122
+
-`Source`: The source of the provider (either "IPNI" or "Amino DHT").
119
123
120
124
#### Results when a `multiaddr` and a `cid` are passed
121
125
122
126
The results of the check are expressed by the `peerCheckOutput` type:
123
127
124
128
```go
125
129
type peerCheckOutput struct {
126
-
ConnectionErrorstring
130
+
ConnectionErrorstring
127
131
PeerFoundInDHTmap[string]int
128
-
ProviderRecordFromPeerInDHTbool
129
-
ConnectionMaddrs []string
130
-
DataAvailableOverBitswapBitswapCheckOutput
132
+
ProviderRecordFromPeerInDHTbool
133
+
ProviderRecordFromPeerInIPNIbool
134
+
ConnectionMaddrs []string
135
+
DataAvailableOverBitswapBitswapCheckOutput
136
+
DataAvailableOverHTTPHTTPCheckOutput
131
137
}
132
138
133
139
typeBitswapCheckOutputstruct {
140
+
Enabledbool
134
141
Duration time.Duration
135
142
Foundbool
136
143
Respondedbool
137
144
Errorstring
138
145
}
139
-
```
140
146
141
-
1. Is the CID (really multihash) advertised in the DHT by the Passed PeerID (or later IPNI)?
147
+
typeHTTPCheckOutputstruct {
148
+
Enabledbool
149
+
Duration time.Duration
150
+
Endpoints []multiaddr.Multiaddr
151
+
Connectedbool
152
+
Requestedbool
153
+
Foundbool
154
+
Errorstring
155
+
}
156
+
```
142
157
143
-
-`ProviderRecordFromPeerInDHT`
158
+
The check performs several validations:
144
159
145
-
2. Are the peer's addresses discoverable (particularly useful if the announcements are DHT based, but also independently useful)
160
+
1. Is the CID advertised in the DHT by the Passed PeerID (or later IPNI)?
161
+
-`ProviderRecordFromPeerInDHT`: Whether the peer has a provider record in the DHT
162
+
-`ProviderRecordFromPeerInIPNI`: Whether the peer has a provider record in IPNI
146
163
147
-
-`PeerFoundInDHT`
164
+
2. Are the peer's addresses discoverable?
165
+
-`PeerFoundInDHT`: Map of discovered addresses and their frequency in the DHT
148
166
149
167
3. Is the peer contactable with the address the user gave us?
150
-
151
-
- If `ConnectionError` is any empty string, a connection to the peer was successful. Otherwise, it contains the error.
152
-
- If a connection is successful, `ConnectionMaddrs` contains the multiaddrs that were used to connect. If the peer is behind NAT, it will contain both the circuit relay multiaddr and the direct maddr.
153
-
154
-
4. Is the address the user gave us present in the DHT?
155
-
156
-
- If `PeerFoundInDHT` contains the address the user passed in
157
-
158
-
1. Does the peer say they have at least the block for the CID (doesn't say anything about the rest of any associated DAG) over Bitswap?
159
-
160
-
-`DataAvailableOverBitswap` contains the duration of the check and whether the peer responded and has the block. If there was an error, `DataAvailableOverBitswap.Error` will contain the error.
168
+
-`ConnectionError`: Empty if connection successful, otherwise contains the error
169
+
-`ConnectionMaddrs`: The multiaddrs used to connect (includes both relay and direct addresses if NAT traversal occurred)
0 commit comments