@@ -100,7 +100,7 @@ async fn main() -> Result<()> {
100100 info ! ( "Starting discovery service in {:?} mode" , args. mode) ;
101101
102102 match args. mode {
103- ServiceMode :: Processor => {
103+ ServiceMode :: Processor | ServiceMode :: Full => {
104104 let chain_sync = ChainSync :: new (
105105 node_store. clone ( ) ,
106106 cancellation_token. clone ( ) ,
@@ -110,10 +110,6 @@ async fn main() -> Result<()> {
110110 ) ;
111111 chain_sync. run ( ) . await ?;
112112
113- tokio:: signal:: ctrl_c ( ) . await ?;
114- cancellation_token. cancel ( ) ;
115- }
116- ServiceMode :: Api => {
117113 if let Err ( err) = start_server (
118114 "0.0.0.0" ,
119115 args. port ,
@@ -123,23 +119,17 @@ async fn main() -> Result<()> {
123119 args. platform_api_key ,
124120 last_chain_sync,
125121 args. max_nodes_per_ip ,
126- false ,
122+ true ,
127123 )
128124 . await
129125 {
130126 error ! ( "❌ Failed to start server: {}" , err) ;
131127 }
132- }
133- ServiceMode :: Full => {
134- let chain_sync = ChainSync :: new (
135- node_store. clone ( ) ,
136- cancellation_token. clone ( ) ,
137- Duration :: from_secs ( 10 ) ,
138- contracts. clone ( ) ,
139- last_chain_sync. clone ( ) ,
140- ) ;
141- chain_sync. run ( ) . await ?;
142128
129+ tokio:: signal:: ctrl_c ( ) . await ?;
130+ cancellation_token. cancel ( ) ;
131+ }
132+ ServiceMode :: Api => {
143133 if let Err ( err) = start_server (
144134 "0.0.0.0" ,
145135 args. port ,
@@ -149,14 +139,12 @@ async fn main() -> Result<()> {
149139 args. platform_api_key ,
150140 last_chain_sync,
151141 args. max_nodes_per_ip ,
152- true ,
142+ false ,
153143 )
154144 . await
155145 {
156146 error ! ( "❌ Failed to start server: {}" , err) ;
157147 }
158-
159- cancellation_token. cancel ( ) ;
160148 }
161149 }
162150
0 commit comments