Skip to content

Commit d35956b

Browse files
committed
Add public rpc address option passthrough
1 parent c30ea13 commit d35956b

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

src/app/fdctl/commands/run_agave.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ agave_boot( config_t const * config ) {
145145
if( config->rpc.port ) ADDH( "--rpc-port", config->rpc.port );
146146
if( config->frankendancer.rpc.full_api ) ADD1( "--full-rpc-api" );
147147
if( config->frankendancer.rpc.private ) ADD1( "--private-rpc" );
148+
if( strcmp( config->frankendancer.rpc.public_address, "" ) ) ADD( "--public-rpc-address", config->frankendancer.rpc.public_address );
148149
if( strcmp( config->frankendancer.rpc.bind_address, "" ) ) ADD( "--rpc-bind-address", config->frankendancer.rpc.bind_address );
149150
if( config->frankendancer.rpc.transaction_history ) ADD1( "--enable-rpc-transaction-history" );
150151
if( config->rpc.extended_tx_metadata_storage ) ADD1( "--enable-extended-tx-metadata-storage" );

src/app/fdctl/config/default.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,12 @@ dynamic_port_range = "8900-9000"
323323
# with the `--rpc-bind-address` argument.
324324
bind_address = ""
325325

326+
# RPC address for the validator to advertise publicly in gossip.
327+
# Useful for validators running behind a load balancer or proxy.
328+
# This option is passed to the Agave client
329+
# with the `--public-rpc-address` argument.
330+
public_address = ""
331+
326332
# Enable historical transaction info over JSON RPC, including the
327333
# `getConfirmedBlock` API. This will cause an increase in disk
328334
# usage and IOPS. This option is passed to the Agave client

src/app/shared/fd_config.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#define AFFINITY_SZ (256UL)
1212
#define CONFIGURE_STAGE_COUNT ( 12UL)
1313
#define FD_CONFIG_GOSSIP_ENTRYPOINTS_MAX ( 16UL)
14+
#define FD_IP4_PORT_STR_MAX ( 22UL)
1415

1516
struct fd_configh {
1617
char dynamic_port_range[ 32 ];
@@ -63,6 +64,7 @@ struct fd_configh {
6364
int full_api;
6465
int private;
6566
char bind_address[ 16 ];
67+
char public_address[ FD_IP4_PORT_STR_MAX ];
6668
int transaction_history;
6769
int only_known;
6870
int pubsub_enable_block_subscription;

src/app/shared/fd_config_parse.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ fd_config_extract_podh( uchar * pod,
5353
CFG_POP ( bool, rpc.full_api );
5454
CFG_POP ( bool, rpc.private );
5555
CFG_POP ( cstr, rpc.bind_address );
56+
CFG_POP ( cstr, rpc.public_address );
5657
CFG_POP ( bool, rpc.transaction_history );
5758
CFG_POP ( bool, rpc.only_known );
5859
CFG_POP ( bool, rpc.pubsub_enable_block_subscription );

0 commit comments

Comments
 (0)