1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-12-19 01:30:17 +08:00
Commit Graph

634 Commits

Author SHA1 Message Date
Andrew Gillis
738d5232fb Upgrade to Boxo v0.33.0 (#10857)
* Upgrade to Boxo v0.33.0
* Update test to work with boxo-v0.33.0
2025-07-08 02:45:43 -07:00
Andrew Gillis
20d9660a64 chore: use go-log/v2 (#10801)
* chore: update to go-log/v2

go-log v2 has been out for quite a while now and it is time to deprecate v1.

Replace all use of go-log with go-log/v2
Makes /api/v0/log/tail useful over HTTP
Updates dependencies that have moved to go-lov/v2
Removes support for ContextWithLoggable as this is not needed for tracing-like functionality
- Replaces: PR #8765
- Closes issue #8753
- Closes issue #9245
- Closes issue #10809

Other fixes:
* update go-ipfs-cmds
* update http logs test
* fix test
* Read/send one line of log data at a time
* Update -log-level docs
2025-05-19 13:04:05 -07:00
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
Andrew Gillis
8077dbea61 use go-datastore without go-process (#10736)
* use go-datastore without go-process
* update go-ds-xxx dependencies
* update go-libp2p-kad-dht
* bitswap api changes
* Do not use multiple multi-error packages, pick one
* update boxo
* update expected metrics
2025-03-04 18:52:26 -08:00
Marcin Rataj
52ca370759 feat(routing/http): support IPIP-484 and streaming (#10534) 2024-10-03 22:58:25 +00:00
Henrique Dias
4606586207 feat(gateway): expose /routing/v1 server (opt-in) (#9877) 2023-08-25 17:30:04 +02:00
Kay
2b7c20fc66 refactor: using error is instead of == (#10093) 2023-08-22 14:53:29 +00:00
Kay
f12b372af9 style: gofumpt and godot [skip changelog] (#10081) 2023-08-17 14:02:08 +02:00
Jorropo
9c02eecad7 fix: mark all routers DoNotWaitForSearchValue (#10020)
* fix: mark ipns pubsub router DoNotWaitForSearchValue

That means if the DHT has finished searching and no one responded over pubsub *yet*, we will not spend 1 minute searching for no reason.

This also include other error handling bug fixes inside `go-libp2p-routing-helpers`.

Fixes: #9927

* routing: bring back the old IPNS behaviour

Stop making this configurable let everything race like it used to do.
2023-07-25 19:39:21 +02:00
Henrique Dias
5156f21162 feat(ipns): records with V2-only signatures (#9932) 2023-06-20 14:24:31 +02:00
Jorropo
e7294cbdff feat: warn users who are falling behind reprovides
Fixes: #9704
Fixes: #9702
Fixes: #9703
Fixes: #9419
2023-06-08 10:05:30 +02:00
Jorropo
3ab1086f71 chore: migrate go-libipfs to boxo
Resolves #9677, #9676, #9675, #9736
2023-03-28 22:05:25 -04:00
Gus Eggert
4c49967d9c feat: add client-side metrics for routing-v1 client 2023-03-27 18:19:28 -04:00
Marcin Rataj
1fa3a789d4 fix: User-Agent sent to HTTP routers
See https://github.com/ipfs/go-libipfs/issues/17
and https://github.com/ipfs/go-libipfs/pull/31
2023-01-19 00:49:46 +01:00
Antonio Navarro Perez
8cdc86d8c4 fix: disable provide over HTTP with Routing.Type=auto (#9511)
Closes https://github.com/ipfs/kubo/issues/9504
2023-01-04 13:56:15 +01:00
Marcin Rataj
70e604ff99 feat: Routing.Type=auto (DHT+IPNI) (#9475)
This changes the default routing to use both DHT and IPNI
at the same time. Closes #9454 Closes #9422

Full context:
https://github.com/ipfs/kubo/issues/9454
https://github.com/ipfs/kubo/issues/9422

Co-authored-by: Steve Loeppky <biglep@protocol.ai>
Co-authored-by: Gus Eggert <gus@gus.dev>
Co-authored-by: Steve Loeppky <biglep@protocol.ai>
2022-12-08 23:20:24 +01:00
Gus Eggert
bf61e639e9 feat: add response body limiter to routing HTTP client (#9478) 2022-12-08 10:36:59 -05:00
Antonio Navarro Perez
401a543f4c Fix variable name
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
2022-12-07 16:34:59 +01:00
Antonio Navarro Perez
df828c0a47 feature: delegated-routing: Add HTTP delegated routing.
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
2022-12-07 16:34:59 +01:00
Antonio Navarro Perez
a3913d9f90 Add logs to the routing system
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
2022-12-06 18:59:09 +01:00
Gus Eggert
8c72ea909a feat: add delegated routing metrics (#9354) 2022-10-19 09:50:30 -04:00
Antonio Navarro Perez
d1b9e41fc2 feat: Delegated routing with custom configuration. (#9274)
New multi-router configuration system based on https://hackmd.io/G1KRDEX5T3qyfoBMkIrBew#Methods

- Added a new routing type: "custom"
- Added specific struct types for different Routers (instead of map[string]interface{})
- Added `Duration` config type, to make easier time string parsing
- Added config documentation.
- Use the latest go-delegated-routing library version with GET support.
- Added changelog notes for this feature.

It:
- closes #9157
- closes #9079
- closes #9186
2022-09-22 15:47:45 +02:00
Jorropo
196887cbe5 chore: bump go-libp2p v0.22.0 & go1.18&go1.19
Fixes: #9225
2022-09-09 17:09:38 +02:00
Antonio Navarro Perez
92c4dc61a8 feat(routing): Delegated Routing (#8997)
* Delegated Routing.

Implementation of Reframe specs (https://github.com/ipfs/specs/blob/master/REFRAME.md) using go-delegated-routing library.

* Requested changes.

* Init using op string

* Separate possible ContentRouters for TopicDiscovery.

If we don't do this, we have a ciclic dependency creating TieredRouter.
Now we can create first all possible content routers, and after that,
create Routers.

* Set dht default routing type

* Add tests and remove uneeded code

* Add documentation.

* docs: Routing.Routers

* Requested changes.

Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>

* Add some documentation on new fx functions.

* Add changelog entry and integration tests

* test: sharness for 'dht' in 'routing' commands

Since 'routing' is currently the same as 'dht' (minus query command)
we need to test both, that way we won't have unnoticed divergence
in the default behavior.

* test(sharness): delegated routing via reframe URL

* Add more tests for delegated routing.

* If any put operation fails, the tiered router will fail.

* refactor: Routing.Routers: Parameters.Endpoint

As agreed  in https://github.com/ipfs/kubo/pull/8997#issuecomment-1175684716

* Try to improve CHANGELOG entry.

* chore: update reframe spec link

* Update go-delegated-routing dependency

* Fix config error test

* use new changelog format

* Remove port conflict

* go mod tidy

* ProviderManyWrapper to ProviderMany

* Update docs/changelogs/v0.14.md

Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>

Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>
2022-07-07 17:10:25 -04:00
Hector Sanjuan
54d87b4ce0 Extract: routing package to github.com/ipfs/go-ipfs-routing
This extracts the routing package to its own repository
(https://github.com/ipfs/go-ipfs-routing). History has
been preserved. The new module has been gx'ed and published.

Imports have been rewritten and re-ordered accordingly.

An internal dependency to go-ipfs/repo has been removed
by substituting it with the go-datastore.Batching interface.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-02-14 18:33:52 +01:00
Hector Sanjuan
c9080f99e8 Import re-ordering
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-02-12 22:51:42 +01:00
Hector Sanjuan
7406a5f1b2 Extract: thirdparty/ds-help submodule
It has been moved to its own repository:

    * github.com/ipfs/go-ipfs-ds-help

History has been preserved. It has been published
with gx. Imports have been updated and re-ordered
accordingly.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-02-12 22:51:03 +01:00
Hector Sanjuan
fd04905adb Extract: flags and thirdparty/delay submodules
They have been moved to their own repositories:

* github.com/ipfs/go-ipfs-delay
* github.com/ipfs/go-ipfs-flags

History has been preserved. They have been published
with gx'ed. Imports have been updated and re-ordered
accordingly.

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-02-12 22:51:03 +01:00
Hector Sanjuan
953d7d4672 Doc: golint-ify routing module
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-02-09 13:10:06 +01:00
Łukasz Magiera
dcfcfc5e8e "fix" routing/mock tests on windows
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-02-04 01:12:53 +01:00
Steven Allen
b2cbfd299c gx: update go-log
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-01-31 21:54:22 -08:00
Steven Allen
fe8846fcd7 gx: mass update
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-01-24 15:58:44 -08:00
Steven Allen
dfe7ef4fcf gx: update go-multihash
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-12-14 13:09:51 -08:00
Łukasz Magiera
6401a9191e gx: Update go-datastore to 1.4.0
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2017-12-02 14:55:26 -08:00
Steven Allen
76e1da02a8 gx: massive update
Note: This commit is technically broken. However, I need to make a bunch of
cmds changes to make this work and I'd rather not bundle both changes into a
single commit.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-11-20 22:20:27 -08:00
keks
0d9d21875c compatible to js-ipfs-api
License: MIT
Signed-off-by: keks <keks@cryptoscope.co>
2017-11-17 15:22:42 +01:00
Jan Winkelmann
f287524949 cmd: use go-ipfs-cmds
License: MIT
Signed-off-by: keks <keks@cryptoscope.co>
2017-11-17 15:22:41 +01:00
Jeromy
94ec788555 update deps for new connmgr code
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2017-10-14 05:38:52 -07:00
Steven Allen
93f3117d7d remove supernode routing
It was never fully implemented and isn't used.

fixes #3950

(not removing routing/mock because that *is* in use).

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-10-12 19:39:29 -07:00
vyzo
4f1edf2570 update go-testutil to 1.1.12
License: MIT
Signed-off-by: vyzo <vyzo@hackzen.org>
2017-10-05 17:11:39 +03:00
Steven Allen
a7a74cbde4 fix dht memory leak
update go-libp2p-kad-dht to fix a nasty memory leak

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-09-19 16:00:44 -07:00
Steven Allen
3f6df3a5f4 update yamux
We need to cancel out all readers/writers on stream reset.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-09-15 18:56:44 -07:00
Steven Allen
adfbecf3f7 use stream.Reset where appropriate
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-09-14 16:10:38 -07:00
Steven Allen
8deaaa8d8c gx: update go-stream-muxer
Introduces a new Reset method on streams that kills both sides of the
connection. Close now officially just closes the write side (what it did all
along...)

* Also pull through shiny new go-multiplexer fixes.
* Also pull in go-reuseport update.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-09-14 12:06:44 -07:00
Jeromy
0eba4f3138 gx: update go-ws-transport
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-09-05 16:18:19 -07:00
Steven Allen
db6f058946 remove some dead code
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-09-04 20:15:20 -07:00
Steven Allen
70d6629940 gx: update go-cid, go-multibase, base32
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-09-01 17:46:49 -07:00
Łukasz Magiera
e34a5e9c0d gx: update go-reuseport
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2017-08-23 16:32:32 +02:00
Steven Allen
19c3bd82a3 extract update go-testutil
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-08-16 17:23:01 -07:00
Steven Allen
38a9be5a0a gx: update go-libp2p-swarm
fixes #4102 (fixed in go-libp2p-swarm)

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2017-07-31 14:04:40 -07:00