Skip to main content

Questions tagged [rpc]

Questions relating to custom RPC implementations or using existing RPCs to make calls to a Substrate node.

Filter by
Sorted by
Tagged with
-1 votes
1 answer
28 views

What is the max value we can use for `--rpc-max-connections ` flag of substrate node template?

I am using substrate node template. We know it comes with many flag . I want to know specifics about --rpc-max-conections . We know that default is 100 but i want to know is there any maximum ...
Md. Raisul Islam Rony's user avatar
3 votes
1 answer
52 views

What's a convenient way to look up a `DispatchError` in RPC

A DispatchError will refer to a pallet and a member of the pallet's Error enum by index: DispatchError: {"module":{"index":123,"error":456}} How can I wrap these and ...
user5303's user avatar
1 vote
0 answers
16 views

Rpc call showing empty in evm integrated chain?

i have been working on polkadot layer 0 chain. i have integrated evm frontier on layer 0 chain and everything is working fine .when i try to call rpc (eth.getcode) it is showing empty . can some ...
Karanvir Singh's user avatar
0 votes
0 answers
30 views

Rpc methods not decorated

Goal I'm trying to decorate the rpc methods to be able to interact with api.tx. If anyone has faced this issue, what has helped you out? Issue I'm not able to access tx method inside of api, which I ...
Peter Kim's user avatar
0 votes
1 answer
31 views

Run Substrate-node-template with wss and secure rpc

I was running substrate node template with non secure ws connection . After integrating with pallet-evm,pallet-ethereum and other precompiles , I wanted to connect to metamask with secure rpc ...
Md Raisul Islam Rony's user avatar
1 vote
1 answer
40 views

How can I change --rpc-max-connections on already running substrate-based node?

I have already running substrate-based node and I started to get error: 429 Too many requests: Too many connections. This happens due to HTTP requests that my FE produces. After research I ...
Artem Levchuk's user avatar
0 votes
0 answers
45 views

Error querying evm rpc endpoint on a node run by Chopsticks

I'm trying to run a local node using Chopsticks and connect to it using Metamask, but when I make the request to the eth-rpc-adapter, it fails. Here are the steps I followed with the corresponding ...
magecnion's user avatar
  • 242
0 votes
0 answers
86 views

Connect a frontend application with a Substrate blockchain as a backend without using an RPC endpoint

I'd like to connect my frontend application (built on Rust) to be able to connect to my network without using any hardcoded endpoints to create a bottleneck for DDoS attacks. One possibility for this ...
Discardo's user avatar
  • 436
1 vote
2 answers
32 views

What are the RPC endpoints that is usually unique to Substrate vs the unique to Polkadot nodes?

I used typegen to generate types for Substrate, Kusama and Polkadot networks. And I got the exact same types for the rpc endpoints (rpc methods). Is this normal? Should not be there some unique ...
Muhammad Altabba's user avatar
1 vote
1 answer
93 views

How to connect to a ws port whe nthe node is in a docker container

I have a Substrate node that I build locally and also into a docker container in CI. When I use my local build or when I use docker run --network host, I can connect to the websocket endpoint on port ...
JoshOrndorff's user avatar
  • 1,191
0 votes
0 answers
20 views

is the endpoint TransactionPaymentApi_query_info usable on current Westend testnet?

