Skip to content

Conversation

@gap-editor
Copy link

PR description

This change enhances the --bootnodes option so it can read enode URLs from a file or remote source, in addition to the existing comma-separated CLI argument. Specifically:

  • Introduce a new helper method resolveBootnodeStrings to handle:
    • HTTP(S) URLs (fetch and parse each line)
    • file:// URIs
    • Local file paths
    • Fallback to raw enode strings when no file or URL is detected
  • Update the bootnodes parsing logic to first resolve all inputs via the helper, then pass the flattened list into buildEnodes.
  • Provide clear error messages if fetching or reading any of the sources fails.

This enables workflows like Ephemery’s dynamic download of latest enodes at runtime:

--bootnodes=https://ephemery.dev/latest/metadata/enodes.txt

Fixed Issue(s)

fixes #8538

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required (docs).
  • Considered the changelog and included an update if required (changelog).
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Locally, you can run these tests to catch failures early:

  • spotless: ./gradlew spotlessApply
  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests

Signed-off-by: Maximilian Hubert <64627729+gap-editor@users.noreply.github.com>
@github-actions
Copy link

This pr is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the Stale label May 27, 2025
@github-actions
Copy link

This pr was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this Jun 10, 2025
@macfarla macfarla reopened this Jul 23, 2025
@github-actions github-actions bot removed the Stale label Jul 23, 2025
@macfarla
Copy link
Contributor

@gap-editor apologies for the delay in reviewing your PR. Are you still interested in getting this over the line? If so -

  • would be nice to see unit tests added
  • also consider some logging at least at DEBUG level, to make it obvious what's happening

if you've moved on, we can prob get someone from the team to pick this up.

I tested that it works with

besu --network=ephemery --bootnodes=https://ephemery.dev/latest/metadata/enodes.txt
...
2025-07-24 15:05:28.424+10:00 | main | INFO  | RunnerBuilder | Resolved 2 bootnodes.
besu --network=ephemery --bootnodes=https://ephemery.dev/latest/metadata/enodes.txt,enode://50a54ecbd2175497640bcf46a25bbe9bb4fae51d7cc2a29ef4947a7ee17496cf39a699b7fe6b703ed0feb9dbaae7e44fc3827fcb7435ca9ac6de4daa4d983b3d@137.74.203.240:30303
...
2025-07-24 15:05:28.424+10:00 | main | INFO  | RunnerBuilder | Resolved 3 bootnodes.

@macfarla
Copy link
Contributor

macfarla commented Aug 5, 2025

Other suggestions for the benefit of anyone picking this up

  • refactor to make it a separate class rather than adding methods to BesuCommand directly
  • add some unit tests

@macfarla macfarla marked this pull request as draft August 5, 2025 03:09
@github-actions
Copy link

github-actions bot commented Sep 5, 2025

This pr is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the Stale label Sep 5, 2025
@macfarla
Copy link
Contributor

macfarla commented Sep 5, 2025

closing as this is superseded by #9097

@macfarla macfarla closed this Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow --bootnodes to read from a file

2 participants