Questions tagged [json-rpc]
The json-rpc tag has no usage guidance.
37
questions
2
votes
0
answers
30
views
How can I use the --rpc-cors flag properly?
I m attempting to use the --rpc-cors flag to specify certain domains that are allowed to send requests to my chain (localhost - substrate-node-template). However, regardless of how I use this flag, I ...
0
votes
1
answer
23
views
AssetConversionApi (asset_conversion_pallet) - How to encode function input parameters in price and reserves RPC calls?
I'm trying to use asset_conversion pallet to call quote prices, and get reserved rpc endpoints (defined here)
In pallets official docs there is small section about calling that endpoint, but it doesn'...
2
votes
1
answer
36
views
Calling external RPC method from OCW
I want to call an external RPC method from the offchain_worker. I checked multiple jsonrpc clients but none of them were no_std compatible. I want to know if there are any clients out there which can ...
0
votes
1
answer
48
views
upgrading substrate node from Polkadot 0.9.28 to 0.9.40
I have a substrate node of Polkadot 0.9.28. It is customised to enable contracts, and I have enabled the contract and runtime pallets. The tutorial I worked on is no more available in substrate docs. ...
3
votes
2
answers
151
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(...
2
votes
1
answer
90
views
How to call chain_getBlock with jsonrpsee?
I'm trying to call my node's chain_getBlock RPC method. I expect to provide a block hash, and get back a complete block.
For starters, I've confirmed that the call I plan to make works as expected ...
3
votes
1
answer
31
views
Why the two ways to get blockhash is not same?
why the two ways to get blockhash is not same ?
0
votes
1
answer
31
views
Retriving the transaction details of a mapping
I have a mapping with 0 to 10. I have values stored in this mapping. If I want to get the information stored on map<5> it gives me the details. Is it possible to get the transaction id and block ...
0
votes
1
answer
99
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
0
answers
61
views
RPC apis & node entry-points
I am trying to identify all the possible entry points that an extrinsic can reach the node.
From my understanding so far the following rpc endpoints are the only ones that can add transactions to the ...
1
vote
2
answers
88
views
Get request error using polkadotjs
let polkaAPI = require("@polkadot/api")
let key = require("@polkadot/keyring")
let Key1 = new key.Keyring( { type:'sr25519'})
let UserKey = Key1.addFromMnemonic("mneomics keys ...
0
votes
1
answer
50
views
why node could be started even though i passed both --validator and --rpc-port?
in this doc it says the following:
By default, the node will refuse to start if you try to expose an RPC
interface and run a validator node at the same time. The --unsafe-*
flags allow you to ...
1
vote
3
answers
58
views
About Polkadot's API List
The polkadot.js documentation has a list of APIs on it, but is there any other list of APIs?
The polkadot.js API list includes eth, which cannot be executed without Frontier.
Is there an API List that ...
0
votes
1
answer
93
views
Why is there no finalization in the substrate-contracts-node?
I am working on the substrate contract node to instantiate a contract using RPC call. I use the this tutorial to do the process. I am getting the message that it is in the block, but not finalized.
...
2
votes
1
answer
95
views
@polkadot/api suppress output messages
I have an issue regarding displaying errors. For errors, the logger @polkadot/api uses will write to console even when the error is caught and handled. I am handling and displaying the messages a ...
4
votes
1
answer
336
views
Rpc payment_queryFeeInfo fails on Westend 9310
After the latest upgrade of Westend runtime to version 9310 the RPC call payment_queryFeeInfo fails with the following error message:
{"jsonrpc":"2.0","error":{"code&...
1
vote
1
answer
66
views
Is there a JSON-RPC method similar to `eth_getLogs`?
I was wondering if there is a JSON-RPC method similar to eth_getLogs.
What I would like to accomplish is to query all the events that meet a certain criteria, and that happened after a certain block. ...
1
vote
0
answers
32
views
Subscribe via json-rpc has no response
I don't get any response from json-rpc subscription.
It seems I need a type paramater, but the provider.subscribe() method does not document the type parameter. (I checked the js, java and python code,...
2
votes
1
answer
262
views
Can't get balance of ALICE account from RPC via curl
If run this RPC query via curl:
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "state_getStorage", "...
0
votes
2
answers
84
views
How to associate stash accounts with host via RPC/JS/shell
I am trying to get the stash id of a validator from the host of the node. I have a list of candidate validators. How would I achieve this?
I tried the following using Polkadot.js
var validator = "...
0
votes
2
answers
76
views
How to query for All Pallets StorageVersions
Is there an easy way to get a list of all pallets storage versions? An output like this:
[
Palletname, StorageVersion
]
Is it possible to query using curl and the rpc for the storage version of all ...
2
votes
3
answers
105
views
JSON-RPC getBlockHash Request
I am trying to request a block hash for a specific block using the Polkadot JSON-RPC but no matter how I construct the request (with Python), it always returns the latest block and not the one I want. ...
1
vote
0
answers
90
views
Metadata V12 / V14
We just migrated from substrate v3 to substrate v4, after that I expected to have metadata V14 when I'll call state_getMetadata rpc method.
but I still get V12 metadata and I don't understand why.
If ...
2
votes
2
answers
181
views
How to get StorageKey associated with an address?
StorageKey keyword mentioned in the RPC substrate docs and polkadotJS RPC API docs
https://polkadot.js.org/docs/substrate/rpc#getkeyskey-storagekey-at-blockhash-vecstoragekey
How to get this ...
1
vote
0
answers
56
views
Get System info in custom RPC call
Hello I would like to be able to call
fn system_name(&self) -> RpcResult<String> {
Ok(self.info.impl_name.clone())
}
inside a custom rpc call
our custom rpc call is implemented like ...
1
vote
1
answer
281
views
Intermitent errors with jsonrpsee: WS error: i/o error: Transport endpoint is not connected (os error 107); terminate connection 1056
We've been getting some intermitent websocket connection issues on our production polkadot UI node since the upgrade to jsonrpsee.
We are running a single Polkadot 0.9.24 container image on our K8s ...
0
votes
1
answer
195
views
Is it possible to fetch balance and nonce without using Polkadot.js?
How does one fetch the balance and nonce for a given address without using the polkadot.js client?
This is how you do it with the client but I can't seem to find the rpc methods or tutorials to do it ...
0
votes
1
answer
93
views
Invalid params for rpc
I am writing runtime rpc with multiple parameters:
#[rpc]
pub trait ShivarthuApi<BlockHash> {
#[rpc(name = "shivarthu_challengerevidence")]
fn get_challengers_evidence(
...
0
votes
1
answer
139
views
Read spec chain in a custom rpc method
I know that some RPC query exist to get informations like :
system_properties
system_chain
system_chainType
But I would like to have all of them in a same custom call.
How I can access to those ...
6
votes
0
answers
153
views
How to use the default Substrate CLI rpc-cors values without using rpc-cors=all for a Collator node and connect from Polkadot.js Apps
I want to be able to connect a collator node using https://polkadot.js.org/apps that is based on the substrate-parachain-template using branch 'polkadot-v0.9.18' and is being run as a parachain in ...
4
votes
1
answer
76
views
How do I include a new rpc that uses a NetworkWorker in the node-template?
The node-template says its service.rs is a specialisation of that on the substrate master branch. Hence, it's sort of hard to relate the two. Nonetheless, I'd like to expose an RPC endpoint that's ...
5
votes
2
answers
190
views
Decode extrinsic on substrate side
hello is there a way to decode this kind of extrinsic on substrate side without polkadotJs :
extrinsics: [0402000b935b2a697f01,
...
1
vote
1
answer
69
views
Can I make a frontier node only accept json-rpc read methods?
Is there a way to filter ethereum json-rpc methods to only allow read calls, not writing? ie, filter out sendTransaction, sendRawTransaction, create, etc
4
votes
2
answers
96
views
Can the metadata of Polkadot change?
As far as I know, the metadata of Polkadot is version 14.
Assuming that the metadata version is not updated,
Can the metadata of the recent block be different?
ex) Block(#9135844)'s metadata != Block(#...
1
vote
1
answer
106
views
How to solve 'Invalid transaction version'?
use std::any::Any;
use std::io;
use subxt::*;
use subxt::{ClientBuilder,DefaultConfig, DefaultExtra};
use subxt::codec::Decode;
use crate::sp_runtime::OpaqueExtrinsic;
use sp_runtime::{
generic::{
...
5
votes
1
answer
125
views
What is the difference between Metadata and FRAME-Metadata?
What is the difference between Metadata and Metadata Type Definitions in Substrate?
Also, when I do the state_getMetadata RPC call I get the metadata. It is rather long. Is there a way to cache this ...
5
votes
2
answers
589
views
How to decode extrinsic at json-RPC call's data(byte code)
I call json-RPC through the terminal and get the data as below.
extrinsics is raw byte, but I'm using polkadot-js(SCALE codec?) to decode it.
But I don't know which method to call.
"block": ...