Blockchain Interactions
Query and mutate Flow blockchain
Last updated
Was this helpful?
Query and mutate Flow blockchain
Last updated
Was this helpful?
Make sure you have set the configuration in first.
We are assuming you have read the before this, as transactions are sort of scripts with more required things.
There are two different operations to interact with Flow blockchain:
Query: Send arbitrary Cadence scripts to the chain and receive decoded values. Can be performed without user login
Mutate: Use transaction to send Cadence code with specify authorizer to perform permanently state changes on chain. Must be performed after user logged in
While query
is used for sending scripts to the chain, mutate
is used for building and sending transactions.
In order to check transaction status, we can use getTransactionStatus
in fcl
to keep polling until transaction have been sealed into block.
After the status changes to sealed, we can query the Flow blockchain to see if the transaction works as expected.