Skip to main content

Capsule is small Python SDK tool you can use to deploy Terra CosmWasm contracts to a given Terra (Cosmos SDK Based) chain.

Project description

capsule

capsule is a small tool with a simple but noble goal; to make deployment of CosmWasm contracts easier.

Firstly we are targeting Terra as the Sponsor User chain as we build out the capsule tool. Eventually we aim to make capsule one of the tools of choice for deploying CosmWasm contracts on all chains!

Installation

Install from pypi

pip install -i https://test.pypi.org/simple/ capsule

We have published the package also under capsule_terra. This is temporary until a final package namespace is chosen.

pip install -i https://test.pypi.org/simple/ capsule_terra
pip install -i https://test.pypi.org/simple/ capsule_terra

Install locally

Git clone the project and change into its parent directory.

git clone
cd 

Install the project using setup tools.

python setup.py install

Access the tool using the command line.

capsule -h

Note: If you have an issue with the above an the command line tool, depending on your platform you will need to prepare a standard distribution and install that. To do so here is two commands together:

python setup.py sdist && pip install dist/capsule-0.0.0.tar.gz

Available Commands and Usage

Deploy - Deploy a given cosm wasm contract artifact to a chain of your choice

capsule deploy -h
usage: 
    $ capsule deploy -p ./my_contract.wasm -c columbus-5
    $ capsule deploy --path ./artifacts/my_contract.wasm --chain tequila-0004
    $ capsule deploy --path ./artifacts/my_contract.wasm --initmsg {'count':3}

Helper tool which enables you to programatically deploy a Wasm contract artifact to a chain as a code object and instantiate it

Configuration

The capsule tool offers the ability to store details you need in a configuration file using the toml format.

The config file by default is located in a capsule specific hidden directory at the home dir level: ~/.capsule It is possible also to specify the path to a custom config file using the CAPSULE_CONFIG_FILE environment variable.

Something to be explored is also enabling both the Mnemonic and the chain to deploy too as env vars also. If this was to happen the order of priority would then become Credentials in the environment -> Config file in the environment -> Default or specified config file. Following this pattern in theory should make this tool very easy to use in CI/CD as a given user can just specify the Mnemonic and chain ID for as secrets in the job for a quick start.

CI/CD

This project uses Github Actions to perform automatic testing on each push and PR as well as a deployment to both test and prod pypi.

Some notes: When deploying to pypi, a version number can only be deployed once! All subsequent deployments will get a 400 and the job will fail.

As a procedure we should update the version number when a new deployed build is needed. Or have its patch versions done automatically.

Lastly the production build which pushes to Pypi only works with a tagged commit.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

capsule_terra-0.0.2.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

capsule_terra-0.0.2-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file capsule_terra-0.0.2.tar.gz.

File metadata

  • Download URL: capsule_terra-0.0.2.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for capsule_terra-0.0.2.tar.gz
Algorithm Hash digest
SHA256 d2459758fad9b6b18979a8559914116c00984b4531f711dfa01025485262997d
MD5 4cfad1d0f45548bb1c91171dc6410d50
BLAKE2b-256 39bbb78a9bab5719fccb1172ab8e3b92c48fa6827f2fbdeb738987c0a4a7c73b

See more details on using hashes here.

File details

Details for the file capsule_terra-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: capsule_terra-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for capsule_terra-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e49fa6e6c7ab1ba5817d2a538c3875f50790a2fa610c9bede7457e3ab15db408
MD5 cf3229ff5ca3323c3c2e40a4a22296f9
BLAKE2b-256 28b9c4af8f4cd37b32ddfc1c9ec2d965d0155b33fd978f4579d923f497baf9eb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page