Chain head subscription (#126)

* Start WebSockets server.

* Expose non-working subscription.

* Dummy subscription for testing.

* Proper implementation with event loop.

* Finalized pubsub.

* Bump clap.

* Fix yml.

* Disable WS logs.

* Remove stale TransactionHash mention

* Fix build from nightly API change.

* Don't panic on invalid port.

* Bind server to random port.

* Send only best blocks.
This commit is contained in:
Tomasz Drwięga
2018-04-17 13:03:57 +02:00
committed by Gav Wood
parent eb6d142846
commit e253a4cb9f
18 changed files with 464 additions and 107 deletions
+7 -1
View File
@@ -29,7 +29,13 @@ fn should_return_header() {
digest: Default::default(),
};
let client = Arc::new(client::new_in_mem(executor::WasmExecutor, || (test_genesis_block.clone(), vec![])).unwrap());
let core = ::tokio_core::reactor::Core::new().unwrap();
let remote = core.remote();
let client = Chain {
client: Arc::new(client::new_in_mem(executor::WasmExecutor, || (test_genesis_block.clone(), vec![])).unwrap()),
subscriptions: Subscriptions::new(remote),
};
assert_matches!(
ChainApi::header(&client, test_genesis_block.blake2_256().into()),