Go to file
Ethan Frey 81e4b66919 Minor adjustments to docker 2020-02-18 22:37:33 +01:00
.circleci Fix ci release build command 2020-02-05 14:56:51 +01:00
.github Merge remote-tracking branch 'remotes/gaia/master' into merge_gaia_master 2020-01-23 14:07:35 +01:00
app Update deps to forked sdk v0.38.2, support --trace debug flag 2020-02-08 22:37:12 +01:00
cli_test Fixed (last) cli test failure 2020-01-23 20:07:35 +01:00
cmd update to sdk v0.38.0 2020-01-23 18:07:52 -05:00
contrib Search and replace gaiad/cl with wasmd/cli 2019-11-19 22:29:50 +01:00
docker Minor adjustments to docker 2020-02-18 22:37:33 +01:00
docs Merge remote-tracking branch 'remotes/gaia/master' into merge_gaia_master 2020-01-23 14:07:35 +01:00
lcd_test update to sdk v0.38.0 2020-01-23 18:07:52 -05:00
networks Merge remote-tracking branch 'remotes/gaia/master' into merge_gaia_master 2020-01-23 14:07:35 +01:00
x/wasm Fixed up REST query responses 2020-02-11 10:02:36 +01:00
.codecov.yml Merge PR #209: update PR template 2019-12-04 14:44:38 -05:00
.gitattributes Merge PR #25: Remove swagger (defined in the SDK) 2019-05-28 09:57:26 -04:00
.gitignore Merge remote-tracking branch 'remotes/gaia/master' into merge_gaia_master 2020-01-23 14:07:35 +01:00
.golangci.yml Merge PR #188: Add linting to CI 2019-11-14 12:04:50 -08:00
CHANGELOG.md Merge PR #265: add version v2.0.5 to CHANGELOG 2020-01-21 12:58:01 -05:00
CODE_OF_CONDUCT.md Initial commit 2019-04-03 02:23:49 +01:00
CONTRIBUTING.md Merge remote-tracking branch 'remotes/gaia/master' into merge_gaia_master 2020-01-23 14:07:35 +01:00
Dockerfile Add helpers for CI setup and document 2020-01-22 15:18:11 +01:00
LICENSE Initial commit 2019-04-03 02:23:49 +01:00
Makefile Merge remote-tracking branch 'remotes/gaia/master' into merge_gaia_master 2020-01-23 14:07:35 +01:00
README.md Update README.md 2020-02-07 14:22:42 +01:00
docker-compose.yml Search and replace gaiad/cl with wasmd/cli 2019-11-19 22:29:50 +01:00
dredd.yml Contract test [GET] (#19) 2019-06-08 15:04:45 +01:00
go.mod sdk version bump, min/max height, better cors 2020-02-18 19:19:22 +01:00
go.sum sdk version bump, min/max height, better cors 2020-02-18 19:19:22 +01:00
sims.mk Search and replace gaiad/cl with wasmd/cli 2019-11-19 22:29:50 +01:00

README.md

Wasm Zone

CircleCI codecov Go Report Card license LoC

This repository hosts Wasmd, the first implementation of a cosmos zone with wasm smart contracts enabled.

This code was forked from the cosmos/gaia repository and the majority of the codebase is the same as gaia.

Note: Requires Go 1.13+

Compatibility: Last merge from cosmos/gaia was 090c545347b03e59415a18107a0a279c703c8f40 (Jan 23, 2020)

Stability

This is alpha software, do not run on a production system. Notably, we currently provide no migration path not even "dump state and restart" to move to future versions. At beta we will begin to offer migrations and better backwards compatibility guarantees.

With the v0.6.0 tag, we are entering semver. That means anything with v0.6.x tags is compatible. We will have a series of minor version updates prior to v1.0.0, where we offer strong backwards compatibility guarantees. In particular, work has begun in the cosmwasm library on v0.7, which will change many internal APIs, in order to allow adding other languages for writing smart contracts. We hope to stabilize much of this well before v1, but we are still in the process of learning from real-world use-cases

Encoding

We use standard cosmos-sdk encoding (amino) for all sdk Messages. However, the message body sent to all contracts, as well as the internal state is encoded using JSON. Cosmwasm allows arbitrary bytes with the contract itself responsible for decodng. For better UX, we often use json.RawMessage to contain these bytes, which enforces that it is valid json, but also give a much more readable interface. If you want to use another encoding in the contracts, that is a relatively minor change to wasmd but would currently require a fork. Please open in issue if this is important for your use case.

Quick Start

make install
make test

if you are using a linux without X or headless linux, look at this article or #31.

To set up a single node testnet, look at the deployment documentation.

If you want to deploy a whole cluster, look at the network scripts.

Dockerized

We provide a docker image to help with test setups. There are two modes to use it

Build: docker build -t cosmwasm/wasmd:manual . or pull from dockerhub

Dev server

Bring up a local node with a test account containing tokens

This is just designed for local testing/CI - DO NOT USE IN PRODUCTION

docker volume rm -f wasmd_data

# pass password (one time) as env variable for setup, so we don't need to keep typing it
# add some addresses that you have private keys for (locally) to give them genesis funds
docker run --rm -it \
    -e PASSWORD=xxxxxxxxx \
    --mount type=volume,source=wasmd_data,target=/root \
    cosmwasm/wasmd-demo:latest ./setup.sh cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6

# This will start both wasmd and wasmcli rest-server, only wasmcli output is shown on the screen
docker run --rm -it -p 26657:26657 -p 26656:26656 -p 1317:1317 \
    --mount type=volume,source=wasmd_data,target=/root \
    cosmwasm/wasmd-demo:latest ./run_all.sh

# view wasmd logs in another shell
docker run --rm -it \
    --mount type=volume,source=wasmd_data,target=/root,readonly \
    cosmwasm/wasmd-demo:latest ./logs.sh

CI

For CI, we want to generate a template one time and save to disk/repo. Then we can start a chain copying the initial state, but not modifying it. This lets us get the same, fresh start every time.

# Init chain and pass addresses so they are non-empty accounts
rm -rf ./template && mkdir ./template
docker run --rm -it \
    -e PASSWORD=xxxxxxxxx \
    --mount type=bind,source=$(pwd)/template,target=/root \
    cosmwasm/wasmd-demo:latest ./setup.sh cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6

sudo chown -R $(id -u):$(id -g) ./template

# FIRST TIME
# bind to non-/root and pass an argument to run.sh to copy the template into /root
# we need wasmd_data volume mount not just for restart, but also to view logs
docker volume rm -f wasmd_data
docker run --rm -it -p 26657:26657 -p 26656:26656 -p 1317:1317 \
    --mount type=bind,source=$(pwd)/template,target=/template \
    --mount type=volume,source=wasmd_data,target=/root \
    cosmwasm/wasmd-demo:latest ./run_all.sh /template

# RESTART CHAIN with existing state
docker run --rm -it -p 26657:26657 -p 26656:26656 -p 1317:1317 \
    --mount type=volume,source=wasmd_data,target=/root \
    cosmwasm/wasmd-demo:latest ./run_all.sh

# view wasmd logs in another shell
docker run --rm -it \
    --mount type=volume,source=wasmd_data,target=/root,readonly \
    cosmwasm/wasmd-demo:latest ./logs.sh

Contributors

Much thanks to all who have contributed to this project, from this app, to the cosmwasm framework, to example contracts and documentation. Or even testing the app and bringing up critical issues. The following have helped bring this project to life:

Sorry if I forgot you from this list, just contact me or add yourself in a PR :)