Skip to main content
19 votes
Accepted

Is there a good indexer for substrate chains (like the graph)?

I personally run an Archive node on my computer which has been sufficient for the queries I do, but there are some tools available within the Substrate ecosystem built more specifically for deep ...
Shawn Tabrizi's user avatar
  • 16.1k
14 votes

Is there a good indexer for substrate chains (like the graph)?

There is also Subsquid, which you can check out https://docs.subsquid.io/#hydra-quickstart
Sam Elamin's user avatar
  • 1,223
12 votes
Accepted

Transaction rollback in Substrate

At the time of this post, Substrate does not have a "revert" behavior by default. That is, any change made to storage will be committed to the chain at the end of the block. We are in the ...
Shawn Tabrizi's user avatar
  • 16.1k
12 votes

Can nonces be skipped in Polkadot/ Kusama

For a default Substrate node, Polkadot and Kusama chain using the CheckNonce signed extension, the answer is "no". What it actually does is the following - If the tx-nonce < account-...
Jaco's user avatar
  • 5,865
12 votes

How to find how many transactions are pending from address to be added to block?

The author_pendingExtrinsics RPC provides the list of pending extrinsics that is in the pool. This is retrieved on a per-node basis, i.e. it will list the extrinsics that is available for the specific ...
Jaco's user avatar
  • 5,865
12 votes

Is a transaction an extrinsic?

Yes, in Substrate, transactions can generally be thought of as any piece of data that's intended for the transaction pool (and consequently, could potentially be included in a block). But there are ...
Sacha Lansky's user avatar
  • 2,640
10 votes
Accepted

What is unique about Substrate's transaction pool?

In my opinion, what makes the implementation of Substrate's transaction pool unique is the concept of Signed Extensions. Developers can use the signed extensions to add any custom logic prior to ...
Iker's user avatar
  • 1,356
9 votes
Accepted

What are the Steps for Encoding an Extrinsic in Substrate?

More generally, if you were to SCALE encode a signed transaction, you'd follow these steps: Combine the call, extra and additional data and SCALE encode it: call data: the pallet index, call index ...
Sacha Lansky's user avatar
  • 2,640
8 votes

Why unsigned extrinsics?

That is correct - with a signed transaction there is validation to check the nonce, make sure the user has enough to pay for the fee, and check if the signature is valid. With an unsigned transaction ...
Bruno's user avatar
  • 8,315
8 votes
Accepted

Get account transactions using Substrate API

Substrate indeed covers quite many use-cases, not just transferring coins from one account to another, and some of that complexity will leak through any API, even if there are specialized ones in the ...
wigy's user avatar
  • 375
7 votes

Is there a good indexer for substrate chains (like the graph)?

I recommend using Subsquid Archive (indexer) to store chain history, you can then use GraphQL to query instantly anything you want. The Archive can be connected with a Squid (processor) that will ...
mrq's user avatar
  • 150
7 votes

Can an account's transactions be front-run on Polkadot? If so, how?

The answer in general is yes, Substrate and Polkadot use a transaction queue just like most other blockchains, and because of this it is possible to increase the transaction fees included with some ...
Shawn Tabrizi's user avatar
  • 16.1k
7 votes
Accepted

Transactions lifecycle

The transaction queue in Substrate has client side APIs that check for the validity of transactions and sorts them into two queues: the ready and future queues. Transactions in the ready queue are ...
Sacha Lansky's user avatar
  • 2,640
7 votes

Transaction rollback in Substrate

I believe you're referring to rolling back storage modifications, right? In that case, you may use the #[transactional] macro to achieve that purpose. That or you may use the "Verify first, write ...
Angelo's user avatar
  • 501
7 votes
Accepted

How to send transactions using RPC?

To send the transaction look at the author_submitExtrinsic and author_submitAndWatchExtrinsic, the latter when using subscriptions and wanting to have access to the processing status. As to the format,...
Jaco's user avatar
  • 5,865
7 votes
Accepted

Can't get transaction hash from signAndSend of Polkadot.js

