From 0f3c1a5ba5f129c2fba0f7fed2ba27fc3968d07f Mon Sep 17 00:00:00 2001 From: Dennis Zoma Date: Thu, 11 Apr 2024 16:48:16 +0200 Subject: [PATCH] feat: Add custom script for better DRink! CLI integration --- .changeset/brave-icons-tan.md | 5 +++++ README.md | 13 ++++++++++++- contracts/package.json | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .changeset/brave-icons-tan.md diff --git a/.changeset/brave-icons-tan.md b/.changeset/brave-icons-tan.md new file mode 100644 index 0000000..bf470d4 --- /dev/null +++ b/.changeset/brave-icons-tan.md @@ -0,0 +1,5 @@ +--- +'@inkathon/contracts': minor +--- + +Integrate named workspace contracts with DRink! CLI in a simplified pnpm command. diff --git a/README.md b/README.md index fc83511..8e92b8a 100644 --- a/README.md +++ b/README.md @@ -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-) --- @@ -260,6 +261,16 @@ Additionally, the VSCode plugins listed below are recommended as they can be ver +## 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 `. + +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 💬
diff --git a/contracts/package.json b/contracts/package.json index 3620f9b..65fb5cb 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -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",