Commit Graph

284 Commits

Author SHA1 Message Date
Lucas Molas
6817fd4744 feat(cmds): allow to set the configuration file path 2022-04-22 13:03:28 -03:00
Marten Seemann
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 b19f7c9eca.
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
Dimitris Apostolou
6c6a55056d Fix typos 2022-03-18 00:58:36 +01:00
Laurent Senta
8d549f03f3 fix: rewrite dependencies over the go-ipfs-config package 2022-03-04 09:45:16 +01:00
Marcin Rataj
74e6436814 go-ipfs-config: docs: updated flatfs/badger profile helptext (#167)
This is copy-paste from https://github.com/ipfs/go-ipfs/pull/8662
to ensure consistency.
2022-01-28 23:39:10 +01:00
Thibault Meunier
9a0bd0fa7a go-ipfs-config: feat: add DNS.MaxCacheTTL for DNS-over-HTTPS resolvers (#161) 2022-01-20 20:04:53 +01:00
Jorropo
a6008f0e36 go-ipfs-config: feat: add Addresses.AppendAnnounce (#135) 2021-11-23 19:09:58 +01:00
Marten Seemann
ded27a5473 go-ipfs-config: feat: omitempty Swarm.EnableRelayHop for circuit v1 migration (#157)
* re-add the Swarm.EnableRelayHop option
* make Swarm.EnableRelayHop omitempty

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2021-11-23 18:45:11 +01:00
Marcin Rataj
d50960f9e3 go-ipfs-config: chore: omitempty Experimental.ShardingEnabled (#158)
We switch to autosharding setup in
https://github.com/ipfs/go-ipfs/pull/8527
2021-11-23 18:44:35 +01:00
Marcin Rataj
5ca8226610 go-ipfs-config: chore: update comment to match struct 2021-11-18 01:35:49 +01:00
Marten Seemann
7fe155c287 go-ipfs-config: feat: add a flag to enable the hole punching service (#155)
* add a flag to enable the hole punching service
* chore: omitempty EnableHolePunching

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2021-11-16 11:55:46 +01:00
Marcin Rataj
aefce5a6cd go-ipfs-config: refactor: AutoRelay → RelayClient
https://github.com/ipfs/go-ipfs-config/pull/154#discussion_r749324695
2021-11-15 15:45:55 +01:00
Marten Seemann
bf3a2ca8de go-ipfs-config: set Swarm.EnableAutoRelay to omitempty
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2021-11-15 17:34:58 +04:00
Marten Seemann
dcf17eb24a go-ipfs-config: improve AutoRelay configuration, add config option for static relays 2021-11-14 16:58:03 +04:00
Marten Seemann
d2268793dc go-ipfs-config: feat: Swarm.RelayService (circuit v2) (#146)
* remove the EnableRelayHop option in the SwarmConfig

* add an option to disable the limited relay

* make the relay service resources configurable

* refactor: use custom types

This enables us to swap defaults in go-ipfs without touching the config
file generated during `ipfs init`

https://github.com/ipfs/go-ipfs-config/pull/146#discussion_r734728162
https://github.com/ipfs/go-ipfs-config/pull/146#discussion_r734728019

* use OptionalDuration in RelayService configuration

* fix: *OptionalInteger with omitempty

This removes null values from the config

* fix: Flag does not need to be a pointer

* refactor: flatten RelayService limits

this simplifies consumer code and removes nil footgun

* docs: clarify different relay types

* feat: flag for ForceReachability mode in libp2p (#150)

adds Internal.Libp2pForceReachability
needed for sharness tests in ipfs/go-ipfs#8522

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

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2021-11-13 03:07:14 -08:00
Marten Seemann
ba9d9f609c go-ipfs-config: fix: String method on the OptionalString (#153)
* fix: String method on the OptionalString
* test(OptionalString): empty string is preserved

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2021-10-29 17:21:53 +02:00
Adin Schmahmann
cdaa222b22 go-ipfs-config: feat: OptionalString type and UnixFSShardingSizeThreshold (#149)
* feat: add OptionalString type
* test: fix OptionalInteger test
* add Internal.UnixFSShardingSizeThreshold as optional string
* test: OptionalString null unmarshal with default
* fix: omitempty UnixFSShardingSizeThreshold

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2021-10-28 22:55:08 +02:00
jwh
9eaf572b28 go-ipfs-config: feat: pubsub and ipns pubsub flags (#145)
* enable pubsub and namesys pubsub to be enable via config
* rename Ipns key, switch type to Flag
* omit the fields if empty
2021-10-27 21:50:10 +02:00
Marten Seemann
2cf170d5fa go-ipfs-config: feat: add an OptionalDuration type (#148)
* feat: make it possible to define optional durations
* test: empty/default optional durations
does not crash if user restores default value and sets it to empty string ""

* refactor: use null in JSON
* refactor(duration): use JSON null as the default

Rationale:
https://github.com/ipfs/go-ipfs-config/pull/148#discussion_r736975879

* refactor: Duration → OptionalDuration

This makes it possible to use OptionalDuration with `json:",omitempty"`
so the null is not serialized to JSON, and get working WithDefault as well.

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2021-10-27 18:23:35 +02:00
Petar Maymounkov
44291176e6 go-ipfs-config: feat: add Internal and Internal.Bitswap config options 2021-08-18 08:14:25 -04:00
Adin Schmahmann
ac81804c8c go-ipfs-config: feat: add an OptionalInteger type 2021-08-18 08:14:25 -04:00
Adin Schmahmann
7c1029c515 go-ipfs-config: fix: make sure the Priority type properly implements the JSON marshal/unmarshal interfaces 2021-08-18 08:14:25 -04:00
Steven Allen
c692e73f3f go-ipfs-config: fix: remove deprecated calls
And rename imports.
2021-07-22 15:54:33 -07:00
web3-bot
8f09fa547f go-ipfs-config: run gofmt -s 2021-05-17 17:00:43 +00:00
Michael Burns
e7bb833760 go-ipfs-config: [LINT] error strings should not end with punctuation or a newline (ST1005) 2021-05-14 14:31:24 -07:00
Adin Schmahmann
22d2b6b8b8 go-ipfs-config: add option for Accelerated DHT Client experiment 2021-05-12 15:13:47 -04:00
Steven Allen
f7b64b3d95 go-ipfs-config: Merge pull request #128 from ipfs/feat/migration-config
Add config for downloading repo migrations
2021-05-03 10:50:38 -07:00
gammazero
4b778ce326 go-ipfs-config: Removed Peers from migration config 2021-05-03 09:08:16 -07:00
gammazero
dbb5fa78a5 go-ipfs-config: Fix comment 2021-04-20 00:29:38 -07:00
gammazero
ec1659d79a go-ipfs-config: Init migration config with empty values 2021-04-19 23:41:54 -07:00
Adin Schmahmann
98052e9025 go-ipfs-config: Merge pull request #121 from RubenKelevra/patch-1
remove duplicate entries in defaultServerFilters
2021-04-19 08:53:04 -07:00
gammazero
5e6df6f54a go-ipfs-config: unit test for migration config 2021-04-17 18:19:05 -07:00
gammazero
67456e2e64 go-ipfs-config: Add config for downloading repo migrations 2021-04-16 17:35:34 -07:00
vyzo
c932e6b700 go-ipfs-config: add default empty config for DNS, rename struct from DNSConfig to DNS 2021-04-14 18:46:35 +03:00
vyzo
f264de4139 go-ipfs-config: update comments
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2021-04-13 17:53:47 +03:00
vyzo
28553d793a go-ipfs-config: simplify DNS config 2021-04-13 17:32:15 +03:00
vyzo
8a8b161da4 go-ipfs-config: add custom DNS Resolver configuration 2021-04-12 13:53:19 +03:00
@RubenKelevra
f5fb70ee0f go-ipfs-config: remove duplicate entries in defaultServerFilters 2021-03-24 12:44:46 +01:00
Adin Schmahmann
2690c10bca go-ipfs-config: add support for pinning mfs (#116)
* add support for pinning mfs
* add pin conceal selector
* add RemoteServicesPath

Co-authored-by: Petar Maymounkov <petarm@gmail.com>
2021-01-28 18:05:47 -05:00
Adin Schmahmann
d643a2bce4 go-ipfs-config: go fmt 2020-12-05 17:21:55 -05:00
Adin Schmahmann
06fe967955 go-ipfs-config: add remote pinning services config 2020-12-05 17:21:55 -05:00
gammazero
74dcf427fc go-ipfs-config: Remove badger2 profile
This is needed for the upcoming release since there is not yet an official badger2 release with the items needed for use by IPFS.
2020-11-23 17:09:21 -08:00
gammazero
1ec9262cda go-ipfs-config: Add badger2 profile and config spec 2020-10-09 16:11:07 -07:00
Petar Maymounkov
da979299da go-ipfs-config: error if bit size specified with ed25519 keys (#105) 2020-07-14 09:50:10 -07:00
Steven Allen
44e005e577 go-ipfs-config: fix: panic on invalid priority/flag values 2020-06-16 10:24:24 -07:00
Steven Allen
38ad98d84d go-ipfs-config: fix: remove undefined support from unmarshal
It's not a part of the JSON spec.
2020-06-16 00:45:58 -07:00
Steven Allen
5c1b4cd0e6 go-ipfs-config: doc: document Flag.WithDefault 2020-06-15 20:01:33 -07:00
Steven Allen
e26444e4c7 go-ipfs-config: fix typo
Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com>
2020-06-15 20:00:51 -07:00
Steven Allen
f55b515255 go-ipfs-config: doc(swarm): extend autorelay docs 2020-06-15 19:57:41 -07:00
Steven Allen
f74d15eacf go-ipfs-config: fix: fix type name typo 2020-06-15 19:56:38 -07:00