Skip to content

Commit

Permalink
De-duplicate rpc code (paritytech#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshOrndorff authored Nov 11, 2020
1 parent 0bb151c commit 8b30ec3
Show file tree
Hide file tree
Showing 12 changed files with 918 additions and 182 deletions.
28 changes: 28 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
members = [
'runtime',
'node/parachain',
'node/rpc',#Temporary
# We do NOT include the standalone node in this main workspace because it builds the
# runtime with the `standalone` feature, which the parachain does not support.
]
Expand Down
1 change: 1 addition & 0 deletions node/parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jsonrpc-pubsub = "14.2.0"

# Parachain dependencies
moonbeam-runtime = { path = "../../runtime" }
moonbeam-rpc = { path = "../rpc" }

# Substrate dependencies
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
Expand Down
1 change: 0 additions & 1 deletion node/parachain/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ mod chain_spec;
mod service;
mod cli;
mod command;
mod rpc;

fn main() -> sc_cli::Result<()> {
command::run()
Expand Down
126 changes: 0 additions & 126 deletions node/parachain/src/rpc.rs

This file was deleted.

4 changes: 2 additions & 2 deletions node/parachain/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ pub fn run_node(
let network = network.clone();

Box::new(move |deny_unsafe| {
let deps = crate::rpc::FullDeps {
let deps = moonbeam_rpc::FullDeps {
client: client.clone(),
pool: pool.clone(),
deny_unsafe,
Expand All @@ -208,7 +208,7 @@ pub fn run_node(
command_sink: Some(command_sink.clone())
};

crate::rpc::create_full(
moonbeam_rpc::create_full(
deps,
subscription_task_executor.clone()
)
Expand Down
34 changes: 34 additions & 0 deletions node/rpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[package]
name = 'moonbeam-rpc'
description = 'RPC extensions for the moonbeam standalone and parachain nodes'
homepage = 'https://moonbeam.network'
license = 'GPL-3.0-only'
version = '0.1.0'
authors = ["PureStake"]
edition = '2018'

[dependencies]
futures = { version = "0.3.1", features = ["compat"] }
codec = { package = 'parity-scale-codec', version = '1.0.0' }
serde = { version = "1.0.101", features = ["derive"] }
serde_json = "1.0"
jsonrpc-core = "14.2.0"
jsonrpc-pubsub = "14.2.0"

moonbeam-runtime = { path = "../../runtime" }

sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "rococo-branch" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "rococo-branch" }
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "rococo-branch" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "rococo-branch" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "rococo-branch" }
sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "rococo-branch" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "rococo-branch" }
substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "rococo-branch" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "rococo-branch" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "rococo-branch" }
sc-consensus-manual-seal = { git = "https://github.com/paritytech/substrate", branch = "rococo-branch" }

frontier-rpc = { version = "0.1.0", git = "https://github.com/purestake/frontier", branch = "v0.3-hotfixes" }
frontier-rpc-primitives = { version = "0.1.0", git = "https://github.com/purestake/frontier", branch = "v0.3-hotfixes" }
File renamed without changes.
Loading

0 comments on commit 8b30ec3

Please sign in to comment.