aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/config.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
index 112fb3c..0584c31 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -1,8 +1,19 @@
1//! # Configuration 1//! # Configuration
2//! 2//!
3//! This module holds the data structures for network configuration. 3//! This module holds the data structures for network configuration.
4use crate::block::Fingerprint;
4use log::{error, info}; 5use log::{error, info};
5use serde::{Deserialize, Serialize}; 6use serde::{Deserialize, Serialize};
7use std::collections::HashMap;
8
9
10/// Configuration struct for a single bot
11#[derive(Debug, Serialize, Deserialize, Clone, Default)]
12pub struct BotConfig {
13 /// The initial balance of this bot.
14 pub starting_balance: u16,
15}
16
6 17
7/// Configuration for a single network 18/// Configuration for a single network
8#[derive(Debug, Serialize, Deserialize, Clone, Default)] 19#[derive(Debug, Serialize, Deserialize, Clone, Default)]
@@ -47,6 +58,10 @@ pub struct Config {
47 58
48 /// Transaction traffic reward 59 /// Transaction traffic reward
49 pub tx_traffic_reward: u16, 60 pub tx_traffic_reward: u16,
61
62 /// The configuration of the bots in this network.
63 /// Maps bot fingerprints to their configurations.
64 pub bots: HashMap<Fingerprint, BotConfig>,
50} 65}
51 66
52impl Config { 67impl Config {