Adjust the RPC service for the WASM-browser use case (#3013)

* Use SpawnTaskHandle to pass to the RPC

* Create the RPC server in lib.rs

* Create the RPC servers in a separate function

* Keep a local version of the RPC handlers

* Make rpc-servers compile for WASM

* Add RpcSesssion

* Clean up

* Address review

* Address pull request review
This commit is contained in:
Pierre Krieger
2019-07-05 09:55:50 +02:00
committed by Gavin Wood
parent 13164304b3
commit 8bca52128f
5 changed files with 199 additions and 160 deletions
+4 -2
View File
@@ -5,10 +5,12 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
http = { package = "jsonrpc-http-server", version = "12.0.0" }
pubsub = { package = "jsonrpc-pubsub", version = "12.0.0" }
ws = { package = "jsonrpc-ws-server", version = "12.0.0" }
log = "0.4"
serde = "1.0"
substrate-rpc = { path = "../rpc" }
sr-primitives = { path = "../sr-primitives" }
[target.'cfg(not(target_os = "unknown"))'.dependencies]
http = { package = "jsonrpc-http-server", version = "12.0.0" }
ws = { package = "jsonrpc-ws-server", version = "12.0.0" }