Questions tagged [rpc]
Questions relating to custom RPC implementations or using existing RPCs to make calls to a Substrate node.
129
questions
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 ...
0
votes
1
answer
102
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 ...
3
votes
1
answer
217
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 })....
4
votes
1
answer
283
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:
...
4
votes
1
answer
127
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....
1
vote
2
answers
56
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 ...
4
votes
2
answers
117
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, ...
3
votes
1
answer
106
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 ...
9
votes
3
answers
189
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 ...
12
votes
1
answer
271
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 ...
2
votes
0
answers
43
views
frontier ethereum pallet integration, the trait `fc_rpc::format::Formatter` is not implemented for `Geth` [closed]
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 ...
3
votes
2
answers
270
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": "...
5
votes
0
answers
107
views
How to extend a `custom RPC` service to query the `off-chain` storage? [closed]
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 ...
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 ...
1
vote
2
answers
67
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 ...
4
votes
2
answers
144
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 ...
7
votes
1
answer
166
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 ...
7
votes
1
answer
102
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 ...
10
votes
2
answers
368
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 ...
7
votes
2
answers
82
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.
8
votes
1
answer
191
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 ...
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,
...
3
votes
1
answer
46
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", "...
3
votes
1
answer
195
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, ...
2
votes
1
answer
200
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 ...
0
votes
1
answer
86
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 "...
9
votes
2
answers
237
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%...
2
votes
1
answer
74
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
5
votes
1
answer
101
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 ...