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
0 answers
4 views

Help needed with payloads and extrinsics

I know that the payload and extrinsics are dynamic, and even different between parachains/base chains(kusama,polkadot,rococo,westend). But I am struggling to find good documentation on how these ...
user avatar
  • 1
-1 votes
0 answers
9 views

Similar eth_call for substrate

a function like we have in ethereum : eth_call exists for substrate ? Thank you.
user avatar
  • 49
0 votes
1 answer
18 views

Is there a way to collect fee of transaction?

I'm looking to collect Extrinsic transfers as images on https://polkadot.subscan.io/ Maybe use api sidecar or rpc to collect this data? Please help me!!! Thank you so much!!!
user avatar
0 votes
1 answer
26 views

Get Transaction by Hash

I'd like to get transaction info like sender and receiver address etc. by sending transaction hash as a parameter. I did found "api.rpc.eth.getTransactionByHash" and tried to pass the hash ...
user avatar
1 vote
1 answer
163 views

Decoding events with Rust

If I make a request to get events in a particular block using web UI, I get a nice human-readable response: I've made an RPC call to get the same data { "id": 1, "jsonrpc":...
user avatar
0 votes
1 answer
18 views

How to perform RPC call system.properties() using py-substrate-interface?

Is there a way to the RPC call output of system.properties() using the py-substrate-interface? I want to access the token name and decimals as shown below (based on this link) { ss58Format: 2 ...
user avatar
1 vote
0 answers
18 views

Load balancing across RPCs

I’m looking for resources on how to implement a front end load balancing mechanism for splitting traffic across RPCs. I know polkadot.js.org has something running that does this and I think it might ...
user avatar
1 vote
0 answers
26 views

How do I call the RPC method `contractInfoOf` using curl?

The docs state that the RPC comes with a few defaultRPCs and then links to polkadotJS documentation on the available API calls. This doesn't help me if I want to call a method using curl. Does anyone ...
user avatar
  • 568
-1 votes
2 answers
66 views

Trading result and trading time [closed]

Request RPC via http. How to obtain transaction results and transaction time. Is there a friend who can give me some advice? thank you very much indeed
user avatar
  • 47
0 votes
4 answers
93 views

Can I get this timestamp through RPC getblock?

Can I get this timestamp through RPC getblock?
user avatar
  • 47
0 votes
0 answers
13 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( ...
user avatar
0 votes
1 answer
38 views

Which RPC can get the details of the transaction through the externalics ID?

How can I pass the externalics ID in the picture. Get the details of the deal. Through RPC method.
user avatar
  • 47
2 votes
1 answer
55 views

What is an RPC node?

What is an RPC node and how to build one as a developer. Also, are there any resources available?
user avatar
  • 21
0 votes
2 answers
52 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 ...
user avatar
  • 542
3 votes
1 answer
37 views

u128 is not supported on jsonrpc

u128 is not supported on rpc. So I am trying to use NumberOrHex How to setup and RPC call that accepts a u128 input? Here is my code for runtime api: #![cfg_attr(not(feature = "std"), no_std)...
user avatar
2 votes
1 answer
114 views

Custom RPCs not decorated

I added some custom RPC endpoints to a substrate blockchain, but when I connect to the node with a simple script it prints: API/INIT: RPC methods not decorated: ... The RPCs work, but don't show up ...
user avatar
1 vote
1 answer
28 views

Extending front-end-template with custom RPC

My chain currently has a couple of custom RPC interfaces that I'd like to interact with using substrates front-end-template. I'm aware that the src/config/common.json file requires modification, which ...
user avatar
0 votes
1 answer
49 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 ...
user avatar
  • 49
0 votes
1 answer
25 views

Different between safe and unsafe RPC calls

When running a substrate node, the CLI accepts a parameter called rpc_methods which accepts Auto, Safe and Unsafe arguments. How can developers declare an RPC call Unsafe and how can one get the list ...
user avatar
2 votes
1 answer
49 views

Dev Substrate Node at Capacity for WS Connections, how to flush?

I'm running a node in dev mode: ./substrate/target/release/substrate --dev --tmp --ws-external My client connection code: provider = new WsProvider(wsProvider) api = await new ApiPromise({ provider })....
user avatar
3 votes
1 answer
63 views

Implementation of runtime api RPC

I am trying to implement custom rpc using the tutorial : https://substrate.recipes/custom-rpc.html, I successfully implemented silly rpc but getting error for runtime api rpc. Here are my code: ...
user avatar
3 votes
1 answer
46 views

How do `subxt` and `substrate-api-client` libraries differ?

I understand that there are two main Rust client libraries for Substrate: subxt substrate-api-client I've checked out the examples for both libraries and it seems to me that they are mostly the same....
user avatar
  • 319
0 votes
2 answers
22 views

Can't connect to pokadot-js UI from my VPS blockchain

I ran a Polkadot node from my VPS: ./target/release/polkadot \ --alice \ --validator \ --base-path /tmp/relay/alice \ --chain rococo-custom-2-raw.json \ --port 30333 \ --ws-port 9944 But it's not ...
user avatar
4 votes
2 answers
54 views

RPC full type specification from metadata

Since metadata v14 and scale-info were introduced, the runtime fully specifies all runtime interfaces and types. On the RPC side however the rpc_methods only returns the list of methods exposed, ...
user avatar
  • 291
3 votes
1 answer
50 views

How do I upgrade my node's RPC?

Following along the Substrate's Forkless Upgrades guide. I can upgrade the runtime but I can't figure it out how to upgrade my pallet's RPC. I have commented the below code for testing purposes and ...
user avatar
  • 497
8 votes
3 answers
90 views

Error adding Custom RPCs for pallet

I've been trying to add some rpc calls available for my node, but an error related to the 'getrandom' module appears (even tho I'm not even using it). I have a very simple pallet that creates and ...
user avatar
  • 542
10 votes
1 answer
80 views

PolkadotJS how to properly setup api for custom RPC invocation

I'm playing around with custom RPC endpoints exposed from my substrate node, but I'm encountering an issue when trying to call it with polkadotjs. Initially, my endpoint only accepted a single ...
user avatar
  • 333
2 votes
0 answers
26 views

frontier ethereum pallet integration, the trait `fc_rpc::format::Formatter` is not implemented for `Geth`

I'm trying to copy a function from the frontier pallet(fc_rpc::format::Formatter), I copied it to a file and imported that. frontier-752fb1c28a6c675a/ea37e8f/client/rpc/src/format.rs It's the same ...
user avatar
3 votes
2 answers
78 views

Getting extrinsic data with the transaction hash

I've successfully submitted the extrinsic RPC call and got a JSON response { "jsonrpc": "2.0", "result": "...
user avatar
5 votes
0 answers
42 views

How to extend a `custom RPC` service to query the `off-chain` storage?

There are many docs/tutorials explaining how to extend the node's RPC service with a Custom RPC to query the Runtime storage. What I could not figure it out yet, is how to do the same but to query the ...
user avatar
4 votes
1 answer
46 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 ...
user avatar
  • 423
0 votes
2 answers
38 views

How to map out transaction history between different WebSocket endpoints?

I would like to begin putting together a history of the usage of different WebSockets across different parachains and parathreads. I am relatively new to this ecosystem and have not been about to ...
user avatar
2 votes
2 answers
71 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 ...
user avatar
  • 141
4 votes
1 answer
76 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 ...
user avatar
5 votes
1 answer
43 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 ...
user avatar
  • 319
9 votes
2 answers
113 views

Generating an extrinsic call for a custom pallet

I'm trying to generate an extrinsic offline based on this example. It worked, but the signed transaction is different. Call Data As you can see in the output the Call Hash is the same. Signed ...
user avatar
3 votes
2 answers
43 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.
user avatar
  • 33
6 votes
1 answer
56 views

Generating a Storage Key when making an RPC request

I'm trying to make an RPC call to a Substrate node, but I can't generate a proper Storage Key. The Module and Method parts are fine, the problem is the Twox64Concat part. The sp_core::twox_64 of value ...
user avatar
5 votes
1 answer
89 views

Decode extrinsic on substrate side

hello is there a way to decode this kind of extrinsic on substrate side without polkadotJs : extrinsics: [0402000b935b2a697f01, ...
user avatar
  • 49
2 votes
1 answer
21 views

How to expose `engine_createBlock` manual-seal RPC? [closed]

Right now when I run: curl -H "Content-Type: application/json" -d '{"id":"1", "jsonrpc":"2.0", "method": "rpc_methods", "...
user avatar
1 vote
1 answer
54 views

Can't request to my Custom RPC with an Enum

I'm trying to create a custom RPC for my pallet. I've followed Substrate Recipes (I know it's outdated but helped a lot) and pallet_transaction for Runtime API and RPC. My first RPC, profile_getSum, ...
user avatar
  • 497
1 vote
1 answer
22 views

Sometimes Polkadot JS won't connect to the local node, unless I enable rpc-cors all

I am using the polkadot js appimage and sometimes while connecting to my node, I see this : Blocked connection to WebSockets server from untrusted origin: Some("file://"). I've tried running ...
user avatar
0 votes
1 answer
51 views

Retrieve reason of fail substrate rpc call

I would like to know if there is a way for understanding why a rpc call via python substrate-interface is failing. On my case, I'm using python substrateinterface lib. And in function "...
user avatar
8 votes
2 answers
65 views

How can we get a snapshot of all balances at a certain block?

Which api/rpc call and method do I need to use to extract the state of all balances at a certain block? Let's use Polkadot and recent block as an example: https://polkadot.js.org/apps/?rpc=wss%3A%2F%...
user avatar
2 votes
1 answer
33 views

How do you query a list of all previous block hashes from a substrate based chain?

I can see how to do so from the subscan api but I am interested in understanding how to query this data from the chain itself. Ie via a storage function or by another means
user avatar
4 votes
1 answer
49 views

How to turn off certain RPCs?

According to substrate rpc docs we shouldn't be exposing some RPCs as they are deemed dangerous. How does one go about turning them off? Currently if I query my node, I have all those RPCs running ...
user avatar