Skip to content

Commit

Permalink
fdctl: add ability to run a bootstrap validator
Browse files Browse the repository at this point in the history
  • Loading branch information
anwayde committed Dec 8, 2023
1 parent 198da97 commit 3e6148d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/app/fdctl/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ static int parse_key_value( config_t * config,

ENTRY_BOOL ( ., development, sandbox );
ENTRY_BOOL ( ., development, no_solana_labs );
ENTRY_BOOL ( ., development, bootstrap );

ENTRY_BOOL ( ., development.netns, enabled );
ENTRY_STR ( ., development.netns, interface0 );
Expand Down
1 change: 1 addition & 0 deletions src/app/fdctl/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ typedef struct {
struct {
int sandbox;
int no_solana_labs;
int bootstrap;
uint debug_tile;
struct {
int enabled;
Expand Down
15 changes: 15 additions & 0 deletions src/app/fdctl/config/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,21 @@ dynamic_port_range = "8900-9000"
# the `--no-solana-labs` argument to `fddev`.
no_solana_labs = false

# Sometimes, it may be useful to run a bootstrap firedancer validator,
# either for development or for testing purposes. The `fddev` tool is
# provided for this purpose, which creates the bootstrap keys and does
# the cluster genesis using some parameters that are typically useful
# for development.
#
# Enabling this allows de-coupling the genesis and key creation from
# the validator startup. The bootstrap validator can then be started
# up with `fdctl`. It will expect the genesis to already exist at
# [ledger.path]. The keys used during genesis should be the same as
# the ones supplied in the [consensus.identity_path] and
# [consensus.vote_account_path]. This option will not be effective if
# [gossip.entrypoints] is non-empty.
bootstrap = false

# It can be convenient during development to use a network namespace
# for running Firedancer. This allows us to send packets at a local
# Firedancer instance and have them go through more of the kernel
Expand Down
5 changes: 3 additions & 2 deletions src/app/fdctl/run/run.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,12 @@ run_cmd_fn( args_t * args,
config_t * const config ) {
(void)args;

if( FD_UNLIKELY( !config->gossip.entrypoints_cnt ) )
if( FD_UNLIKELY( !config->gossip.entrypoints_cnt && !config->development.bootstrap ) )
FD_LOG_ERR(( "No entrypoints specified in configuration file under [gossip.entrypoints], but "
"at least one is needed to determine how to connect to the Solana cluster. If "
"you want to start a new cluster in a development environment, use `fddev` instead "
"of `fdctl`." ));
"of `fdctl`. If you want to use an existing genesis, set [development.bootstrap] "
"to \"true\" in the configuration file." ));

for( ulong i=0; i<config->gossip.entrypoints_cnt; i++ ) {
if( FD_UNLIKELY( !strcmp( config->gossip.entrypoints[ i ], "" ) ) )
Expand Down

0 comments on commit 3e6148d

Please sign in to comment.