Skip to content

Comments

Pr/911#912

Closed
gammazero wants to merge 7 commits intomainfrom
pr/911
Closed

Pr/911#912
gammazero wants to merge 7 commits intomainfrom
pr/911

Conversation

@gammazero
Copy link
Contributor

No description provided.

@gammazero gammazero requested a review from a team as a code owner April 29, 2025 18:24
@gammazero gammazero closed this Apr 29, 2025
@gammazero gammazero deleted the pr/911 branch April 29, 2025 19:50
gammazero added a commit to ipfs/kubo that referenced this pull request Apr 29, 2025
Original PR: #10782

This pull request introduces changes to the Bitswap configuration and functionality, including the addition of new configuration options, modifications to the Bitswap server/client behavior, and the inclusion of new tests to verify these changes.

* Added a new `BitswapConfig` struct in `config/bitswap.go` to hold Bitswap configuration options, including `Enabled` and `ServerEnabled` flags.
* Updated the `Config` struct in `config/config.go` to include the new `BitswapConfig` field.

* Modified the `Bitswap` function in `core/node/bitswap.go` to respect the `ServerEnabled` flag, using an empty blockstore when the server is disabled to prevent serving blocks to other peers.
* Updated the `OnlineExchange` function to return a no-op exchange when Bitswap is disabled.
* Added a `noopExchange` struct to handle cases where Bitswap is disabled, ensuring no blocks are served or retrieved.

* Introduced a new test file `test/cli/bitswap_config_test.go` with multiple test cases to verify the behavior of Bitswap configuration, including scenarios where the server is enabled, disabled, or Bitswap is completely disabled.

- Closes #10717
- Depends on ipfs/boxo#912
gammazero added a commit to ipfs/kubo that referenced this pull request Apr 30, 2025
Original PR: #10782

This pull request introduces changes to the Bitswap configuration and functionality, including the addition of new configuration options, modifications to the Bitswap server/client behavior, and the inclusion of new tests to verify these changes.

* Added a new `BitswapConfig` struct in `config/bitswap.go` to hold Bitswap configuration options, including `Enabled` and `ServerEnabled` flags.
* Updated the `Config` struct in `config/config.go` to include the new `BitswapConfig` field.

* Modified the `Bitswap` function in `core/node/bitswap.go` to respect the `ServerEnabled` flag, using an empty blockstore when the server is disabled to prevent serving blocks to other peers.
* Updated the `OnlineExchange` function to return a no-op exchange when Bitswap is disabled.
* Added a `noopExchange` struct to handle cases where Bitswap is disabled, ensuring no blocks are served or retrieved.

* Introduced a new test file `test/cli/bitswap_config_test.go` with multiple test cases to verify the behavior of Bitswap configuration, including scenarios where the server is enabled, disabled, or Bitswap is completely disabled.

- Closes #10717
- Depends on ipfs/boxo#912
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants