Skip to content

Make P2P Hybrid available#178

Closed
nullun wants to merge 33 commits intoalgorandfoundation:mainfrom
nullun:feature/enable-p2p-hybrid
Closed

Make P2P Hybrid available#178
nullun wants to merge 33 commits intoalgorandfoundation:mainfrom
nullun:feature/enable-p2p-hybrid

Conversation

@nullun
Copy link
Collaborator

@nullun nullun commented Oct 21, 2025

ℹ Overview

This PR add the ability to configure your algod node to support P2P Hybrid connections on the network.

It also adds a whole bunch of other tweaks and fixes I had to do whilst developing on MacOS.

Is it possible to release this as a beta version first? That way we can get some testing and feedback before the marketing push that gets everyone using it.

✅ Acceptance:

  • Works for me
  • Works for you

nullun added 19 commits October 10, 2025 15:17
If a node has disabled API Authentication, then algod.token doesn't exist, but genesis.json should always exist
feat: Added algod config to StateModel for displaying items in the UI
@codecov
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

❌ Patch coverage is 26.26728% with 320 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.35%. Comparing base (43b79ba) to head (c7438cc).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/algod/utils/utils.go 10.52% 68 Missing ⚠️
cmd/configure/algod.go 3.50% 55 Missing ⚠️
ui/modals/hybrid/model.go 20.58% 54 Missing ⚠️
internal/algod/utils/settings.go 0.00% 28 Missing ⚠️
ui/status.go 50.00% 18 Missing and 10 partials ⚠️
internal/algod/config/config.go 0.00% 19 Missing ⚠️
cmd/root.go 0.00% 10 Missing and 2 partials ⚠️
internal/algod/metrics.go 75.00% 6 Missing and 4 partials ⚠️
internal/algod/algod.go 47.05% 5 Missing and 4 partials ⚠️
cmd/bootstrap.go 0.00% 8 Missing ⚠️
... and 13 more
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #178       +/-   ##
===========================================
+ Coverage   34.75%   45.35%   +10.59%     
===========================================
  Files          89       93        +4     
  Lines        6974     5850     -1124     
===========================================
+ Hits         2424     2653      +229     
+ Misses       4417     2928     -1489     
- Partials      133      269      +136     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nullun nullun marked this pull request as ready for review October 27, 2025 09:25
@nullun nullun requested a review from Copilot October 27, 2025 09:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces P2P Hybrid mode configuration support to NodeKit, allowing users to configure their Algorand nodes to support P2P Hybrid connections. The implementation includes a new configuration interface, UI components to display and toggle the feature, and various cross-platform compatibility fixes.

Key Changes:

  • Added P2P Hybrid mode configuration via configure algod command with persistent storage in config.json
  • Implemented a modal UI component to inform users about P2P Hybrid mode availability
  • Improved algod.IsRunning() to check PID file existence rather than process name lookup for better reliability

Reviewed Changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
internal/algod/config/config.go New config package defining P2P Hybrid mode settings
internal/algod/utils/utils.go Added config read/write functions and hybrid popup state management
internal/algod/algod.go Updated IsRunning to use PID-based process checking
cmd/configure/algod.go New command for managing algod configuration options
ui/modals/hybrid/model.go New modal component for P2P Hybrid mode information
ui/status.go Updated status view to display P2P mode state
api/catchpoint.go Changed error handling from string to error type
Multiple files Import reorganization and filepath.Join adoption for cross-platform compatibility
Comments suppressed due to low confidence (1)

internal/algod/utils/utils.go:1

  • This change modifies the behavior of FindPathToFile to check for file existence within each directory rather than checking if the path itself is a directory. The original code checked os.Stat(path) to verify path was a directory before processing. Now it's checking if targetFileName exists in path, which changes the function's semantics. This could break existing callers that expect directory validation.
package utils

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nullun nullun requested a review from tasosbit October 27, 2025 11:18
nullun and others added 2 commits November 6, 2025 13:40
@tasosbit tasosbit requested a review from Copilot November 6, 2025 14:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 33 out of 33 changed files in this pull request and generated 13 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Mostly nil reference checks, most (if not all) would be impossible to happen, but better safe than sorry.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@nullun
Copy link
Collaborator Author

nullun commented Dec 9, 2025

Closing in favour of #183 which includes all the same code plus some nice status UI tweaks.

@nullun nullun closed this Dec 9, 2025
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.

4 participants