I was trying to query payment_queryInfo on current Westend testnet, and the following payload used to works at spec 9430. { "jsonrpc": "2.0", "method": "...
johnhckuo's user avatar
  • 123
1 vote
0 answers
54 views

How are the node threads and tasks managed?

When we run a node, we start a bunch of tasks using task_manager.spawn_handle() or task_manager.spawn_essential_handle(). From my understanding, those spawn new Tokio tasks. If my computer has ...
Timothée Delabrouille's user avatar
0 votes
0 answers
13 views

Does Substrate support custom node specific environment vars or flags

I have a pallet that should have access to a secp256k1::Keypair for signing messages. And I want to be able to start the node with either the secret_key string or a path to a key-file. Then have the ...
ambiguous omen's user avatar
0 votes
0 answers
23 views

Adding RPC node in private network without node authorization

I have set up a private network and it has node_authorization pallet included. I have added several validator nodes by using the node_authorization pallet as well_known nodes. Now I want to allow some ...
Faraz Ahmad's user avatar
0 votes
0 answers
39 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>, ...
Discardo's user avatar
  • 436
1 vote
0 answers
27 views

how to solve mismatched type error in substrate?

I have been integrating paritytech frontier(0.9.43) version with the substrate 0.9.43 version . while integrating when i added frontier changes in rpc.rs and service.rs file i am facing this error. ...
Karanvir Singh's user avatar
3 votes
1 answer
84 views

RPC node is rebooting itself from time to time

Node is working correct but there is a moment that shows the following error messages and reboots: 2023-10-12 19:39:26 Accepting new connection 170/10000 2023-10-12 19:39:26 Accepting new connection ...
Diego Forziati's user avatar
1 vote
0 answers
26 views

How to curl `ink!` contract storage?

I'm trying to use curl to query an ink contract's storage using the RPC of substrate. I've looked at the below question How do I call the RPC method `contractInfoOf` using curl? but it does not ...
goastler's user avatar
  • 569
0 votes
1 answer
99 views

Beefy justification subscription is not working

I would like to subscribe to the beefy justification stream on Rococo. The rpc for getFinalizedHead works fine, but I also require the justifications themselves. When I try to subscribe to the ...
Shoeb Siddiqui's user avatar
0 votes
1 answer
39 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
2 answers
49 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 ...
Discardo's user avatar
  • 436
0 votes
1 answer
114 views

Scalecodec: How can I get the equivalent of Decode in Python, instead of DecodeAll?

When using the Python script: timestamp = ScaleDecoder.get_decoder_class('Timestamp', ScaleBytes(timestamp_bytes_array)).decode() it seems that the decoder expects the size of the array to be exactly ...
The Quantum Physicist's user avatar
3 votes
1 answer
102 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. ...
0x5hmoo's user avatar
  • 189
2 votes
1 answer
61 views

Validating node, how connet to polkadot.js

For running validate nodes, through set up, now i can see my node on the telemetry. but I don't know how to connect to polkadot.js. polka wiki says "You can generate your Session keys in the ...
jay p's user avatar
  • 61
3 votes
1 answer
38 views

Off chain worker for https:// request

I have a simple question if i use off chain workers to get calls to https://somecoinexchange/ to get data for some calculation, what will be the gas usage. I was presuming that since no chain work is ...
Nöörah Smith's user avatar
3 votes
1 answer
201 views

How to encode an extrinsic for RPC from a web client?

I need to programmatically pack an extrinsic for an RPC, I believe I'm looking for the following front-end functionality: extract relevant indices from the Metadata fill the extrinsic parameters ...
Yury Yukhananov's user avatar
5 votes
2 answers
185 views

How to implement `into_rpc` method in jsonrpsee's rpc macro

I'm trying to add custom RPC to Substrate node template. As explained in the jsonrpsee's proc_macro doc here, I define BalancesApi trait where #[rpc(server)] attribute added, and implement ...
Shunsuke's user avatar
  • 432
3 votes
2 answers
241 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
4 votes
1 answer
278 views

Sign a transaction offline for Westend testnet and verification of the transaction

Could Polkadot experts execute the code below and advise me on the questions, please? You just need to replace the code by your own Westend accounts and nonce. import { construct, getRegistry, ...
drhanlondon's user avatar
4 votes
2 answers
208 views

Read a value from offchain storage of a node

I want to read a single value from OffchainStorage of a live substrate node. Is it possible? Assume I can not use localStorageGet rpc request because it is an unsafe rpc.
Matt Duncan's user avatar
3 votes
1 answer
73 views

When will I stop receiving TransactionStatus updates for a transaction submitted via author_submitAndWatchExtrinsic?

If I submit a transaction via "author_submitAndWatchExtrinsic", I start getting back TransactionStatus updates, which look like one of these: pub enum TransactionStatus<Hash, BlockHash>...
jsdw's user avatar
  • 1,335
0 votes
1 answer
122 views

how to fix transactionPaymentApi.queryInfo runtime call issue?

api.tx.balances.transfer(recipient, new BN(txAmount)).paymentInfo(sender) When I call paymentinfo to get a transaction fee, I got this error. Error: The transactionPaymentApi.queryInfo runtime call is ...
INcre's user avatar
  • 35
2 votes
1 answer
71 views

Calculate total staked & rewarded for validation per era/block

Is there an elegant way to get the total amount staked & rewarded for each era/block? Right now I get a list of staking.Bonded data from Subscan: { "code": 0, "message": &...
Begley Brothers Inc's user avatar
1 vote
1 answer
182 views

Parachain RPC errors since Polkadot 0.9.36 client upgrade

Astar uplifted to Polkadot 0.9.36 in v4.47.1 Client upgrade introduces 2 new errors on RPC nodes, both WS and HTTP. HTTP: lots of these errors - seems high impact HTTP serve connection failed hyper::...
bLd's user avatar
  • 182
1 vote
1 answer
56 views

Iterate storage maps inside an offchain worker

I need to iterate over the following double map inside an offchain worker: How can I access this map outside the pallet assets? Can I use an RPC method to get all the values for that double map ...
Mateo Baldassarre's user avatar
2 votes
0 answers
83 views

Fuzzing Polkadot produces Invalid Signature after chaos is injected

I'm using Polkadot version 0.9.37-08b1c09ca46, across 4 Nodes - Alice, Bob, Charlie, Dave, in a local testnet environment. I have a period of network chaos applied, and then moments of stabilized '...
David Searle's user avatar
0 votes
2 answers
128 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
2 votes
0 answers
96 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
0 votes
1 answer
102 views

polkadotJS chain state system.account() include option false, how to rebuild with RPC?

I'm trying to parse the whole storage from a node with the encoded partial key through RPC, it seems to be doable with polkadotJS see the picture in one call. The fastest approach that we currently ...
Cedric Decoster's user avatar
0 votes
1 answer
149 views

"Cannot call send() while not connected" with RPC websocket provider

I will try to explain it briefly. I'm using Promise API to connect to few different RPCs (ws). Also I'm listening to an event connected on each websocket provider. When all providers are connected I ...
guakamole's user avatar
3 votes
1 answer
65 views

How to build the browser extension with substrate?

Can we make browser extension with substrate and yes and how ? can anyone please provide the resource to read about it ?
Deepak Chaudhary's user avatar
2 votes
1 answer
87 views

How do I query the state of a contract at a given block number given the deprecation of contracts_getStorage?

The previous answer is now incorrect due to the deprecation of the RPCs. How do we query the historic contract state now? In the PR comment it states: The high level contracts API in polkadot.js ...
forgetso's user avatar
  • 1,502
2 votes
1 answer
46 views

How to add parachains to parity signer?

I'm setting up a metadata site for parachains. I have the github pages site working, and am currently adding parachains. I just have a few questions to make sure I do this properly. For rpc_endpoint ...
ZeroPhase's user avatar
  • 123
2 votes
1 answer
192 views

required by a bound in `Methods::merge`

i gonna add custom rpc in substrate , but every time i run this command : cargo check , it show me this error : error[E0277]: the trait bound `Methods: From<jsonrpsee_core::server::...
Mr Coder's user avatar
  • 923
2 votes
1 answer
246 views

Runtime error: Execution failed: Runtime panicked: Bad input data provided to validate_transaction: Invalid length prefix

Getting Error : "Verification Error: Runtime error: Execution failed: Runtime panicked: Bad input data provided to validate_transaction: Invalid length prefix" While calling the custom RPC ...
Kumar's user avatar
  • 135
3 votes
1 answer
49 views

Duplicate Lang Error When Adding Custom RPC

I am trying to add a custom rpc in Substrate, but I ran into a problem. I have done all steps in this article: Add custom RPC to the node and my code is here: https://github.com/dortajkianoush/...
Mr Coder's user avatar
  • 923
2 votes
1 answer
155 views

How to retrive data stored in a block

I have stored an information on chain and I want to access that information using RPC call. I used the following code and provided the hash created. const signedBlock = await api.rpc.chain.getBlock(...
Stanly Wilson's user avatar
1 vote
1 answer
47 views

When should an RPC be unsafe?

When making a new RPC/runtime-api endpoint, what criteria should you have in mind regarding making it safe/unsafe? For example, assume that a UI wants to fetch a large amount of data (a lot of keys in ...
kianenigma's user avatar
  • 2,799
3 votes
1 answer
256 views

Error: no matching package named 'pallet-contracts-rpc' found

I am trying to add the pallet-contracts-rpc dependency but keep getting this error. ''' error: no matching package named pallet-contracts-rpc found location searched: https://github.com/paritytech/...
Kaioh33's user avatar
  • 63
0 votes
0 answers
59 views

StakerStatus is not updating on my custom explorer

I have made a custom explorer of a substrate based blockchain, and when i am chilling the staker, its status is not updating to inactive on the custom explorer, is there any RPC call or any other way ...
Gagandeep Kaur's user avatar