Interact with the Terra Classic blockchain using this command-line interface (CLI) script. Perform actions such as storing a contract, instantiating it, executing functions, querying state, and migrating contracts.
- Clone this repository:
git clone https://github.com/przmyst/contract-cli
- Navigate to the directory and install the dependencies:
npm install
You can interact with the Terra blockchain by using the following command format:
node index <command> [arguments...]
Ensure you have the necessary environment variables set up, such as MNEMONIC
, CHAIN_ID
, etc.
-
store: Store a WASM contract on the Terra blockchain.
node index store [path-to-wasm-file]
-
instantiate: Instantiate a stored contract.
node index instantiate [code-id] [luna-deposit] [label]
-
execute: Execute the
increment
function of a given contract.node index execute [contract-address]
-
query: Query the state of a given contract.
node index query [contract-address]
-
migrate: Migrate a contract to new code.
node index migrate [contract-address] [code-id]