Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Updated the deployer example. #230

Merged
merged 4 commits into from
Dec 6, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions docs/examples/deployer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Open the `deployer/deployer/src/lib.rs` file to follow along.

Before deploying the new contract instances, the WASM code needs to be installed
on-chain. Then it can be used to deploy an arbitrary number of contract
instances. The installation typically should happen outside of the deployer
instances. The installation should typically happen outside of the deployer
contract, as it needs to happen just once.
while the deployer contract can be called multiple times.

Expand Down Expand Up @@ -275,21 +275,29 @@ both contracts:
If you have [`soroban-cli`] installed, you can invoke the contract function to
deploy the test contract.

TODO: the CLI currently doesn't support the install operation. Before running
the `invoke` below, the contract has to be installed.
Before the contract can be deployed, you need to install the child contract WASM.

```sh
soroban install --wasm target/wasm32-unknown-unknown/release/soroban_deployer_test_contract.wasm
```

This command will return the hash of the installed WASM(`edce149b183ea03dfd896a263d2e17c1f08229da52afa6f822d9cbc67c103806` here).
leighmcculloch marked this conversation as resolved.
Show resolved Hide resolved

Then the deployer contract may be invoked with the WASM hash above.

```sh
soroban invoke \
--wasm target/wasm32-unknown-unknown/release/soroban_deployer_contract.wasm \
--id 0 \
--fn deploy \
--arg 0000000000000000000000000000000000000000000000000000000000000000 \
--arg <installed WASM hash> \
--arg edce149b183ea03dfd896a263d2e17c1f08229da52afa6f822d9cbc67c103806 \
--arg init \
--arg '[{"u32":5}]'
```

And then invoke the deployed test contract.
And then invoke the deployed test contract using the identifier returned from
the previous command.

```sh
soroban invoke \
Expand Down