Skip to content

Commit

Permalink
docs: Routing.Type=auto timeouts for DHT/IPNI
Browse files Browse the repository at this point in the history
Based on feedback from #9475
  • Loading branch information
lidel committed Dec 7, 2022
1 parent 76a3c2c commit e65885a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions core/node/libp2p/routingopt.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ func ConstructDefaultRouting(peerID string, addrs []string, privKey string) func
}
routers = append(routers, &routinghelpers.ParallelRouter{
Router: dhtRouting,
IgnoreError: false, // TODO: confirm this is what we want
Timeout: 1 * time.Minute, // TODO: what value makes sense here?
IgnoreError: false,
Timeout: 5 * time.Minute, // https://github.com/ipfs/kubo/pull/9475#discussion_r1042501333
ExecuteAfter: 0,
})

Expand All @@ -70,8 +70,8 @@ func ConstructDefaultRouting(peerID string, addrs []string, privKey string) func
}
routers = append(routers, &routinghelpers.ParallelRouter{
Router: httpRouter,
IgnoreError: true, // TODO: confirm this is what we want
Timeout: 1 * time.Minute, // TODO: what value makes sense here?
IgnoreError: true, // https://github.com/ipfs/kubo/pull/9475#discussion_r1042507387
Timeout: 15 * time.Second, // 5x server value from https://github.com/ipfs/kubo/pull/9475#discussion_r1042428529
ExecuteAfter: 0,
})
}
Expand Down
4 changes: 3 additions & 1 deletion docs/changelogs/v0.18.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ The default `Routing.Type` is changed from `dht` to `auto`.

When `Routing.Type` is unset or set to `auto`, your node will accelerate some types of routing
by leveraging HTTP endpoints compatible with [IPIP-337](https://github.com/ipfs/specs/pull/337)
in addition to the IPFS DHT.
in addition to the IPFS DHT. DHT response timeout in `auto` mode is 5 minutes, and IPNI is 3 seconds.
By default, an instance of IPNI ([InterPlanetary Network Indexer](https://github.com/ipni/specs/blob/main/IPNI.md#readme))
at https://cid.contact is used.


Old behavior can be restored by setting `Routing.Type` to `dht`.

Alternative routing rules, including alternative IPNI endpoints, can be configured in `Routing.Routers` after setting `Routing.Type` to `custom`.

Learn more in [`Routing` docs](https://github.com/ipfs/kubo/blob/master/docs/config.md#routing).
Expand Down

0 comments on commit e65885a

Please sign in to comment.