diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index 455474312d..31ef437375 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -174,9 +174,9 @@ jobs: - name: Run clippy (without extra features) run: | cargo clippy --manifest-path concordium-node/Cargo.toml --all -- -Dclippy::all - - name: Run clippy (with features 'instrumentation', 'collector', 'network_dump', 'database_emitter') + - name: Run clippy (with features 'instrumentation', 'collector', 'network_dump') run: | - cargo clippy --manifest-path concordium-node/Cargo.toml --features=instrumentation,collector,network_dump,database_emitter --all -- -Dclippy::all + cargo clippy --manifest-path concordium-node/Cargo.toml --features=instrumentation,collector,network_dump --all -- -Dclippy::all - name: Run clippy on collector backend run: | cargo clippy --manifest-path collector-backend/Cargo.toml -- -Dclippy::all diff --git a/CHANGELOG.md b/CHANGELOG.md index 67b394e0ef..dad4cc99f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,10 @@ This affects all queries whose input was a block or transaction hash. These queries now return `InvalidArgument` error, as opposed to `Unknown` which they returned previously. - +- Fix issue #244: Collector to keep querying. Remove the parameter for maximum allowed + times a gRPC call can fail and keeps `node-collector` querying forever. +- `GetAccountInfo` endpoint supports querying the account via the account index. + ## concordium-node 3.0.1 - Fix a starvation bug in some cases of parallel node queries. diff --git a/concordium-base b/concordium-base index e93409bed7..b53569a1bc 160000 --- a/concordium-base +++ b/concordium-base @@ -1 +1 @@ -Subproject commit e93409bed7e1848ef2e6f2273b10d8b4873674c7 +Subproject commit b53569a1bc438a2c70da0aa32eab479b18a44ad3 diff --git a/concordium-consensus/src/Concordium/External.hs b/concordium-consensus/src/Concordium/External.hs index e8281246c6..6b50505a3e 100644 --- a/concordium-consensus/src/Concordium/External.hs +++ b/concordium-consensus/src/Concordium/External.hs @@ -29,7 +29,6 @@ import qualified Data.FixedByteString as FBS import Concordium.Afgjort.Finalize.Types (FinalizationInstance (FinalizationInstance)) import Concordium.Birk.Bake import Concordium.Constants.Time (defaultEarlyBlockThreshold, defaultMaxBakingDelay) -import Concordium.Crypto.ByteStringHelpers import Concordium.GlobalState import Concordium.GlobalState.Persistent.LMDB (addDatabaseVersion) import Concordium.GlobalState.Persistent.TreeState (InitException (..)) @@ -891,15 +890,6 @@ decodeBlockHash blockcstr = readMaybe <$> peekCString blockcstr decodeAccountAddress :: CString -> IO (Either String AccountAddress) decodeAccountAddress acctstr = addressFromBytes <$> BS.packCString acctstr --- |Decode a null-terminated string as either an account address (base-58) or a --- credential registration ID (base-16). -decodeAccountAddressOrCredId :: CString -> IO (Maybe (Either CredentialRegistrationID AccountAddress)) -decodeAccountAddressOrCredId str = do - bs <- BS.packCString str - return $ case addressFromBytes bs of - Left _ -> Left <$> bsDeserializeBase16 bs - Right acc -> Just $ Right acc - -- |Decode an instance address from a null-terminated JSON-encoded string. decodeInstanceAddress :: CString -> IO (Maybe ContractAddress) decodeInstanceAddress inststr = AE.decodeStrict <$> BS.packCString inststr @@ -1071,8 +1061,9 @@ getModuleList cptr blockcstr = do getAccountInfo :: StablePtr ConsensusRunner -> CString -> CString -> IO CString getAccountInfo cptr blockcstr acctcstr = do mblock <- decodeBlockHash blockcstr - maccount <- decodeAccountAddressOrCredId acctcstr - case (mblock, maccount) of + acctbs <- BS.packCString acctcstr + let account = decodeAccountIdentifier acctbs + case (mblock, account) of (Just bh, Just acct) -> jsonQuery cptr (Q.getAccountInfo bh acct) _ -> jsonCString AE.Null diff --git a/concordium-consensus/src/Concordium/GlobalState/Basic/BlockState.hs b/concordium-consensus/src/Concordium/GlobalState/Basic/BlockState.hs index 270e79aacd..0b83cc0686 100644 --- a/concordium-consensus/src/Concordium/GlobalState/Basic/BlockState.hs +++ b/concordium-consensus/src/Concordium/GlobalState/Basic/BlockState.hs @@ -424,6 +424,10 @@ instance (IsProtocolVersion pv, Monad m) => BS.BlockStateQuery (PureBlockStateMo Nothing -> return Nothing Just ai -> return $ (ai, ) <$> bs ^? blockAccounts . Accounts.indexedAccount ai + {-# INLINE getAccountByIndex #-} + getAccountByIndex bs ai = + return $ (ai, ) <$> bs ^? blockAccounts . Accounts.indexedAccount ai + {-# INLINE getBakerAccount #-} getBakerAccount bs (BakerId ai) = return $ bs ^? blockAccounts . Accounts.indexedAccount ai diff --git a/concordium-consensus/src/Concordium/GlobalState/BlockState.hs b/concordium-consensus/src/Concordium/GlobalState/BlockState.hs index 85f780a0a9..0536bc2898 100644 --- a/concordium-consensus/src/Concordium/GlobalState/BlockState.hs +++ b/concordium-consensus/src/Concordium/GlobalState/BlockState.hs @@ -291,6 +291,9 @@ class (ContractStateOperations m, AccountOperations m) => BlockStateQuery m wher -- |Query an account by the id of the credential that belonged to it. getAccountByCredId :: BlockState m -> CredentialRegistrationID -> m (Maybe (AccountIndex, Account m)) + -- |Query an account by the account index that belonged to it. + getAccountByIndex :: BlockState m -> AccountIndex -> m (Maybe (AccountIndex, Account m)) + -- |Get the contract state from the contract table of the state instance. getContractInstance :: BlockState m -> ContractAddress -> m (Maybe (InstanceInfo m)) @@ -760,6 +763,7 @@ instance (Monad (t m), MonadTrans t, BlockStateQuery m) => BlockStateQuery (MGST getAccount s = lift . getAccount s accountExists s = lift . accountExists s getAccountByCredId s = lift . getAccountByCredId s + getAccountByIndex s = lift . getAccountByIndex s getBakerAccount s = lift . getBakerAccount s getContractInstance s = lift . getContractInstance s getModuleList = lift . getModuleList @@ -790,6 +794,7 @@ instance (Monad (t m), MonadTrans t, BlockStateQuery m) => BlockStateQuery (MGST {-# INLINE getAccount #-} {-# INLINE accountExists #-} {-# INLINE getAccountByCredId #-} + {-# INLINE getAccountByIndex #-} {-# INLINE getBakerAccount #-} {-# INLINE getContractInstance #-} {-# INLINE getModuleList #-} diff --git a/concordium-consensus/src/Concordium/GlobalState/Paired.hs b/concordium-consensus/src/Concordium/GlobalState/Paired.hs index a9dcc50be8..8985cbeab4 100644 --- a/concordium-consensus/src/Concordium/GlobalState/Paired.hs +++ b/concordium-consensus/src/Concordium/GlobalState/Paired.hs @@ -222,6 +222,17 @@ instance (Monad m, C.HasGlobalStateContext (PairGSContext lc rc) r, BlockStateQu return Nothing (Nothing, _) -> error $ "Cannot get account with credid " ++ show cid ++ " in left implementation" (_, Nothing) -> error $ "Cannot get account with credid " ++ show cid ++ " in right implementation" + getAccountByIndex (ls, rs) idx = do + a1 <- coerceBSML (getAccountByIndex ls idx) + a2 <- coerceBSMR (getAccountByIndex rs idx) + case (a1, a2) of + (Just (ai1, a1'), Just (ai2, a2')) -> + assert ((getHash a1' :: H.Hash) == getHash a2' && ai1 == ai2) $ + return $ Just (ai1, (a1', a2')) + (Nothing, Nothing) -> + return Nothing + (Nothing, _) -> error $ "Cannot get account by index " ++ show idx ++ " in left implementation" + (_, Nothing) -> error $ "Cannot get account by index " ++ show idx ++ " in right implementation" getBakerAccount (ls, rs) bid = do a1 <- coerceBSML (getBakerAccount ls bid) a2 <- coerceBSMR (getBakerAccount rs bid) diff --git a/concordium-consensus/src/Concordium/GlobalState/Persistent/BlockState.hs b/concordium-consensus/src/Concordium/GlobalState/Persistent/BlockState.hs index bdcffae49c..4832ee3641 100644 --- a/concordium-consensus/src/Concordium/GlobalState/Persistent/BlockState.hs +++ b/concordium-consensus/src/Concordium/GlobalState/Persistent/BlockState.hs @@ -899,6 +899,10 @@ doGetAccountByCredId pbs cid = do bsp <- loadPBS pbs Accounts.getAccountByCredId cid (bspAccounts bsp) +doGetAccountByIndex :: (IsProtocolVersion pv, MonadBlobStore m) => PersistentBlockState pv -> AccountIndex -> m (Maybe (AccountIndex, PersistentAccount pv)) +doGetAccountByIndex pbs idx = do + bsp <- loadPBS pbs + fmap (idx, ) <$> Accounts.indexedAccount idx (bspAccounts bsp) doGetAccountIndex :: (IsProtocolVersion pv, MonadBlobStore m) => PersistentBlockState pv -> AccountAddress -> m (Maybe AccountIndex) doGetAccountIndex pbs addr = do @@ -1314,6 +1318,7 @@ instance (IsProtocolVersion pv, PersistentState r m) => BlockStateQuery (Persist getAccount = doGetAccount . hpbsPointers accountExists = doGetAccountExists . hpbsPointers getAccountByCredId = doGetAccountByCredId . hpbsPointers + getAccountByIndex = doGetAccountByIndex . hpbsPointers getContractInstance = doGetInstance . hpbsPointers getModuleList = doGetModuleList . hpbsPointers getAccountList = doAccountList . hpbsPointers diff --git a/concordium-consensus/src/Concordium/Queries.hs b/concordium-consensus/src/Concordium/Queries.hs index 58138bc06e..1f9910cd12 100644 --- a/concordium-consensus/src/Concordium/Queries.hs +++ b/concordium-consensus/src/Concordium/Queries.hs @@ -460,19 +460,22 @@ getModuleList :: BlockHash -> MVR gsconf finconf (Maybe [ModuleRef]) getModuleList = liftSkovQueryBlock $ BS.getModuleList <=< blockState -- |Get the details of an account in the block state. --- The account can be given either via an address, or via a credential registration id. +-- The account can be given via an address, an account index or a credential registration id. -- In the latter case we lookup the account the credential is associated with, even if it was -- removed from the account. getAccountInfo :: BlockHash -> - Either CredentialRegistrationID AccountAddress -> + AccountIdentifier -> MVR gsconf finconf (Maybe AccountInfo) getAccountInfo blockHash acct = join <$> liftSkovQueryBlock ( \bp -> do bs <- blockState bp - macc <- either (BS.getAccountByCredId bs) (BS.getAccount bs) acct + macc <- case acct of + AccAddress addr -> BS.getAccount bs addr + AccIndex idx -> BS.getAccountByIndex bs idx + CredRegID crid -> BS.getAccountByCredId bs crid forM macc $ \(aiAccountIndex, acc) -> do aiAccountNonce <- BS.getAccountNonce acc aiAccountAmount <- BS.getAccountAmount acc diff --git a/concordium-node/Cargo.toml b/concordium-node/Cargo.toml index f6ee53fc53..eec440aeeb 100644 --- a/concordium-node/Cargo.toml +++ b/concordium-node/Cargo.toml @@ -19,8 +19,6 @@ network_dump = [] static = [ ] profiling = [ "static" ] collector = [ "reqwest/default-tls", "serde/derive", "rmp-serde", "collector-backend" ] -database_emitter = [] -genesis_tester = [ "tempfile" ] [profile.release] codegen-units = 1 @@ -129,25 +127,10 @@ name = "node-collector" path = "src/bin/collector.rs" required-features = [ "collector" ] -[[bin]] -name = "network_stress_test" -path = "src/bin/network_stress_test.rs" -required-features = [ "test_utils" ] - [[bin]] name = "bootstrap_checker" path = "src/bin/bootstrap_checker.rs" -[[bin]] -name = "database_emitter" -path = "src/bin/database_emitter.rs" -required-features = [ "database_emitter" ] - -[[bin]] -name = "genesis_tester" -path = "src/bin/genesis_tester.rs" -required-features = [ "genesis_tester" ] - [[bench]] name = "p2p_lib_benchmark" required-features = [ "test_utils" ] diff --git a/concordium-node/README.md b/concordium-node/README.md index 89fe358523..f702de4455 100644 --- a/concordium-node/README.md +++ b/concordium-node/README.md @@ -20,8 +20,6 @@ * static - build against static haskell libraries (Linux only) * profiling - build against haskell libraries with profiling support enabled (Linux only) * collector - enables the build of the node-collector and backend -* database_emitter - enables building the database emitter binary to inject a database exported to a set of nodes -* genesis_tester - a tool used by a CI to validate the genesis data * dedup_benchmarks - enable support in the benchmarks for deduplication queues ## Building the node diff --git a/concordium-node/src/bin/collector.rs b/concordium-node/src/bin/collector.rs index d25d2d39c3..ee93954ca2 100644 --- a/concordium-node/src/bin/collector.rs +++ b/concordium-node/src/bin/collector.rs @@ -3,16 +3,7 @@ use collector_backend::{IsInBakingCommittee, NodeInfo}; use concordium_node::utils::setup_macos_logger; use concordium_node::{common::grpc_api, req_with_auth, utils::setup_logger}; use serde_json::Value; -use std::{ - borrow::ToOwned, - default::Default, - fmt, - process::exit, - str::FromStr, - sync::atomic::{AtomicUsize, Ordering as AtomicOrdering}, - thread, - time::Duration, -}; +use std::{borrow::ToOwned, fmt, process::exit, str::FromStr, time::Duration}; use structopt::StructOpt; use tonic::{metadata::MetadataValue, transport::channel::Channel, Request}; #[macro_use] @@ -50,7 +41,7 @@ struct ConfigCli { env = "CONCORDIUM_NODE_COLLECTOR_GRPC_AUTHENTICATION_TOKEN", hide_env_values = true )] - pub grpc_auth_token: String, + pub grpc_auth_token: String, #[structopt( long = "grpc-host", help = "gRPC host to collect from", @@ -58,51 +49,51 @@ struct ConfigCli { env = "CONCORDIUM_NODE_COLLECTOR_GRPC_HOST", use_delimiter = true // default delimiter is a comma )] - pub grpc_hosts: Vec, + pub grpc_hosts: Vec, #[structopt( long = "node-name", help = "Node name", env = "CONCORDIUM_NODE_COLLECTOR_NODE_NAME", use_delimiter = true // default delimiter is a comma )] - pub node_names: Vec, + pub node_names: Vec, #[structopt( long = "collector-url", help = "Alias submitted of the node collected from", default_value = "http://localhost:3000/post/nodes", env = "CONCORDIUM_NODE_COLLECTOR_URL" )] - pub collector_url: String, + pub collector_url: String, #[structopt( long = "print-config", help = "Print out config struct", env = "CONCORDIUM_NODE_COLLECTOR_PRINT_CONFIG" )] - pub print_config: bool, + pub print_config: bool, #[structopt( long = "debug", short = "d", help = "Debug mode", env = "CONCORDIUM_NODE_COLLECTOR_DEBUG" )] - pub debug: bool, + pub debug: bool, #[structopt(long = "trace", help = "Trace mode", env = "CONCORDIUM_NODE_COLLECTOR_TRACE")] - pub trace: bool, + pub trace: bool, #[structopt(long = "info", help = "Info mode", env = "CONCORDIUM_NODE_COLLECTOR_INFO")] - pub info: bool, + pub info: bool, #[structopt( long = "no-log-timestamp", help = "Do not output timestamp in log output", env = "CONCORDIUM_NODE_COLLECTOR_NO_LOG_TIMESTAMP" )] - pub no_log_timestamp: bool, + pub no_log_timestamp: bool, #[structopt( long = "collect-interval", help = "Interval in miliseconds to sleep between runs of the collector", default_value = "5000", env = "CONCORDIUM_NODE_COLLECTOR_COLLECT_INTERVAL" )] - pub collector_interval: u64, + pub collector_interval: u64, #[structopt( long = "artificial-start-delay", help = "Time (in ms) to delay when the first gRPC request is sent to the node", @@ -111,12 +102,12 @@ struct ConfigCli { )] pub artificial_start_delay: u64, #[structopt( - long = "max-grpc-failures-allowed", - help = "Maximum allowed times a gRPC call can fail before terminating the program", - default_value = "50", - env = "CONCORDIUM_NODE_COLLECTOR_MAX_GRPC_FAILURES_ALLOWED" + long = "grpc-timeout", + help = "Time (in seconds) for gRPC request timeouts", + default_value = "30", + env = "CONCORDIUM_NODE_COLLECTOR_GRPC_TIMEOUT" )] - pub max_grpc_failures_allowed: u64, + pub grpc_timeout: u64, #[cfg(target_os = "macos")] #[structopt( long = "use-mac-log", @@ -127,7 +118,7 @@ struct ConfigCli { env = "CONCORDIUM_NODE_COLLECTOR_USE_MAC_LOG", conflicts_with = "log-config" )] - pub use_mac_log: Option, + pub use_mac_log: Option, } #[tokio::main] @@ -159,18 +150,15 @@ async fn main() { if conf.artificial_start_delay > 0 { info!("Delaying first collection from the node for {} ms", conf.artificial_start_delay); - thread::sleep(Duration::from_millis(conf.artificial_start_delay)); + tokio::time::sleep(Duration::from_millis(conf.artificial_start_delay)).await; } - let atomic_counter: AtomicUsize = Default::default(); + let mut interval = tokio::time::interval(Duration::from_millis(conf.collector_interval)); #[allow(unreachable_code)] loop { - let grpc_failure_count = atomic_counter.load(AtomicOrdering::Relaxed); - trace!("Failure count is {}/{}", grpc_failure_count, conf.max_grpc_failures_allowed); for (node_name, grpc_host) in conf.node_names.iter().zip(conf.grpc_hosts.iter()) { trace!("Processing node {}/{}", node_name, grpc_host); - match collect_data(node_name.clone(), grpc_host.to_owned(), &conf.grpc_auth_token).await - { + match collect_data(node_name.clone(), grpc_host.to_owned(), &conf).await { Ok(node_info) => { trace!("Node data collected successfully from {}/{}", node_name, grpc_host); match rmp_serde::encode::to_vec(&node_info) { @@ -188,21 +176,15 @@ async fn main() { } } Err(e) => { - let _ = atomic_counter.fetch_add(1, AtomicOrdering::SeqCst); error!( "gRPC failed with \"{}\" for {}, sleeping for {} ms", e, &grpc_host, conf.collector_interval ); } } - - if grpc_failure_count + 1 >= conf.max_grpc_failures_allowed as usize { - error!("Too many gRPC failures, exiting!"); - exit(1); - } } trace!("Sleeping for {} ms", conf.collector_interval); - thread::sleep(Duration::from_millis(conf.collector_interval)); + interval.tick().await; } } @@ -210,14 +192,19 @@ async fn main() { async fn collect_data<'a>( node_name: NodeName, grpc_host: String, - grpc_auth_token: &str, + conf: &ConfigCli, ) -> anyhow::Result { + let grpc_auth_token = &conf.grpc_auth_token; + let grpc_timeout = conf.grpc_timeout; info!( "Collecting node information via gRPC from {}/{}/{}", node_name, grpc_host, grpc_auth_token ); - - let channel = Channel::from_shared(grpc_host).unwrap().connect().await?; + let channel = Channel::from_shared(grpc_host) + .unwrap() + .timeout(Duration::from_secs(grpc_timeout)) + .connect() + .await?; let mut client = grpc_api::p2p_client::P2pClient::new(channel); let empty_req = || req_with_auth!(grpc_api::Empty {}, grpc_auth_token); diff --git a/concordium-node/src/bin/database_emitter.rs b/concordium-node/src/bin/database_emitter.rs deleted file mode 100644 index cb7ea1e304..0000000000 --- a/concordium-node/src/bin/database_emitter.rs +++ /dev/null @@ -1,124 +0,0 @@ -#![recursion_limit = "1024"] -#[macro_use] -extern crate log; - -// Force the system allocator on every platform -use std::alloc::System; -#[global_allocator] -static A: System = System; - -use anyhow::{bail, Context}; -use concordium_node::{ - common::PeerType, - consensus_ffi::helpers::PacketType, - network::NetworkId, - p2p::{ - connectivity::{connect, send_broadcast_message}, - maintenance::{spawn, P2PNode}, - }, - stats_export_service::instantiate_stats_export_engine, - utils, -}; -use crypto_common::Serial; -use std::{fs::File, io::prelude::*, net::ToSocketAddrs, sync::Arc, thread, time::Duration}; - -fn main() -> anyhow::Result<()> { - let (mut conf, _app_prefs) = utils::get_config_and_logging_setup()?; - - conf.connection.no_bootstrap_dns = true; - conf.connection.desired_nodes = conf.connection.connect_to.len() as u16; - - let stats_export_service = instantiate_stats_export_engine(&conf)?; - - let (node, server, poll) = P2PNode::new( - conf.common.id, - &conf, - PeerType::Node, - stats_export_service, - Arc::new(Default::default()), - ) - .context("Failed to create the node")?; - - spawn(&node, server, poll, None); - - conf.connection.connect_to.iter().for_each( - |host: &String| match ToSocketAddrs::to_socket_addrs(&host) { - Ok(addrs) => { - for addr in addrs { - let _ = connect(&node, PeerType::Node, addr, None, false) - .map_err(|e| error!("{}", e)); - } - } - Err(err) => error!("Can't parse configured addresses to connect to: {}", err), - }, - ); - - info!("Sleeping to let network connections settle"); - thread::sleep(Duration::from_millis(10000)); - if !(node.connections().read().unwrap()).is_empty() { - info!("Connected to network"); - - if let Ok(mut file) = File::open(&conf.database_emitter.import_file) { - let mut counter = 0; - loop { - let mut block_len_buffer = [0; 8]; - if let Ok(read_bytes) = file.read(&mut block_len_buffer) { - if read_bytes != block_len_buffer.len() { - if read_bytes == 0 { - info!("No more blocks to be read from file"); - } else { - error!("No enough bytes to read"); - } - break; - } - let block_size = u64::from_be_bytes(block_len_buffer); - info!( - "Block#{} - will read {} bytes for block from file {}", - counter, block_size, &conf.database_emitter.import_file - ); - let mut blocks_data_buffer = vec![0; block_size as usize]; - if let Ok(blocks_bytes_read) = file.read(&mut blocks_data_buffer[..]) { - if blocks_bytes_read != block_size as usize { - error!( - "The file didn't contain all the {} byte(s) needed to properly \ - read the block!", - block_size - ); - break; - } - if counter < conf.database_emitter.skip_first { - info!("- skipping as per request"); - counter += 1; - continue; - } - let mut data_out = vec![0; 0]; - (PacketType::Block as u8).serial(&mut data_out); - data_out.extend(blocks_data_buffer); - info!( - "- Sent {} byte(s)", - send_broadcast_message( - &node, - vec![], - NetworkId::from(conf.common.network_ids.clone()[0]), - Arc::from(data_out), - ) - ); - } else { - bail!("Error reading block!"); - } - } else { - bail!("Can't read size of next block from file!"); - } - if counter != 0 && counter % conf.database_emitter.batch_sizes == 0 { - info!("Will stall for {} ms", &conf.database_emitter.delay_between_batches); - thread::sleep(Duration::from_millis( - conf.database_emitter.delay_between_batches, - )); - } - counter += 1; - } - } - } - - node.close_and_join() -} diff --git a/concordium-node/src/configuration.rs b/concordium-node/src/configuration.rs index 9fd94cbff7..25dcf9d162 100644 --- a/concordium-node/src/configuration.rs +++ b/concordium-node/src/configuration.rs @@ -80,42 +80,6 @@ pub const DATABASE_SUB_DIRECTORY_NAME: &str = "database-v4"; /// being dropped prematurely. const KEEP_ALIVE_FACTOR: u8 = 3; -#[cfg(feature = "database_emitter")] -#[derive(StructOpt, Debug)] -// Parameters related to the database emitter. -pub struct DatabaseEmitterConfig { - #[structopt( - long = "import-file", - help = "File to import from", - env = "CONCORDIUM_NODE_DB_EMITTER_IMPORT_FILE" - )] - pub import_file: String, - - #[structopt( - long = "batches-delay", - help = "Delay between batches in miliseconds", - default_value = "2000", - env = "CONCORDIUM_NODE_DB_EMITTER_BATCHES_DELAY" - )] - pub delay_between_batches: u64, - - #[structopt( - long = "batch-size", - help = "Size of each batch to emit", - default_value = "40", - env = "CONCORDIUM_NODE_DB_EMITTER_BATCH_SIZES" - )] - pub batch_sizes: u64, - - #[structopt( - long = "skip-first", - help = "Amount of the initial blocks to skip", - default_value = "0", - env = "CONCORDIUM_NODE_DB_EMITTER_SKIP_FIRST" - )] - pub skip_first: u64, -} - #[cfg(feature = "instrumentation")] #[derive(StructOpt, Debug)] // Parameters related to Prometheus. @@ -778,22 +742,19 @@ pub struct MacOsConfig { #[structopt(about = "Concordium P2P node.")] pub struct Config { #[structopt(flatten)] - pub common: CommonConfig, + pub common: CommonConfig, #[cfg(feature = "instrumentation")] #[structopt(flatten)] - pub prometheus: PrometheusConfig, - #[structopt(flatten)] - pub connection: ConnectionConfig, + pub prometheus: PrometheusConfig, #[structopt(flatten)] - pub cli: CliConfig, + pub connection: ConnectionConfig, #[structopt(flatten)] - pub bootstrapper: BootstrapperConfig, - #[cfg(feature = "database_emitter")] + pub cli: CliConfig, #[structopt(flatten)] - pub database_emitter: DatabaseEmitterConfig, + pub bootstrapper: BootstrapperConfig, #[cfg(target_os = "macos")] #[structopt(flatten)] - pub macos: MacOsConfig, + pub macos: MacOsConfig, } impl Config { diff --git a/scripts/test-genesis.sh b/scripts/test-genesis.sh deleted file mode 100755 index f0446d144f..0000000000 --- a/scripts/test-genesis.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash -set -e -GENESIS_TESTER_BIN="concordium-node/target/debug/genesis_tester" - -rm -rf genesis-data-test -mkdir genesis-data-test -tar xzf genesis-data/$1 -C genesis-data-test - -if [ -n "$2" ]; then - echo "Testing genesis $1 and private key $2" - $GENESIS_TESTER_BIN --genesis-file genesis-data-test/genesis_data/genesis.dat --private-key-file genesis-data-test/genesis_data/baker-$2-credentials.json -else - echo "Testing genesis $1" - $GENESIS_TESTER_BIN --genesis-file genesis-data-test/genesis_data/genesis.dat -fi