1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
// Copyright (c) 2022 MASSA LABS <info@massa.net>
use massa_deferred_calls::config::DeferredCallsConfig;
use massa_models::amount::Amount;
use massa_signature::KeyPair;
use massa_time::MassaTime;
use std::net::SocketAddr;
use std::path::PathBuf;
use serde::Deserialize;
/// API settings.
/// the API settings
#[derive(Debug, Deserialize, Clone)]
pub struct APIConfig {
/// when looking for next draw we want to look at max `draw_lookahead_period_count`
pub draw_lookahead_period_count: u64,
/// bind for the private API
pub bind_private: SocketAddr,
/// bind for the public API
pub bind_public: SocketAddr,
/// bind for the Massa API
pub bind_api: SocketAddr,
/// max argument count
pub max_arguments: u64,
/// openrpc specification path
pub openrpc_spec_path: PathBuf,
/// bootstrap whitelist path
pub bootstrap_whitelist_path: PathBuf,
/// bootstrap blacklist path
pub bootstrap_blacklist_path: PathBuf,
/// maximum size in bytes of a request.
pub max_request_body_size: u32,
/// maximum size in bytes of a response.
pub max_response_body_size: u32,
/// maximum number of incoming connections allowed.
pub max_connections: u32,
/// maximum number of subscriptions per connection.
pub max_subscriptions_per_connection: u32,
/// max length for logging for requests and responses. Logs bigger than this limit will be truncated.
pub max_log_length: u32,
/// host filtering.
pub allow_hosts: Vec<String>,
/// batch request limit. 0 means disabled.
pub batch_request_limit: u32,
/// the interval at which `Ping` frames are submitted.
pub ping_interval: MassaTime,
/// whether to enable HTTP.
pub enable_http: bool,
/// whether to enable WS.
pub enable_ws: bool,
/// max datastore value length
pub max_datastore_value_length: u64,
/// max op datastore entry
pub max_op_datastore_entry_count: u64,
/// max datastore key length
pub max_op_datastore_key_length: u8,
/// max datastore value length
pub max_op_datastore_value_length: u64,
/// max function name length
pub max_function_name_length: u16,
/// max parameter size
pub max_parameter_size: u32,
/// max gas in a block
pub max_gas_per_block: u64,
/// base gas used by any operation
pub base_operation_gas_cost: u64,
/// Amount required for a SinglePass compilation (ExecuteSC operation)
pub sp_compilation_cost: u64,
/// thread count
pub thread_count: u8,
/// `genesis_timestamp`
pub genesis_timestamp: MassaTime,
/// t0
pub t0: MassaTime,
/// periods per cycle
pub periods_per_cycle: u64,
/// keypair file
pub keypair: KeyPair,
/// last_start_period value, used to know if we are during a restart or not
pub last_start_period: u64,
/// chain id
pub chain_id: u64,
/// Delta to compute upper bounds when fetching deferred credits
pub deferred_credits_delta: MassaTime,
/// minimal fees to include an operation in a block
pub minimal_fees: Amount,
/// deferred calls config
pub deferred_calls_config: DeferredCallsConfig,
}