From e079f0981365c665e1f6e4fc89d0be826fc644a4 Mon Sep 17 00:00:00 2001 From: Guille Date: Sat, 4 Jan 2025 22:02:40 +0100 Subject: [PATCH] fix deploy commands for js examples (#2408) Co-authored-by: Guillermo Alejandro Gallardo Diez --- docs/3.tutorials/examples/advanced-xcc.md | 22 ++++++++++++++++--- docs/3.tutorials/examples/count-near.md | 26 +++++++++++++++++++---- docs/3.tutorials/examples/donation.md | 22 ++++++++++++++++--- docs/3.tutorials/examples/guest-book.md | 24 +++++++++++++++++---- docs/3.tutorials/examples/xcc.md | 23 +++++++++++++++++--- 5 files changed, 100 insertions(+), 17 deletions(-) diff --git a/docs/3.tutorials/examples/advanced-xcc.md b/docs/3.tutorials/examples/advanced-xcc.md index e2edac64fc..eae98efc9b 100644 --- a/docs/3.tutorials/examples/advanced-xcc.md +++ b/docs/3.tutorials/examples/advanced-xcc.md @@ -289,9 +289,25 @@ In order to deploy the contract you will need to create a NEAR account. Go into the directory containing the smart contract (`cd contract-advanced-ts` or `cd contract-advanced-rs`), build and deploy it: -```bash -cargo near deploy build-non-reproducible-wasm with-init-call new json-args '{"hello_account":"hello.near-example.testnet","guestbook_account":"guestbook_account.near-example.testnet","counter_account":"counter_account.near-example.testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send -``` + + + + + ```bash + npm run build + near deploy ./build/cross_contract.wasm --initFunction new --initArgs '{"hello_account":"hello.near-example.testnet","guestbook_account":"guestbook_account.near-example.testnet","counter_account":"counter_account.near-example.testnet"}' + ``` + + + + + ```bash + cargo near deploy build-non-reproducible-wasm with-init-call new json-args '{"hello_account":"hello.near-example.testnet","guestbook_account":"guestbook_account.near-example.testnet","counter_account":"counter_account.near-example.testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send + ``` + + + +
diff --git a/docs/3.tutorials/examples/count-near.md b/docs/3.tutorials/examples/count-near.md index e5e9db885d..52e045d09c 100644 --- a/docs/3.tutorials/examples/count-near.md +++ b/docs/3.tutorials/examples/count-near.md @@ -116,7 +116,7 @@ The contract presents 4 methods: `get_num`, `increment`, `decrement`, and `reset + start="3" end="33" /> -``` + + + + + ```bash + npm run build + near deploy ./build/counter.wasm + ``` + + + + + ```bash + cargo near deploy build-non-reproducible-wasm + ``` + + + + + :::tip To interact with your contract from the [frontend](#frontend), simply replace the value of the `testnet` key in the `config.js` file. ::: +
### CLI: Interacting with the Contract diff --git a/docs/3.tutorials/examples/donation.md b/docs/3.tutorials/examples/donation.md index 95bd637a8b..1175a4c97e 100644 --- a/docs/3.tutorials/examples/donation.md +++ b/docs/3.tutorials/examples/donation.md @@ -185,9 +185,25 @@ In order to deploy the contract you will need to create a NEAR account. Go into the directory containing the smart contract (`cd contract-ts` or `cd contract-rs`), build and deploy it: -```bash -cargo near deploy build-non-reproducible-wasm -``` + + + + + ```bash + npm run build + near deploy ./build/donation.wasm + ``` + + + + + ```bash + cargo near deploy build-non-reproducible-wasm + ``` + + + + :::tip To interact with your contract from the [frontend](#frontend), simply replace the variable `CONTRACT_NAME` in the `index.js` file. diff --git a/docs/3.tutorials/examples/guest-book.md b/docs/3.tutorials/examples/guest-book.md index 86be34a066..78ea630f31 100644 --- a/docs/3.tutorials/examples/guest-book.md +++ b/docs/3.tutorials/examples/guest-book.md @@ -25,7 +25,7 @@ You have two options to start the Guest book Example. 2. Clone the repository locally and use it from your computer. | Codespaces | Clone locally | -| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | +|-----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------| | [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/near-examples/guest-book-examples) | 🌐 `https://github.com/near-examples/guest-book-examples` | --- @@ -183,9 +183,25 @@ In order to deploy the contract you will need to create a NEAR account. Go into the directory containing the smart contract (`cd contract-ts` or `cd contract-rs`), build and deploy it: -```bash -cargo near deploy build-non-reproducible-wasm -``` + + + + + ```bash + npm run build + near deploy ./build/guest_book.wasm + ``` + + + + + ```bash + cargo near deploy build-non-reproducible-wasm + ``` + + + + :::tip To interact with your contract from the [frontend](#frontend), simply replace the variable `CONTRACT_NAME` in the `index.js` file. diff --git a/docs/3.tutorials/examples/xcc.md b/docs/3.tutorials/examples/xcc.md index f0af14951c..71d5fe0a18 100644 --- a/docs/3.tutorials/examples/xcc.md +++ b/docs/3.tutorials/examples/xcc.md @@ -167,9 +167,26 @@ In order to deploy the contract you will need to create a NEAR account. Go into the directory containing the smart contract (`cd contract-advanced-ts` or `cd contract-advanced-rs`), build and deploy it: -```bash -cargo near deploy build-non-reproducible-wasm with-init-call new json-args '{"hello_account":"hello.near-example.testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send -``` + + + + + ```bash + npm run build + near deploy ./build/cross_contract.wasm --initFunction new --initArgs '{"hello_account":"hello.near-example.testnet"}' + ``` + + + + + ```bash + cargo near deploy build-non-reproducible-wasm with-init-call new json-args '{"hello_account":"hello.near-example.testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send + + ``` + + + +