Commit Graph

152 Commits

Author SHA1 Message Date
Vedant Madane
59b5d6ab4d
feat(key): add 'ipfs key ls' as alias for 'ipfs key list' (#11147)
* feat(key): add 'ipfs key ls' as alias for 'ipfs key list'

Add 'ls' as an alias for the 'list' subcommand in 'ipfs key' to be
consistent with other ipfs commands like 'ipfs repo ls' and
'ipfs pin ls' which use 'ls' instead of 'list'.

Fixes #10976

Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com>

* feat(key): make 'ipfs key ls' canonical, deprecate 'list'

aligns with other commands like 'ipfs pin ls' and 'ipfs files ls'.
'ipfs key list' still works but shows deprecation warning.

* fix(key): correct --key option description in verify command

was copy-pasted from sign command and said "signing" instead of "verifying"

---------

Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2026-01-30 19:39:26 +01:00
Marcin Rataj
d37b92bfcd
fix: ipfs pin ls <cid> --names (#10970)
* fix: use CheckIfPinnedWithType for pin ls with names

updates to use CheckIfPinnedWithType method from https://github.com/ipfs/boxo/pull/1035,
enabling efficient pin name retrieval for 'ipfs pin ls <cid> --names'

- uses new CheckIfPinnedWithType from boxo for type-specific pin checks
- pin names are now returned when listing specific CIDs with --names flag

* test: add CLI tests for pin ls with names

tests cover:
- pin ls with specific CIDs returning names
- pin ls without CID listing all pins with names
- pin ls with --type and --names combinations
- JSON output with and without names
- pin update preserving names
- error cases (invalid CID, unpinned CID)

* docs: add pin name improvements to v0.38 changelog

covers fix for ipfs pin ls --names with specific CIDs
and RPC pin name leak fix

* fix(rpc): support pin names in Add()

passes the Name field from PinAddSettings to the API request

adds test to verify pin names work via RPC

* test: add coverage for pin names functionality

- test special characters, unicode, long names
- test concurrent operations
- test persistence across daemon restarts
- test garbage collection preservation
- fix indirect pin test logic

* chore: boxo@main with boxo#1039

* fix(pin): improve pin ls robustness and validation

- add nil check for n.Pinning with early fail-fast validation
- use pin.StringToMode() for consistent type validation
- add edge case tests for invalid types and unpinned CIDs
2025-09-19 03:17:45 +02:00
Marcin Rataj
71e883440e
refactor(config): migration 17-to-18 to unify Provider/Reprovider into Provide.DHT (#10951)
Some checks are pending
CodeQL / codeql (push) Waiting to run
Docker Check / lint (push) Waiting to run
Docker Check / build (push) Waiting to run
Gateway Conformance / gateway-conformance (push) Waiting to run
Gateway Conformance / gateway-conformance-libp2p-experiment (push) Waiting to run
Go Build / go-build (push) Waiting to run
Go Check / go-check (push) Waiting to run
Go Lint / go-lint (push) Waiting to run
Go Test / go-test (push) Waiting to run
Interop / interop-prep (push) Waiting to run
Interop / helia-interop (push) Blocked by required conditions
Interop / ipfs-webui (push) Blocked by required conditions
Sharness / sharness-test (push) Waiting to run
Spell Check / spellcheck (push) Waiting to run
* 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
djdv
38be7908b6
rpc: retreive pin names when Detailed option provided (#10966)
Some checks failed
CodeQL / codeql (push) Has been cancelled
Docker Check / lint (push) Has been cancelled
Docker Check / build (push) Has been cancelled
Gateway Conformance / gateway-conformance (push) Has been cancelled
Gateway Conformance / gateway-conformance-libp2p-experiment (push) Has been cancelled
Go Build / go-build (push) Has been cancelled
Go Check / go-check (push) Has been cancelled
Go Lint / go-lint (push) Has been cancelled
Go Test / go-test (push) Has been cancelled
Interop / interop-prep (push) Has been cancelled
Sharness / sharness-test (push) Has been cancelled
Spell Check / spellcheck (push) Has been cancelled
Interop / helia-interop (push) Has been cancelled
Interop / ipfs-webui (push) Has been cancelled
* rpc: don't reuse object during decode

Retaining the object during the loop will make fields such as `Name`
stick between iterations.
This patch decodes into a new struct each iteration, assuring we don't
retain values from other pins.

* rpc: use the Detailed option during request
2025-09-12 16:16:36 -07:00
Andrew Gillis
a3b01cd05f
Replace uber-go/multierr with errors.Join (#10912) 2025-08-13 02:03:42 -07:00
Hector Sanjuan
6e039a4e1e
client/rpc: re-enable tests on windows. (#10895)
Some checks are pending
CodeQL / codeql (push) Waiting to run
Docker Build / docker-build (push) Waiting to run
Gateway Conformance / gateway-conformance (push) Waiting to run
Gateway Conformance / gateway-conformance-libp2p-experiment (push) Waiting to run
Go Build / go-build (push) Waiting to run
Go Check / go-check (push) Waiting to run
Go Lint / go-lint (push) Waiting to run
Go Test / go-test (push) Waiting to run
Interop / interop-prep (push) Waiting to run
Interop / helia-interop (push) Blocked by required conditions
Interop / ipfs-webui (push) Blocked by required conditions
Sharness / sharness-test (push) Waiting to run
Spell Check / spellcheck (push) Waiting to run
Fixes #9905.

Co-authored-by: Andrew Gillis <11790789+gammazero@users.noreply.github.com>
2025-08-08 11:22:51 +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
Andrew Gillis
224d6a3ba4
refactor(cmds): do not return errors embedded in result type (#10527)
incl. https://github.com/ipfs/boxo/pull/738
2024-12-03 20:15:33 +01:00
Andrew Gillis
4009ad3e5a
chore: stop using go-homedir (#10568)
Some checks failed
CodeQL / codeql (push) Has been cancelled
Docker Build / docker-build (push) Has been cancelled
Gateway Conformance / gateway-conformance (push) Has been cancelled
Gateway Conformance / gateway-conformance-libp2p-experiment (push) Has been cancelled
Go Build / go-build (push) Has been cancelled
Go Check / go-check (push) Has been cancelled
Go Lint / go-lint (push) Has been cancelled
Go Test / go-test (push) Has been cancelled
Interop / interop-prep (push) Has been cancelled
Sharness / sharness-test (push) Has been cancelled
Interop / helia-interop (push) Has been cancelled
Interop / ipfs-webui (push) Has been cancelled
* chore: stop using go-homedir

The `github.com/mitchellh/go-homedir` repo is archived, no longer needed, and no longer maintained.

- `homedir.Dir` is replaced by the stdlib `os.UserHomeDir`
- `homedir.Expand` is replaced by fsutil.ExpandHome` in the `github.com/ipfs/kubo/misc/fsutil` package.

Additional functionality, such as `DirWritable` and `FileExists` was moved into or included in the `github.com/ipfs/kubo/misc/fsutil` package.
2024-11-05 07:45:11 -08:00
Andrew Gillis
680d420f9f
docs: replace outdated package paths described in rpc README (#10505)
Closes #10498
2024-09-05 23:20:08 +02:00
Andrew Gillis
263edb251e
feat: Support storing UnixFS 1.5 Mode and ModTime (#10478)
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2024-08-21 02:02:46 +02:00
Andrew Gillis
56abfc4911
Merge branch 'master' into uds-client 2024-08-19 19:05:35 -07:00
looklose
2fdb997bc5
chore: fix some typos (#10396)
Signed-off-by: looklose <shishuaiqun@yeah.net>
2024-06-03 17:17:58 +02:00
Oleg Kovalov
75df4e8173
refactor: stop using github.com/pkg/errors (#10431) 2024-05-26 11:04:40 +00:00
Henrique Dias
11183bb2f5
chore: upgrade go-libp2p-kad-dht (#10378)
* chore: upgrade go-libp2p-kad-dht
* config: make LoopbackAddressesOnLanDHT a Flag
* config: add DefaultLoopbackAddressesOnLanDHT
* docs(config): Routing.LoopbackAddressesOnLanDHT

---------

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2024-04-04 12:56:19 +00:00
occupyhabit
62eb143915
docs: fix some typos (#10377) 2024-03-25 09:59:47 +01:00
Henrique Dias
9047fed8d5
core/commands!: remove deprecated object APIs (#10375) 2024-03-22 09:32:30 +01:00
Dominic Della Valle
23ca62ad2c fix: Unix domain socket maddrs used with NewApi 2024-03-12 14:59:43 -04: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
a8a6bbe929
feat: support optional pin names (#10261) 2024-01-04 14:25:06 +01:00
Henrique Dias
8ab2de5ff0
feat: ipfs key sign|verify (#10235) 2023-12-04 09:51:26 +01:00
Henrique Dias
58c29399cf
chore: clean migration 2023-11-29 12:29:59 +01:00
Henrique Dias
01cc5eab57
feat(rpc): Opt-in HTTP RPC API Authorization (#10218)
Context: https://github.com/ipfs/kubo/issues/10187
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2023-11-17 01:29:29 +01:00
Henrique Dias
4695fd9fed
refactor: namesys cleanup, gateway /ipns/ ttl (#10115) 2023-10-18 10:23:50 +02:00
Jorropo
a5668d22ba chore: update boxo for structification of ImmutablePath 2023-10-09 09:44:39 +02:00
Henrique Dias
a7c6518497
feat: path consolidation (#10063) 2023-10-06 16:14:44 +02:00
Icarus9913
9fdb085605
refactor: stop using go-libp2p deprecated peer.ID.Pretty
Signed-off-by: Icarus9913 <icaruswu66@qq.com>
2023-09-18 15:58:15 +02:00
Henrique Dias
1e5ce93659 fix: use %-encoded headers in most compatible way 2023-08-22 15:43:01 +02:00
Kay
f12b372af9
style: gofumpt and godot [skip changelog] (#10081) 2023-08-17 14:02:08 +02:00
Henrique Dias
5156f21162
feat(ipns): records with V2-only signatures (#9932) 2023-06-20 14:24:31 +02:00
Adin Schmahmann
de59ac1b44 feat(client/rpc): switch rpc client to use go-ipld-prime global decoders via go-ipld-legacy instead of go-ipld-format ones 2023-06-08 09:38:31 +02:00
Jorropo
f8f4b83c9c client/rpc: use streaming pin listing
This also fix a leaking goroutine bug on client/rpc.PinAPI.Ls, we would deadlock if context was canceled while writing the keys.
2023-06-05 11:49:13 +02:00
Jorropo
9b63ab6da6 client/rpc: bring up to speed with streaming pins 2023-06-02 16:55:51 +02:00
Jorropo
12f343d837 client/rpc: rename package name to match rpc and edit migration story 2023-05-31 15:40:00 +02:00
Jorropo
86d8e75b7f client/rpc: migrate go-ipfs-http-client 2023-05-30 21:28:07 +02:00
Ross Jones
7d8262307c fix: use https URI when multiaddress specifies tls (#177)
Currently any clients created through `NewApiWithClient` will make a
HTTP request to the api, even if the multiaddress specifies TLS or (the
deprecated multiaddr option) https.

This commit addresses this by having NewApiWithClient iterate the
available protocols for the multiaddress, specifying the URL proto as
https if it finds TLS or HTTPS is specified. The default continues to be
http for those multiaddresses that do not specify these options.

Should resolve #176

This commit was moved from ipfs/go-ipfs-http-client@7e1de1f7cc
2023-05-15 18:18:51 +02:00
Jorropo
8bebfc00b7 chore: migrate from go-libipfs to boxo
This commit was moved from ipfs/go-ipfs-http-client@ae996cbe5a
2023-04-18 15:31:48 +02:00
João Pedro
5c21cf0ce9 docs: adding example of connection and pinning to README (#173)
Co-authored-by: JPexplorer <jpexplorer@pop-os.localdomain>


This commit was moved from ipfs/go-ipfs-http-client@b0de2b028e
2023-03-28 12:38:24 +02:00
Jorropo
75b6f45f76 chore: bumps for Kubo 0.18 and Routing API with stub for Put
This commit was moved from ipfs/go-ipfs-http-client@c076c3cb71
2023-02-10 03:36:15 +01:00
galargh
1193b2978f chore: remove unused linter directives
This commit was moved from ipfs/go-ipfs-http-client@c4fc1a7740
2022-10-01 17:37:23 +02:00
web3-bot
0fff1d5d8e stop using the deprecated io/ioutil package
This commit was moved from ipfs/go-ipfs-http-client@026ba730a1
2022-09-23 07:43:33 +00:00
Marcin Rataj
1cdb9adf89 fix: interop with go-ipfs 0.13 (#160)
This ensures cid-codec introduced in https://github.com/ipfs/go-ipfs/pull/8568
gets correctly passed (+ we maintain backward-compatibility with CIDv0)

This commit was moved from ipfs/go-ipfs-http-client@9c9f43fd9c
2022-06-23 22:39:01 +02:00
Marcin Rataj
fd209019f2 fix: interop with 'block put' from go-ipfs 0.13 (#158)
* chore: interop with go-ipfs 0.13

Applies necessary changes to ensure 'block/put' works
and is backward-compatible.

Context:
https://github.com/ipfs/go-ipfs/pull/8568

* chore: 0.3.1

bumping as patch because we bumped to 0.3.0 recently, 
as part of other (unreleased) go-ipfs 0.13 work

This commit was moved from ipfs/go-ipfs-http-client@ecf364c989
2022-04-21 22:18:19 +02:00
Jorropo
60a548b621 correctness: only match CIDs matching go-cid.Cid.String output
This commit was moved from ipfs/go-ipfs-http-client@34cc489461
2022-04-05 20:14:40 +02:00
Jorropo
f2f2109bc1 test: add a false case test to blockstore parsing
This commit was moved from ipfs/go-ipfs-http-client@75f597aa16
2022-04-05 20:14:40 +02:00
Jorropo
54f6e90870 fix: change CID breaking logic when parsing ipld.ErrNotFound
This commit was moved from ipfs/go-ipfs-http-client@a3b49352bf
2022-04-05 20:14:40 +02:00
Jorropo
775bcb7f09 feat: add blockstore: block not found matching too
This commit was moved from ipfs/go-ipfs-http-client@a3354f062c
2022-04-05 20:14:40 +02:00
Jorropo
ddd36645b2 feat: update the error parsing for go-ipld-format to v0.4.0
This commit was moved from ipfs/go-ipfs-http-client@296534fd16
2022-04-05 20:14:40 +02:00
Jorropo
a2a60768ea fix: parseIPLDErrNotFound test
This commit was moved from ipfs/go-ipfs-http-client@2e09c4b3ab
2022-04-01 00:32:30 +02:00