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",