Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

jsonrpsee integration #8783

Merged
merged 350 commits into from
May 10, 2022
Merged
Show file tree
Hide file tree
Changes from 78 commits
Commits
Show all changes
350 commits
Select commit Hold shift + click to select a range
b995567
Add tokio
dvdplm Aug 30, 2021
d8fa4f0
No need to map CallError to CallError
dvdplm Aug 30, 2021
d75493e
jsonrpsee proc macros (#9673)
niklasad1 Sep 3, 2021
11b26f1
Port over system_ rpc tests
dvdplm Sep 6, 2021
3cc43c2
Make it compile
dvdplm Sep 6, 2021
5f66746
Use prost 0.8
dvdplm Sep 6, 2021
6d6c1ff
Use prost 0.8
dvdplm Sep 6, 2021
ca95c8b
Make it compile
dvdplm Sep 6, 2021
dc56989
Merge branch 'dp-jsonrpsee-integration-2' into dp-rpc-testing
dvdplm Sep 6, 2021
67f4d6d
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Sep 6, 2021
c45bff5
Ignore more failing tests
dvdplm Sep 6, 2021
dc8a2d0
Comment out WIP tests
dvdplm Sep 6, 2021
6ceeb07
fix nit in frame system api
niklasad1 Sep 6, 2021
174cbdd
Update lockfile
dvdplm Sep 6, 2021
b1ff6a7
No more juggling tokio versions
dvdplm Sep 6, 2021
1a74a64
No more wait_for_stop ?
dvdplm Sep 6, 2021
0eda45a
Remove browser-testing
dvdplm Sep 6, 2021
cb1f907
Arguments must be arrays
dvdplm Sep 6, 2021
d65a931
Use same argument names
dvdplm Sep 6, 2021
391d547
Resolve todo: no wait_for_stop for WS server
dvdplm Sep 6, 2021
f58eedb
fmt
dvdplm Sep 6, 2021
a88917f
log
dvdplm Sep 7, 2021
f96f0b5
One test passes
dvdplm Sep 8, 2021
d3e43d4
update jsonrpsee
niklasad1 Sep 8, 2021
ae96494
update jsonrpsee
niklasad1 Sep 13, 2021
32e206a
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Sep 13, 2021
dbd10d9
cleanup rpc-servers crate
niklasad1 Sep 14, 2021
ce666f0
jsonrpsee: add host and origin filtering (#9787)
niklasad1 Sep 15, 2021
d4cfa37
remove unused files
niklasad1 Sep 16, 2021
210816a
resolve some todos
niklasad1 Sep 16, 2021
68ff17e
jsonrpsee more cleanup (#9803)
niklasad1 Sep 17, 2021
43af2b4
update jsonrpsee
niklasad1 Sep 17, 2021
959f406
downgrade zeroize
niklasad1 Sep 17, 2021
669e2ca
pin jsonrpsee rev
niklasad1 Sep 17, 2021
641bf8d
remove unwrap nit
niklasad1 Sep 17, 2021
8a6ba85
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Sep 20, 2021
ea0ea2c
Merge branch 'dp-jsonrpsee-integration-2' into dp-rpc-testing
dvdplm Sep 20, 2021
6c17589
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Sep 20, 2021
3c88421
Comment out more tests that aren't ported
dvdplm Sep 21, 2021
e15e945
Comment out more tests
dvdplm Sep 21, 2021
4997ede
Merge branch 'dp-jsonrpsee-integration-2' into dp-rpc-testing
dvdplm Sep 21, 2021
91c14b4
Fix tests after merge
dvdplm Sep 21, 2021
4f2b2cd
Subscription test
dvdplm Sep 21, 2021
46a637f
Invalid nonce test
dvdplm Sep 21, 2021
2278968
Pending exts
dvdplm Sep 21, 2021
4856d37
WIP removeExtrinsic test
dvdplm Sep 21, 2021
d4c6a4d
Test remove_extrinsic
dvdplm Sep 22, 2021
b7a78c9
Make state test: should_return_storage work
jsdw Sep 22, 2021
832ce62
Merge branch 'dp-rpc-testing' of github.com:paritytech/substrate into…
jsdw Sep 22, 2021
075e613
Uncomment/fix the other non-subscription related state tests
jsdw Sep 22, 2021
19f39f6
test: author_insertKey
dvdplm Sep 22, 2021
27a789d
test: author_rotateKeys
dvdplm Sep 22, 2021
f30a8be
Get rest of state tests passing
jsdw Sep 22, 2021
3116aa1
Merge branch 'dp-rpc-testing' of github.com:paritytech/substrate into…
jsdw Sep 22, 2021
947750c
asyncify a little more
jsdw Sep 22, 2021
3759645
Add todo to note #msg change
jsdw Sep 22, 2021
06cb6f5
Crashing test for has_session_keys
dvdplm Sep 23, 2021
966f0db
Fix error conversion to avoid stack overflows
dvdplm Sep 23, 2021
a34a590
test author_hasKey
dvdplm Sep 23, 2021
1abd83f
Add two missing tests
dvdplm Sep 24, 2021
1b14b0b
RPC tests for state, author and system (#9859)
dvdplm Sep 24, 2021
d91b15c
fix drop in state test
niklasad1 Sep 24, 2021
6f326d4
Merge remote-tracking branch 'origin/dp-jsonrpsee-integration-2' into…
niklasad1 Sep 24, 2021
6368752
update jsonrpsee
niklasad1 Sep 27, 2021
efb701a
fix ignored system test
niklasad1 Sep 27, 2021
8800f0c
fix chain tests
niklasad1 Sep 27, 2021
5b7e32d
remove some boiler plate
niklasad1 Sep 27, 2021
cbc4642
Port BEEFY RPC (#9883)
dvdplm Sep 28, 2021
464c6d8
trivial changes left over from merge
dvdplm Sep 30, 2021
15d15bb
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Sep 30, 2021
fa719a3
Remove unused code
dvdplm Oct 1, 2021
ab17c6d
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Oct 1, 2021
26926e6
Update jsonrpsee
dvdplm Oct 1, 2021
fd9e1ae
fix build
niklasad1 Oct 6, 2021
b983887
make tests compile again
niklasad1 Oct 7, 2021
f9bcb98
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Oct 8, 2021
66da48f
beefy update jsonrpsee
niklasad1 Oct 9, 2021
f67e23e
fix: respect rpc methods policy
niklasad1 Oct 9, 2021
570958e
update cargo.lock
niklasad1 Oct 9, 2021
795ff10
update jsonrpsee
niklasad1 Oct 11, 2021
1aefa99
update jsonrpsee
niklasad1 Oct 13, 2021
084e98c
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Oct 18, 2021
18536f4
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Oct 21, 2021
7a6ea8d
downgrade error logs
niklasad1 Nov 1, 2021
ea90fd1
update jsonrpsee
niklasad1 Nov 1, 2021
01622c6
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Nov 3, 2021
7898fcc
Fix typo
dvdplm Nov 3, 2021
08caf2a
remove unused file
niklasad1 Nov 8, 2021
f7b9f80
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Nov 8, 2021
1737599
Better name
dvdplm Nov 8, 2021
bc8df75
Port Babe RPC tests
dvdplm Nov 8, 2021
9ddb0e9
Merge branch 'dp-jsonrpsee-integration-2' of github.com:paritytech/su…
dvdplm Nov 8, 2021
6a7ed3f
Put docs back
dvdplm Nov 8, 2021
24cb823
Resolve todo
dvdplm Nov 8, 2021
c5abbae
Port tests for System RPCs
dvdplm Nov 8, 2021
e2fdd1a
Resolve todo
dvdplm Nov 8, 2021
7ad29c8
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Nov 9, 2021
f6b0a1c
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Nov 11, 2021
06c2d73
fix build
niklasad1 Nov 11, 2021
5c307dc
Updated jsonrpsee to current master
maciejhirsz Nov 11, 2021
4e1c295
fix: port finality grandpa rpc tests
niklasad1 Nov 11, 2021
48fdeaf
Merge remote-tracking branch 'origin/dp-jsonrpsee-integration-2' into…
niklasad1 Nov 11, 2021
97b7254
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Nov 11, 2021
8fb4d4d
Move .into() outside of the match
dvdplm Nov 12, 2021
32e16e7
more review grumbles
dvdplm Nov 12, 2021
4894b27
jsonrpsee: add `rpc handlers` back (#10245)
niklasad1 Nov 12, 2021
99c7ca3
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Nov 12, 2021
95d709b
fix grumble: remove needless alloc
niklasad1 Nov 12, 2021
c127c68
resolve TODO
niklasad1 Nov 12, 2021
415835f
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Nov 15, 2021
2da1969
fmt
dvdplm Nov 15, 2021
721423c
Fix typo
dvdplm Nov 16, 2021
23a7dd1
grumble: Use constants based on BASE_ERROR
dvdplm Nov 16, 2021
76ef3bd
grumble: DRY whitelisted listening addresses
dvdplm Nov 16, 2021
6bf7584
cleanup
dvdplm Nov 16, 2021
7b254bd
grumbles: Making readers aware of the possibility of gaps
dvdplm Nov 16, 2021
3babd88
review grumbles
dvdplm Nov 16, 2021
2b4118f
grumbles
dvdplm Nov 16, 2021
75041ed
remove notes from niklasad1
niklasad1 Nov 16, 2021
49e587e
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Nov 17, 2021
ef8d325
Update `jsonrpsee`
dvdplm Nov 17, 2021
8901195
fix: jsonrpsee features
niklasad1 Nov 17, 2021
2570371
jsonrpsee: fallback to random port in case the specified port failed …
niklasad1 Nov 18, 2021
9347959
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Nov 18, 2021
fcb6fd7
Update jsonrpsee to 092081a0a2b8904c6ebd2cd99e16c7bc13ffc3ae
dvdplm Nov 18, 2021
6a04da2
lockfile
dvdplm Nov 18, 2021
5ae444b
update jsonrpsee
niklasad1 Nov 18, 2021
ccd9736
Merge branch 'dp-jsonrpsee-integration-2' of github.com:paritytech/su…
dvdplm Nov 19, 2021
bec87f6
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Nov 19, 2021
5d2605d
fix warning
dvdplm Nov 19, 2021
4246269
Don't fetch jsonrpsee from crates
dvdplm Nov 19, 2021
538f03a
make tests compile again
niklasad1 Nov 19, 2021
27907c7
fix rpc tests
niklasad1 Nov 19, 2021
6b8e50d
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Nov 19, 2021
930bb9e
remove unused deps
niklasad1 Nov 19, 2021
b22f74b
update tokio
niklasad1 Nov 19, 2021
03f7301
fix rpc tests again
niklasad1 Nov 19, 2021
ece49e3
fix: test runner
niklasad1 Nov 19, 2021
47ec471
cargo fmt
niklasad1 Nov 19, 2021
730f7c8
grumbles: fix subscription aliases
niklasad1 Nov 21, 2021
1c0a6b8
make clippy happy
niklasad1 Nov 21, 2021
f889cb5
update remaining subscriptions alias
niklasad1 Nov 22, 2021
5d4d22a
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Nov 22, 2021
7ab1b7f
cleanup
dvdplm Nov 22, 2021
4727565
cleanup
dvdplm Nov 22, 2021
44a3e3d
Merge branch 'dp-jsonrpsee-integration-2' of github.com:paritytech/su…
dvdplm Nov 22, 2021
7034e6e
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Nov 22, 2021
5acc878
fix chain subscription: less boiler plate (#10285)
niklasad1 Nov 22, 2021
d6f4170
cargo fmt
niklasad1 Nov 23, 2021
925059f
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Nov 23, 2021
67a6dab
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Nov 24, 2021
6c658df
Switch to jsonrpsee 0.5
dvdplm Nov 24, 2021
14dae6a
fix build
niklasad1 Nov 24, 2021
6e34af0
add missing features
niklasad1 Nov 24, 2021
1c11977
fix nit: remove needless Box::pin
niklasad1 Nov 29, 2021
a378fdd
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Nov 30, 2021
0eadbe3
Integrate jsonrpsee metrics (#10395)
dvdplm Dec 1, 2021
beec025
fix build
niklasad1 Dec 1, 2021
3bd55fb
remove needless Arc::clone
niklasad1 Dec 1, 2021
ecc872c
Update to jsonrpsee 0.6
dvdplm Dec 1, 2021
57e3c80
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Dec 1, 2021
eed6c6a
lolz
niklasad1 Dec 1, 2021
5d1148d
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
dvdplm Dec 2, 2021
9544b06
fix metrics
niklasad1 Dec 2, 2021
bd5ceae
Revert "lolz"
niklasad1 Dec 2, 2021
3e96b8e
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Dec 2, 2021
30d220d
Merge branch 'dp-jsonrpsee-integration-2' of github.com:paritytech/su…
dvdplm Dec 2, 2021
d8d2e46
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
dvdplm Dec 3, 2021
3b6ff68
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Dec 6, 2021
e8801ce
fix: in-memory rpc support subscriptions
niklasad1 Dec 7, 2021
6b90e0f
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Dec 7, 2021
4655ba8
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Dec 10, 2021
604335a
Merge remote-tracking branch 'origin' into dp-jsonrpsee-integration-2
niklasad1 Dec 14, 2021
ec79904
commit Cargo.lock
niklasad1 Dec 14, 2021
09f8852
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Dec 23, 2021
36400aa
Update tests to 0.7
dvdplm Dec 23, 2021
08c8e3c
fix TODOs
niklasad1 Jan 3, 2022
f414cf6
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Jan 3, 2022
5d59277
ws server: generate subscriptionIDs as Strings
niklasad1 Jan 4, 2022
9d7e6be
Increase timeout
dvdplm Jan 11, 2022
7a5a6b4
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Jan 11, 2022
54c2dd9
Port over tests
dvdplm Jan 12, 2022
66c6c54
cleanup
dvdplm Jan 12, 2022
b5fecd6
Using error codes from the spec
dvdplm Jan 13, 2022
3966532
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Jan 13, 2022
30b5624
fix clippy
niklasad1 Jan 13, 2022
26e622b
cargo fmt
niklasad1 Jan 13, 2022
f718474
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Jan 14, 2022
fc311f4
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Jan 17, 2022
f35044a
update jsonrpsee
niklasad1 Jan 23, 2022
f959e93
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Jan 23, 2022
5a86875
fix nits
niklasad1 Jan 23, 2022
5ff0165
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Jan 25, 2022
0a61c83
fix: rpc_query
niklasad1 Jan 25, 2022
5c5eb70
enable custom subid gen through spawn_tasks
niklasad1 Jan 25, 2022
b37b768
remove unsed deps
niklasad1 Jan 25, 2022
b58da3c
unify tokio deps
niklasad1 Jan 25, 2022
cc8d671
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Jan 26, 2022
3b76732
Revert "enable custom subid gen through spawn_tasks"
niklasad1 Jan 26, 2022
7f2a252
fix bad merge of `test-utils`
niklasad1 Jan 26, 2022
5a5776a
fix more nits
niklasad1 Jan 27, 2022
538867c
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Jan 28, 2022
f08a7c1
downgrade wasm-instrument to 0.1.0
niklasad1 Jan 28, 2022
cec775d
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Feb 3, 2022
2f337d0
[jsonrpsee]: enable custom RPC subscription ID generatation (#10731)
niklasad1 Feb 3, 2022
6e8450b
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Feb 7, 2022
4678fbb
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Mar 10, 2022
2a2d4d7
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Mar 11, 2022
c16a523
cargo fmt
niklasad1 Mar 14, 2022
50a4c6f
Merge remote-tracking branch 'origin/master' into HEAD
niklasad1 Mar 14, 2022
bb4a87a
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Mar 18, 2022
8c3b057
Merge branch 'master' into dp-jsonrpsee-integration-2
dvdplm Mar 22, 2022
5f50afb
fmt
dvdplm Mar 23, 2022
2d8b4ef
port RPC-API dev
niklasad1 Mar 23, 2022
9d777d0
Remove unused file
dvdplm Mar 23, 2022
0150fc4
fix nit: remove async trait
niklasad1 Mar 23, 2022
f9aa57d
fix doc links
niklasad1 Mar 23, 2022
43db19a
Merge branch 'dp-jsonrpsee-integration-2' of github.com:paritytech/su…
dvdplm Mar 24, 2022
07f668c
Merge branch 'dp-jsonrpsee-integration-2' of github.com:paritytech/su…
dvdplm Mar 24, 2022
ab681d0
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Apr 3, 2022
c1e51c1
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Apr 6, 2022
cf40d19
fix merge nit: remove jsonrpc deps
niklasad1 Apr 7, 2022
7037547
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Apr 7, 2022
4bfeaaa
kill namespace on rpc apis
niklasad1 Apr 7, 2022
f209e07
companion for jsonrpsee v0.10 (#11158)
dvdplm Apr 7, 2022
ab11cb5
send error before subs are closed
niklasad1 Apr 7, 2022
a6ccd66
fix unsubscribe method names: chain
niklasad1 Apr 12, 2022
34897e0
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Apr 19, 2022
5c1977d
fix tests
niklasad1 Apr 19, 2022
0ed8413
jsonrpc server: print binded local address
niklasad1 Apr 19, 2022
5b99226
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 Apr 19, 2022
3103f6f
grumbles: kill SubscriptionTaskExecutor
niklasad1 Apr 20, 2022
760ae95
Update client/sync-state-rpc/src/lib.rs
niklasad1 Apr 20, 2022
dea4c81
Update client/rpc/src/chain/chain_full.rs
niklasad1 Apr 20, 2022
0e4081a
Update client/rpc/src/chain/chain_full.rs
niklasad1 Apr 20, 2022
6614117
sync-state-rpc: kill anyhow
niklasad1 Apr 20, 2022
e7b34f8
no more anyhow
niklasad1 Apr 20, 2022
f502e03
remove todo
niklasad1 Apr 20, 2022
c9f6e59
jsonrpsee: fix bad params in subscriptions. (#11251)
niklasad1 Apr 20, 2022
5107c79
dont do weird stuff in drop impl
niklasad1 Apr 20, 2022
2ee97b8
jsonrpsee v0.11
niklasad1 Apr 21, 2022
b03a471
rpc servers: remove needless clone
niklasad1 Apr 22, 2022
c5492c6
Remove silly constants
dvdplm Apr 22, 2022
d2e2390
Merge remote-tracking branch 'origin/master' into dp-jsonrpsee-integr…
niklasad1 May 6, 2022
be14e01
chore: update jsonrpsee v0.12
niklasad1 May 6, 2022
60d5b1f
commit Cargo.lock
niklasad1 May 6, 2022
2788cc2
deps: downgrade git2
niklasad1 May 6, 2022
e156038
feat: CLI flag max subscriptions per connection
niklasad1 May 7, 2022
0955558
metrics: use old logging format
niklasad1 May 7, 2022
44581c6
fix: read WS address from substrate output (#11379)
niklasad1 May 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
707 changes: 226 additions & 481 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ members = [
"bin/node/executor",
"bin/node/primitives",
"bin/node/rpc",
"bin/node/rpc-client",
# TODO(niklasad1): bring back once rpsee macros is a thing.
# "bin/node/rpc-client",
"bin/node/runtime",
"bin/node/testing",
"bin/utils/chain-spec-builder",
Expand Down Expand Up @@ -199,7 +200,8 @@ members = [
"utils/frame/remote-externalities",
"utils/frame/frame-utilities-cli",
"utils/frame/try-runtime/cli",
"utils/frame/rpc/support",
# TODO(niklasad1): port this to jsonrpsee
# "utils/frame/rpc/support",
"utils/frame/rpc/system",
"utils/prometheus",
"utils/wasm-builder",
Expand Down
2 changes: 1 addition & 1 deletion bin/node-template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ sp-runtime = { version = "4.0.0-dev", path = "../../../primitives/runtime" }
sp-timestamp = { version = "4.0.0-dev", path = "../../../primitives/timestamp" }

# These dependencies are used for the node template's RPCs
jsonrpc-core = "15.1.0"
jsonrpsee = { git = "https://github.com/paritytech/jsonrpsee", branch = "master", features = ["server"] }
sc-rpc = { version = "4.0.0-dev", path = "../../../client/rpc" }
sp-api = { version = "4.0.0-dev", path = "../../../primitives/api" }
sc-rpc-api = { version = "0.10.0-dev", path = "../../../client/rpc-api" }
Expand Down
3 changes: 2 additions & 1 deletion bin/node-template/node/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pub mod chain_spec;
pub mod rpc;
// TODO(niklasad1): port this back?!
// pub mod rpc;
pub mod service;
1 change: 0 additions & 1 deletion bin/node-template/node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ mod chain_spec;
mod service;
mod cli;
mod command;
mod rpc;

fn main() -> sc_cli::Result<()> {
command::run()
Expand Down
21 changes: 7 additions & 14 deletions bin/node-template/node/src/service.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! Service and ServiceFactory implementation. Specialized wrapper over substrate service.

use jsonrpsee::RpcModule;
use node_template_runtime::{self, opaque::Block, RuntimeApi};
use sc_client_api::{ExecutorProvider, RemoteBackend};
use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams};
Expand Down Expand Up @@ -126,6 +127,7 @@ pub fn new_partial(
keystore_container,
select_chain,
transaction_pool,
rpc_builder: Box::new(|_, _| RpcModule::new(())),
other: (grandpa_block_import, grandpa_link, telemetry),
})
}
Expand All @@ -147,6 +149,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
mut keystore_container,
select_chain,
transaction_pool,
rpc_builder: _rpc_builder,
other: (block_import, grandpa_link, mut telemetry),
} = new_partial(&config)?;

Expand Down Expand Up @@ -195,25 +198,14 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
let enable_grandpa = !config.disable_grandpa;
let prometheus_registry = config.prometheus_registry().cloned();

let rpc_extensions_builder = {
let client = client.clone();
let pool = transaction_pool.clone();

Box::new(move |deny_unsafe, _| {
let deps =
crate::rpc::FullDeps { client: client.clone(), pool: pool.clone(), deny_unsafe };

Ok(crate::rpc::create_full(deps))
})
};

let _rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams {
network: network.clone(),
client: client.clone(),
keystore: keystore_container.sync_keystore(),
task_manager: &mut task_manager,
transaction_pool: transaction_pool.clone(),
rpc_extensions_builder,
// TODO: (dp) implement
rpc_builder: Box::new(|_, _| RpcModule::new(())),
on_demand: None,
remote_blockchain: None,
backend,
Expand Down Expand Up @@ -436,7 +428,8 @@ pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError>
transaction_pool,
task_manager: &mut task_manager,
on_demand: Some(on_demand),
rpc_extensions_builder: Box::new(|_, _| Ok(())),
// TODO: (dp) implement
rpc_builder: Box::new(|_, _| RpcModule::new(())),
config,
client,
keystore: keystore_container.sync_keystore(),
Expand Down
2 changes: 1 addition & 1 deletion bin/node/browser-testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "Apache-2.0"
[dependencies]
futures-timer = "3.0.2"
libp2p = { version = "0.37.1", default-features = false }
jsonrpc-core = "15.0.0"
jsonrpsee-types = { git = "https://github.com/paritytech/jsonrpsee" }
serde = "1.0.126"
serde_json = "1.0.48"
wasm-bindgen = { version = "=0.2.73", features = ["serde-serialize"] }
Expand Down
25 changes: 11 additions & 14 deletions bin/node/browser-testing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@
//! ```text
//! CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER=wasm-bindgen-test-runner WASM_BINDGEN_TEST_TIMEOUT=60 cargo test --target wasm32-unknown-unknown
//! ```
//! For debug infomation, such as the informant, run without the `--headless`
//! For debug information, such as the informant, run without the `--headless`
//! flag and open a browser to the url that `wasm-pack test` outputs.
//! For more infomation see <https://rustwasm.github.io/docs/wasm-pack/>.
//! For more information see <https://rustwasm.github.io/docs/wasm-pack/>.

use jsonrpc_core::types::{Id, MethodCall, Params, Success, Version};
use jsonrpsee_types::v2::{
params::{Id, JsonRpcParams},
request::JsonRpcCallSer,
response::JsonRpcResponse,
};
use serde::de::DeserializeOwned;
use wasm_bindgen::JsValue;
use wasm_bindgen_futures::JsFuture;
Expand All @@ -37,21 +41,14 @@ use wasm_bindgen_test::{wasm_bindgen_test, wasm_bindgen_test_configure};
wasm_bindgen_test_configure!(run_in_browser);

fn rpc_call(method: &str) -> String {
serde_json::to_string(&MethodCall {
jsonrpc: Some(Version::V2),
method: method.into(),
params: Params::None,
id: Id::Num(1),
})
.unwrap()
serde_json::to_string(&JsonRpcCallSer::new(Id::Number(1), method, JsonRpcParams::NoParams))
.unwrap()
}

fn deserialize_rpc_result<T: DeserializeOwned>(js_value: JsValue) -> T {
let string = js_value.as_string().unwrap();
let value = serde_json::from_str::<Success>(&string).unwrap().result;
// We need to convert a `Value::Object` into a proper type.
let value_string = serde_json::to_string(&value).unwrap();
serde_json::from_str(&value_string).unwrap()
let val = serde_json::from_str::<JsonRpcResponse<T>>(&string).unwrap().result;
val
}

#[wasm_bindgen_test]
Expand Down
12 changes: 9 additions & 3 deletions bin/node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,13 @@ crate-type = ["cdylib", "rlib"]

[dependencies]
# third-party dependencies
codec = { package = "parity-scale-codec", version = "2.0.0" }
jsonrpsee = { git = "https://github.com/paritytech/jsonrpsee", branch = "master", features = ["server"] }
serde = { version = "1.0.126", features = ["derive"] }
futures = { version = "0.3.9", features = ["compat"] }
hex-literal = "0.3.1"
log = "0.4.8"
rand = "0.7.2"
structopt = { version = "0.3.8", optional = true }
parking_lot = "0.11.1"

# primitives
sp-authority-discovery = { version = "4.0.0-dev", path = "../../../primitives/authority-discovery" }
Expand All @@ -60,6 +59,14 @@ sp-transaction-pool = { version = "4.0.0-dev", path = "../../../primitives/trans
sp-transaction-storage-proof = { version = "4.0.0-dev", path = "../../../primitives/transaction-storage-proof" }

# client dependencies
sc-consensus-babe-rpc = { version = "0.10.0-dev", path = "../../../client/consensus/babe/rpc" }
sc-finality-grandpa-rpc = { version = "0.10.0-dev", path = "../../../client/finality-grandpa/rpc" }
sc-sync-state-rpc = { version = "0.10.0-dev", path = "../../../client/sync-state-rpc" }
pallet-transaction-payment-rpc = { version = "4.0.0-dev", path = "../../../frame/transaction-payment/rpc/" }
substrate-frame-rpc-system = { version = "4.0.0-dev", path = "../../../utils/frame/rpc/system/" }
pallet-mmr-rpc = { version = "3.0.0", path = "../../../frame/merkle-mountain-range/rpc/" }
pallet-contracts-rpc = { version = "4.0.0-dev", path = "../../../frame/contracts/rpc/" }

sc-client-api = { version = "4.0.0-dev", path = "../../../client/api" }
sc-chain-spec = { version = "4.0.0-dev", path = "../../../client/chain-spec" }
sc-consensus = { version = "0.10.0-dev", path = "../../../client/consensus/common" }
Expand All @@ -78,7 +85,6 @@ sc-service = { version = "0.10.0-dev", default-features = false, path = "../../.
sc-tracing = { version = "4.0.0-dev", path = "../../../client/tracing" }
sc-telemetry = { version = "4.0.0-dev", path = "../../../client/telemetry" }
sc-authority-discovery = { version = "0.10.0-dev", path = "../../../client/authority-discovery" }
sc-sync-state-rpc = { version = "0.10.0-dev", path = "../../../client/sync-state-rpc" }

# frame dependencies
pallet-indices = { version = "4.0.0-dev", path = "../../../frame/indices" }
Expand Down
6 changes: 3 additions & 3 deletions bin/node/cli/src/browser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ fn start_inner(
info!("👤 Role: {:?}", config.role);

// Create the service. This is the most heavy initialization step.
let (task_manager, rpc_handlers) = crate::service::new_light_base(config)
.map(|(components, rpc_handlers, _, _, _)| (components, rpc_handlers))
let task_manager = crate::service::new_light_base(config)
.map(|(task_manager, _, _, _)| task_manager)
.map_err(|e| format!("{:?}", e))?;

Ok(browser_utils::start_client(task_manager, rpc_handlers))
Ok(browser_utils::start_client(task_manager))
}
Loading