From 4c32b53a245def222868050aee725d5f01753176 Mon Sep 17 00:00:00 2001 From: Kumar Anirudha Date: Wed, 3 Apr 2024 23:02:29 +0530 Subject: [PATCH 1/4] updated readme instructions on compiling --- README.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c07c2d7..fc54acf 100644 --- a/README.md +++ b/README.md @@ -43,12 +43,20 @@ Here are some of the tasks available in the `justfile`: - `publish {{chain-id}}`: Publish the App to a network. - `wasm`: Optimize the contract. - `schema`: Generate the json schemas for the contract -- `ts-codegen`: Generate the typescript client code for the contract -- `ts-publish`: Publish the typescript client code to npm + + - `publish-schemas`: Publish the schemas by creating a PR on the Abstract [schemas](https://github.com/AbstractSDK/schemas) repository. You can see the full list of tasks available by running `just --list`. +### Compiling + +You can compile your module by running the following command: +```sh +just wasm +``` +This should result in an artifacts directory being created in your project root. Inside you will find a `my_module.wasm` file that is your module’s binary. + ### Testing You can test the module using the different provided methods. @@ -71,7 +79,7 @@ You can now use `just publish {{chain-id}}` to run the [`examples/publish.rs`](. To publish your module schemas, we provide the `publish-schemas` command, which creates a pull request on the Abstract [schemas](https://github.com/AbstractSDK/schemas) repository. -Please install [github cli](https://cli.github.com/) before proceeding. +Please install [github cli](https://cli.github.com/) before proceeding. Also login and setup your github auth by `gh auth login`. Now, we're ready to proceed. ```bash just publish-schemas @@ -88,7 +96,7 @@ For this command to work properly, please make sure that your `metadata.json` fi Example: ```bash -just publish-schemas my-namespace my-module 0.1 +just publish-schemas my-namespace my-module 0.0.1 ``` In the example above, `my-namespace` is the namespace, `my-module` is the module's name, and `0.1` is the minor version. If you create a patch for your module (e.g., `0.1.1`), you don't need to run `publish-schemas` again unless the schemas have changed. From 30e5327c1cae3b4ed0ed509f803caa67da968234 Mon Sep 17 00:00:00 2001 From: Kumar Anirudha Date: Wed, 3 Apr 2024 23:03:55 +0530 Subject: [PATCH 2/4] updated readme instructions on compiling --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fc54acf..baadab3 100644 --- a/README.md +++ b/README.md @@ -51,11 +51,13 @@ You can see the full list of tasks available by running `just --list`. ### Compiling +Best to run `cargo update` to have synced versions just in case. + You can compile your module by running the following command: ```sh just wasm ``` -This should result in an artifacts directory being created in your project root. Inside you will find a `my_module.wasm` file that is your module’s binary. +This should result in an artifacts directory being created in your project root. Inside you will find a `my_module.wasm` file that is your module’s binary. Make sure it's the same name as mentioned in `Cargo.toml` file. If not, just edit it to match. ### Testing From 2261f452c20356c6a1678ada400404f9149e8cf4 Mon Sep 17 00:00:00 2001 From: Kumar Anirudha Date: Thu, 4 Apr 2024 16:41:00 +0530 Subject: [PATCH 3/4] updated publish script incase build not found --- justfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/justfile b/justfile index bcfdc9f..73c7d6c 100644 --- a/justfile +++ b/justfile @@ -121,4 +121,12 @@ run-script script +CHAINS: cargo run --example {{script}} --features="daemon" -- --network-ids {{CHAINS}} publish +CHAINS: + #!/usr/bin/env bash + set -euxo pipefail + + if [ -d "artifacts" ]; then + echo "Build found ✅"; + else + just wasm + fi just run-script publish {{CHAINS}} From ea6ab1aeaf64c41e8be14513af510f2fb751ff19 Mon Sep 17 00:00:00 2001 From: Kumar Anirudha Date: Thu, 4 Apr 2024 16:42:13 +0530 Subject: [PATCH 4/4] updated publish script incase build not found --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index baadab3..8b5c678 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ You can compile your module by running the following command: ```sh just wasm ``` -This should result in an artifacts directory being created in your project root. Inside you will find a `my_module.wasm` file that is your module’s binary. Make sure it's the same name as mentioned in `Cargo.toml` file. If not, just edit it to match. +This should result in an artifacts directory being created in your project root. Inside you will find a `my_module.wasm` file that is your module’s binary. ### Testing