Build a Complex Transaction
Simple Transactions
Sending a transaction using the Flow CLI can simply be achieved by using the send command documented here.
Complex Transactions
If you would like to build more complex transactions the Flow CLI provides commands to build, sign and send transactions allowing you to specify different authorizers, signers and proposers.
The process of sending a complex transactions includes three steps:
Read more about each command flags and arguments in the above links.
Examples
We will describe common examples for complex transactions. All examples are using an example configuration.
Single payer, proposer and authorizer
The simplest Flow transaction declares a single account as the proposer, payer and authorizer.
Build the transaction:
Sign the transaction:
Submit the signed transaction:
Transaction content (tx.cdc
):
Single payer and proposer, multiple authorizers
A transaction that declares same payer and proposer but multiple authorizers each required to sign the transaction. Please note that the order of signing is important, and the payer must sign last.
Build the transaction:
Sign the transaction with authorizers:
Sign the transaction with payer:
Submit the signed transaction:
Transaction content (tx.cdc
):
Different payer, proposer and authorizer
A transaction that declares different payer, proposer and authorizer each signing separately. Please note that the order of signing is important, and the payer must sign last.
Build the transaction:
Sign the transaction with proposer:
Sign the transaction with authorizer:
Sign the transaction with payer:
Submit the signed transaction:
Transaction content (tx.cdc
):
Single payer, proposer and authorizer but multiple keys
A transaction that declares same payer, proposer and authorizer but the signer account has two keys with half weight, required to sign with both.
Build the transaction:
Sign the transaction with the first key:
Sign the transaction with the second key:
Submit the signed transaction:
Transaction content (tx.cdc
):
Configuration
This is an example configuration using mock values: