barge/README.md

170 lines
7.6 KiB
Markdown
Raw Normal View History

[![banner](https://raw.githubusercontent.com/oceanprotocol/art/master/github/repo-banner%402x.png)](https://oceanprotocol.com)
2018-08-10 14:30:25 +02:00
<h1 align="center">barge</h1>
2018-08-10 14:30:25 +02:00
2019-07-26 18:03:42 +02:00
> 🐳 Docker Compose files for the full Ocean Protocol stack.
2018-08-10 14:30:25 +02:00
2018-09-19 18:52:52 +02:00
---
2019-07-26 18:03:42 +02:00
- [Prerequisites](#prerequisites)
- [Get Started](#get-started)
- [Options](#options)
- [Component Versions](#component-versions)
- [All Options](#all-options)
- [Docker Building Blocks](#docker-building-blocks)
- [Aquarius](#aquarius)
2020-09-08 18:23:10 +02:00
- [Provider](#provider)
- [Ganache](#ganache)
2019-10-09 15:29:02 +02:00
- [Dashboard](#dashboard)
2019-07-26 18:03:42 +02:00
- [Contributing](#contributing)
- [License](#license)
2018-08-10 14:30:25 +02:00
---
2018-09-19 18:52:52 +02:00
## Prerequisites
2018-08-16 12:20:54 +02:00
You need to have the newest versions of:
2018-08-13 15:12:21 +02:00
2019-05-08 14:08:17 +02:00
- Linux or macOS. Windows is not currently supported. If you are on Windows, we recommend running Barge inside a Linux VM. Another option might be to use the [Windows Subsystem for Linux (WSL)](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux).
- [Docker](https://www.docker.com/get-started)
- [Docker Compose](https://docs.docker.com/compose/)
2018-09-19 18:52:52 +02:00
## Get Started
2018-08-10 14:30:25 +02:00
2019-07-18 14:16:02 +02:00
If you're new to Barge, it's best to start with the defaults:
2018-08-10 14:30:25 +02:00
```bash
git clone git@github.com:oceanprotocol/barge.git
cd barge
./start_ocean.sh
```
2020-09-08 18:23:10 +02:00
That will run the current default versions of Aquarius, Provider, Ganache.
2019-06-05 14:21:31 +02:00
<img width="486" alt="Welcome to Ocean Protocol" src="Welcome_to_Ocean_Protocol.png">
2019-07-18 14:16:02 +02:00
It's overkill, but to be _sure_ that you use exactly the Docker images and volumes you want, you can prune all the Docker things in your system first:
2019-07-18 13:17:34 +02:00
```bash
docker system prune --all --volumes
```
## Options
2019-09-02 09:50:09 +02:00
The startup script comes with a set of options for customizing various things.
2019-07-18 13:17:34 +02:00
### Component Versions
2018-08-10 14:30:25 +02:00
2019-07-18 13:17:34 +02:00
The default versions are always a combination of component versions which are considered stable.
2019-06-05 14:21:31 +02:00
| Aquarius | Provider | Ganache | ocean-contracts |
| -------- | -------- | -------- | --------------- |
| `vx.x.x` | `vx.x.x` | `latest` | `test`
2018-08-13 15:12:21 +02:00
2019-07-18 12:03:03 +02:00
You can override the Docker image tag used for a particular component by setting its associated environment variable before calling `start_ocean.sh`:
- `AQUARIUS_VERSION`
2020-09-08 18:23:10 +02:00
- `PROVIDER_VERSION`
- `CONTRACTS_VERSION`
2019-07-18 12:03:03 +02:00
For example:
```bash
2020-09-08 18:23:10 +02:00
export AQUARIUS_VERSION=v2.0.0
./start_ocean.sh
```
2019-07-18 13:17:34 +02:00
### All Options
2019-06-26 14:55:39 +02:00
| Option | Description |
| -------------------------- | ----------------------------------------------------------------------------------------------- |
| `--no-aquarius` | Start up Ocean without the `aquarius` Building Block. |
2020-09-08 18:23:10 +02:00
| `--no-provider` | Start up Ocean without the `provider` Building Block. |
| `--no-ganache` | Start up Ocean without the `ganache` Building Block. |
2019-10-09 19:26:45 +02:00
| `--no-dashboard` | Start up Ocean without the `dashboard` Building Block. |
2019-06-26 14:55:39 +02:00
| `--mongodb` | Start up Ocean with MongoDB as DB engine for Aquarius instead of Elasticsearch. |
| `--force-pull` | Force pulling the latest revision of the used Docker images. |
| `--purge` | Removes the Docker containers, volumes, artifact folder and networks used by the script. |
2020-09-08 18:23:10 +02:00
| `--exposeip` | Binds the components to that specific ip. Example: `./start_ocean.sh --exposeip 192.168.0.1` |
2019-12-10 14:48:40 +01:00
2018-12-11 11:54:06 +01:00
## Docker Building Blocks
Barge consists of a set of building blocks that can be combined to form a local test environment. By default all building blocks will be started by the `start_ocean.sh` script.
2018-12-11 11:54:06 +01:00
### Aquarius
2018-11-15 10:30:28 +01:00
By default it will start two containers (one for Aquarius and one for its database engine). By default, Barge will use Elasticsearch for its database engine. You can use the `--mongodb` option to use MongoDB instead.
2019-07-26 18:03:42 +02:00
2019-02-27 17:11:13 +01:00
This Building Block can be disabled by setting the `--no-aquarius` flag.
2018-11-15 10:30:28 +01:00
| Hostname | External Port | Internal URL | Local URL | Description |
| --------------- | ------------- | -------------------- | --------------------- | ----------------------------------------------------- |
| `aquarius` | `5000` | http://aquarius:5000 | http://localhost:5000 | [Aquarius](https://github.com/oceanprotocol/aquarius) |
| `elasticsearch` | | | | The Elasticsearch used by Aquarius |
| `mongodb` | | | | The MongoDB used by Aquarius |
2018-08-13 15:12:21 +02:00
2020-09-08 18:23:10 +02:00
### Provider
2018-11-15 10:30:28 +01:00
2020-09-08 18:23:10 +02:00
| Hostname | External Port | Internal URL | Local URL | Description |
| ----------- | ------------- | --------------------- | --------------------- | --------------------------------------------------- |
| `provider` | `8030` | http://provider:9000 | http://localhost:8030 | |
2019-07-18 12:03:03 +02:00
2020-09-08 18:23:10 +02:00
### Ganache
2019-07-18 12:03:03 +02:00
2020-09-08 18:23:10 +02:00
| Hostname | External Port | Internal URL | Local URL | Description |
| ----------- | ------------- | --------------------- | --------------------- | --------------------------------------------------- |
| `ganache` | `8545` | http://ganache:9000 | http://localhost:8545 | |
2019-07-18 15:41:41 +02:00
### ocean-contracts
* Deploy all smart contracts from the ocean-contracts repo
* Export artifacts files (.json) to default shared folder between all containers
* Create address file (address.json) that has the address of each deployed
smart contract that is required by the ocean library. This file is saved to the same folder with the artifacts files
| Hostname | External Port | Internal URL | Local URL | Description |
| ------------------- | ------------- | --------------------- | --------------------- | ------------------------------------------- |
| `ocean-contracts` | | | | |
The accounts can be accessed with this seed phrase:
2019-12-10 14:48:40 +01:00
2020-09-08 18:23:10 +02:00
```
taxi music thumb unique chat sand crew more leg another off lamp
```
2019-12-10 14:48:40 +01:00
2020-09-08 18:23:10 +02:00
Alternatively, you can pass your own mnemonic with `GANACHE_MNEMONIC`.
2019-12-10 14:48:40 +01:00
2019-10-09 15:29:02 +02:00
### Dashboard
This will start a `portainer` dashboard with the following admin credentials and connects to the local docker host. This Building Block can be disabled by setting the `--no-dashboard` flag.
- User: `admin`
- Password: `oceanprotocol`
| Hostname | External Port | Internal URL | Local URL | Description |
| ----------- | ------------- | --------------------- | --------------------- | --------------------------------------------------- |
| `dashboard` | `9000` | http://dashboard:9000 | http://localhost:9000 | [Portainer](https://github.com/portainer/portainer) |
2018-08-10 14:30:25 +02:00
## Contributing
See the page titled "[Ways to Contribute](https://docs.oceanprotocol.com/concepts/contributing/)" in the Ocean Protocol documentation.
2018-08-10 14:30:25 +02:00
## License
```text
2020-09-08 18:23:10 +02:00
Copyright 2020 Ocean Protocol Foundation
2018-08-10 14:30:25 +02:00
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```