Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runbook execution models #43

Open
lgalabru opened this issue Apr 20, 2024 · 0 comments
Open

Runbook execution models #43

lgalabru opened this issue Apr 20, 2024 · 0 comments

Comments

@lgalabru
Copy link
Member

Project Types

File-based

Typical Layout

path
path/hello.tx

Command

txtx run path/hello.tx

Directory-based

Typical Layout

path
path/hello/
path/hello/inputs.tx
path/hello/main.tx

Command

txtx run path/hello

Manifest-based

Typical Layout

path
path/txtx.json
path/run/
path/run/dir-1/
path/run/dir-1/subdir-1/
path/run/dir-1/subdir-1/inputs.tx
path/run/dir-1/subdir-1/main.tx

Command

txtx run --runbook dir-1/subdir-1

Execution types

Assuming path/hello.tx

input "token_name" {
  default_value = "stSTX"
  type = "string"
}

input "max_debt" {
  value = 3700000000000
  type = "uint"
}

action "set_token_transaction" "stacks::encode_contract_call" {
  description = "Encodes the contract call, prompts the user to sign, and broadcasts the set-token function."
  network_id = input.network_id.value
  contract_id = "${input.contract_address.value}.arkadiko-vaults-tokens-v1-1"
  function_name = "set-token"
  function_args = [
    cv_ascii(input.token_name.value),
    cv_uint(input.max_debt.value),
  ]
}

output "encoded_payload" {
    value = action.value
}

Interactive

Running

txtx run path/hello.tx

Should run the Web console UI.

Running

txtx run path/hello.tx --input-token_name stSTX --input-max_debt 3700000000000

Should run the web console, replacing the default inputs.

Command line

Running

txtx run path/hello.tx --input-token_name stSTX --input-max_debt 3700000000000

Should execute the runbook, CLI prompt the values that have missing value (no value + default value), and display the outputs.

We could add --json-output formatting the outputs as json, and --output-encoded_payload to display one particular value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant