1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-26 12:32:31 +08:00

2192 Commits

Author SHA1 Message Date
0ff406170d fix: update rcmgr for go-libp2p v0.25 2023-02-14 22:19:46 +01:00
a00f5cae23 chore: update go-libp2p to v0.25.1 2023-02-14 22:19:46 +01:00
fb7f7b15b3 fix: restore wire format for /api/v0/routing/get|put (#9639)
Closes #9638
2023-02-10 02:41:45 +01:00
b3c98bb085 chore: bump go-libipfs remove go-bitswap 2023-01-27 23:07:01 +01:00
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
94e7f79805 fix(ipns): honour --ttl flag in 'ipfs name publish' (#9471)
* fix: honour --ttl flag in 'ipfs name publish'
* docs(cli): ipfs name inspect --help

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2023-01-27 02:33:13 +01:00
f20c980f2d chore: bump go-libipfs to replace go-block-format
Includes changes from:
- https://github.com/ipfs/go-block-format/pull/37
- https://github.com/ipfs/go-libipfs/pull/58
2023-01-26 16:55:48 +01:00
255e64e49e chore: migrate from go-ipfs-files to go-libipfs/files (#9535) 2023-01-13 14:27:03 +01:00
01e0bfa359 docs: libp2p resource management (#9468)
Co-authored-by: Antonio Navarro Perez <antnavper@gmail.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-12-08 16:18:04 +01:00
d16e63a23e Fix: Resource Manager: Filter stats correctly by %
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
2022-12-07 18:05:15 +01:00
b9a4d4592d chore: migrate ipfs/tar-utils to libipfs 2022-12-05 21:28:30 -05:00
807b98537d Revert "fix: ensure hasher is registered when using a hashing function"
This has been superseeded by 7d0ea08289ee32ec174a2f6a8392859fe8d1977c.

This reverts commit 773c246232c1f3d7fc67d7ddf5b1cb172ece8fa1.
2022-12-05 15:03:16 +01:00
cb1ba70a9b fix: handle new ProtoNode errors 2022-12-02 10:16:10 +11:00
254d81a9d5 feat: Improve ResourceManager UX (#9338)
This PR adds several new functionalities to make easier the usage of ResourceManager:

- Now resource manager logs when resources are exceeded are on ERROR instead of warning.
- The resources exceeded error now shows what kind of limit was reached and the scope.
- When there was no limit exceeded, we print a message for the user saying that limits are not exceeded anymore.
- Added `swarm limit all` command to show all set limits with the same format as `swarm stats all`
- Added `min-used-limit-perc` option to `swarm stats all` to only show stats that are above a specific percentage
- Simplify a lot default values.
- **Enable ResourceManager by default.**

Output example:
```
2022-11-09T10:51:40.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:59      Consider inspecting logs and raising the resource manager limits. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgr
2022-11-09T10:51:50.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 483095 times with error "transient: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:51:50.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:59      Consider inspecting logs and raising the resource manager limits. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgr
2022-11-09T10:52:00.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 455294 times with error "transient: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:52:00.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:59      Consider inspecting logs and raising the resource manager limits. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgr
2022-11-09T10:52:10.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 471384 times with error "transient: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:52:10.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:59      Consider inspecting logs and raising the resource manager limits. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgr
2022-11-09T10:52:20.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 8 times with error "peer:12D3KooWKqcaBtcmZKLKCCoDPBuA6AXGJMNrLQUPPMsA5Q6D1eG6: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:52:20.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 192 times with error "peer:12D3KooWPjetWPGQUih9LZTGHdyAM9fKaXtUxDyBhA93E3JAWCXj: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:52:20.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 469746 times with error "transient: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:52:20.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:59      Consider inspecting logs and raising the resource manager limits. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgr
2022-11-09T10:52:30.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 484137 times with error "transient: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:52:30.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 29 times with error "peer:12D3KooWPjetWPGQUih9LZTGHdyAM9fKaXtUxDyBhA93E3JAWCXj: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:52:30.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:59      Consider inspecting logs and raising the resource manager limits. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgr
2022-11-09T10:52:40.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 468843 times with error "transient: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:52:40.566+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:59      Consider inspecting logs and raising the resource manager limits. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgr
2022-11-09T10:52:50.566+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 366638 times with error "transient: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:52:50.566+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:59      Consider inspecting logs and raising the resource manager limits. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgr
2022-11-09T10:53:00.566+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 405526 times with error "transient: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:53:00.566+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 107 times with error "peer:12D3KooWQZQCwevTDGhkE9iGYk5sBzWRDUSX68oyrcfM9tXyrs2Q: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:53:00.566+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:59      Consider inspecting logs and raising the resource manager limits. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgr
2022-11-09T10:53:10.566+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 336923 times with error "transient: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:53:10.566+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:59      Consider inspecting logs and raising the resource manager limits. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgr
2022-11-09T10:53:20.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:55      Resource limits were exceeded 71 times with error "transient: cannot reserve inbound stream: resource limit exceeded".
2022-11-09T10:53:20.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:59      Consider inspecting logs and raising the resource manager limits. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#swarmresourcemgr
2022-11-09T10:53:30.565+0100    ERROR   resourcemanager libp2p/rcmgr_logging.go:64      Resrouce limits are no longer being exceeded.

```
## Validation tests

- Accelerated DHT client runs with no errors when ResourceManager is active. No problems were observed.
- Running an attack with 200 connections and 1M streams using yamux protocol. Node was usable during the attack. With ResourceManager deactivated, the node was killed by the OS because of the amount of memory consumed.
	- Actions done when the attack was active:
		- Add files 
		- Force a reprovide
		- Use the gateway to resolve an IPNS address.

It closes #9001 
It closes #9351
It closes #9322
2022-11-10 12:25:57 +01:00
4bebe2b667 docs: note log tail is broken (#9383) 2022-11-10 00:20:53 +01:00
3574caede5 fix: error when using huge json limit file
This error nicely instead of ooming when trying to use a json file so big it would oom.
2022-11-08 22:28:14 +01:00
2fd4e197a0 feat: Add command line completion for fish 2022-10-30 21:13:53 +00:00
b7a19d057e docs: pin remote arg
It accepts only one arg.
2022-10-14 21:16:36 +02:00
553d3e0ce7 add refs local alias repo ls (#9320)
* add refs local alias repo ls

* add test for /repo/ls

Co-authored-by: Nikhilesh Susarla <nikhilesh.susarla@cylogic.com>
2022-10-13 17:30:19 +02:00
007c960e0f docs(cmds): Clarify block fetching of refs endpoint. 2022-10-13 17:29:29 +02:00
e48626f517 chore(cmds): dag import: use ipld legacy decode 2022-10-13 16:45:50 +02:00
b5fe824964 fix ipfs swarm peering crash in offline mode (#9261) 2022-10-13 16:43:06 +02:00
bf8274f6e2 feat: --reset flag on swarm limit command (#9310)
* feat: --reset flag on swarm limit command

This flag allows to the user to reset limits to default values.

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

* Use adjusted default limits and remove already fixed FIXME

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

* Apply suggestions from code review

Co-authored-by: Gus Eggert <gus@gus.dev>

* Return correct defaults

* Remove resetting all values from a map.

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

Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Co-authored-by: Gus Eggert <gus@gus.dev>
2022-10-12 11:02:43 -04:00
e550d9e476 ci: add stylecheck to golangci-lint (#9334) 2022-10-06 10:18:40 -04:00
773c246232 fix: ensure hasher is registered when using a hashing function
Fixes #9297
2022-09-26 10:05:26 +02:00
1146f2dd81 Add <protocols> to ipfs id -h options (#9229) 2022-09-22 06:43:54 +00:00
74aaf37cec chore: bump go-libp2p v0.23.1
This does not include any WebTransport config code in Kubo, this will be done later in an other PR.
2022-09-21 23:16:03 +02:00
9e5d0aaaec feat(cmds/add): --to-files option automates files cp (#8927)
* feat(cmds/add): --to-files option as files cp
* tests(to-files): ensure error handling is covered

this adds bunch of tests that guard UX around importing multiple files
into MFS, and the logic around trailing slash to indicate if the MFS
destination if a directory.

If the destination has a trailing slash, we ensure that the directory
exists and is a dir and not a file. this allows us to support
adding multipl files into MFS dir:

ipfs add file1.txt file2.txt --to-files /some/mfs/dir/

* docs: to-files helptext

Co-authored-by: Antonio Navarro Perez <antnavper@gmail.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-09-21 18:08:36 +02:00
196887cbe5 chore: bump go-libp2p v0.22.0 & go1.18&go1.19
Fixes: #9225
2022-09-09 17:09:38 +02:00
82fbb84384 fmt: applies go1.19 fmt 2022-09-08 18:34:06 +02:00
92baa6c039 docs(add): skip binary name in helptext
Co-authored-by: Jorropo <jorropo.pgm@gmail.com>
2022-08-17 03:30:35 +00:00
0080a66639 docs(cli): clarify CID determinism in add command
Better 'ipfs add --help'  docs, based on feedback from
https://discuss.ipfs.io/t/ipfs-for-publishing-research-data-car-files/14748
2022-08-17 03:30:35 +00:00
2ab89cfe36 docs(cli): clarify CAR format in dag export|import 2022-08-17 03:30:35 +00:00
c3589a1728 WIP rcmgr auto limit scaling 2022-08-15 14:12:18 -07:00
6eea94e8d0 chore(cmd): add shutdown to CLI help 2022-08-15 16:12:02 -03:00
d30e71fa5a fix: kubo in daemon and cli stdout 2022-07-20 16:26:49 +02:00
93847da2e7 fix: Add routing command to subcommands help list. 2022-07-08 17:51:03 +02:00
cbb9aeec49 chore: update go-multibase 🚀
This add supports for base256emoji.
2022-07-07 23:29:47 +02:00
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
82467bc936 refactor: rename to kubo 2022-07-06 18:40:37 +02:00
cbf5fdae55 chore: update go-car 2022-07-06 15:30:29 +02:00
6602dd704e refactor: prealloc slices with known sizes (#8892)
Often those are small slices and that cuts down the number
of (small) allocations from 2~7 to 1. 
This is consistent too, always only gets 1.
2022-06-24 21:19:19 +01:00
058803f167 docs: fix typo in cid/base32 2022-06-21 22:42:46 +02:00
a433064d72 chore: replace ioutil with io and os (#8969)
Co-authored-by: Håvard Anda Estensen <haavard.ae@gmail.com>
2022-06-14 12:37:02 -04:00
20083ab328 fix(cmd/config): make config edit subcommand work on windows
Co-authored-by: Jorropo <jorropo.pgm@gmail.com>
2022-06-09 17:36:11 +02:00
8d7ed002df feat: upgrade to go-libp2p-kad-dht@v0.16.0 (#9005)
* feat: upgrade to go-libp2p-kad-dht@v0.16.0

* rename "cid format --codec" to "cid format --mc"

* refactor(test): from --codec to --mc

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-06-03 16:56:30 -04:00
0a01574ff7 docs: fix typo in the swarm/peering help text 2022-06-03 08:37:58 -07:00
5615715c55 feat: log when resource manager limits are exceeded (#8980)
This periodically logs how many times Resource Manager limits were
exceeded. If they aren't exceeded, then nothing is logged. The log
levels are at ERROR log level so that they are shown by default.

The motivation is so that users know when they have exceeded resource
manager limits. To find what is exceeding the limits, they'll need to
turn on debug logging and inspect the errors being logged. This could
collect the specific limits being reached, but that's more complicated
to implement and could result in much longer log messages.
2022-05-19 15:27:44 -04:00
7892cc91f9 fix: hanging goroutine in get fileArchive handler
Fixes #8957

The context was only checked while reading data.
Not while writing data to the http connection.
So since the data flow through an io.Pipe the closing didn't flowed through and left the writer open hanging.

Co-authored-by: Antonio Navarro Perez <antnavper@gmail.com>
2022-05-13 18:24:34 +02:00
53299e84e0 chore: mark fuse experimental (#8962)
It works only on some platforms, and does not work reliably.
This corrects our error of not setting expectations right.
2022-05-12 10:32:54 -07:00