The txhash is only returned when you use the non-subscribe form. In code for the non-sub form - // don't subscribe, txhash is returned const txHash = await polkadot.tx.balances .transfer('5F1pZe........
Jaco's user avatar
  • 5,865
7 votes
Accepted

How the transaction payment pallet handles transaction fee of every extrinsic?

It handles transaction payments through what is known as Signed Extensions in Substrate. Basically, a signed extension allows you to perform logic that pertains to validating the transaction received ...
Purple_Turtle's user avatar
7 votes
Accepted

Calculating actual weights for extrinsics

First, the transaction_payment pallet does this for you with compute_actual_fee from the post_dispatch and configuring it in your runtime with the ChargeTransactionPayment signed extension via ...
Daan van der Plas's user avatar
7 votes
Accepted

Are on_idle hooks transactional?

No, pallet hooks are not transactional by default, only extrinsics are. You should be able to create a transactional layer within the pallet hook so that the error of NoLayer goes away, but generally, ...
Shawn Tabrizi's user avatar
  • 16.1k
6 votes

Get account transactions using Substrate API

No blockchain is designed to be able to easily get all transactions for an account, as this is a waste of storage for a normal syncing chain. Substrate provide the ability to run an Archive node, ...
Shawn Tabrizi's user avatar
  • 16.1k
6 votes

Transactions lifecycle

Every node validates every transaction that comes from the outside. From the outside here means either by a RPC call or from another node. If a transaction is valid it is stored in the ready or future ...
bkchr's user avatar
  • 11.6k
6 votes

How can I get a deeper / lower level insight into how my transaction is processed with sidecar?

Sidecar provides the following experimental trace related endpoints : /experimental/blocks/{blockId}/traces/operations?actions=false /experimental/blocks/head/traces/operations?actions=false /...
dominique's user avatar
  • 1,693
6 votes
Accepted

Why could we find the same transaction hash in 3 different blocks?

In substrate what uniquely identifies an extrinsic is the block# + its index in that block, not the call hash. So in this case, the call you are referring to would be identified by 10219793-2, for ...
Alejandro Martínez's user avatar
6 votes

Get Transactions from wallet address in polkadot.js/api

To answer your comment around block-by-hash (there are no account -> transaction mappings on the RPCs, as per the linked answers in the comments above) - You can use the getBlock RPC call. Since ...
Luna's user avatar
  • 321
6 votes
Accepted

Cannot map Enum JSON, unable to find 'aUSD' in token in api.tx.currencies.transfer

Looking at the extrinsics page, the currencyId is an Enum indicating the type of transfer. So you need to pass the Token explicitly. This should do the trick - const transfer = polkadot.tx.currencies....
Jaco's user avatar
  • 5,865
6 votes
Accepted

Substrate call raw transaction

05000046ebddef8cd9bb167dc30878d7113b7e168e6f0646beffd77d69d39bad76b47a30 is an encoded call, but it is not an encoded extrinsic. So you won't be able to submit that into the pool, the format is ...
Jaco's user avatar
  • 5,865
6 votes

Substrate weight limits and block production

Your understanding is correct, if max_total is reached for a particular Dispatch Class, no more transactions of that class will be attempted to be included in the block. Substrate is flexible about ...
NachoPal's user avatar
  • 514
6 votes
Accepted

How to make rawTransaction? and Can I get some guide or reference about offchain sign?

In order to make an unsigned transaction you can create an object with the required chain metadata and payload information: // create unsigned transaction payload const unsigned = { ...
Cameron Marshall's user avatar
6 votes

Sign a transaction offline for Westend testnet and verification of the transaction

For context all the information to answer this question is in this github issue: https://github.com/paritytech/txwrapper-core/issues/296 Given the address you are using to conduct the transaction, ...
Tarik Gul's user avatar
  • 1,131
5 votes

How to use Polkadot.js API for governance proxy call correctly?

To wrap something in a proxy, just pass the api.tx.<module>.<method>(...) as-is. In code it would be - function proxyVoting(address, type, ref_index, vote) { return api.tx.proxy.proxy( ...
Jaco's user avatar
  • 5,865

Only top scored, non community-wiki answers of a minimum length are eligible