Questions tagged [rpc]
Questions relating to custom RPC implementations or using existing RPCs to make calls to a Substrate node.
121
questions
0
votes
1
answer
23
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
33
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 ...
0
votes
0
answers
30
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 ...
3
votes
1
answer
39
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.
...
2
votes
1
answer
38
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 dont know how to connect to polkadot.js.
polka wiki says
"You can generate your Session keys in the ...
3
votes
1
answer
30
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 ...
3
votes
1
answer
123
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
80
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
2
answers
151
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(...
4
votes
1
answer
195
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, ...
4
votes
2
answers
132
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.
3
votes
1
answer
50
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>...
0
votes
1
answer
67
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 ...
2
votes
1
answer
41
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": &...
1
vote
1
answer
108
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
1
answer
40
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 ...
2
votes
0
answers
61
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 '...
0
votes
1
answer
99
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,
...
2
votes
0
answers
61
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 ...
0
votes
1
answer
58
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 ...
0
votes
0
answers
50
views
--listen-addr /ip4/0.0.0.0/tcp/9944/ws breaks polkadot.js
I am trying to get my westend boot nodes to also serve polkadot.js
Following https://github.com/paritytech/polkadot/issues/6208, there is a recommendation [requirement?] to run polkadot with Node was ...
0
votes
1
answer
47
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 ...
2
votes
1
answer
47
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 ?
0
votes
0
answers
30
views
Property 'x' does not exist on type 'DecoratedRpc<"promise", RpcInterface>'
I have decorated custom RPC types for methods for polkadot-js-apps. I added them in ./packages/apps-config/src/api/spec/<chain-name>.ts, (then i also needed to add it into typesBundle.js, and ...
2
votes
1
answer
50
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 ...
2
votes
1
answer
40
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 ...
2
votes
1
answer
123
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::...
2
votes
1
answer
164
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 ...
3
votes
1
answer
45
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/...
2
votes
1
answer
105
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(...
1
vote
1
answer
34
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 ...
3
votes
1
answer
181
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/...
0
votes
0
answers
55
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 ...
2
votes
1
answer
66
views
Frontier EVM integration: UnknownTransaction::NoUnsignedValidator error occurs while transferring funds via Metamask
I'm integrating Frontier EVM into my Substrate chain and facing the following issue while trying to send some funds between accounts via metamask:
[ethjs-query] while formatting outputs from RPC '{&...
4
votes
2
answers
193
views
How to decorate RPC correctly?
The rpc methods (showing in rpc_methods), are still not showing in their own area, after (attempting to) decorate the rpc.
I have custom rpc on a substrate template.
Here are the rpc_methods:
I have ...
1
vote
1
answer
184
views
Is it possible to submit an extrinsic using rpc?
Could it be possible to submit and extrinsic using JSON-RPC methods.
Say submit a balance_transfer along with its parameters using curl or postman as a JSON-RPC
1
vote
1
answer
47
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 ...
2
votes
2
answers
112
views
Finding about native token of a parachain
Is there a way to query whether a chain has a native token and what it is?
For instance can I query Moonbeam, to find that it's native token is GLMR(Glimmer). Similarly for the rest of the parachains.
1
vote
1
answer
27
views
Where is the `peer_count` function?
I can't find the net::* RPC APIs under https://github.com/paritytech/substrate/tree/be259234bfee056bef970ac372e04a74411c5224/client/rpc-api.
There are three net APIs, netListening, netPeerCount and ...
0
votes
2
answers
81
views
incorrect balance response
I've created test address in westend network. Topped up it using faucet. https://westend.subscan.io/account/5FpS4PkRzLmJZcwvJM6jxPU3N3481nbnTe6nzFwwQUVvu9LF?tab=transfer. In explorer I see 1WND ...
5
votes
1
answer
103
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 ...
1
vote
1
answer
48
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....
1
vote
2
answers
114
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
36
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
336
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
97
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
600
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
103
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
75
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
44
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!