cli.md 2.03 KB
Newer Older
Will Cory's avatar
Will Cory committed
1 2
# atst cli docs

3
![preview](../assets/preview.gif)
Will Cory's avatar
Will Cory committed
4

Will Cory's avatar
Will Cory committed
5 6 7 8 9 10
## Installation

```bash
npm install @eth-optimism/atst --global
```

Will Cory's avatar
Will Cory committed
11 12 13
## Usage

```bash
Will Cory's avatar
Will Cory committed
14
npx atst <command> [options]
Will Cory's avatar
Will Cory committed
15 16
```

17
### Commands
Will Cory's avatar
Will Cory committed
18

19 20
- `read` read an attestation
- `write` write an attestation
Will Cory's avatar
Will Cory committed
21 22 23 24

For more info, run any command with the `--help` flag:

```bash
Will Cory's avatar
Will Cory committed
25 26
npx atst read --help
npx atst write --help
Will Cory's avatar
Will Cory committed
27 28
```

29
### General options
Will Cory's avatar
Will Cory committed
30

31 32
- `-h`, `--help` Display help message
- `-v`, `--version` Display version number
Will Cory's avatar
Will Cory committed
33 34 35 36


### Read

37 38 39 40 41 42 43
- `--creator <address>` Address of the creator of the attestation
- `--about <address>` Address of the subject of the attestation
- `--key <string>` Key of the attestation either as string or hex number
- `[--data-type <string>]` The DataType type `string` | `bytes` | `number` | `bool` | `address` (default: `string`)
- `[--rpc-url <url>]` Rpc url to use (default: `https://mainnet.optimism.io`)
- `[--contract <address>]` Contract address to read from (default: `0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77`)
- `-h`, `--help` Display help message
Will Cory's avatar
Will Cory committed
44 45 46 47

Example:

```bash
48 49
npx atst read --key "optimist.base-uri" --about 0x2335022c740d17c2837f9C884Bfe4fFdbf0A95D5 \
    --creator 0x60c5C9c98bcBd0b0F2fD89B24c16e533BaA8CdA3
Will Cory's avatar
Will Cory committed
50 51
```

52 53 54 55 56 57 58 59 60 61
### Write

- `--private-key <string>` Private key of the creator of the attestation
- `[--data-type <string>]` The DataType type `string` | `bytes` | `number` | `bool` | `address` (default: `string`)
- `--about <address>` Address of the subject of the attestation
- `--key <address>` Key of the attestation either as string or hex number
- `--value <string>` undefined
- `[--rpc-url <url>]` Rpc url to use (default: `https://mainnet.optimism.io`)
- `[--contract <address>]` Contract address to read from (default: 0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77) 
- `-h`, `--help` Display this message
Will Cory's avatar
Will Cory committed
62

63
Example: 
Will Cory's avatar
Will Cory committed
64 65

```bash
66 67 68 69 70
npx atst write --key "optimist.base-uri" \
    --about 0x2335022c740d17c2837f9C884Bfe4fFdbf0A95D5 \
    --value "my attestation" \
    --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
    --rpc-url http://goerli.optimism.io
Will Cory's avatar
Will Cory committed
71
```