Skip to content

Commit 1d663d2

Browse files
authored
Merge pull request #90 from ipfs/release-05
release 0.5 with http checks and improved ui
2 parents 4a5ac35 + 6724a66 commit 1d663d2

File tree

2 files changed

+48
-21
lines changed

2 files changed

+48
-21
lines changed

README.md

Lines changed: 47 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ type providerOutput struct {
106106
Addrs []string
107107
ConnectionMaddrs []string
108108
DataAvailableOverBitswap BitswapCheckOutput
109+
DataAvailableOverHTTP HTTPCheckOutput
110+
Source string
109111
}
110112
```
111113

@@ -116,48 +118,73 @@ The `providerOutput` type contains the following fields:
116118
- `Addrs`: The multiaddrs of the provider from the DHT.
117119
- `ConnectionMaddrs`: The multiaddrs that were used to connect to the provider.
118120
- `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").
119123

120124
#### Results when a `multiaddr` and a `cid` are passed
121125

122126
The results of the check are expressed by the `peerCheckOutput` type:
123127

124128
```go
125129
type peerCheckOutput struct {
126-
ConnectionError string
130+
ConnectionError string
127131
PeerFoundInDHT map[string]int
128-
ProviderRecordFromPeerInDHT bool
129-
ConnectionMaddrs []string
130-
DataAvailableOverBitswap BitswapCheckOutput
132+
ProviderRecordFromPeerInDHT bool
133+
ProviderRecordFromPeerInIPNI bool
134+
ConnectionMaddrs []string
135+
DataAvailableOverBitswap BitswapCheckOutput
136+
DataAvailableOverHTTP HTTPCheckOutput
131137
}
132138

133139
type BitswapCheckOutput struct {
140+
Enabled bool
134141
Duration time.Duration
135142
Found bool
136143
Responded bool
137144
Error string
138145
}
139-
```
140146

141-
1. Is the CID (really multihash) advertised in the DHT by the Passed PeerID (or later IPNI)?
147+
type HTTPCheckOutput struct {
148+
Enabled bool
149+
Duration time.Duration
150+
Endpoints []multiaddr.Multiaddr
151+
Connected bool
152+
Requested bool
153+
Found bool
154+
Error string
155+
}
156+
```
142157

143-
- `ProviderRecordFromPeerInDHT`
158+
The check performs several validations:
144159

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
146163

147-
- `PeerFoundInDHT`
164+
2. Are the peer's addresses discoverable?
165+
- `PeerFoundInDHT`: Map of discovered addresses and their frequency in the DHT
148166

149167
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)
170+
171+
4. Is the data available over Bitswap?
172+
- `DataAvailableOverBitswap`: Contains:
173+
- `Enabled`: Whether Bitswap check was performed
174+
- `Duration`: How long the check took
175+
- `Found`: Whether the block was found
176+
- `Responded`: Whether the peer responded
177+
- `Error`: Any error that occurred
178+
179+
5. Is the data available over HTTP?
180+
- `DataAvailableOverHTTP`: Contains:
181+
- `Enabled`: Whether HTTP check was performed
182+
- `Duration`: How long the check took
183+
- `Endpoints`: List of HTTP multiaddrs
184+
- `Connected`: Whether connection was successful
185+
- `Requested`: Whether the request was sent
186+
- `Found`: Whether the block was found
187+
- `Error`: Any error that occurred
161188

162189
## Metrics
163190

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "0.4.0"
2+
"version": "0.5.0"
33
}

0 commit comments

Comments
 (0)