From b4755840bf1b5c4fa6ce1306e0bdfb7833fd1817 Mon Sep 17 00:00:00 2001 From: Giovanni Sanchez <108043524+sisyphusSmiling@users.noreply.github.com> Date: Wed, 6 Dec 2023 18:46:01 -0600 Subject: [PATCH] update README --- README.md | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index d97412b..22f3886 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ advanced deployments are possible with support for multiple contract accounts an 1. We can see that the `Foo` has been deployed, and call its only contract method `foo()`, getting back `"foo"`: ```sh - flow scripts execute ./scripts/foo.cdc + flow scripts execute ./scripts/test/foo.cdc ``` 1. Configure `StagedContractUpdates.Updater`, passing the block height, contract name, and contract code in hex form (see @@ -44,7 +44,7 @@ advanced deployments are possible with support for multiple contract accounts an 1. `code: [String]` ```sh - flow transactions send ./transactions/setup_updater_single_account_and_contract.cdc \ + flow transactions send ./transactions/updater/setup_updater_single_account_and_contract.cdc \ 10 "Foo" 70756220636f6e747261637420466f6f207b0a202020207075622066756e20666f6f28293a20537472696e67207b0a202020202020202072657475726e2022626172220a202020207d0a7d \ --signer foo ``` @@ -58,14 +58,14 @@ advanced deployments are possible with support for multiple contract accounts an 1. We can get details from our `Updater` before updating: ```sh - flow scripts execute ./scripts/get_updater_info.cdc 0xe03daebed8ca0615 + flow scripts execute ./scripts/updater/get_updater_info.cdc 0xe03daebed8ca0615 ``` ```sh - flow scripts execute ./scripts/get_updater_deployment.cdc 0xe03daebed8ca0615 + flow scripts execute ./scripts/updater/get_updater_deployment.cdc 0xe03daebed8ca0615 ``` -1. Next, we'll delegate the `Updater` Capability as `DelegatedUpdater` to the `Delegatee` stored in the `StagedContractUpdates`'s account. +1. Next, we'll delegate the `Updater` Capability to the `Delegatee` stored in the `StagedContractUpdates`'s account. ```sh flow transactions send ./transactions/delegate.cdc --signer foo @@ -74,14 +74,14 @@ advanced deployments are possible with support for multiple contract accounts an 1. Lastly, we'll run the updating transaction as the `Delegatee`: ```sh - flow transactions send ./transactions/execute_delegated_updates.cdc + flow transactions send ./transactions/delegatee/execute_all_delegated_updates.cdc ``` 1. And we can validate the update has taken place by calling `Foo.foo()` again and seeing the return value is now `"bar"` ```sh - flow scripts execute ./scripts/foo.cdc + flow scripts execute ./scripts/test/foo.cdc ``` ## Multi-Account Multi-Contract Deployment @@ -138,18 +138,19 @@ account. :information_source: If you haven't already, perform the [setup steps above](#setup) 1. Since we'll be configuring an update deployment across a number of contract accounts, we'll need to delegate access - to those accounts via AuthAccount Capabilities on each. Running the following transaction will link an AuthAccount - Capability on the signer's account and publish it for the account where our `Updater` will live. + to those accounts via AuthAccount Capabilities on each. Running the following transaction will link and encapsulate + an AuthAccount Capability in a `Host` within the signer's account and publish a Capability on it for the account + where our `Updater` will live. ```sh - flow transactions send ./transactions/publish_auth_account_capability.cdc \ - 0xf669cb8d41ce0c74 \ + flow transactions send ./transactions/host/publish_host_capability.cdc \ + 0xe03daebed8ca0615 \ --signer a-account ``` ```sh - flow transactions send ./transactions/publish_auth_account_capability.cdc \ - 0xf669cb8d41ce0c74 \ + flow transactions send ./transactions/host/publish_host_capability.cdc \ + 0xe03daebed8ca0615 \ --signer bc-account ``` @@ -164,7 +165,7 @@ account. 1. `deploymentConfig: [[{Address: {String: String}}]]` ```sh - flow transactions send transactions/setup_updater_multi_account.cdc \ + flow transactions send transactions/updater/setup_updater_multi_account.cdc \ --args-json "$(cat args.json)" \ --signer abc-updater ``` @@ -176,17 +177,17 @@ account. resource was created, so let's query against the updater account to get its info. ```sh - flow scripts execute ./scripts/get_updater_info.cdc 0xf669cb8d41ce0c74 + flow scripts execute ./scripts/updater/get_updater_info.cdc 0xe03daebed8ca0615 ``` ```sh - flow scripts execute ./scripts/get_updater_deployment.cdc 0xf669cb8d41ce0c74 + flow scripts execute ./scripts/updater/get_updater_deployment.cdc 0xe03daebed8ca0615 ``` 1. Now we'll delegate a Capability on the `Updater` to the `Delegatee`: ```sh - flow transactions send ./transactions/delegate.cdc --signer abc-updater + flow transactions send ./transactions/updater/delegate.cdc --signer abc-updater ``` 1. In the previous transaction we should see that the `UpdaterDelegationChanged` event includes the `Updater` UUID @@ -194,7 +195,7 @@ account. and execute the update. ```sh - flow transactions send ./transactions/execute_delegated_updates.cdc + flow transactions send ./transactions/delegatee/execute_all_delegated_updates.cdc ``` This transaction calls `Updater.update()`, executing the first staged deployment, and updating contract `A`. Note @@ -203,13 +204,13 @@ account. time updating `B`. ```sh - flow transactions send ./transactions/execute_delegated_updates.cdc + flow transactions send ./transactions/delegatee/execute_all_delegated_updates.cdc ``` Now we see `B` has been updated, but we still have one more stage to complete. Let's complete the staged update. ```sh - flow transactions send ./transactions/execute_delegated_updates.cdc + flow transactions send ./transactions/delegatee/execute_all_delegated_updates.cdc ``` And finally, we see that `C` was updated and `updateComplete` is now `true`. \ No newline at end of file