Comment on page
you need it when you ...
- need to query for logs
- OR need to query for historical tx receipt that exist before you start the provider or rpc adapter
Transactions from unfinalized blocks only live in cache, so new transactions will usually be in the cache first (for a couple blocks), then live in both the cache and the subquery, later, after the cache expires, they only live in subquery.
Developers who run a mandala node and eth-rpc-adaptor locally, usually won’t need to start any subquery or database services for testing, since new transaction receipt will be in cache and findable without subquery, as long as there is no need for querying the transactions older than 200 blocks.
Also, logs are NOT cached (we will probably implement log cache in the future). So if your tests rely on logs, for example if they call
eth_getLogs, you will need subquery.
Cache vs. SubQuery representation
Metamask will sometimes cache the nonce locally, which is used to infer next tx nonce. For example, if we send a tx with nonce 3, metamask will set nonce 4 for next tx. However, after we restart the local mandala node, all accounts are reset and the nonce is back to 0, but metamaks doesn't know it!
As a result, the account with nonce 0 send a tx with nonce 4, which won't be mined and got stuck!
To solve this, we need to reset metamask after restarting local Mandala, so the nonce and cache will be cleared:
settings => advanced => reset account. Or we can simply manually override the nonce to
0for the first metamask tx after restarting the network.
Metamask shows total balance, which might include non-transferable balances. For example, if some of your ACA is staking, they will still show in metamask, but can't be transfered.
In this case
ReserveStorageFailedmeans account balance not enough.
tx failed reason
there are 2 ways: