@voydwalkr/terrain
v0.2.0-alpha.1
Published
Flavored Terra development environment
Downloads
3
Maintainers
Readme
VoydWalkr's Terrain Fork
This is a flavored fork of @terra-money/terrain. What started as a simple mod quickly devolved into its own existence.
Proper documentation will follow. For now, I hope the terrain --help
command suffices.
Table of Contents
Installation
Currently, VoydWalkr's Terrain is an alpha release. I lack the capacity to extensively test all facets of the fork; please report any issues you come across.
Install with npm via $ npm i --global @voydwalkr/terrain
,
or with yarn via $ yarn global add @voydwalkr/terrain
.
Linux: Setup libsecret
On Linux only, keytar depends on libsecret
. If not already available on your system, install like so:
- Debian/Ubuntu/PopOS:
sudo apt install libsecret-1-dev
- Red Hat:
sudo yum install libsecret-devel
- Arch Linux:
sudo pacman -S libsecret
Notable Differences
There were some design choices which noticably distinguish this fork from the original - design choices which make it unfeasible to merge this fork back into the original.
Keytar Support
Rather than store private keys or entire mnemonics in plain text in the project root, we store them in secure storage dependent on your platform. We thus do not have the wallet
topic, but the key
topic.
TOML Configuration
I found the config.terrain.json
file cumbersome and bulky, so I decided to implement project configuration with TOML.
Terrain Files Renamed
Terrain files followed the format <file>.terrain.<ext>
. I changed it to terrain.<file>.<ext>
to lexigraphically group terrain files together.
terrain code:new NAME
terrain code:store CONTRACT
terrain console
terrain contract:instantiate CONTRACT
terrain contract:migrate [CONTRACT]
terrain contract:new NAME
terrain contract:store CONTRACT
terrain contract:updateAdmin CONTRACT ADMIN
terrain key:add:mnemonic NAME
terrain key:add:raw NAME [KEY]
terrain key:delete NAME
terrain key:list [TYPE]
terrain new NAME
terrain schema:compile [CONTRACT]
terrain sync-refs [FILE]
terrain task:new [TASK]
terrain task:run [TASK]
terrain test CONTRACT-NAME
terrain version
terrain code:new NAME
Generate new contract.
USAGE
$ terrain code:new [NAME] [--path <value>] [--version <value>]
FLAGS
--path=<value> [default: ./contracts] path to keep the contracts
--version=<value> [default: 0.16]
DESCRIPTION
Generate new contract.
See code: src/commands/code/new.ts
terrain code:store CONTRACT
Store code on chain.
USAGE
$ terrain code:store [CONTRACT] --signer <value> [--no-rebuild] [--network <value>] [--config-path <value>]
[--refs-path <value>] [--keys-path <value>] [--migrate]
FLAGS
--config-path=<value> [default: ./config.terrain.toml]
--keys-path=<value> [default: ./terrain.keys.js]
--migrate migrate the contract to an updated version after a chain upgrade; works only once per chain
upgrade
--network=<value> [default: localterra]
--no-rebuild
--refs-path=<value> [default: ./terrain.refs.json]
--signer=<value> (required)
DESCRIPTION
Store code on chain.
See code: src/commands/code/store.ts
terrain console
Start a repl console that provides context and convinient utilities to interact with the blockchain and your contracts.
USAGE
$ terrain console [--network <value>] [--config-path <value>] [--refs-path <value>] [--keys-path <value>]
FLAGS
--config-path=<value> [default: config.terrain.toml]
--keys-path=<value> [default: terrain.keys.js]
--network=<value> [default: localterra]
--refs-path=<value> [default: terrain.refs.json]
DESCRIPTION
Start a repl console that provides context and convinient utilities to interact with the blockchain and your
contracts.
See code: src/commands/console.ts
terrain contract:instantiate CONTRACT
Instantiate the contract.
USAGE
$ terrain contract:instantiate [CONTRACT] --signer <value> [--network <value>] [--config-path <value>] [--refs-path
<value>] [--keys-path <value>] [--instance-id <value>] [--no-admin] [--admin <value>]
FLAGS
--admin=<value> admin address to set - defaults to signer
--config-path=<value> [default: ./config.terrain.toml]
--instance-id=<value> [default: default]
--keys-path=<value> [default: ./terrain.keys.js]
--network=<value> [default: localterra]
--no-admin instantiate contract w/o an admin; this prohibits migrations
--refs-path=<value> [default: ./terrain.refs.json]
--signer=<value> (required)
DESCRIPTION
Instantiate the contract.
See code: src/commands/contract/instantiate.ts
terrain contract:migrate [CONTRACT]
migrate an existing contract instance
USAGE
$ terrain contract:migrate [CONTRACT] --signer <value> [--network <value>] [--config-path <value>] [--refs-path
<value>] [--keys-path <value>] [--instance-id <value>]
FLAGS
--config-path=<value> [default: ./config.terrain.toml]
--instance-id=<value> [default: default]
--keys-path=<value> [default: ./terrain.keys.js]
--network=<value> [default: localterra]
--refs-path=<value> [default: ./terrain.refs.json]
--signer=<value> (required)
DESCRIPTION
migrate an existing contract instance
See code: src/commands/contract/migrate.ts
terrain contract:new NAME
Generate new contract.
USAGE
$ terrain contract:new [NAME] [--path <value>] [--version <value>] [--authors <value>]
FLAGS
--authors=<value> [default: Terra Money <[email protected]>]
--path=<value> [default: ./contracts] path to keep the contracts
--version=<value> [default: 1.0-beta6]
DESCRIPTION
Generate new contract.
EXAMPLES
$ terrain code:new awesome_contract
$ terrain code:new awesome_contract --path path/to/dapp
$ terrain code:new awesome_contract --path path/to/dapp --authors "ExampleAuthor<[email protected]>"
See code: src/commands/contract/new.ts
terrain contract:store CONTRACT
Store code on chain.
USAGE
$ terrain contract:store [CONTRACT] --signer <value> [--no-rebuild] [--network <value>] [--config-path <value>]
[--refs-path <value>] [--keys-path <value>] [--arm64] [--migrate]
FLAGS
--arm64
--config-path=<value> [default: ./config.terrain.toml]
--keys-path=<value> [default: ./terrain.keys.js]
--migrate
--network=<value> [default: localterra]
--no-rebuild
--refs-path=<value> [default: ./terrain.refs.json]
--signer=<value> (required)
DESCRIPTION
Store code on chain.
See code: src/commands/contract/store.ts
terrain contract:updateAdmin CONTRACT ADMIN
Update the admin of a contract.
USAGE
$ terrain contract:updateAdmin [CONTRACT] [ADMIN] --signer <value> [--network <value>] [--config-path <value>]
[--refs-path <value>] [--keys-path <value>] [--instance-id <value>]
FLAGS
--config-path=<value> [default: ./config.terrain.toml]
--instance-id=<value> [default: default]
--keys-path=<value> [default: ./terrain.keys.js]
--network=<value> [default: localterra]
--refs-path=<value> [default: ./terrain.refs.json]
--signer=<value> (required)
DESCRIPTION
Update the admin of a contract.
See code: src/commands/contract/updateAdmin.ts
terrain key:add:mnemonic NAME
add a new private key by mnemonic
USAGE
$ terrain key:add:mnemonic [NAME]
DESCRIPTION
add a new private key by mnemonic
See code: src/commands/key/add/mnemonic.ts
terrain key:add:raw NAME [KEY]
add a new raw private key
USAGE
$ terrain key:add:raw [NAME] [KEY]
DESCRIPTION
add a new raw private key
See code: src/commands/key/add/raw.ts
terrain key:delete NAME
delete an existing private key
USAGE
$ terrain key:delete [NAME]
DESCRIPTION
delete an existing private key
See code: src/commands/key/delete.ts
terrain key:list [TYPE]
list stored private keys by name
USAGE
$ terrain key:list [TYPE]
DESCRIPTION
list stored private keys by name
See code: src/commands/key/list.ts
terrain new NAME
Create new dapp from a template.
USAGE
$ terrain new [NAME] [--path <value>] [--framework ] [--version <value>] [--authors <value>]
FLAGS
--authors=<value> [default: Terra Money <[email protected]>]
--framework=<option> [default: react] Choose the frontend framework you want to use. Non-react framework options have
better wallet-provider support but less streamlined contract integration.
<options: >
--path=<value> [default: .] Path to create the workspace
--version=<value> [default: 1.0]
DESCRIPTION
Create new dapp from a template.
EXAMPLES
$ terrain new awesome-dapp
$ terrain new awesome-dapp --path path/to/dapp
$ terrain new awesome-dapp --path path/to/dapp --authors "ExampleAuthor<[email protected]>"
$ terrain new awesome-dapp --path path/to/dapp --framework vue --authors "ExampleAuthor<[email protected]>"
See code: src/commands/new.ts
terrain schema:compile [CONTRACT]
compile JSON schemas and their corresponding TypeScript type definitions
USAGE
$ terrain schema:compile [CONTRACT]
DESCRIPTION
compile JSON schemas and their corresponding TypeScript type definitions
See code: src/commands/schema/compile.ts
terrain sync-refs [FILE]
Sync configuration with frontend app.
USAGE
$ terrain sync-refs [FILE] [--refs-path <value>] [--dest <value>]
FLAGS
--dest=<value> [default: ./frontend/src/terrain.refs.json]
--refs-path=<value> [default: ./terrain.refs.json]
DESCRIPTION
Sync configuration with frontend app.
See code: src/commands/sync-refs.ts
terrain task:new [TASK]
create new task
USAGE
$ terrain task:new [TASK]
DESCRIPTION
create new task
See code: src/commands/task/new.ts
terrain task:run [TASK]
run predefined task
USAGE
$ terrain task:run [TASK] [--network <value>] [--config-path <value>] [--refs-path <value>] [--keys-path
<value>]
FLAGS
--config-path=<value> [default: config.terrain.toml]
--keys-path=<value> [default: terrain.keys.js]
--network=<value> [default: localterra]
--refs-path=<value> [default: terrain.refs.json]
DESCRIPTION
run predefined task
See code: src/commands/task/run.ts
terrain test CONTRACT-NAME
Runs unit tests for a contract directory.
USAGE
$ terrain test [CONTRACT-NAME] [--no-fail-fast]
FLAGS
--no-fail-fast Run all tests regardless of failure.
DESCRIPTION
Runs unit tests for a contract directory.
EXAMPLES
$ terrain test counter
$ terrain test counter --no-fail-fast
See code: src/commands/test.ts
terrain version
USAGE
$ terrain version
See code: @oclif/plugin-version