1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-06 03:19:47 +08:00

223 Commits

Author SHA1 Message Date
196887cbe5 chore: bump go-libp2p v0.22.0 & go1.18&go1.19
Fixes: #9225
2022-09-09 17:09:38 +02:00
c3589a1728 WIP rcmgr auto limit scaling 2022-08-15 14:12:18 -07:00
82467bc936 refactor: rename to kubo 2022-07-06 18:40:37 +02: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
74aff245d2 feat: persist limits to Swarm.ResourceMgr.Limits (#8901)
* feat: persist limit changes to config

This changes the "ipfs swarm limit" command so that when limit changes
are applied via the command line, they are persisted to the repo
config, so that they remain in effect when the daemon restarts.

Any existing limit.json can be dropped into the IPFS config easily
using something like:

cat ~/.ipfs/config | jq ".Swarm.ResourceMgr.Limits = $(cat limit.json)" | sponge ~/.ipfs/config

This also upgrades to Resource Manager v0.3.0, which exports the config
schema so that we don't have to maintain our own copy of it.

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-04-28 15:27:16 +02:00
514411bedb feat: opt-in Swarm.ResourceMgr (go-libp2p v0.18) (#8680)
* update go-libp2p to v0.18.0

* initialize the resource manager

* add resource manager stats/limit commands

* load limit file when building resource manager

* log absent limit file

* write rcmgr to file when IPFS_DEBUG_RCMGR is set

* fix: mark swarm limit|stats as experimental

* feat(cfg): opt-in Swarm.ResourceMgr

This ensures we can safely test the resource manager without impacting
default behavior.

- Resource manager is disabled by default
    - Default for Swarm.ResourceMgr.Enabled is false for now
- Swarm.ResourceMgr.Limits allows user to tweak limits per specific
  scope in a way that is persisted across restarts
- 'ipfs swarm limit system' outputs human-readable json
- 'ipfs swarm limit system new-limits.json' sets new runtime limits
  (but does not change Swarm.ResourceMgr.Limits in the config)

Conventions to make libp2p devs life easier:
- 'IPFS_RCMGR=1 ipfs daemon' overrides the config and enables resource manager
- 'limit.json' overrides implicit defaults from libp2p (if present)

* docs(config): small tweaks

* fix: skip libp2p.ResourceManager if disabled

This ensures 'ipfs swarm limit|stats' work only when enabled.

* fix: use NullResourceManager when disabled

This reverts commit b19f7c9eca4cee4187f8cba3389dc2c930258512.
after clarification feedback from
https://github.com/ipfs/go-ipfs/pull/8680#discussion_r841680182

* style: rename IPFS_RCMGR to LIBP2P_RCMGR

preexisting libp2p toggles use LIBP2P_ prefix

* test: Swarm.ResourceMgr

* fix: location of opt-in limit.json and rcmgr.json.gz

Places these files inside of IPFS_PATH

* Update docs/config.md

* feat: expose rcmgr metrics when enabled (#8785)

* add metrics for the resource manager
* export protocol and service name in Prometheus metrics
* fix: expose rcmgr metrics only when enabled

Co-authored-by: Marcin Rataj <lidel@lidel.org>

* refactor: rcmgr_metrics.go

* refactor: rcmgr_defaults.go

This file defines implicit limit defaults used when Swarm.ResourceMgr.Enabled

We keep vendored copy to ensure go-ipfs is not impacted when go-libp2p
decides to change defaults in any of the future releases.

* refactor: adjustedDefaultLimits

Cleans up the way we initialize defaults and adds a fix for case
when connection manager runs with high limits.

It also hides `Swarm.ResourceMgr.Limits` until we have a better
understanding what syntax makes sense.

* chore: cleanup after a review

* fix: restore go-ipld-prime v0.14.2

* fix: restore go-ds-flatfs v0.5.1

Co-authored-by: Lucas Molas <schomatis@gmail.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-04-07 21:06:35 -04:00
8d549f03f3 fix: rewrite dependencies over the go-ipfs-config package 2022-03-04 09:45:16 +01:00
a43e506d7f fix: multibase in pubsub http rpc (#8183)
* multibase encoding on pubsub
* emit multibase for json clients
* refactor(pubsub): base64url for all URL args

This makes it easier to reason about.
Also added better helptext to each command explaining how the binary
data is encoded on the wire, and how to process it in userland.

* refactor: remove ndpayload and lenpayload

Those output formats are undocumented and seem to be only used in tests.
This change removes their implementation and replaces it with error
message to use JSON instead.

I also refactored tests to test the --enc=json response format instead
of imaginary one, making tests more useful as they also act as
regression tests for HTTP RPC.

* test(pubsub): go-ipfs-api

Testing against compatible version from
https://github.com/ipfs/go-ipfs-api/pull/255

* refactor: safeTextListEncoder

Making it clear what it does and why

* refactor(pubsub): unify peerids

This ensures `ipfs pubsub sub` returns the same peerids in the `From`
field as `ipfs pubsub peers`.

libp2p already uses base encoding, no need to double wrap or use custom
multibase.

* test(pubsub): go-ipfs-http-client

* refactor(pubsub): make pub command read from a file

We want to send payload in the body as multipart so users can use
existing tools like curl for publishing arbitrary bytes to a topic.

StringArg was created for "one message per line" use case, and if data
has `\n` or `\r\n` byte sequences, it will cause payload to be split. It
is not possible to undo this, because mentioned sequences are lost, so
we are not able to tell if it was `\n` or `\r\n`

We already avoid this problem in `block put` and `dht put` by reading
payload via FileArg which does not mangle binary data and send it as-is.
It feel like `pubsub pub` should be using it in the first place anyway,
so this commit replaces StringArg with FileArg.

This also closes https://github.com/ipfs/go-ipfs/issues/8454
and makes rpc in go-ipfs easier to code against.

* test(pubsub): publishing with line breaks

Making sure we don't see regressions in the future.
Ref. https://github.com/ipfs/go-ipfs/issues/7939

* chore: disable pubsub interop for now

See
344f692d8c

* test: t0322-pubsub-http-rpc.sh

- Adds HTTP RPC regression test that ensures topic is encoded as URL-safe
  multibase.
- Moves pubsub tests to live in unique range ./t032x

* fix(ci):  js-ipfs with  fixed pubsub wire format

uses js-ipfs from https://github.com/ipfs/js-ipfs/pull/3922 
until js-ipfs release can ship with dependency on go-ipfs 0.11.0-rc1

Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>
2021-11-29 23:06:54 +01:00
a651045c50 feature: 'ipfs swarm peering' command (#8147)
* feat: added swarm peering command supporting add, ls and rm

Co-authored-by: Steven Allen <steven@stebalien.com>
2021-09-15 07:46:16 -07:00
543c5da34a explicit construction of DNS resolver 2021-05-10 21:03:27 -07:00
69ccf99915 chore: update libp2p 2020-05-20 16:56:22 -07:00
26c5e38571 fix: use the correct protocol name for ipfs swarm addrs local --id 2020-02-05 07:46:37 -08:00
15c35a5a95 doc: update documentation for /ipfs -> /p2p multiaddr switch
See: https://github.com/libp2p/libp2p/issues/79
2019-12-14 19:39:59 +01:00
c9f3d4b9ab cmds(help): fix swarm filter add/rm help text
These _are_ added/removed from the config.

fixes #4605
2019-09-20 15:02:11 -07:00
5d468e23ea chore: deprecate go-ipfs-addr 2019-05-31 23:46:11 -07:00
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
2b84b2ba13 chore: fix linter nits and tests that don't compile 2019-05-21 11:09:57 -07:00
5f64b270f8 cmdkit -> cmds
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-05-10 23:00:20 -07:00
1f293eff1b chore: fix a bunch of issues caught by golangci-lint
Most of these are probably harmless but a few looked like they might actually be
bugs. Most of them are just faulty tests.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-03-29 11:57:45 +00:00
5fc7b027fd fix(swarm): improve swarm connect no peers found error
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-03-18 19:13:56 -07:00
1cc8c3a17e fix(swarm): catch cases where we fail to resolve an address to a peer
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-03-18 19:13:53 -07:00
f1b6888081 fix(swarm): use the go fork/join idiom
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-03-18 19:13:49 -07:00
291614848f fix(swarm): feed through context
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-03-18 19:13:43 -07:00
597bf2a481 fix(swarm): collect maddr by channel
License: MIT
Signed-off-by: Overbool <overbool.xu@gmail.com>
2019-03-18 18:52:16 -07:00
309cf70570 fix(swarm): add dnsaddr support in swarm connect
License: MIT
Signed-off-by: Overbool <overbool.xu@gmail.com>
2019-03-18 18:51:20 -07:00
42e191c017 gx: unrewrite
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2019-03-05 18:33:56 +01:00
3fa1bfe1bc gx: update cmds and flatfs
fixes #6028, fixes crash when writing after closing on flatfs.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-03-01 12:17:49 -08:00
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
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
3c2536dd81 gx: update go-ipfs-cmds
fixes #6021

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-25 16:45:43 -07:00
2f17b951c2 gx: update deps
* Updates go-ipfs-cmds to try to get the tests to pass on travis.
* While we're at it, fix duplicate gx deps.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-19 13:12:21 -08:00
28cf3de0f9 Update protobuf
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2019-02-18 20:46:22 +01:00
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
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
7c2aa0e9a9 gx: update go-unixfs to propagate archive changes
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-01-30 20:58:32 +01:00
ab270fbaa7 Bubble go-ipfs-cmds 2.0.10
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2019-01-10 21:31:11 +01:00
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
7b4ab36817 gx: update go-ipfs-config
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-01-04 02:37:06 +01:00
5894291139 gx: update go-ipfs-config
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-12-20 10:07:32 -08:00
2c2f9f2bed coreapi: implement --local with Offline option
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-12-20 16:40:51 +01:00
0618fd77be gx: update go-ipfs-files to 2.0
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-12-20 13:52:20 +01:00
90926ca5c7 gx: update go-ipfs-cmds
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-12-12 16:35:42 -08:00
9dcec2b3e2 gx: update go-libp2p-peer
Reverts the changes that allowed small keys (ed25519 keys) to be inlined.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-12-07 15:37:23 -08:00
cef645936d gx: update go-ipfs-config
* AutoRelay options for #5785.
* Badger truncate-by-default option for #5275, #5625.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-11-26 17:42:13 -08:00
0963c9cdcb Update go-ipfs-delay and assoc deps
License: MIT
Signed-off-by: hannahhoward <hannah@hannahhoward.net>
2018-11-15 18:53:45 -08:00
51fa833fda cmds: use MakeTypedEncoder
License: MIT
Signed-off-by: Overbool <overbool.xu@gmail.com>
2018-11-10 12:11:45 +08:00
0d80fc54c3 gx: update go-log and sha256
fixes #5709

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-11-02 21:17:20 -07:00
38cae95f30 gx: update go-ipfs-cmds to 2.0.5
License: MIT
Signed-off-by: Dominic Della Valle <ddvpublic@gmail.com>
2018-10-26 19:50:32 -04:00
37f0fd92c7 gx: update go-ipfs-cmds
(no code changes)

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-10-26 09:26:53 -07:00