Skip to content

Commit 0f3c1a5

Browse files
committed
feat: Add custom script for better DRink! CLI integration
1 parent 216f5b7 commit 0f3c1a5

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

.changeset/brave-icons-tan.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@inkathon/contracts': minor
3+
---
4+
5+
Integrate named workspace contracts with DRink! CLI in a simplified pnpm command.

README.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ Other projects include:
4444
7. [VSCode Setup 🛠](#vscode-setup-)
4545
1. [Workspace](#workspace)
4646
2. [Plugins](#plugins)
47-
8. [FAQs \& Troubleshooting 💬](#faqs--troubleshooting-)
47+
8. [DRink! CLI Usage 💧](#drink-cli-usage-)
48+
9. [FAQs \& Troubleshooting 💬](#faqs--troubleshooting-)
4849

4950
---
5051

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

261262
</details>
262263

264+
## DRink! CLI Usage 💧
265+
266+
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.
267+
268+
1. Install `drink-cli` via `cargo install drink-cli --force --locked`.
269+
2. Build your contracts via `pnpm run build`.
270+
3. Run the following command to prepare & open the CLI for your contract: `pnpm run drink-cli <contract-name>`.
271+
272+
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"`.
273+
263274
## FAQs & Troubleshooting 💬
264275

265276
<details>

contracts/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"build": "bash build-all.sh",
1010
"node": "substrate-contracts-node --dev --base-path ./.node-data",
1111
"script": "f() { tsx ./scripts/$1; }; f \"$@\"",
12+
"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 \"$@\"",
1213
"deploy": "pnpm run script deploy",
1314
"contracts-ui": "open https://contracts-ui.substrate.io/?rpc=ws://127.0.0.1:9944",
1415
"explorer-ui": "open https://polkadot.js.org/apps/#/explorer?rpc=ws://127.0.0.1:9944",

0 commit comments

Comments
 (0)