kubo/core/node/libp2p
Hector Sanjuan b5d73695ba
feat: opt-in http retrieval client (#10772)
* Feat: http retrieval as experimental feature

This introduces the http-retrieval capability as an experimental feature.

It can be enabled in the configuration `Experimental.HTTPRetrieval.Enabled = true`.

Documentation and changelog to be added later.

* refactor: HTTPRetrieval.Enabled as Flag

* docs(config): HTTPRetrieval section

* refactor: reusable MockHTTPContentRouter

* feat: HTTPRetrieval.TLSInsecureSkipVerify

allows self-signed certificates in tests

* feat(config): HTTPRetrieval.MaxBlockSize

* test: end-to-end HTTPRetrieval.Enabled

this spawns two http services on localhost:
1. HTTP router that returns HTTP provider when /routing/v1/providers/cid  i queried
2. HTTP provider that returns a block when /ipfs/cid is queried
3. Configures Kubo to use (1) instead of cid.contact

this seems to work (running test with DEBUG=true shows (1) was queried
for the test CID and returned multiaddr of (2), but Kubo never requested
test CID block from (2) – needs investigation

* fix: enable /routing/v1/peers for non-cid.contact

we artificially limited every delegated routing endpoint because of
cid.contact being limited to one endpoint

* feat: Routing.DelegatedRouters

make it easy to override the hardcoded implicit HTTP routeur URL
without having to set the entire custom Router.Routers and
Router.Methods

(http_retrieval_client_test.go still needs to be fixed in future commit)

* test: flag remaining work

* docs: review feedback

* refactor: providerQueryMgr with bitswapNetworks

this fixes two regressions:

(1) introduced in https://github.com/ipfs/kubo/issues/10717
    where we only used bitswapLib2p query manager
    (this is why E2E did not act on http provider)

(2) introduced in https://github.com/ipfs/kubo/pull/10765
    where it was not possible to set binary peerID in IgnoreProviders
    (we changed to []string)

* refactor: Bitswap.Libp2pEnabled

replaces Bitswap.Enabled with Bitswap.Libp2pEnabled
adds tests that confirm it is possible to disable libp2p bitswap fully
and only keep http in client mode

also, removes the need for passing empty blockstore in client-only mode

* docs: changelog

---------

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2025-05-06 19:06:40 +02:00
..
fd feat: Improve ResourceManager UX (#9338) 2022-11-10 12:25:57 +01:00
addrs.go feat(AutoTLS): enabled by default with 1h RegistrationDelay (#10724) 2025-02-25 22:25:58 +01:00
discovery.go chore: bump go-libp2p v0.22.0 & go1.18&go1.19 2022-09-09 17:09:38 +02:00
dns.go refactor: update to go-libp2p v0.37.0 (#10554) 2024-10-23 01:31:40 +02:00
filters.go chore: bump go-libp2p v0.22.0 & go1.18&go1.19 2022-09-09 17:09:38 +02:00
host.go chore: upgrade go-libp2p-kad-dht (#10378) 2024-04-04 12:56:19 +00:00
hostopt.go refactor: stop using go-libp2p deprecated peer.ID.Pretty 2023-09-18 15:58:15 +02:00
libp2p_test.go add a test case for libp2p option prioritization 2022-02-28 15:26:06 +04:00
libp2p.go fix: apply agent-version-suffix to libp2p identify 2022-12-06 12:52:54 +01:00
nat.go feat: run AutoNAT V2 service in addition to V1 (#10468) 2024-08-06 21:51:45 +02:00
peerstore.go chore: bump go-libp2p v0.22.0 & go1.18&go1.19 2022-09-09 17:09:38 +02:00
pnet.go chore: bump go-libp2p v0.22.0 & go1.18&go1.19 2022-09-09 17:09:38 +02:00
pubsub.go chore: bump go-libp2p v0.22.0 & go1.18&go1.19 2022-09-09 17:09:38 +02:00
rcmgr_defaults.go docs: fix typos 2023-09-22 11:08:26 +00:00
rcmgr_logging_test.go update dependencies (#10664) 2025-01-21 13:00:32 -08:00
rcmgr_logging.go update dependencies (#10664) 2025-01-21 13:00:32 -08:00
rcmgr.go update dependencies (#10664) 2025-01-21 13:00:32 -08:00
relay.go refactor: update to go-libp2p v0.37.0 (#10554) 2024-10-23 01:31:40 +02:00
routing.go chore: fix typos and comment formatting (#10653) 2025-01-06 18:17:39 -08:00
routingopt_test.go chore: update boxo, go-libp2p, and internalize mplex (#10095) 2023-08-24 06:11:02 +00:00
routingopt.go feat: opt-in http retrieval client (#10772) 2025-05-06 19:06:40 +02:00
sec.go Merge branch 'master' into tls-by-default 2024-08-06 20:16:57 -07:00
smux.go chore: use errors.New to replace fmt.Errorf with no parameters (#10617) 2024-12-10 13:50:35 -08:00
topicdiscovery.go style: gofumpt and godot [skip changelog] (#10081) 2023-08-17 14:02:08 +02:00
transport.go feat(libp2p): shared TCP listeners and AutoTLS.AutoWSS (#10565) 2024-12-20 18:41:25 +01:00