@@ -18,6 +18,7 @@ use tokio::sync::RwLock;
18
18
#[ derive( Debug ) ]
19
19
pub struct AggregatorConfig < ' a > {
20
20
pub is_master : bool ,
21
+ pub index : usize ,
21
22
pub name : & ' a str ,
22
23
pub server_port : u64 ,
23
24
pub pool_node : & ' a PoolNode ,
@@ -39,6 +40,7 @@ pub struct AggregatorConfig<'a> {
39
40
#[ derive( Debug ) ]
40
41
pub struct Aggregator {
41
42
is_master : bool ,
43
+ index : usize ,
42
44
name_suffix : String ,
43
45
server_port : u64 ,
44
46
db_directory : PathBuf ,
@@ -134,6 +136,7 @@ impl Aggregator {
134
136
135
137
Ok ( Self {
136
138
is_master : aggregator_config. is_master ,
139
+ index : aggregator_config. index ,
137
140
name_suffix : aggregator_config. name . to_string ( ) ,
138
141
server_port : aggregator_config. server_port ,
139
142
db_directory : aggregator_config. pool_node . db_path . clone ( ) ,
@@ -145,6 +148,7 @@ impl Aggregator {
145
148
pub fn copy_configuration ( other : & Aggregator ) -> Self {
146
149
Self {
147
150
is_master : other. is_master ,
151
+ index : other. index ,
148
152
name_suffix : other. name_suffix . clone ( ) ,
149
153
server_port : other. server_port ,
150
154
db_directory : other. db_directory . clone ( ) ,
@@ -157,6 +161,10 @@ impl Aggregator {
157
161
self . is_master
158
162
}
159
163
164
+ pub fn index ( & self ) -> usize {
165
+ self . index
166
+ }
167
+
160
168
pub fn name ( & self ) -> String {
161
169
format ! ( "mithril-aggregator-{}" , self . name_suffix)
162
170
}
0 commit comments