Skip to content

Commit

Permalink
[Docs] Editorial pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
Raj Karamchedu authored and banool committed Sep 15, 2022
1 parent 22653d0 commit 5519731
Show file tree
Hide file tree
Showing 3 changed files with 257 additions and 254 deletions.
131 changes: 67 additions & 64 deletions developer-docs-site/docs/cli-tools/aptos-cli-tool/install-aptos-cli.md
Expand Up @@ -5,67 +5,70 @@ id: "install-aptos-cli"

# Install Aptos CLI

The `aptos` tool is a command line interface (CLI) for debugging, development, and node operations. This document describes how to install the `aptos` CLI tool. See [Use Aptos CLI](use-aptos-cli) for how to use the CLI.

## Install precompiled binary

1. Navigate to the [release page](https://github.com/aptos-labs/aptos-core/releases?q=cli&expanded=true) for Aptos CLI.
2. From the latest release section, download the binary zip file for your platform. The binary zip files contain the platform name in the filename.
3. Unzip the downloaded file. This will extract the `aptos` CLI tool.
4. Place this extracted `aptos` file at a location for you to run it. For example, place it in `~/bin/aptos` in Linux.
5. On Linux and Mac, make this `~/bin/aptos` as an executable by running this command: `chmod +x ~/bin/aptos`.
6. Type `~/bin/aptos help` to read help instructions.
7. Add `~/bin` to your path in your appropriate `.bashrc` or `.zshrc` for future use.

### Step 2 (optional): Install the dependencies of Move Prover

1. Ensure you have `git` installed https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
2. Clone the Aptos core repo: `git clone https://github.com/aptos-labs/aptos-core.git`
3. Change directory into `aptos-core` directory: `cd aptos-core`
4. Run the dev setup script to prepare your environment: `./scripts/dev_setup.sh -yp`
5. Source the profile file `source ~/.profile`

This command should work on MacOS and Linux flavors like Ubuntu or CentOS. (Windows is currently not supported).

Notice that you have to include environment variable definitions in `~/.profile` into your shell. Depending on your
setup, the `~/.profile` may be already automatically loaded for each login shell, or it may not. If not, you may
need to add `. ~/.profile` to your `~/.bash_profile` or other shell configuration manually.

6. You should now be able to prove an example
```bash
aptos move prove --package-dir aptos-move/move-examples/hello_prover/
```

## Install from Git
### Step 1: Install from Git

Start by cloning the `aptos-core` GitHub repo from [GitHub](https://github.com/aptos-labs/aptos-core).

1. Ensure you have `git` installed https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
2. Clone the Aptos core repo: `git clone https://github.com/aptos-labs/aptos-core.git`
3. Change directory into `aptos-core` directory: `cd aptos-core`
4. Run the dev setup script to prepare your environment: `./scripts/dev_setup.sh`
5. Update your current shell environment: `source ~/.cargo/env`
6. Checkout the correct branch `git checkout --track origin/branch`, where branch is
- `devnet` for building on Devnet
- `testnet` for building on Testnet
- `main` for the current development branch
7. Build the CLI tool: `cargo build --package aptos --release`
8. The binary will be available in `target/release/aptos`
9. (Optional) Move this executable to a place on your path e.g. `~/bin/aptos`

### Step 2 (optional): Install the dependencies of Move Prover

1. Run the dev setup script to prepare your environment: `./scripts/dev_setup.sh -yp`
2. Source the profile file `source ~/.profile`

This command should work on MacOS and Linux flavors like Ubuntu or CentOS. (Windows is currently not supported).

Notice that you have to include environment variable definitions in `~/.profile` into your shell. Depending on your
setup, the `~/.profile` may be already automatically loaded for each login shell, or it may not. If not, you may
need to add `. ~/.profile` to your `~/.bash_profile` or other shell configuration manually.

3. You should now be able to prove an example
```bash
aptos move prove --package-dir aptos-move/move-examples/hello_prover/
```
The `aptos` tool is a command line interface (CLI) for developing on the Aptos blockchain, debugging, and for node operations. This document describes how to install the `aptos` CLI tool. See [Use Aptos CLI](use-aptos-cli) for how to use the CLI.

You can install the CLI in one of the two ways:

1. Download the precompiled binary for your platform, or
2. Build the binary locally from the source code.

:::tip Move Prover Dependencies
If you want to use the Move Prover, then, [install the Move Prover dependencies](#optional-install-the-dependencies-of-move-prover) after installing the CLI.
:::

Choose an option below and follow the step-by-step instructions to either install or upgrade the Aptos CLI tool.

## Download precompiled binary

1. Go to the [Aptos CLI release page](https://github.com/aptos-labs/aptos-core/releases?q=cli&expanded=true).
2. In the latest release section, you will see the zip files with the filename of the format: `aptos-cli-<version>-<platform>`. These are the platform-specific pre-compiled binaries of the CLI. Download the zip file for your platform.
3. Unzip the downloaded file. This will extract the `aptos` CLI binary file into your default downloads folder. For example, on MacOS it is the `~/Downloads` folder.
4. Move this extracted `aptos` binary file into your preferred local folder. For example, place it in `~/bin/aptos` folder on Linux or MacOS.
:::tip Upgrading? Remember to look in the default download folder
When you update the CLI binary with the latest version, note that the newer version binary will be downloaded to your default Downloads folder. Remember to move this newer version binary from the Downloads folder to `~/bin/aptos` folder (overwriting the older version).
:::
1. Make this `~/bin/aptos` as an executable by running this command:
- On Linux and MacOS: `chmod +x ~/bin/aptos`.
2. Type `~/bin/aptos help` to read help instructions.
3. Add `~/bin` to your path in your `.bashrc` or `.zshrc` file for future use.


## Build the binary from the source

Follow these steps to build the CLI binary locally by downloading the source code.

1. Ensure you have `git` installed https://git-scm.com/book/en/v2/Getting-Started-Installing-Git.
2. Clone the Aptos core repo: `git clone https://github.com/aptos-labs/aptos-core.git`.
3. Change directory into `aptos-core` directory: `cd aptos-core`.
4. Run the dev setup script to prepare your environment: `./scripts/dev_setup.sh`.
5. Update your current shell environment: `source ~/.cargo/env`.
6. Checkout the correct branch `git checkout --track origin/<branch>`, where `<branch>` is:
- `devnet` for building on the Aptos devnet.
- `testnet` for building on the Aptos testnet.
- `main` for the current development branch.
7. Build the CLI tool: `cargo build --package aptos --release`.
8. The binary will be available in `target/release/aptos` folder.
9. (Optional) Move this executable to a place on your path e.g. `~/bin/aptos`.


## (Optional) Install the dependencies of Move Prover

If you want to use the Move Prover, install the dependencies by following the below steps:

:::tip Windows is not supported
The Move Prover is not supported on the Windows.
:::

1. Ensure you have `git` installed https://git-scm.com/book/en/v2/Getting-Started-Installing-Git.
2. Clone the Aptos core repo: `git clone https://github.com/aptos-labs/aptos-core.git`.
3. Change directory into `aptos-core` directory: `cd aptos-core`.
4. Run the dev setup script to prepare your environment: `./scripts/dev_setup.sh -yp`.
5. Source the profile file: `source ~/.profile`.
:::info
Note that you have to include environment variable definitions in `~/.profile` into your shell. Depending on your setup, the `~/.profile` may be already automatically loaded for each login shell, or it may not. If not, you may
need to add `. ~/.profile` to your `~/.bash_profile` or other shell configuration manually.
:::
6. You can now run the Move Prover to prove an example:
```bash
aptos move prove --package-dir aptos-move/move-examples/hello_prover/
```
12 changes: 6 additions & 6 deletions developer-docs-site/package.json
Expand Up @@ -17,11 +17,11 @@
"lint": "yarn install --frozen-lockfile --silent && prettier --check '**/*.(ts|js)'"
},
"dependencies": {
"@docusaurus/core": "^2.0.1",
"@docusaurus/plugin-client-redirects": "^2.0.1",
"@docusaurus/plugin-google-analytics": "^2.0.1",
"@docusaurus/plugin-google-gtag": "^2.0.0-beta.20",
"@docusaurus/preset-classic": "^2.0.0-beta.20",
"@docusaurus/core": "^2.1.0",
"@docusaurus/plugin-client-redirects": "^2.1.0",
"@docusaurus/plugin-google-analytics": "^2.1.0",
"@docusaurus/plugin-google-gtag": "^2.1.0",
"@docusaurus/preset-classic": "^2.1.0",
"@mdx-js/react": "^1.6.21",
"clsx": "^1.1.1",
"prism-react-renderer": "^1.2.1",
Expand All @@ -31,7 +31,7 @@
"unist-util-visit-children": "^2.0.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^2.0.0-beta.20",
"@docusaurus/module-type-aliases": "^2.1.0",
"@tsconfig/docusaurus": "^1.0.4",
"prettier": "^2.6.2",
"typescript": "4.7.4"
Expand Down

0 comments on commit 5519731

Please sign in to comment.