Skip to content

config: Flag to disable Bitswap client and server #10717

@lidel

Description

@lidel

Kubo needs an explicit configuration Flag for controlling if Bitswap protocol is enabled, and also if we enabled only Client or also Client+Server.

Proposed feature

Add top level Bitswap to the config with two flags

  • Bitswap.Enabled controls both client and server (Flag, enabled by default)
  • Bitswap.ServerEnabled controls if node responds to WANTs, it disables announcing bitswap protocol in libp2p identify (ipfs id) responses (Flag, depends on Bitswap.Enabled, enabled by default)
  • basic regression tests in kubo/test/cli to ensure flags truly disable it

Notes:

  • we have Internal.Bitswap but that is for super low level knobs. we keep them there.
  • we have some code prior art in rainbow/setup_bitswap.go where Bitswap server is opt-in
  • when in doubt, follow convention we already have for things like AutoNAT, Relays, AutoTLS.

Use cases

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium: Good to have, but can wait until someone steps uphelp wantedSeeking public contribution on this issuekind/featureA new featureneed/triageNeeds initial labeling and prioritizationtopic/bitswapTopic bitswaptopic/configTopic config

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions