@@ -126,48 +126,34 @@ impl Agent {
126126 let mut jhs = vec ! [ ] ;
127127
128128 // Create the Application State.
129- let state = Arc :: new ( state:: State :: new ( self . config . state . clone ( ) ) . await ) ;
129+ let state = Arc :: new ( state:: State :: new ( & self . config ) . await ) ;
130130
131131 // Spawn the primary network Oracle.
132- {
133- // Publisher permissions updates between oracle and exporter
134- let ( publisher_permissions_tx, publisher_permissions_rx) =
135- watch:: channel ( <_ >:: default ( ) ) ;
136-
137- jhs. push ( tokio:: spawn ( services:: oracle (
138- self . config . primary_network . clone ( ) ,
139- network:: Network :: Primary ,
140- state. clone ( ) ,
141- publisher_permissions_tx. clone ( ) ,
142- ) ) ) ;
132+ jhs. push ( tokio:: spawn ( services:: oracle (
133+ self . config . primary_network . clone ( ) ,
134+ network:: Network :: Primary ,
135+ state. clone ( ) ,
136+ ) ) ) ;
143137
144- // Spawn the primary network
145- jhs. extend ( network:: spawn_network (
146- self . config . primary_network . clone ( ) ,
147- network:: Network :: Primary ,
148- state. clone ( ) ,
149- publisher_permissions_rx. clone ( ) ,
150- ) ?) ;
151- }
138+ jhs. push ( tokio:: spawn ( services:: exporter (
139+ self . config . primary_network . clone ( ) ,
140+ network:: Network :: Primary ,
141+ state. clone ( ) ,
142+ ) ) ) ;
152143
153144 // Spawn the secondary network Oracle, if needed.
154145 if let Some ( config) = & self . config . secondary_network {
155- let ( publisher_permissions_tx, publisher_permissions_rx) =
156- watch:: channel ( <_ >:: default ( ) ) ;
157-
158146 jhs. push ( tokio:: spawn ( services:: oracle (
159147 config. clone ( ) ,
160148 network:: Network :: Secondary ,
161149 state. clone ( ) ,
162- publisher_permissions_tx. clone ( ) ,
163150 ) ) ) ;
164151
165- jhs. extend ( network :: spawn_network (
152+ jhs. push ( tokio :: spawn ( services :: exporter (
166153 config. clone ( ) ,
167154 network:: Network :: Secondary ,
168155 state. clone ( ) ,
169- publisher_permissions_rx,
170- ) ?) ;
156+ ) ) ) ;
171157 }
172158
173159 // Create the Notifier task for the Pythd RPC.
0 commit comments