Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
bb57020
wip: rpc
weichweich Mar 18, 2022
2196e20
fix: use correct sporran keys
weichweich Mar 30, 2022
12cee68
fix toml
weichweich Mar 30, 2022
1ea7c00
rpc calls
weichweich Mar 31, 2022
3572360
rpc for standalone
weichweich Apr 1, 2022
d771286
rpcs
weichweich Apr 5, 2022
39c6934
fix clippy
weichweich Apr 5, 2022
726542b
fix
weichweich Apr 6, 2022
931151a
fixes
weichweich Apr 6, 2022
b7a1d2b
fix debug implementation
weichweich Apr 6, 2022
0f8cba4
fix features
weichweich Apr 6, 2022
6c28d69
Merge remote-tracking branch 'origin/develop' into aw-did-rpc
weichweich Apr 7, 2022
5032977
Merge remote-tracking branch 'origin/develop' into aw-did-rpc
weichweich Apr 19, 2022
219b691
feat: list of linked accounts
weichweich Apr 20, 2022
a7495c6
fix: features
weichweich Apr 20, 2022
003c3f1
reafactor: derive debug
weichweich Apr 21, 2022
5d55212
feat: include service endpoints
weichweich Apr 22, 2022
aa6329c
feat: query by did
weichweich Apr 26, 2022
b2f26b0
refactor: derive debug
weichweich Apr 26, 2022
77a5547
refactor: clear DidPublicKeyDetails from pallet specifics
weichweich Apr 26, 2022
560b321
feat: did details
weichweich Apr 27, 2022
1dea6a2
fix: u128 not supported by serde
weichweich Apr 27, 2022
5b8123a
fix: clippy & tests
weichweich Apr 27, 2022
8ae429c
test: test u128 serde fix
weichweich Apr 27, 2022
11c90c0
fmt
weichweich Apr 27, 2022
f0b0c59
Merge remote-tracking branch 'origin/develop' into aw-did-rpc
weichweich Apr 27, 2022
fd40383
Merge remote-tracking branch 'origin/develop' into aw-did-rpc
weichweich Apr 28, 2022
7fbc0a5
chore: cleaning
weichweich Apr 28, 2022
6691f34
sorted features
weichweich Apr 29, 2022
3c2d6b5
Update rpc/did/src/lib.rs
weichweich May 2, 2022
ccc688f
refactor: Rename to linked info
weichweich May 16, 2022
9e152ee
wip
ntn-x2 Jun 22, 2022
f9cc49c
fix: integrate develop and update to new jsonrpsee framework
ntn-x2 Jun 22, 2022
e9e5253
chore: minor chores
ntn-x2 Jun 22, 2022
8ccf22a
Merge commit '9d2e9e90e180f88ab23aaa859622634f92b78a60' into aw-did-rpc
ntn-x2 Jun 23, 2022
9733f93
chore: fmt
ntn-x2 Jun 23, 2022
ba7d2be
Merge branch 'develop' into aw-did-rpc
weichweich Jun 28, 2022
55f8d18
style: 🧹🐢
weichweich Jun 28, 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
96 changes: 66 additions & 30 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ panic = "unwind"
members = [
"nodes/*",
"pallets/*",
"rpc/did",
"rpc/did/runtime-api",
"runtimes/*",
"support",
]
7 changes: 4 additions & 3 deletions nodes/parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ substrate-build-script-utils = {git = "https://github.com/paritytech/substrate",
[dependencies]

# Internal dependencies
did-rpc = {path = "../../rpc/did"}
peregrine-runtime = {path = "../../runtimes/peregrine"}
runtime-common = {path = "../../runtimes/common"}
spiritnet-runtime = {path = "../../runtimes/spiritnet"}
Expand All @@ -37,15 +38,15 @@ frame-rpc-system = {package = "substrate-frame-rpc-system", git = "https://githu
pallet-transaction-payment-rpc = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24"}
sc-basic-authorship = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24"}
sc-chain-spec = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24"}
sc-cli = {git = "https://github.com/paritytech/substrate", features = ["wasmtime"] , branch = "polkadot-v0.9.24"}
sc-cli = {git = "https://github.com/paritytech/substrate", features = ["wasmtime"], branch = "polkadot-v0.9.24"}
sc-client-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24"}
sc-consensus = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24"}
sc-executor = {git = "https://github.com/paritytech/substrate", features = ["wasmtime"] , branch = "polkadot-v0.9.24"}
sc-executor = {git = "https://github.com/paritytech/substrate", features = ["wasmtime"], branch = "polkadot-v0.9.24"}
sc-keystore = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24"}
sc-network = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24"}
sc-rpc = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24"}
sc-rpc-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24"}
sc-service = {git = "https://github.com/paritytech/substrate", features = ["wasmtime"] , branch = "polkadot-v0.9.24"}
sc-service = {git = "https://github.com/paritytech/substrate", features = ["wasmtime"], branch = "polkadot-v0.9.24"}
sc-sysinfo = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24"}
sc-telemetry = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24"}
sc-tracing = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24"}
Expand Down
27 changes: 13 additions & 14 deletions nodes/parachain/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,15 @@

use std::sync::Arc;

use polkadot_service::AuxStore;
use runtime_common::{AccountId, Balance, Block, Index};
use jsonrpsee::RpcModule;

pub use sc_rpc_api::DenyUnsafe;
use sc_transaction_pool_api::TransactionPool;
use sp_api::ProvideRuntimeApi;
use sp_block_builder::BlockBuilder;
use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};

pub use sc_rpc_api::DenyUnsafe;

/// A type representing all RPC extensions.
pub type RpcExtension = jsonrpsee::RpcModule<()>;
use runtime_common::{AccountId, Balance, Block, BlockNumber, DidIdentifier, Hash, Index};

/// Full client dependencies.
pub struct FullDeps<C, P> {
Expand All @@ -48,35 +46,36 @@ pub struct FullDeps<C, P> {
}

/// Instantiate all full RPC extensions.
pub fn create_full<C, P>(deps: FullDeps<C, P>) -> Result<RpcExtension, Box<dyn std::error::Error + Send + Sync>>
pub fn create_full<C, P>(deps: FullDeps<C, P>) -> Result<RpcModule<()>, Box<dyn std::error::Error + Send + Sync>>
where
C: ProvideRuntimeApi<Block>,
C: AuxStore,
C: HeaderBackend<Block> + HeaderMetadata<Block, Error = BlockChainError> + 'static,
C: Send + Sync + 'static,
C::Api: frame_rpc_system::AccountNonceApi<Block, AccountId, Index>,
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
C::Api: BlockBuilder<Block>,
P: TransactionPool + Sync + Send + 'static,
C::Api: did_rpc::DidRuntimeApi<Block, DidIdentifier, AccountId, Balance, Hash, BlockNumber>,
P: TransactionPool + 'static,
{
use did_rpc::{DidApiServer, DidQuery};
use frame_rpc_system::{System, SystemApiServer};
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};

let mut module = RpcExtension::new(());
let mut module = RpcModule::new(());
let FullDeps {
client,
pool,
deny_unsafe,
} = deps;

module.merge(System::new(client.clone(), pool, deny_unsafe).into_rpc())?;
module.merge(TransactionPayment::new(client).into_rpc())?;

module.merge(TransactionPayment::new(client.clone()).into_rpc())?;
// Extend this RPC with a custom API by using the following syntax.
// `YourRpcStruct` should have a reference to a client, which is needed
// to call into the runtime.
// `module.merge(YourRpcTrait::into_rpc(YourRpcStruct::new(ReferenceToClient,
// ...)))?;`
//
// `module.merge(YourRpcStruct::new(ReferenceToClient).into_rpc())?;`
module.merge(DidQuery::new(client).into_rpc())?;

Ok(module)
}
Loading