Questions tagged [json-rpc]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
6 votes
0 answers
182 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 ...
Luke Schoen's user avatar
  • 2,292
5 votes
2 answers
657 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": ...
PaperFrog's user avatar
  • 495
5 votes
1 answer
128 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 ...
PaperFrog's user avatar
  • 495
5 votes
2 answers
195 views

Decode extrinsic on substrate side

hello is there a way to decode this kind of extrinsic on substrate side without polkadotJs : extrinsics: [0402000b935b2a697f01, ...
cibou's user avatar
  • 131
4 votes
2 answers
107 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(#...
PaperFrog's user avatar
  • 495
4 votes
1 answer
348 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&...
Valentun's user avatar
  • 220
4 votes
1 answer
87 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 ...
islami00's user avatar
  • 561
3 votes
2 answers
168 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(...
cocokick's user avatar
  • 165
3 votes
1 answer
32 views

Why the two ways to get blockhash is not same?

why the two ways to get blockhash is not same ?
Rose's user avatar
  • 305
2 votes
3 answers
131 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. ...
Teodor's user avatar
  • 21
2 votes
1 answer
290 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", "...
Robert La Ferla's user avatar
2 votes
2 answers
231 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 ...
muddlebee's user avatar
2 votes
1 answer
128 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 ...
JoshOrndorff's user avatar
  • 1,105
2 votes
1 answer
40 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 ...
StackedQ's user avatar
  • 131
2 votes
1 answer
102 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 ...
Dario Tsvetanoff's user avatar
2 votes
0 answers
39 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 ...
rirotho's user avatar
  • 113
2 votes
0 answers
68 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 ...
thduke's user avatar
  • 21
1 vote
2 answers
105 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 ...
18dew's user avatar
  • 31
1 vote
1 answer
369 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 ...
T9b's user avatar
  • 446
1 vote
1 answer
75 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
afm's user avatar
  • 345
1 vote
1 answer
110 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::{ ...
PaperFrog's user avatar
  • 495
1 vote
3 answers
62 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 ...
Satish's user avatar
  • 23
1 vote
1 answer
73 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. ...
Josep's user avatar
  • 113
1 vote
0 answers
37 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,...
DerekC's user avatar
  • 205
1 vote
0 answers
94 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 ...
cibou's user avatar
  • 131
1 vote
0 answers
59 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 ...
cibou's user avatar
  • 131
0 votes
2 answers
94 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 = "...
Matthias Hutter's user avatar
0 votes
1 answer
49 views

RPC author_extrinsicUpdate, missing TxIndex

Currently not sure if I missed something here, but I'm expecting TxIndex in the inblock and finalized updates of the extrinsic, but it seems to be missing. { "jsonrpc": "2.0"" ...
Cedric Decoster's user avatar
0 votes
1 answer
31 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'...
Kaliman's user avatar
0 votes
1 answer
35 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 ...
Stanly Wilson's user avatar
0 votes
1 answer
58 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 ...
dadzerlaze's user avatar
  • 1,073
0 votes
1 answer
109 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. ...
Stanly Wilson's user avatar
0 votes
2 answers
89 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 ...
flipchan's user avatar
  • 309
0 votes
1 answer
236 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 ...
124141251's user avatar
0 votes
1 answer
106 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( ...
Amiya Behera's user avatar
0 votes
1 answer
145 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 ...
cibou's user avatar
  • 131
0 votes
1 answer
50 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. ...
Stanly Wilson's user avatar
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, ...
Ivan Temchenko's user avatar