Skip to content

Commit

Permalink
Merge pull request #1242 from valory-xyz/docs/update-demos-cli
Browse files Browse the repository at this point in the history
Fix cli in demos
  • Loading branch information
DavidMinarsch authored Aug 26, 2022
2 parents e00be11 + bc0b957 commit ee38f13
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 24 deletions.
32 changes: 25 additions & 7 deletions docs/counter_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ The steps below will guide you to download the counter agent service definition
1. Ensure that your machine satisfies the [framework requirements](quick_start.md#requirements) and that
you have followed the [setup instructions](quick_start.md#setup). As a result you should have a Pipenv workspace folder.

2. Inside the workspace folder, create a JSON file `keys.json` containing the addresses and keys of the four agents that are
2. Use the CLI to download the `valory/counter` service.
```bash
autonomy fetch valory/counter:0.1.0:bafybeicgcqytl2hoy67hmmi5vbhq2sjzkj4d5eajudjav3d6aqskl2bsge --remote --service
cd counter
```

3. Inside the workspace folder, create a JSON file `keys.json` containing the addresses and keys of the four agents that are
part of this demo. Below you have a sample `keys.json` file that you can use for testing.

!!! warning "Important"
Expand All @@ -50,18 +56,30 @@ you have followed the [setup instructions](quick_start.md#setup). As a result yo
]
```

3. Use the {{open_autonomy}} CLI to download and build the agent images:
4. Build the required image
```bash
autonomy deploy build deployment valory/counter:0.1.0:bafybeicgcqytl2hoy67hmmi5vbhq2sjzkj4d5eajudjav3d6aqskl2bsge keys.json
autonomy build-image
```
This command above downloads the counter agent service definition from the Service Registry, and generates the required Docker images to run it using the keys provided in the `keys.json` file.
The command above generates the required images to run the agent service.

4. The build configuration will be located in `./abci_build`. Execute [Docker Compose](https://docs.docker.com/compose/install/) as indicated below. This will deploy a local counter agent service with four agents connected to four [Tendermint](https://tendermint.com/) nodes.
5. Build a deployment setup for the demo service:
```bash
autonomy deploy build keys.json
```

This will build the deployment setup required to run the service locally.
!!!note
It is also possible to generate a deployment using a local service definition. See the [CLI section](./autonomy.md) for the complete details.

6. The build configuration will be located in `./abci_build`. Run the deployment using
```bash
cd abci_build
docker-compose up --force-recreate
autonomy deploy run
```
5. The logs of a single agent or [Tendermint](https://tendermint.com/) node can be inspected in another terminal with, e.g.,

This will deploy a local counter service with four agents connected to four Tendermint nodes.

7. The logs of a single agent or [Tendermint](https://tendermint.com/) node can be inspected in another terminal with, e.g.,
```bash
docker logs <container_id> --follow
```
Expand Down
37 changes: 27 additions & 10 deletions docs/price_oracle_intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,18 @@ node.


## Running the Demo
The steps below will guide you to download the price oracle agent service definition from the Service Registry, build and run a deployment that will run locally.
The steps below will guide you to download the price oracle agent service definition from the Service Registry, build and run a deployment locally.

1. Ensure that your machine satisfies the [framework requirements](quick_start.md#requirements) and that
you have followed the [setup instructions](quick_start.md#setup). As a result you should have a Pipenv workspace folder.

2. Inside the workspace folder, create a JSON file `keys.json` containing the addresses and keys of the four agents that are
2. Use the CLI to download the `valory/oracle_hardhat` service.
```bash
autonomy fetch valory/oracle_hardhat:0.1.0:bafybeibuyjmi4uk4hlxdgd3gsprtunz52lomd4z4v6rwf4c6cz7jtjbs2a --remote --service
cd oracle_hardhat
```

3. Prepare a JSON file `keys.json` containing the addresses and keys of the four agents that are
part of this demo. Below you have a sample `keys.json` file that you can use for testing.

!!! warning "Important"
Expand All @@ -66,24 +72,35 @@ you have followed the [setup instructions](quick_start.md#setup). As a result yo
]
```

3. Use the {{open_autonomy}} CLI to download and build the agent images:
4. Build the required image
```bash
autonomy build-image
```
The command above generates the required images to run the agent service.

5. Build a deployment setup for the demo service:
```bash
autonomy deploy build deployment valory/oracle_hardhat:0.1.0:bafybeibuyjmi4uk4hlxdgd3gsprtunz52lomd4z4v6rwf4c6cz7jtjbs2a keys.json
autonomy deploy build keys.json
```
This command above downloads the price oracle agent service definition from the Service Registry, and generates the required Docker images to run it using the keys provided in the `keys.json` file.

4. Open a second terminal and run a local [HardHat](https://hardhat.org/) node that will emulate a blockchain node. For convenience, we provide a Docker image in [Docker Hub](https://hub.docker.com/) that can be run by executing:
This will build the deployment setup required to run the service locally.
!!!note
It is also possible to generate a deployment using a local service definition. See the [CLI section](./autonomy.md) for the complete details.

6. Open a second terminal and run a local [HardHat](https://hardhat.org/) node that will emulate a blockchain node. For convenience, we provide a Docker image in [Docker Hub](https://hub.docker.com/) that can be run by executing:
```bash
docker run -p 8545:8545 -it valory/open-autonomy-hardhat:0.1.0
```

5. Return to the workspace terminal.
The build configuration will be located in `./abci_build`. Execute [Docker Compose](https://docs.docker.com/compose/install/) as indicated below. This will deploy a local price oracle agent service with four agents connected to four [Tendermint](https://tendermint.com/) nodes.
7. Return to the workspace terminal.
The build configuration will be located in `./abci_build`. Run the deployment using
```bash
cd abci_build
docker-compose up --force-recreate
autonomy deploy run
```
6. The logs of a single agent or [Tendermint](https://tendermint.com/) node can be inspected in another terminal with, e.g.,
This will deploy a local price oracle agent service with four agents connected to four [Tendermint](https://tendermint.com/) nodes.

8. The logs of a single agent or [Tendermint](https://tendermint.com/) node can be inspected in another terminal with, e.g.,
```bash
docker logs <container_id> --follow
```
Expand Down
31 changes: 24 additions & 7 deletions docs/simple_abci.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ The steps below will guide you to download the simple agent service definition f
1. Ensure that your machine satisfies the [framework requirements](quick_start.md#requirements) and that
you have followed the [setup instructions](quick_start.md#setup). As a result you should have a Pipenv workspace folder.

2. Inside the workspace folder, create a JSON file `keys.json` containing the addresses and keys of the four agents that are
2. Use the CLI to download the `valory/simple_abci` service.
```bash
autonomy fetch valory/simple_abci:bafybeiaxt7m2pde37nn5arr6xkkyjmzhyyca4bhjwgixduvlp6d7aioyry --remote --service
cd simple_abci
```

3. Inside the workspace folder, create a JSON file `keys.json` containing the addresses and keys of the four agents that are
part of this demo. Below you have a sample `keys.json` file that you can use for testing.

!!! warning "Important"
Expand All @@ -62,19 +68,30 @@ you have followed the [setup instructions](quick_start.md#setup). As a result yo
]
```

3. Use the {{open_autonomy}} CLI to download and build the agent images:
4. Build the required image
```bash
autonomy build-image
```
The command above generates the required images to run the agent service.

5. Build a deployment setup for the demo service:
```bash
autonomy deploy build deployment valory/simple_abci:hash keys.json
autonomy deploy build keys.json
```
This command above downloads the simple agent service definition from the Service Registry, and generates the required Docker images to run it using the keys provided in the `keys.json` file.

4. The build configuration will be located in `./abci_build`. Execute [Docker Compose](https://docs.docker.com/compose/install/) as indicated below. This will deploy a local simple agent service with four agents connected to four [Tendermint](https://tendermint.com/) nodes.
This will build the deployment setup required to run the service locally.
!!!note
It is also possible to generate a deployment using a local service definition. See the [CLI section](./autonomy.md) for the complete details.

6. The build configuration will be located in `./abci_build`. Run the deployment using
```bash
cd abci_build
docker-compose up --force-recreate
autonomy deploy run
```

5. The logs of a single agent or [Tendermint](https://tendermint.com/) node can be inspected in another terminal with, e.g.,
This will deploy a local simple service with four agents connected to four Tendermint nodes.

7. The logs of a single agent or [Tendermint](https://tendermint.com/) node can be inspected in another terminal with, e.g.,
```bash
docker logs <container_id> --follow
```
Expand Down

0 comments on commit ee38f13

Please sign in to comment.