flow-cli icon indicating copy to clipboard operation
flow-cli copied to clipboard

Allow specifying reference block height for transaction

Open Kay-Zee opened this issue 1 year ago • 1 comments

Issue To Be Solved

The transactions build command doesn't seem to provide an option to select the block height in which to use as the reference block height. While this is currently done automatically via the latest block height available, this forces some connection with an AN, which could possibly be avoided if we know at approximately which height we'd like to send the tx.

Somewhat niche use-case, but should have the flexibility to input the reference height

Usage:
  flow transactions build <code filename>  [<argument> <argument> ...] [flags]

Examples:
flow transactions build ./transaction.cdc "Hello" --proposer alice --authorizer alice --payer bob


Flags:
      --args-json string         arguments in JSON-Cadence format
      --authorizer strings       transaction authorizer (default [emulator-account])
      --gas-limit uint           transaction gas limit (default 1000)
  -h, --help                     help for build
      --payer string             transaction payer (default "emulator-account")
      --proposer string          transaction proposer (default "emulator-account")
      --proposer-key-index int   proposer key index

Global Flags:
  -f, --config-path strings   Path to flow configuration file (default [/Users/kanzhang/flow.json,flow.json])
  -x, --filter string         Filter result values by property name
      --host string           Flow Access API host address
  -l, --log string            Log level, options: "debug", "info", "error", "none" (default "info")
  -n, --network string        Network from configuration file (default "emulator")
      --network-key string    Flow Access API host network key for secure client connections
  -o, --output string         Output format, options: "text", "json", "inline" (default "text")
  -s, --save string           Save result to a filename
      --skip-version-check    Skip version check during start up
  -y, --yes                   Approve any prompts

(Optional): Suggest A Solution

Simply adding an optional flag for the block height would suffice

(Optional): Context

I'd like to build a tx without needed to ask for the latest block height, as well as possibly pick a height in the future

Kay-Zee avatar Jun 07 '23 17:06 Kay-Zee