Skip to content

Commit

Permalink
Merge branch 'main' into go-sdk-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gregnazario authored Aug 28, 2024
2 parents a3cae2b + a72fda9 commit 24de32e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
5 changes: 1 addition & 4 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,4 @@ apps/nextra/pages/en/network/nodes/** @rustielin @aptos-labs/prod-eng
apps/nextra/pages/en/build/indexer/** @banool

## SDKs
apps/nextra/pages/en/build/sdks/** @0xmaayan @gregnazario

## Move
apps/nextra/pages/en/build/smart-contracts/** @movekevin @gregnazario
apps/nextra/pages/en/build/sdks/** @gregnazario @aptos-labs/developer-platform
29 changes: 14 additions & 15 deletions apps/nextra/pages/en/build/smart-contracts/deployment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,35 @@ import { Steps } from 'nextra/components'

### Compile code

Make sure `<your_account_name>` is left as a placeholder `_`. This is needed as the CLI command will override the address. `<your_account_name>` represents the owner of the code, or the owner of the object to deploy the code to.
Here is an example as `<your_account_name>` with the value `my_account`.
Make sure `<your_module_name>` is left as a placeholder `_`. This is needed as the CLI command will override the address. `<your_module_name>` value represents the owner of the code, or the owner of the object to deploy the code to.
Here is an example as `<your_module_name>` with the value `my_module`.

```toml filename="Move.toml"
[addresses]
my_account = "_"
my_module = "_"
```

Compile your move code running the below command.
- Replace `<your_account_name>` with the desired name of the account.
- Replace `<your_module_name>` with the module name.
- Replace `<your_address>` with the address of your account.

```bash filename="Terminal"
aptos move compile --named-addresses <your_account_name>=<your_address>
aptos move compile --named-addresses <your_module_name>=<your_address>
```

### Deploy code to an object

Deploy the compiled code to an an object via the command:
- Replace `<your_account_name>` with the desired name of the account.
- Replace `<your_address>` with the address of your account.
Deploy the compiled code to an object via the command:
- Replace `<your_module_name>` with the module name.

```bash filename="Terminal"
aptos move create-object-and-publish-package --address-name <your_account_name> --named-addresses <your_account_name>=<your_address>
aptos move deploy-object --address-name <your_module_name>
```

**An example can be found below:**

```bash filename="Terminal"
aptos move create-object-and-publish-package --address-name my_account --named-addresses my_account=0xa0f0b100f243cbda3df93ceb42c0b9464c359a0853ed98f2bce558be9605e88b
aptos move deploy-object --address-name my_module
```

This will ask if you want to publish the code under the specified object address.
Expand All @@ -71,19 +70,19 @@ Take note of the object address as you will need it later for upgrades.
### Upgrade code in an existing package

If you wish to upgrade the code in the object deployed, run the following:
- Replace `<object_address>` with the address of the object hosting the code.
- Replace `<your_account_name>` with the existing name of your account.
- Replace `<your_module_name>` with the existing module name.
- Replace `<code_object_addr>` with the address of the object hosting the code.

Note: the value for the account name should _now_ be the object address, as the package containing the module(s) is now deployed to that address.
Note: the value for the account name should now be the object address, as the package containing the module(s) is now deployed to that address.

```bash filename="Terminal"
aptos move upgrade-object-package --object-address <object_address> --named-addresses <your_account_name>=<object_address>
aptos move upgrade-object --address-name <your_module_name> --object-address <code_object_addr>
```

Example of the command above:

```bash filename="Terminal"
aptos move upgrade-object-package --object-address 0x8d6eb306bcf6c61dbaa0dbf8daa8252e121b63e95991afcab3b12d3be7f001ab --named-addresses my_account=0x8d6eb306bcf6c61dbaa0dbf8daa8252e121b63e95991afcab3b12d3be7f001ab
aptos move upgrade-object --address-name my_module --object-address 0x8d6eb306bcf6c61dbaa0dbf8daa8252e121b63e95991afcab3b12d3be7f001ab
```

This will ask if you want to upgrade the existing code deployed at the object address.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Before selecting a deployment method, make sure to read and understand the [Node

Select a deployment method for your nodes:

- ### [Using Source Code](../full-node/deployments/using-source-code.mdx)
- ### [Using Docker](../full-node/deployments/using-docker.mdx)
- ### [Using Source Code](deploy-nodes/using-source-code.mdx)
- ### [Using Docker](deploy-nodes/using-docker.mdx)
- ### [Using AWS](deploy-nodes/using-aws.mdx)
- ### [Using Azure](deploy-nodes/using-azure.mdx)
- ### [Using GCP](../full-node/deployments/using-gcp.mdx)
- ### [Using GCP](deploy-nodes/using-gcp.mdx)

0 comments on commit 24de32e

Please sign in to comment.