Accountsdb: support config in Json5 (#22605)

* accountsdb: support config in json5

* update docs

* remove not required dependencies

Co-authored-by: Lijun Wang <83639177+lijunwangs@users.noreply.github.com>
This commit is contained in:
Kirill Fomichev
2022-01-23 05:00:06 +03:00
committed by GitHub
parent 92e43df266
commit 31ed4c18f9
4 changed files with 115 additions and 16 deletions

View File

@@ -9,7 +9,6 @@ use {
},
crossbeam_channel::Receiver,
log::*,
serde_json,
solana_rpc::{
optimistically_confirmed_bank_tracker::BankNotification,
transaction_notifier_interface::TransactionNotifierLock,
@@ -156,12 +155,12 @@ impl AccountsDbPluginService {
)));
}
let result: serde_json::Value = match serde_json::from_str(&contents) {
let result: serde_json::Value = match json5::from_str(&contents) {
Ok(value) => value,
Err(err) => {
return Err(AccountsdbPluginServiceError::InvalidConfigFileFormat(
format!(
"The config file {:?} is not in a valid Json format, error: {:?}",
"The config file {:?} is not in a valid Json5 format, error: {:?}",
accountsdb_plugin_config_file, err
),
));