Skip to content

Commit 15fbab7

Browse files
committed
[cli] docs: corrections and improvements after a walk-through
1 parent 6538323 commit 15fbab7

File tree

3 files changed

+47
-24
lines changed

3 files changed

+47
-24
lines changed

cli/README.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
## Context
44

5-
This is a command line interface (CLI) to track accesses to expensive resources. In particular we are focusing on the Cardano Foundation controlled Antithesis instance. The only command relative to the specific instance is the `anti agent run-test` command, which is used to run tests on the Antithesis platform. The rest of the commands are independent of the resource. This CLI uses MPFS as a backend meaning all data is stored on the Cardano blockchain. ATM MPFS is only supporting preprod.
6-
The CLI should be used to book tests on the Antithesis platform. ATM it supports only projects on GitHub.
5+
This is a command line interface (CLI) to track accesses to expensive resources. In particular we are focusing on the Cardano Foundation controlled Antithesis instance. The only command relative to the specific instance is the `anti agent run-test` command, which is used to run tests on the Antithesis platform. The rest of the commands are independent of the resource. This CLI uses MPFS as a backend meaning all data is stored on the Cardano blockchain. Currently MPFS is only supporting preprod.
6+
The CLI should be used to book tests on the Antithesis platform. Currently it supports only projects on GitHub.
77

88
## Prerequisites
99

@@ -61,8 +61,7 @@ export ANTI_PRETTY=1
6161

6262
For scripting purposes you can disable the pretty effect of the env-var by passing `--no-pretty` switch.
6363

64-
65-
### Environment variables
64+
### Environment variables and preliminaries
6665

6766
#### MPFS host
6867
If you do not want to host your own MPFS service, you can use a public one at `https://mpfs.plutimus.com`.
@@ -75,7 +74,7 @@ export ANTI_MPFS_HOST=https://mpfs.plutimus.com
7574

7675
#### Your wallet
7776

78-
ATM the anti CLI works only by reading a wallet file containing a mnemonic phrase.
77+
Currently the anti CLI works only by reading a wallet file containing a mnemonic phrase.
7978

8079
The anti command will read the wallet file from the `ANTI_WALLET_FILE` environment variable.
8180

@@ -131,21 +130,20 @@ anti wallet decrypt path/to/decrypted/secret/file
131130

132131
For the both cases `ANTI_WALLET_FILE` is set as before.
133132

133+
> Store a copy of your encrypted/plaintext wallet file in a password manager. Think twice before storing a plaintext wallet file. Store your passphrase in a password manager too. Currently we do not support hardware wallets like Ledger or Trezor.
134134
135-
> Store a copy of your encrypted/plaintext wallet file in a password manager. Think twice before storing a plaintext wallet file. Store your passphrase in a password manager too. ATM we do not support hardware wallets like Ledger or Trezor.
136-
137-
`> Fund your wallet with some tAda tokens on preprod, for example using the [Cardano Testnet Faucet](https://docs.cardano.org/cardano-testnets/tools/faucet/).
135+
> Fund your wallet with some tAda tokens on preprod, for example using the [Cardano Testnet Faucet](https://docs.cardano.org/cardano-testnets/tools/faucet/).
138136
139137

140-
### Antithesis token
138+
#### Antithesis token
141139

142140
This is the unique token that identifies the Antithesis access interface. You need to refer to it setting the `ANTI_TOKEN_ID` environment variable.
143141

144142
```bash
145143
export ANTI_TOKEN_ID=21c523c3b4565f1fc1ad7e54e82ca976f60997d8e7e9946826813fabf341069b
146144
```
147145

148-
### Set the timeout for the `anti` command
146+
#### Set the timeout for the `anti` command
149147

150148
When submitting txs to the chain, it's quite convenient to wait for the transaction to be included in the chain, so that you can immediately use the result of the transaction.
151149

@@ -155,7 +153,19 @@ To do that, you can set the `ANTI_WAIT` environment variable to the number of se
155153
export ANTI_WAIT=120
156154
```
157155

158-
## Querying the token state
156+
#### Configuring access to GitHub
157+
158+
The tool will query the GitHub platform on your behalf in order to obtain (public) information about repositories (where Antithesis test runs are stored) and users (requesting a test run).
159+
160+
In order to make this possible you must provide a GitHub Personal Access Token (PAT) for read-only access to public data. See the GitHub platform's documentation for how to create one.
161+
162+
Provide your GitHub PAT to the tool by setting an environment variable:
163+
164+
```bash
165+
export ANTI_GITHUB_PAT="github_pat_31A...<snipped>...xL"
166+
```
167+
168+
### Querying the token state
159169

160170
You can query the state of the Antithesis token with the following command:
161171

@@ -169,7 +179,7 @@ This will show
169179
- the root of the mpf tree
170180
- the current UTxO of the state
171181

172-
## Querying facts of the Antithesis token
182+
### Querying facts of the Antithesis token
173183

174184
You can always query the Antithesis token and its facts
175185

