File tree 1 file changed +14
-4
lines changed
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change
1
+ use std:: collections:: HashMap ;
2
+
1
3
use gasket:: framework:: * ;
2
4
use pallas:: interop:: utxorpc:: spec:: sync:: BlockRef ;
3
5
use pallas:: network:: miniprotocols:: Point ;
@@ -86,11 +88,17 @@ impl gasket::framework::Worker<Stage> for Worker {
86
88
async fn bootstrap ( stage : & Stage ) -> Result < Self , WorkerError > {
87
89
debug ! ( "connecting" ) ;
88
90
89
- let mut client = ClientBuilder :: new ( )
91
+ let mut builder = ClientBuilder :: new ( )
90
92
. uri ( stage. config . url . as_str ( ) )
91
- . or_panic ( ) ?
92
- . build :: < CardanoSyncClient > ( )
93
- . await ;
93
+ . or_panic ( ) ?;
94
+
95
+ for ( key, value) in stage. config . metadata . iter ( ) {
96
+ builder = builder
97
+ . metadata ( key. to_string ( ) , value. to_string ( ) )
98
+ . or_panic ( ) ?;
99
+ }
100
+
101
+ let mut client = builder. build :: < CardanoSyncClient > ( ) . await ;
94
102
95
103
let intersect: Vec < _ > = if stage. breadcrumbs . is_empty ( ) {
96
104
stage. intersect . points ( ) . unwrap_or_default ( )
@@ -158,6 +166,8 @@ pub struct Stage {
158
166
#[ derive( Deserialize ) ]
159
167
pub struct Config {
160
168
url : String ,
169
+ metadata : HashMap < String , String > ,
170
+ #[ serde( default ) ]
161
171
use_parsed_blocks : bool ,
162
172
}
163
173
You can’t perform that action at this time.
0 commit comments