Skip to contents

Creates a global variable on the blockchain. Variables are key‑value stores that can be read by filters and transactions.

Usage

mc_create_variable(conn, name, open = TRUE, value = NULL)

Arguments

conn

A connection object created by mc_connect.

name

Character string. Variable name (must be unique).

open

Logical. If TRUE, anyone with create permissions can edit the variable. If FALSE, only admins can edit.

value

Optional. Initial JSON value (list, number, string, etc.).

Value

A list containing the result of the RPC call (usually transaction ID).

Examples

if (FALSE) { # \dontrun{
mc_create_variable(conn, "myvar", open = TRUE, value = list(key = "value"))
} # }