1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-12-14 21:39:12 +08:00
Commit Graph

119 Commits

Author SHA1 Message Date
Marcin Rataj
71e883440e refactor(config): migration 17-to-18 to unify Provider/Reprovider into Provide.DHT (#10951)
* refactor: consolidate Provider/Reprovider into unified Provide config

- merge Provider and Reprovider configs into single Provide section
- add fs-repo-17-to-18 migration for config consolidation
- improve migration ergonomics with common package utilities
- convert deprecated "flat" strategy to "all" during migration
- improve Provide docs

* docs: add total_provide_count metric guidance

- document how to monitor provide success rates via prometheus metrics
- add performance comparison section to changelog
- explain how to evaluate sweep vs legacy provider effectiveness

* fix: add OpenTelemetry meter provider for metrics

- set up meter provider with Prometheus exporter in daemon
- enables metrics from external libs like go-libp2p-kad-dht
- fixes missing total_provide_count_total when SweepEnabled=true
- update docs to reflect actual metric names

---------

Co-authored-by: gammazero <11790789+gammazero@users.noreply.github.com>
Co-authored-by: guillaumemichel <guillaume@michel.id>
Co-authored-by: Daniel Norman <1992255+2color@users.noreply.github.com>
Co-authored-by: Hector Sanjuan <code@hector.link>
2025-09-18 22:17:43 +02:00
Guillaume Michel
006f9dc704 feat: opt-in new Sweep provide system (#10834)
* reprovide sweep draft

* update reprovider dep

* go mod tidy

* fix provider type

* change router type

* dual reprovider

* revert to provider.System

* back to start

* SweepingReprovider test

* fix nil pointer deref

* noop provider for nil dht

* disabled initial network estimation

* another iteration

* suppress missing self addrs err

* silence empty rt err on lan dht

* comments

* new attempt at integrating

* reverting changes in core/node/libp2p/routing.go

* removing SweepingProvider

* make reprovider optional

* add noop reprovider

* update KeyChanFunc type alias

* restore boxo KeyChanFunc

* fix missing KeyChanFunc

* test(sharness): PARALLEL=1 and timeout 30m

running sequentially to see where timeout occurs

* initialize MHStore

* revert workflow debug

* config

* config docs

* merged IpfsNode provider and reprovider

* move Provider interface to from kad-dht to node

* moved Provider interface from kad-dht to kubo/core/node

* mod_tidy

* Add Clear to Provider interface

* use latest kad-dht commit

* make linter happy

* updated boxo provide interface

* boxo PR fix

* using latest kad-dht commit

* use latest boxo release

* fix fx

* fx cyclic deps

* fix merge issues

* extended tests

* don't provide LAN DHT

* docs

* restore dual dht provider

* don't start provider before it is online

* address linter

* dual/provider fix

* add delay in provider tests for dht bootstrap

* add OfflineDelay parameter to config

* remove increase number of workers in test

* improved keystore gc process

* fix: replace incorrect logger import in coreapi

replaced github.com/labstack/gommon/log with the standard
github.com/ipfs/go-log/v2 logger used throughout kubo.
removed unused labstack dependency from go.mod files.

* fix: remove duplicate WithDefault call in provider config

* fix: use correct option method for burst workers

* fix: improve error messages for experimental sweeping provider

updated error messages to clearly indicate when commands are unavailable
due to experimental sweeping provider being enabled via Reprovider.Sweep.Enabled=true

* docs: remove obsolete KeyStoreGCInterval config

removed from config.md as option no longer exists (removed in b540fba1a)
updated keystore description to reflect gc happens at reprovide interval

* docs: add TODO placeholder changelog for experimental sweeping DHT provider

using v0.38-TODO.md name to avoid merge conflicts with master branch
and allow CI tests to run. will be renamed to v0.38.md once config
migration is added to the PR

* fix: provideKeysRec go routine

* clear keystore on close

* fix: datastore prefix

* fix: improve error handling in provideKeysRec

- close errCh channel to distinguish between nil and pending errors
- check for pending errors when provided.New closes
- handle context cancellation during error send
- prevent race condition where errors could be silently lost

this ensures DAG walk errors are always propagated correctly

* address gammazero's review

* rename BurstProvider to LegacyProvider

* use latest provider/keystore

* boxo: make mfs StartProviding async

* bump boxo

* chore: update boxo to f2b4e12fb9a8ac138ccb82aae3b51ec51d9f631c

- updated boxo dependency to specified commit
- updated go.mod and go.sum files across all modules

* use latest kad-dht/boxo

* Buffered SweepingProvider wrapper

* use latest kad-dht commit

* allow no DHT router

* use latest kad-dht & boxo

---------

Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: gammazero <11790789+gammazero@users.noreply.github.com>
2025-09-18 17:22:04 +02:00
Hector Sanjuan
a673c2ec95 fix: Provide according to Reprovider.Strategy (#10886)
* Provide according to strategy

Updates boxo to a version with the changes from https://github.com/ipfs/boxo/pull/976, which decentralize the providing responsibilities (from a central providing.Exchange to blockstore, pinner, mfs).

The changes consist in initializing the Pinner, MFS and the blockstore with the provider.System, which is created first.

Since the provider.System is created first, the reproviding KeyChanFunc is set
later when we can create it once we have the Pinner, MFS and the blockstore.

Some additional work applies to the Add() workflow. Normally, blocks would get provided at the Blockstore or the Pinner, but when adding blocks AND a "pinned" strategy is used, the blockstore does not provide, and the
pinner does not traverse the DAG (and thus doesn't provide either), so we need to provide directly from the Adder. This is resolved by wrapping the DAGService in a "providingDAGService" which provides every added block, when using the "pinned" strategy.

`ipfs --offline add` when the ONLINE daemon is running will now announce blocks per the chosen strategy, where before it did not announce them. This is documented in the changelog. A couple of releases ago, adding with `ipfs --offline add` was faster, but this is no longer the case so we are not incurring in any penalties by sticking to the fact that the daemon is online and has a providing strategy that we follow.

Co-authored-by: gammazero <11790789+gammazero@users.noreply.github.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2025-08-08 10:56:44 +02:00
Hector Sanjuan
519ae27dce feat: expose BlockKeyCacheSize and enable WriteThrough datastore options (#10614)
* feat: expose BlockKeyCacheSize and enable WriteThrough when bloom filter disabled
* import/config: add BatchMaxSize and BatchMaxNodes
* config: make BlockKeyCacheSize an OptionalInteger
* config: add and wire datastore.WriteThrough option
* config: omitempty on BlockKeyCacheSize
* changelog: rewrite entry about new options for the datastore
* config: add docs for BatchMaxNodes and BatchMaxSize
* config: make WriteThrough an optional Flag
* changelog: improve description of new datastore/import options
* refactor: DefaultWriteThrough as bool
* chore: boxo v0.26.0
* docs: config and changelog fixes
2024-12-19 23:12:05 +00:00
Andi
642e58ef3b chore: use errors.New to replace fmt.Errorf with no parameters (#10617) 2024-12-10 13:50:35 -08:00
Henrique Dias
d77a9e69f7 client/rpc!: remove deprecated DHT commands 2024-03-05 09:01:00 +01:00
Henrique Dias
80973d87cc core: deprecate CoreAPI.Dht, introduce CoreAPI.Routing 2024-02-07 10:47:30 +01:00
Henrique Dias
0ea879b4a1 feat: add Ipns.MaxCacheTTL 2024-01-26 11:20:34 +01:00
Henrique Dias
58c29399cf chore: clean migration 2023-11-29 12:29:59 +01:00
Henrique Dias
4c04311257 docs: clean mentions of go-ipfs-api, go-ipfs-http-api 2023-10-13 13:57:05 +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
Hector Sanjuan
027c5b1a09 feat: allow injecting custom path resolvers (#9750)
In order to make it possible to easily-overwrite the path Resolvers (i.e. via
plugins), this creates resolvers as part of the Node rather than creating them
ad-hoc.
2023-04-04 18:11:32 +00:00
Jorropo
3ab1086f71 chore: migrate go-libipfs to boxo
Resolves #9677, #9676, #9675, #9736
2023-03-28 22:05:25 -04:00
Henrique Dias
a3c70a11e6 feat(gateway): IPNS record response format (IPIP-351) (#9399)
* feat(gateway): IPNS record response format
* docs(rpc): mark as experimental: routing provide, get, put

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2023-01-27 04:46:50 +01:00
Gus Eggert
e550d9e476 ci: add stylecheck to golangci-lint (#9334) 2022-10-06 10:18:40 -04:00
Jorropo
196887cbe5 chore: bump go-libp2p v0.22.0 & go1.18&go1.19
Fixes: #9225
2022-09-09 17:09:38 +02:00
Marcin Rataj
82467bc936 refactor: rename to kubo 2022-07-06 18:40:37 +02:00
Hannah Howard
f63a997c35 IPLD Prime In IPFS: Target Merge Branch (#7976)
* feat: switch to using go-ipld-prime for codecs, path resolution, and the `dag put/get` commands
* fix: `dag put/get` not roundtripping due to an extra new line being added (https://github.com/ipfs/go-ipfs/issues/3503)

More detailed information is in the CHANGELOG.md file. Very high level:
* IPLD codecs (and their plugins) must use go-ipld-prime
* Added support for the dag-json codec
* `dag get/put` use IPLD codec names from the multicodec table
* `dag get` defaults to dag-json output instead of json, but may output with other codecs
* Data model pathing can be achieved using the /ipld prefix. For example, you can use `/ipld/QmFoo/Links/0/Hash` to traverse through a DagPB node
* With `dag get/put` the DagPB field names have been changed to match the ones in the protobuf listed in the specification

Co-authored-by: hannahhoward <hannah@hannahhoward.net>
Co-authored-by: Daniel Martí <mvdan@mvdan.cc>
Co-authored-by: acruikshank <acruikshank@example.com>
Co-authored-by: Steven Allen <steven@stebalien.com>
Co-authored-by: Will Scott <will.scott@protocol.ai>
Co-authored-by: Will Scott <will@cypherpunk.email>
Co-authored-by: Rod Vagg <rod@vagg.org>
Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>
Co-authored-by: Eric Myhre <hash@exultant.us>
2021-08-17 13:32:49 -04:00
vyzo
eb7456d38f update for the new namesys api 2021-05-10 21:04:57 -07:00
vyzo
543c5da34a explicit construction of DNS resolver 2021-05-10 21:03:27 -07:00
Hector Sanjuan
3db9551f79 Extract the namesys and the keystore submodules
Namesys is a very useful submodule. Given a ValueStore and a Datastore it can
resolve and publish /ipns/ paths.

This functionality does not need to be sequestered inside go-ipfs as it can
and should be used without IPFS, for example, for implementing lightweight
IPNS publishing services or for resolving /ipns/ paths.

"keystore" extraction was necessary, as there is a dependency to it in
namesys. Keystore is also a useful module by itself within the stack.

Fixes #6537
2021-03-12 14:09:36 -05:00
Steven Allen
c58e3e4c7d fix: remove pubsub discovery hack
Pubsub handles this internally now.
2020-05-29 16:42:10 -07:00
Michael Muré
c3692a5913 extract the pinner to go-ipfs-pinner and dagutils into go-merkledag 2019-12-02 15:45:44 -05:00
Michael Avila
10de165644 Change to construct provider from go-ipfs-provider 2019-07-03 14:22:55 -07:00
Raúl Kripalani
e8c2852179 migrate to go-libp2p-core.
closes #6391

License: MIT
Signed-off-by: Raúl Kripalani <raul@protocol.ai>
2019-05-31 23:23:52 -07:00
Michael Avila
6d6ce8fba7 Introduce first strategic provider: do nothing
License: MIT
Signed-off-by: Michael Avila <davidmichaelavila@gmail.com>
2019-05-29 16:20:31 -07:00
Łukasz Magiera
d35dac70f0 Cleanup core package
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 16:56:27 -07:00
Michael Avila
dde397ebc1 Refactor per code climate rules
License: MIT
Signed-off-by: Michael Avila <davidmichaelavila@gmail.com>
2019-03-11 09:55:13 -07:00
Michael Avila
bfcea27d39 Use offlineProvider when --offline
License: MIT
Signed-off-by: Michael Avila <davidmichaelavila@gmail.com>
2019-03-08 16:44:28 -08:00
Michael Avila
a9b6534687 Provide root node immediately when add and pin add
License: MIT
Signed-off-by: Michael Avila <davidmichaelavila@gmail.com>
2019-03-08 14:27:43 -08:00
Jakub Sztandera
42e191c017 gx: unrewrite
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2019-03-05 18:33:56 +01:00
Steven Allen
3dac4609a8 split 'mode' into IsOnline and IsDaemon flags
1. They don't _have_ to be mutually exclusive.
2. local, mode, etc is _really_ confusing.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-03-04 19:00:47 -08:00
Steven Allen
f227862e88 gx: update go-ipfs-cmds, go-bitswap, go-libp2p-kad-dht, and go-mplex
Fixes the latest batch of bugs found in RC testing.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-27 12:39:24 -08:00
Hector Sanjuan
6972a9aa4d Gx Bubble. libp2p-6.0.38
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2019-02-27 01:10:59 +00:00
Steven Allen
fea7ae727f gx: update go-cid
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-20 20:29:06 -08:00
Steven Allen
f924f57c61 gx: update go-bitswap and go-libp2p-kad-dht
* go-bitswap: fix some race conditions.
* go-libp2p-kad-dht: fix a goroutine leak.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-20 17:19:54 -08:00
Steven Allen
91ca5911be coreapi: return coreiface.ErrNotSupported when "catting" symlinks.
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-19 03:48:04 -08:00
Jakub Sztandera
28cf3de0f9 Update protobuf
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2019-02-18 20:46:22 +01:00
Steven Allen
cf0d4706e2 gx: update libp2p stuff
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-14 14:58:35 -08:00
Steven Allen
e97a60b073 gx: update go-ipfs-files
fix compatibility issue with js-ipfs

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-11 10:48:58 -08:00
Łukasz Magiera
648cc40ec3 coreapi: fix import grouping after extracting iface
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-02-09 01:57:26 +01:00
Łukasz Magiera
7ed6b518b6 coreapi: update imports to updated interface
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-02-09 01:42:32 +01:00
Steven Allen
2c93eeffc6 gx: update go-libp2p-peer
Switch _back_ to the 0.4.18 style of peer IDs while we figure things out. See
https://github.com/libp2p/specs/issues/138.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-07 17:41:39 -08:00
Łukasz Magiera
53e55e3314 gx: update go-unixfs to 1.2.14 and go-bitswap to 1.1.21
(and everything else...)

License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-01-23 11:01:38 -08:00
Łukasz Magiera
85eb8812fa Port dag commansds to CoreAPI
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-01-22 21:01:19 +01:00
Łukasz Magiera
eb23c90031 coreapi: replace coreiface.DagAPI with ipld.DAGService
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-01-12 16:05:02 +01:00
Steven Allen
08cc5da55f gx: update deps
Importantly:

* fixes a bunch of MFS bugs
* pulls in some bitswap improvements

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-01-08 19:19:34 -08:00
Łukasz Magiera
2c28ef19ae coreapi: FetchBlocks option
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-01-04 15:40:15 +01:00
Łukasz Magiera
6cee21d39a Fix offline gateway directory logic
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-01-04 02:39:17 +01:00
Łukasz Magiera
85772fcd54 Fix name resolve --offline
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-01-02 11:58:31 -08:00