Skip to content

Commit

Permalink
fix(example): Fixed the indexer SystemRunner to run
Browse files Browse the repository at this point in the history
Test Plan:
```
sandi@sandi-ThinkPad-X1-Carbon-7th ~/w/n/n/t/i/example (master)> cargo run -p indexer-example run
   Compiling indexer-example v0.1.0 (/home/sandi/workspace/near/nearcore/tools/indexer/example)
    Finished dev [unoptimized + debuginfo] target(s) in 34.21s
     Running `/home/sandi/workspace/near/nearcore/target/debug/indexer-example run`
Mar 15 15:15:15.352  INFO indexer: Starting Streamer...
Mar 15 15:15:15.363  INFO stats: Server listening at ed25519:HumL9eo6ZHmNNkwmB6LpswH3YP7AA2RCjPR476LErS1i@0.0.0.0:24567
Mar 15 15:15:17.385  INFO indexer_example: #1 HNA6J8v6LHv6Ak3uD4X81GPS2sfvDgMHZhoy69AXJwkr Chunks: 0, Transactions: 0, Receipts: 0, ExecutionOutcomes: 0
Mar 15 15:15:18.401  INFO indexer_example: #2 5K2rKMqBUAua9eCA3uP46t3yntNZ8vbEFRLnBazBB6wH Chunks: 1, Transactions: 0, Receipts: 0, ExecutionOutcomes: 0
Mar 15 15:15:18.913  INFO indexer_example: #3 C6mu4VXWerLBr1gBnBGexz2q5nMdLNbNbsw6Md2uxLWE Chunks: 1, Transactions: 0, Receipts: 0, ExecutionOutcomes: 0
Mar 15 15:15:19.422  INFO indexer_example: #4 4Jh9G9WRWA3YuqCtRPrE8WuSWxvcyDfmLAPKU3YxPyvM Chunks: 1, Transactions: 0, Receipts: 0, ExecutionOutcomes: 0
Mar 15 15:15:19.930  INFO indexer_example: #5 3MaretjoFgfcUoAcA7x9SvfvJf7Bi7mSjtXC9o1Z2RZB Chunks: 1, Transactions: 0, Receipts: 0, ExecutionOutcomes: 0
Mar 15 15:15:20.461  INFO indexer_example: #6 644pcD9ZSz6dwjKpgc184RfnuXG6xB5pgwKT732ndRdt Chunks: 1, Transactions: 0, Receipts: 0, ExecutionOutcomes: 0
Mar 15 15:15:21.489  INFO indexer_example: #7 rj8gRGK9n7SiLLsbsBnoFhnMNtrP424JQzaaWFE3mEo Chunks: 1, Transactions: 0, Receipts: 0, ExecutionOutcomes: 0
Mar 15 15:15:21.997  INFO indexer_example: #8 2mQDVeaZZ12o68DSZA9mwxeCRBpKfZ2PqripV9tT9CGC Chunks: 1, Transactions: 0, Receipts: 0, ExecutionOutcomes: 0
Mar 15 15:15:22.510  INFO indexer_example: #9 6sF7tWNLP9YCD2hxzicVHVwXVccQXn1xmXepKBcWJEGS Chunks: 1, Transactions: 0, Receipts: 0, ExecutionOutcomes: 0
Mar 15 15:15:23.024  INFO indexer_example: #10 5yCfSrTKq51XMKhDKCHTJ9foEvNiNWwWmeMF16nCft19 Chunks: 1, Transactions: 0, Receipts: 0, ExecutionOutcomes: 0
^CMar 15 15:15:23.565  INFO indexer_example: #11 6cW7QqzYBsUwNzJPUAXS5QPEtrEn4LFUFWtNNLyKtMF9 Chunks: 1, Transactions: 0, Receipts: 0, ExecutionOutcomes: 0
```
  • Loading branch information
chefsale committed Mar 15, 2021
1 parent acb26a3 commit 2f3685b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/indexer/example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,13 @@ fn main() {
sync_mode: near_indexer::SyncModeEnum::FromInterruption,
await_for_node_synced: near_indexer::AwaitForNodeSyncedEnum::WaitForFullSync,
};
actix::System::new().block_on(async move {
let system = actix::System::new();
system.block_on(async move {
let indexer = near_indexer::Indexer::new(indexer_config);
let stream = indexer.streamer();
actix::spawn(listen_blocks(stream));
});
system.run().unwrap();
}
SubCommand::Init(config) => near_indexer::indexer_init_configs(&home_dir, config.into()),
}
Expand Down

0 comments on commit 2f3685b

Please sign in to comment.