@@ -17,9 +17,12 @@ use std::path::PathBuf;
17
17
18
18
use nautilus_common:: enums:: Environment ;
19
19
use nautilus_core:: env:: get_env_var;
20
- use nautilus_databento:: factories:: { DatabentoDataClientFactory , DatabentoLiveClientConfig } ;
20
+ use nautilus_databento:: {
21
+ actor:: { DatabentoSubscriberActor , DatabentoSubscriberActorConfig } ,
22
+ factories:: { DatabentoDataClientFactory , DatabentoLiveClientConfig } ,
23
+ } ;
21
24
use nautilus_live:: node:: LiveNode ;
22
- use nautilus_model:: identifiers:: TraderId ;
25
+ use nautilus_model:: identifiers:: { ClientId , InstrumentId , TraderId } ;
23
26
use tokio:: time:: Duration ;
24
27
25
28
// Run with `cargo run -p nautilus-databento --bin databento-node-test --features live`
@@ -53,7 +56,6 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
53
56
"⚠️ Publishers file not found at: {}" ,
54
57
publishers_filepath. display( )
55
58
) ;
56
- println ! ( " This is expected in CI/test environments" ) ;
57
59
}
58
60
59
61
// Configure Databento client
@@ -66,17 +68,27 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
66
68
67
69
let client_factory = Box :: new ( DatabentoDataClientFactory :: new ( ) ) ;
68
70
71
+ // Create and register a Databento subscriber actor
72
+ let client_id = ClientId :: new ( "DATABENTO" ) ;
73
+ let instrument_ids = vec ! [
74
+ InstrumentId :: from( "ES.c.0.GLBX" ) ,
75
+ // Add more instruments as needed
76
+ ] ;
77
+
69
78
// Build the live node with Databento data client
70
79
let mut node = LiveNode :: builder ( node_name, trader_id, environment) ?
71
80
. with_load_state ( false )
72
81
. with_save_state ( false )
73
- . add_data_client (
74
- Some ( "DATABENTO" . to_string ( ) ) , // Use custom name
75
- client_factory,
76
- Box :: new ( databento_config) ,
77
- ) ?
82
+ . add_data_client ( None , client_factory, Box :: new ( databento_config) ) ?
78
83
. build ( ) ?;
79
84
85
+ // TODO: Move this into trader registration
86
+ let actor_config = DatabentoSubscriberActorConfig :: new ( instrument_ids, client_id) ;
87
+ let cache = node. kernel ( ) . cache ( ) ;
88
+ let clock = node. kernel ( ) . clock ( ) ;
89
+ let actor = DatabentoSubscriberActor :: new ( actor_config, cache, clock) ;
90
+ node. add_actor ( Box :: new ( actor) ) ?;
91
+
80
92
node. start ( ) . await ?;
81
93
82
94
// Let it run briefly to ensure all components are properly initialized
0 commit comments