Add --enable-bigtable-ledger-upload flag
This commit is contained in:
parent
a13efc52b3
commit
d8e2038dda
|
@ -99,6 +99,7 @@ pub struct JsonRpcConfig {
|
||||||
pub faucet_addr: Option<SocketAddr>,
|
pub faucet_addr: Option<SocketAddr>,
|
||||||
pub health_check_slot_distance: u64,
|
pub health_check_slot_distance: u64,
|
||||||
pub enable_bigtable_ledger_storage: bool,
|
pub enable_bigtable_ledger_storage: bool,
|
||||||
|
pub enable_bigtable_ledger_upload: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
|
|
@ -260,20 +260,23 @@ impl JsonRpcService {
|
||||||
.build()
|
.build()
|
||||||
.expect("Runtime");
|
.expect("Runtime");
|
||||||
|
|
||||||
let bigtable_ledger_storage = if config.enable_bigtable_ledger_storage {
|
let bigtable_ledger_storage =
|
||||||
runtime
|
if config.enable_bigtable_ledger_storage || config.enable_bigtable_ledger_upload {
|
||||||
.block_on(solana_storage_bigtable::LedgerStorage::new(false))
|
runtime
|
||||||
.map(|x| {
|
.block_on(solana_storage_bigtable::LedgerStorage::new(
|
||||||
info!("BigTable ledger storage initialized");
|
config.enable_bigtable_ledger_upload,
|
||||||
Some(x)
|
))
|
||||||
})
|
.map(|x| {
|
||||||
.unwrap_or_else(|err| {
|
info!("BigTable ledger storage initialized");
|
||||||
error!("Failed to initialize BigTable ledger storage: {:?}", err);
|
Some(x)
|
||||||
None
|
})
|
||||||
})
|
.unwrap_or_else(|err| {
|
||||||
} else {
|
error!("Failed to initialize BigTable ledger storage: {:?}", err);
|
||||||
None
|
None
|
||||||
};
|
})
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
};
|
||||||
|
|
||||||
let (request_processor, receiver) = JsonRpcRequestProcessor::new(
|
let (request_processor, receiver) = JsonRpcRequestProcessor::new(
|
||||||
config,
|
config,
|
||||||
|
|
|
@ -659,6 +659,13 @@ pub fn main() {
|
||||||
.help("Fetch historical transaction info from a BigTable instance \
|
.help("Fetch historical transaction info from a BigTable instance \
|
||||||
as a fallback to local ledger data"),
|
as a fallback to local ledger data"),
|
||||||
)
|
)
|
||||||
|
.arg(
|
||||||
|
Arg::with_name("enable_bigtable_ledger_upload")
|
||||||
|
.long("enable-bigtable-ledger-upload")
|
||||||
|
.requires("enable_rpc_transaction_history")
|
||||||
|
.takes_value(false)
|
||||||
|
.help("Upload new confirmed blocks into a BigTable instance"),
|
||||||
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("health_check_slot_distance")
|
Arg::with_name("health_check_slot_distance")
|
||||||
.long("health-check-slot-distance")
|
.long("health-check-slot-distance")
|
||||||
|
@ -976,6 +983,7 @@ pub fn main() {
|
||||||
enable_rpc_transaction_history: matches.is_present("enable_rpc_transaction_history"),
|
enable_rpc_transaction_history: matches.is_present("enable_rpc_transaction_history"),
|
||||||
enable_bigtable_ledger_storage: matches
|
enable_bigtable_ledger_storage: matches
|
||||||
.is_present("enable_rpc_bigtable_ledger_storage"),
|
.is_present("enable_rpc_bigtable_ledger_storage"),
|
||||||
|
enable_bigtable_ledger_upload: matches.is_present("enable_bigtable_ledger_upload"),
|
||||||
identity_pubkey: identity_keypair.pubkey(),
|
identity_pubkey: identity_keypair.pubkey(),
|
||||||
faucet_addr: matches.value_of("rpc_faucet_addr").map(|address| {
|
faucet_addr: matches.value_of("rpc_faucet_addr").map(|address| {
|
||||||
solana_net_utils::parse_host_port(address).expect("failed to parse faucet address")
|
solana_net_utils::parse_host_port(address).expect("failed to parse faucet address")
|
||||||
|
|
Loading…
Reference in New Issue