Sign a Transaction with the Flow CLI
The Flow CLI provides a command to sign transactions with options to specify authorizer accounts, payer accounts and proposer accounts.
Use this functionality in the following order:
- Use the
build
command to build the transaction. - Use this command (
sign
) to sign with each account specified in the build process. - Use the
send-signed
command to submit the signed transaction to the Flow network.
_10flow transactions sign <built transaction filename>
Example Usage
_41> flow transactions sign ./built.rlp --signer alice \_41 --filter payload --save signed.rlp_41_41Hash b03b18a8d9d30ff7c9f0fdaa80fcaab242c2f36eedb687dd9b368326311fe376_41Payer f8d6e0586b0a20c7_41Authorizers [f8d6e0586b0a20c7]_41_41Proposal Key: _41 Address f8d6e0586b0a20c7_41 Index 0_41 Sequence 6_41_41No Envelope Signatures_41_41Payload Signature 0:_41 Address f8d6e0586b0a20c7_41 Signature b5b1dfed2a899037...164e1b224a7ac924018e7033b68b0df86769dd54_41 Key Index 0_41_41_41Arguments (1):_41 - Argument 0: {"type":"String","value":"Meow"}_41_41_41Code_41_41transaction(greeting: String) {_41 let guest: Address_41_41 prepare(authorizer: AuthAccount) {_41 self.guest = authorizer.address_41 }_41_41 execute {_41 log(greeting.concat(",").concat(self.guest.toString()))_41 }_41}_41_41_41Payload:_41f90184f...a199bfd9b837a11a0885f9104b54014750f5e3e5bfe4a5795968b0df86769dd54c0
Arguments
Built Transaction Filename or Remote Server URL
- Name:
built transaction filename | --from-remote-url <url>
- Valid inputs: Any filename and path valid on the system or --from-remote-url flag and fully qualified remote server url.
Specify the filename containing valid transaction payload that will be used for signing.
To be used with the flow transaction build
command.
When --from-remote-url flag is used the value needs to be a fully qualified url to transaction RLP
Example: flow transaction sign --from-remote-url https://fully/qualified/url --signer alice
Flags
From Remote Url
- Flag:
--from-remote-url
- Valid input:
http(s)://fully/qualified/server/url
Specify this flag with a fully qualified url to transaction RLP. The RLP will be fetched from server then signed. The resulting signed RLP is then posted to the remote url. This feature is to support protocol level multiple signature transaction coordination between multiple signers.
Note: --yes flag is not supported and will fail sign
command when this flag is used. This forces the user to verify the cadence code.
Include Fields
- Flag:
--include
- Valid inputs:
code
,payload
,signatures
Specify fields to include in the result output. Applies only to the text output.
Signer
- Flag:
--signer
- Valid inputs: the name of an account defined in the configuration (
flow.json
)
Specify the name of the account that will be used to sign the transaction.
Host
- Flag:
--host
- Valid inputs: an IP address or hostname.
- Default:
127.0.0.1:3569
(Flow Emulator)
Specify the hostname of the Access API that will be used to execute the commands.
Network Key
- Flag:
--network-key
- Valid inputs: A valid network public key of the host in hex string format
Specify the network public key of the Access API that will be used to create a secure GRPC client when executing the command.
Network
- Flag:
--network
- Short Flag:
-n
- Valid inputs: the name of a network defined in the configuration (
flow.json
) - Default:
emulator
Specify which network you want the command to use for execution.
Filter
- Flag:
--filter
- Short Flag:
-x
- Valid inputs: case-sensitive name of the result property.
Specify any property name from the result you want to return as the only value.
Output
- Flag:
--output
- Short Flag:
-o
- Valid inputs:
json
,inline
Specify in which format you want to display the result.
Save
- Flag:
--save
- Short Flag:
-s
- Valid inputs: valid filename
Specify the filename where you want the result to be saved.
Log
- Flag:
--log
- Short Flag:
-l
- Valid inputs:
none
,error
,debug
- Default:
info
Specify the log level. Control how much output you want to see while command execution.
Configuration
- Flag:
--conf
- Short Flag:
-f
- Valid inputs: valid filename
Specify a filename for the configuration files, you can provide multiple configuration
files by using -f
flag multiple times.
Version Check
- Flag:
--skip-version-check
- Default:
false
Skip version check during start up to speed up process for slow connections.