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
0 votes
1 answer
38 views

Force bonding withdrawal period to 0 days

I run a local testnode using chopsticks and I want to unbond funds right after I bond them. What configuration I could use in chopsticks or RPC call I could make to make sure I can withdraw my funds ...
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 ...
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 ...
1 vote
1 answer
57 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 ...
5 votes
2 answers
188 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 ...
3 votes
1 answer
53 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 ...
-1 votes
1 answer
32 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 ...
0 votes
1 answer
167 views

RPC connection errors(rate limits?)

How to check the rate limits of concrete RPC? It works until some time and then starts throwing an error. I suspect it's the rate limits I connect to the remote node. For example wss://acala-rpc....
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::...
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 ...
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, ...
3 votes
1 answer
101 views

exposing RPC/ws publicaly

I want to expose an RPC/WS endpoints publicly. What mesures should I take into consideration? Should I just expose RPC/WS using substrate options --unsafe-rpc-external --unsafe-ws-external? But as I ...
0 votes
0 answers
32 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 ...
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 ...
1 vote
1 answer
61 views

Best way to automate extrinsic submissions for testing

I am developing a chain in substrate, and am trying to find the best way to run integration tests against certain sets of extrinsic submissions when the network is running in development mode. It's ...
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 ...
0 votes
0 answers
46 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 ...
2 votes
2 answers
343 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 ...
0 votes
0 answers
87 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 ...
1 vote
1 answer
95 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 ...
0 votes
0 answers
22 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": "...
2 votes
2 answers
229 views

Best way to query multiple blocks via chain RPC endpoint?

Currently there does not seem to be an easy way to query the content of multiple blocks in the same RPC operation, I guess for spam protection reasons? What is then the best way to know how many ...
1 vote
0 answers
56 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 ...
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 ...
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 ...
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>, ...
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 ...
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. ...
0 votes
1 answer
101 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 ...
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 ...
0 votes
1 answer
117 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 ...
0 votes
1 answer
40 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'...
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 ...
3 votes
1 answer
105 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. ...
5 votes
2 answers
207 views

Decode extrinsic on substrate side

hello is there a way to decode this kind of extrinsic on substrate side without polkadotJs : extrinsics: [0402000b935b2a697f01, ...
7 votes
1 answer
113 views

How to programmatically get current unbonding information on the Polkadot relay chain?

Using either a Rust or JavaScript client library I would like to get the amount of DOT that is currently being unbonded on the relay chain. Some staking information is available in the Polkadot JS ...
7 votes
1 answer
188 views

Is it possible to query an OCW's Off-chain storage via RPC from an external service?

I'm off-chain indexing some pallet events into my off-chain local storage using an OCW. Now, I want to be able to retrieve this data via RPC from an external service. Is this possible? Does it require ...
4 votes
2 answers
189 views

How to update the SS58Prefix for a running node?

If I have started running a Substrate node but the ss58Format value in the chain specification .json file that is generated from using the build-spec command is not 42, how do I update the chain so ...
3 votes
2 answers
244 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(...
7 votes
2 answers
90 views

Is it ok to combine RPC node with collator together?

For a parachain is it ok to have RPC and collator in one node? If not why? I'd love to hear some deeper explanation.
3 votes
1 answer
78 views

RPC deployment Guideline

I have a question in regard to RPC node for Polkadot or Substrate. RPC node configuration - I don't see too many information about this. Is there public information on how to setup a RPC, if there isn'...
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 ...
1 vote
1 answer
215 views

Get Metadata inside custom rpc call

Hello I am creating custom rpc call, I need metadata to be able to decode extrinsics call inside my calls. But I don't know how to get substrate metadata inside my rpc call?
3 votes
1 answer
205 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 ...
5 votes
1 answer
117 views

Removing randomness-collective-flip pallet from runtime

We recently tried to remove pallet-randomness-collective-flip from our runtime. This pallet has been in our runtime since it was created as it was included in the template-node-runtime, but we never ...
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, ...
1 vote
1 answer
60 views

How to get the contract address for a events

I am using github.com/centrifuge/go-substrate-rpc-client And able to get list of events from each block and also able to filter it out but is there a way to identify which contract triggered the event....
0 votes
1 answer
123 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 ...
4 votes
2 answers
210 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.
2 votes
1 answer
194 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::...