Questions tagged [custom-rpc]
The custom-rpc tag has no usage guidance.
27
questions
0
votes
0
answers
38
views
Implementing FullDeps in Substrate rpc.rs using channels instead of Arcs
This is a standard implementation of FullDeps in the rpc.rs:
// Full client dependencies.
pub struct FullDeps<C, P, SC, B> {
/// The client instance to use.
pub client: Arc<C>,
...
0
votes
2
answers
35
views
A blockchain to read events from another blockchain
I'm working on an idea where I would want my substrate-based blockchain (let's name it Blockchain A) to read events from another substrate-based blockchain (let's call it Blockchain B) and perform ...
3
votes
1
answer
55
views
Custom RPC vs. runtime API
As a Substrate builder, I don't see any reason of still implementing custom RPCs as runtime API seems superior to me. So I was wondering about any arguments for still adding custom RPCs to the client.
...
0
votes
1
answer
21
views
Error on custom rpc in new version
Updating to new version of substrate, of the branch = "polkadot-v0.9.42", it giving error,
impl<C, Block, AccountId> ProfileValidationApi<<Block as BlockT>::Hash, AccountId>...
3
votes
1
answer
19
views
Property X does not exist on type DecoratedRpc
We are currently experiencing an issue related to RPC methods. Let me provide a description of the problem:
To generate metadata from our node, we use the following command:
echo '{"id":1,&...
6
votes
1
answer
87
views
How to make an RPC call from a working custom RPC, decorate types and display info successfully?
We are building a custom UI for chains containing a specific custom pallet and rpc module.
The custom UI is similar to a polkadot-js clone we built, but much simpler. In our simple custom UI, we are ...
1
vote
1
answer
27
views
How to send data to custom network?
is there any simple example to send data to network?
like name, email, phone, address (which is made keyring), and address, etc
3
votes
2
answers
172
views
polkadot js RPC can't get u128
i have an rpc call that returns an array of structs with multiple fields, one of which is balance of an asset for a user, balance type is u128. when the number is large i get this error createType(...
0
votes
1
answer
113
views
Custom RPC sized array parameters
I have custom RPC, which looks like so
#[rpc(client, server)]
pub trait SomeRpcApi {
#[method(name = "some_submitData")]
async fn submit_data(
&self,
id: u64,
...
2
votes
2
answers
46
views
Does RuntimeApis storage accesses counts towards PoV when called from RPC and not any extrinisc?
We have some custom RPCs that call some custom RuntimeApis that from inside our pallets expose some on chain data.
I know that any access (read or write) of on-chain storage from extrinsics will ...
0
votes
0
answers
37
views
Property 'x' does not exist on type 'DecoratedRpc<"promise", RpcInterface>'
I have decorated custom RPC types for methods for polkadot-js-apps. I added them in ./packages/apps-config/src/api/spec/<chain-name>.ts, (then i also needed to add it into typesBundle.js, and ...
0
votes
1
answer
63
views
Generate the type-definition for the polkadot.js apps
Currently, I am trying to add the custom RPC into the polkadot.js apps to let me send the RPC call via polkadot.js apps.
I discovered that I have to generate my type-definition with the RPC/types, a ...
4
votes
2
answers
219
views
How to decorate RPC correctly?
The rpc methods (showing in rpc_methods), are still not showing in their own area, after (attempting to) decorate the rpc.
I have custom rpc on a substrate template.
Here are the rpc_methods:
I have ...
5
votes
2
answers
143
views
Show custom RPCs/RuntimeAPIs in PolkadotJS UI
At the moment I try to figure out why PolkadotJS UI (https://polkadot.js.org/) is not able to show my custom RPC endpoints or runtime APIs. They are available in general and also available in the list ...
5
votes
1
answer
734
views
How to add custom RPCs?
I have the template pallet in the Substrate node template.
This pallet template has a function do_something that store a value in the storage.
I would like to create an RPC call that queries that ...
4
votes
1
answer
71
views
Panic when Using Rayon with runtime_api in a custom RPC
Works: Use normal iteration in a custom RPC with a runtime_api() call.
Goal: Use rayon parallel iteration instead.
Result: Panic
Working code Simplified Real Code in GitHub
let api = self.client....
1
vote
0
answers
62
views
Use state call to query from custom Runtime Api, Balance in frontend is not equal to Balance in Runtime
Background
Our front end use state call to query custom RuntimeApi of our solo chain.
We try to use state call to replace custom rpcs.
Definition
Balance is our chain is u128.
RuntimeApi Definition
...
3
votes
1
answer
102
views
Testing Custom RPC with a Mock Runtime API
I'm trying to test a Custom RPC. Let's make it a simple pass through.
p_api::decl_runtime_apis! {
pub trait SimpleApi<AccountId> where
AccountId: Codec,
{
fn is_true() -&...
0
votes
1
answer
103
views
Calculate fee for a given transaction
is it possible to calculate the weight (and transform to fees) for a given transaction ?
I mean, I need to create a custom RPC method which will calculate that and return the fees.
Thank you
0
votes
0
answers
50
views
How to call a function from custom pallet using api.tx?
I made a custom pallet and wants to access its method using a extrinsic call like api.tx.<module>.<method> but was not able to do that, do i need to implement it in blockchain code or it ...
2
votes
1
answer
573
views
How to curl custom RPC methods?
We have a pallet (called pallet_supersig), and have an RPC module that we have implemented into a substrate node template with supersig, when running the dev node we can find the rpc methods() that ...
1
vote
1
answer
123
views
Substrate call raw transaction
I created a custom function in a custom RPC call to send a raw transaction :
fn send_raw_transaction(&self, bytes: Bytes) -> FutureResult<TxHash<P>> {
let slice = &bytes....
1
vote
1
answer
175
views
How to call a contract using a custom RPC?
I uploaded a smart contract to the Aleph Zero test net.
When I tried to query one of the methods of said smart contract, I encountered this error:
2022-08-09 09:34:28 API/INIT: RPC methods not ...
-2
votes
1
answer
49
views
Similar eth_call for substrate [closed]
a function like we have in ethereum : eth_call exists for substrate ?
Thank you.
0
votes
2
answers
55
views
runtime custom rpc is not taking "at" params as optional
I have an rpc
#[rpc]
pub trait ShivarthuApi<BlockHash> {
#[rpc(name = "shivarthu_challengerevidence")]
fn get_challengers_evidence(
&self,
at: Option<...
0
votes
2
answers
214
views
Custom RPC parameters
I'm trying to return an item that is within a storageMap. Its key is a Vec(u8), but I don't know how to send this type using a curl call. I tried using the id as string and using its hex version and I ...
1
vote
1
answer
36
views
Releasing custom RPC implementation on only a single testnet runtime
We have multiple testnet runtimes configured for the node. A new pallet I'm building is only available for testing in one testnet. There is also a new custom RPC I have written to call into the new ...