Skip to content

Commit

Permalink
feat: Add custom script for better DRink! CLI integration
Browse files Browse the repository at this point in the history
  • Loading branch information
wottpal committed Apr 11, 2024
1 parent 216f5b7 commit 0f3c1a5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/brave-icons-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@inkathon/contracts': minor
---

Integrate named workspace contracts with DRink! CLI in a simplified pnpm command.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ Other projects include:
7. [VSCode Setup 🛠](#vscode-setup-)
1. [Workspace](#workspace)
2. [Plugins](#plugins)
8. [FAQs \& Troubleshooting 💬](#faqs--troubleshooting-)
8. [DRink! CLI Usage 💧](#drink-cli-usage-)
9. [FAQs \& Troubleshooting 💬](#faqs--troubleshooting-)

---

Expand Down Expand Up @@ -260,6 +261,16 @@ Additionally, the VSCode plugins listed below are recommended as they can be ver

</details>

## DRink! CLI Usage 💧

The [DRink! CLI](https://github.com/inkdevhub/drink/blob/main/drink-cli/README.md) is a convenient command line tool that helps you to play with your ink! contracts without setting up a local node.

1. Install `drink-cli` via `cargo install drink-cli --force --locked`.
2. Build your contracts via `pnpm run build`.
3. Run the following command to prepare & open the CLI for your contract: `pnpm run drink-cli <contract-name>`.

Then, just use the `help` command to see all available commands and start interacting with your contract. For example, you can deploy the greeter example contract via `d --constructor default` or `d "Hello World"`.

## FAQs & Troubleshooting 💬

<details>
Expand Down
1 change: 1 addition & 0 deletions contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"build": "bash build-all.sh",
"node": "substrate-contracts-node --dev --base-path ./.node-data",
"script": "f() { tsx ./scripts/$1; }; f \"$@\"",
"drink-cli": "f() { cp ./target/ink/$1/$1.json ./target/ink/$1.json; cp ./target/ink/$1/$1.wasm ./target/ink/$1.wasm; drink-cli; }; f \"$@\"",
"deploy": "pnpm run script deploy",
"contracts-ui": "open https://contracts-ui.substrate.io/?rpc=ws://127.0.0.1:9944",
"explorer-ui": "open https://polkadot.js.org/apps/#/explorer?rpc=ws://127.0.0.1:9944",
Expand Down

0 comments on commit 0f3c1a5

Please sign in to comment.