diff --git a/Cargo.lock b/Cargo.lock index 5bf69cbb31..1f7f1ee9f1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4115,6 +4115,7 @@ dependencies = [ "gstuff", "hex 0.4.3", "lazy_static", + "mm2_event_stream", "mm2_metrics", "mm2_rpc", "primitives", @@ -4183,6 +4184,19 @@ dependencies = [ "web3", ] +[[package]] +name = "mm2_event_stream" +version = "0.1.0" +dependencies = [ + "async-trait", + "cfg-if 1.0.0", + "common", + "parking_lot 0.12.0", + "serde", + "tokio", + "wasm-bindgen-test", +] + [[package]] name = "mm2_git" version = "0.1.0" @@ -4278,6 +4292,7 @@ dependencies = [ "mm2_core", "mm2_db", "mm2_err_handle", + "mm2_event_stream", "mm2_gui_storage", "mm2_io", "mm2_metrics", @@ -4373,6 +4388,7 @@ dependencies = [ name = "mm2_net" version = "0.1.0" dependencies = [ + "async-stream", "async-trait", "bytes 1.1.0", "cfg-if 1.0.0", @@ -4386,9 +4402,13 @@ dependencies = [ "hyper", "js-sys", "lazy_static", + "mm2-libp2p", "mm2_core", "mm2_err_handle", + "mm2_event_stream", "mm2_state_machine", + "mocktopus", + "parking_lot 0.12.0", "prost", "rand 0.7.3", "rustls 0.20.4", diff --git a/Cargo.toml b/Cargo.toml index a3f3e98803..a7cf3badf3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,44 +1,45 @@ [workspace] members = [ + "mm2src/coins_activation", "mm2src/coins", "mm2src/coins/utxo_signer", - "mm2src/coins_activation", "mm2src/common/shared_ref_counter", "mm2src/crypto", "mm2src/db_common", "mm2src/derives/enum_from", - "mm2src/derives/ser_error", "mm2src/derives/ser_error_derive", + "mm2src/derives/ser_error", "mm2src/floodsub", "mm2src/gossipsub", - "mm2src/mm2_gui_storage", "mm2src/hw_common", "mm2src/mm2_bin_lib", - "mm2src/mm2_bitcoin/crypto", "mm2src/mm2_bitcoin/chain", + "mm2src/mm2_bitcoin/crypto", "mm2src/mm2_bitcoin/keys", - "mm2src/mm2_bitcoin/rpc", "mm2src/mm2_bitcoin/primitives", + "mm2src/mm2_bitcoin/rpc", "mm2src/mm2_bitcoin/script", - "mm2src/mm2_bitcoin/serialization", "mm2src/mm2_bitcoin/serialization_derive", + "mm2src/mm2_bitcoin/serialization", "mm2src/mm2_bitcoin/test_helpers", "mm2src/mm2_core", "mm2src/mm2_db", "mm2src/mm2_err_handle", "mm2src/mm2_eth", + "mm2src/mm2_event_stream", "mm2src/mm2_git", + "mm2src/mm2_gui_storage", "mm2src/mm2_io", "mm2src/mm2_libp2p", + "mm2src/mm2_main", "mm2src/mm2_metamask", "mm2src/mm2_metrics", - "mm2src/mm2_main", "mm2src/mm2_net", "mm2src/mm2_number", "mm2src/mm2_rpc", "mm2src/mm2_state_machine", - "mm2src/rpc_task", "mm2src/mm2_test_helpers", + "mm2src/rpc_task", "mm2src/trezor", ] diff --git a/examples/sse/README.md b/examples/sse/README.md new file mode 100644 index 0000000000..b43c213d02 --- /dev/null +++ b/examples/sse/README.md @@ -0,0 +1,14 @@ +# Listening event-stream from komodo-defi-framework + +1. Start komodo-defi-framework with event streaming activated +2. Run a local HTTP server + - if you use Python 3, run: + ``` + python3 -m http.server 8000 + ``` + - if you use Python 2, run: + ``` + python -m SimpleHTTPServer 8000 + ``` + +You should now be able to observe events from the komodo-defi-framework through the SSE. diff --git a/examples/sse/index.html b/examples/sse/index.html new file mode 100644 index 0000000000..e780004ccb --- /dev/null +++ b/examples/sse/index.html @@ -0,0 +1,26 @@ + + + +
+ +