Questions tagged [rpc]
Questions relating to custom RPC implementations or using existing RPCs to make calls to a Substrate node.
129
questions
2
votes
2
answers
154
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
1
answer
37
views
Opt-out of polkadot.js/api system_health calls for wss rpc
We have been spoiled with free, almost unlimited public websocker rpcs in Kusama and Polkadot ecosystem, but this is changing fast, so we are exploring paid RPC API services. But we have noticed that ...
4
votes
1
answer
353
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&...
1
vote
1
answer
103
views
Problem while adding new API to runtime, RPC, and service
pub fn create_full<C, P>(
deps: FullDeps<C, P>,
) -> Result<RpcExtension, Box<dyn std::error::Error + Send + Sync>>
where
C: ProvideRuntimeApi<Block>
+ ...
5
votes
1
answer
734
views
How to add custom RPCs?
I have the template pallet in the Substrate node template.
This pallet template has a function do_something that store a value in the storage.
I would like to create an RPC call that queries that ...
0
votes
1
answer
113
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....
0
votes
1
answer
87
views
RPC custom request/response
Currently using Postman I can make requests to my node and get a response.
The code below is a request:
{
"jsonrpc":"2.0",
"id":3,
"method":"...
0
votes
1
answer
45
views
Best way to connect my substrate node with android app
I do have a native app written in Java/Kotlin and I would like to connect it with my substrate node.
Which is the best way to do it? Any open-source library?
Thank you!
0
votes
1
answer
103
views
Calculate fee for a given transaction
is it possible to calculate the weight (and transform to fees) for a given transaction ?
I mean, I need to create a custom RPC method which will calculate that and return the fees.
Thank you
1
vote
0
answers
28
views
RPC enabled? CLI configuration?
I need to determine whether RPCs are enabled in a OCW. I am thinking that I could check rpc_external and/or ws_external in sc_cli::commands::run_cmd but (1) is this the best way and (2) if it is, how ...
0
votes
1
answer
80
views
Can't access substrate node explorer
I expose RPC from the second node with command:
./target/release/node-template \
--base-path /tmp/node02 \
--chain ./customSpecRaw.json \
--listen-addr /ip4/0.0.0.0/tcp/30333 \
--ws-port 9946 ...
0
votes
1
answer
71
views
Is Substrate Storage Queries exploitable for a DDoS attack?
I have some pallet that provide storage SomeValue, and this storage was exposed through #[pallet::getter(fn some_value)]. Having removed this getter in favour of a paged RPC API, I was thinking that ...
0
votes
1
answer
67
views
Query returning all instances of a contract based on it's code hash?
Looking to write a call that could return all the contract addresses of ink contracts matching a code hash of the contract via RPC.
What would be the best way to go about getting the list of contract ...
0
votes
2
answers
98
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 = "...
1
vote
1
answer
76
views
Is it possible to test/mock the rpc calls in substrate?
I was trying to mock the rpc calls in substrate, but if there's any example for that then I guess it would help better.
3
votes
1
answer
70
views
How to query the max extrinsic weight over rpc?
How do i query over rpc the maximum weight for normal extrinsics as defined in frame_system here:
https://github.com/paritytech/substrate/blob/master/frame/system/src/limits.rs#L99-L122
0
votes
1
answer
43
views
Custom type is encoded as Bytes
In my pallet have created a custom new-type, in the same fashion as AccountId32:
#[derive(Encode, Decode, Clone, PartialEq, Eq, Ord, PartialOrd, Debug, MaxEncodedLen, TypeInfo)]
pub struct GenericId(...
2
votes
1
answer
78
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
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 ...
1
vote
1
answer
123
views
Substrate call raw transaction
I created a custom function in a custom RPC call to send a raw transaction :
fn send_raw_transaction(&self, bytes: Bytes) -> FutureResult<TxHash<P>> {
let slice = &bytes....
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. ...
1
vote
1
answer
166
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?
1
vote
2
answers
98
views
How to list all available RPC and extrinsics endpoints of a node?
Is there a way to query a running (local) node and list all available RPC and/or extrinsic endpoints?
I want to create an overview for new team members and for our company, and maybe even pipe the ...
3
votes
1
answer
73
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'...
1
vote
1
answer
91
views
fork-off-substrate dying at 37% with rpc max size disconnect
I'm trying to get fork-off to work with a pair of custom types(https://github.com/hicommonwealth/edgeware-node-types) and I am getting fork-off-substrate to work with a WS socket instead of a HTTP RPC ...
6
votes
2
answers
197
views
What's the different between "Extrinsic" and "RPC" methods for pallets?
I notice that for the nicks pallet there is no need to write a custom RPC or configure that, while with the contracts pallet that need seems to be there. It also seems that in the Substrate Front End ...
1
vote
0
answers
24
views
upgrade custom chain to 0.9.24, rpc-client/src/main.rs report "no `AuthorClient` in `author`"
report "no AuthorClient in author" in rpc-client/src/main.rs when i upgrade chain to 0.9.24
report "add dyn keyword before this trait" if i change to AuthorApiClient.
does ...
2
votes
2
answers
234
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 ...
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 ...
1
vote
1
answer
527
views
Unsafe RPC calls?
I wonder why most substrate nodes have that --unsafe-rpc-external flag and which of the calls are actually unsafe. Is there a RPC documentation somewhere?
0
votes
1
answer
125
views
How to decode RPC results using Python's Scale library
I'm trying to get the chain state information from substrate using RPC for IdentityOf of any Accountid
Upon succesfull request, I get the following result:
{
"jsonrpc": "2.0",
...
1
vote
1
answer
83
views
Where can I find minimum active stake for a certain era?
I'm writing a script using the polkadot.js API. I want to find the minimum active stake for a certain era. I.e. the minimum amount of DOTs staked by a nominator that also got a reward for that era. ...
1
vote
2
answers
376
views
How to send transactions using RPC?
I'm developing a client library for Dart. I wonder how can I send transactions using RPC.
If I wanted to send a balance transfer only using RPC how could I do it? What are the steps?
I know that I ...
2
votes
2
answers
122
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 ...
-2
votes
1
answer
49
views
Similar eth_call for substrate [closed]
a function like we have in ethereum : eth_call exists for substrate ?
Thank you.
0
votes
1
answer
95
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!!!
0
votes
1
answer
684
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 ...
4
votes
1
answer
431
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":...
1
vote
1
answer
75
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
...
1
vote
0
answers
36
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 ...
1
vote
1
answer
248
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 ...
-1
votes
2
answers
82
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
0
votes
4
answers
284
views
Can I get this timestamp through RPC getblock?
Can I get this timestamp through RPC getblock?
0
votes
1
answer
108
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(
...
0
votes
1
answer
74
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.
2
votes
1
answer
411
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?
0
votes
2
answers
213
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 ...
3
votes
1
answer
109
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)...
5
votes
1
answer
937
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 ...
1
vote
1
answer
68
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 ...