cli/docs/oracle-role.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ version=$(nix eval .#version --raw)
2828
docker run cardano-foundation/anti-oracle:$version
2929
```
3030
31+
## Running oracle commands manually
32+
33+
Alternatively, oracle commands can be run manually, using the `anti` CLI. See the [README.md](../README.md) for how to install it.
34+
3135
## Creating the anti token (only once)
3236
33-
Oracle operations needs a wallet. Given the role aside setting the `ANTI_WALLET_FILE` environment variable to point to the wallet file, you also wanto to set th `ANTI_WALLET_PASSPHRASE` environment variable to encrypt it.
37+
Oracle operations need a wallet. Since the oracle role is critical, in addition to setting the `ANTI_WALLET_FILE` environment variable to point to the wallet file, you should also set the `ANTI_WALLET_PASSPHRASE` environment variable to encrypt the wallet.
3438
3539
You can create a wallet with the `anti wallet create` command.
3640

cli/docs/requester-role.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,55 @@
22

33
This is the role of the user who wants to run tests using the Antithesis platform.
44

5-
Before you can request a test run, you need to register yourself as github user with an ed25519 public key.
5+
Before you can request a test run, you need to register yourself as GitHub user with an SSH ed25519 public key.
66

77
## Registrations
88

99
A couple of requests have to be made once before the regular test-run requests can succeed. These requests are used to register the user and the project on the Antithesis platform.
1010

11-
ATM we only support Github as a platform, but we plan to support other platforms in the future.
11+
Currently we only support GitHub as a platform, but we plan to support other platforms in the future.
1212

13-
Registration and unregistrations can be requested by anyone. The oracle role will simply validate the facts against the Github platform and update the Antithesis token accordingly. You cannot register a user or project that is already registered.
13+
Registration and unregistrations can be requested by anyone. The oracle role will simply validate the facts against the GitHub platform and update the Antithesis token accordingly. You cannot register a user or project that is already registered.
1414

15-
Be careful that there is no imperativity here, so i.e. you cannot unregister a user public key if it's present in Github.
15+
Be careful that there is no imperativity here, so i.e. you cannot unregister a user public key if it's present in GitHub.
1616

1717
### Registering a user public key
1818

1919
To register yourself as a user, you can use the `anti requester register-user` command.
2020

21+
You must provide (using the incorrectly-named `pubkeyhash` flag) the actual (base64-encoded) ed15519 public key (without the ssh-ed25519 prefix and without the optional key-id). So, for example, if your GitHub username is `alice` and you have configured this public key in your GitHub account:
22+
23+
```bash
24+
$ cat ~/.ssh/id_ed25519.pub
25+
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO773JHqlyLm5XzOjSe+Q5yFJyLFuMLL6+n63t4t7HR8 [email protected]
26+
```
27+
28+
then you should copy/paste the second field into the following command:
29+
2130
```bash
2231
anti requester register-user --platform github --username alice --pubkeyhash AAAAC3NzaC1lZDI1NTE5AAAAIO773JHqlyLm5XzOjSe+Q5yFJyLFuMLL6+n63t4t7HR8
2332
```
2433

25-
As with all other requests, once submitted regularly you have to wait for the oracle to merge your request into the Antithesis token.
34+
As with all other requests, once submitted you have to wait for the oracle to merge your request into the Antithesis token.
2635

2736
You can use the `anti token` command to inspect your pending requests in the Antithesis token.
2837

2938
You can use the `anti facts` command to query the Antithesis token and see if your user is part of the facts.
3039

3140
```bash
32-
anti token | jq '.requests' "
41+
anti token --no-pretty | jq '.requests'
3342
```
3443

35-
Until your requests is there, you cannot proceed with the next steps.
44+
As long as your request is listed by `anti token`, you cannot proceed with the next steps.
3645

37-
As with all requests to an mpfs you can retract your request using the `anti retract` command, anytime before the oracle merges it into the Antithesis token.
46+
As with all requests to an MPFS you can retract your request using the `anti retract` command, anytime before the oracle merges it into the Antithesis token.
3847

3948
Get the `outputRefId` of your request from pending requests command output and use it to retract your request
4049

4150
```bash
4251
anti retract -o 9ec36572e01bca9f7d32d791a5a6c529ef91c10d536f662735af26311b2c8766-0
4352
```
44-
ATM the oracle is not able to justify a request rejection. But anti cli will apply the oracle validation before submitting it, so rejections will be caught before submitting the request.
53+
Currently the oracle is not able to justify a request rejection. But anti cli will apply the oracle validation before submitting it, so rejections will be caught before submitting the request.
4554

4655
### Unregistering a user public key
4756

@@ -53,15 +62,15 @@ anti requester unregister-user --platform github --username alice --pubkeyhash A
5362

5463
### Registering a role
5564

56-
This is necessary to register a user as a github repository antitheisis test requester.
65+
This is necessary to register a user as a GitHub repository antithesis test requester.
5766

5867
Before you do this make sure your repository CODEOWNERS file contains a line like this:
5968

6069
```
6170
antithesis: @your-github-username
6271
```
6372

64-
You can have as many user as you want but registering them as test-run requesters has to be done one by one.
73+
You can have as many users as you want but registering them as test-run requesters has to be done one by one.
6574

6675
To register a role, you can use the `anti requester register-role` command.
6776

0 commit comments

Comments
 (0)