SkillAgentSearch skills...

Barge

🐳 Docker Compose files for the full Ocean Protocol stack

Install / Use

/learn @oceanprotocol/Barge
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

banner

<h1 align="center">barge</h1>

🐳 Docker Compose files for the full Ocean Protocol stack running locally for development.



Prerequisites

We recommend running Barge inside a Linux machine.

Get Started

If you're new to Barge, it's best to start with the defaults:

git clone git@github.com:oceanprotocol/barge.git
cd barge

./start_ocean.sh

This will run the current default versions of Aquarius, Provider, and Ganache with our contracts deployed to it.

<img width="486" alt="Welcome to Ocean Protocol" src="Welcome_to_Ocean_Protocol.png">

Cleanup

To clean up your environment, you can run

./cleanup.sh

This will stop & remove any ocean related containers, then delete any volumes and networks created by barge.

Troubleshooting

If your code using Barge hits KeyError: "development", this is a Barge issue: Barge couldn't deploy the contracts and update address.json in ~/.ocean/. Further cleanup is needed. Further cleanup can fix other issues too. Here are tactics.

Tactic: clean up old Docker containers

docker system prune -a --volumes

Tactic: delete Ocean cache, or a sub-directory of it. (This is not part of cleanup.sh in case you want to preserve parts of ~/.ocean/.)

# delete whole cache
rm -rf ~/.ocean

# OR, delete sub-directory
# (find the sub-directory, and rm -rf it)

Tactic: Kill redis or postgres processes. Why: they usually have autostart enabled and can interfere with Barge.

# use ps. Do as superuser to ensure you see the process.
sudo ps aux | grep redis
sudo ps aux | grep postgresql

# If you see unwanted processes, kill them by process id. -9 to force
kill -9 <pid>

Tactic: reboot your computer. Why: will stop any other unwanted process.

Startup Options

The startup script comes with a set of options for customizing various things.

Component Versions and exposed ports

The default versions are always a combination of component versions which are considered stable.

| Component name | Required by | Version | IP Address | Ports exposed | | -------------- | ------------------ | --------------------------------- | --------------- | ------------- | | ganache | ocean-contracts | latest | 172.15.0.3 | 8545 -> 8545 | | ocean-contracts | | v2.3.0 | 172.15.0.14 | | | Ocean-Node | | latest | 172.15.0.5 | 8000 -> 8000, 8001 -> 8001 | | Elasticsearch | Ocean-node | 8.5.1 | 172.15.0.6 | | | Typesense | Ocean-node | 0.25.1 | 172.15.0.20 | 8108 -> 8108 | | Ipfs | | ipfs/go-ipfs:v0.4.23 | 172.15.0.16 | 5001 -> 5001 | | Dashboard | | portainer/portainer | 172.15.0.25 | 9100 -> 9000 |

You can override the Docker image tag used for a particular component by setting its associated environment variable before calling start_ocean.sh.

  • CONTRACTS_VERSION

For example:

export NODE_VERSION=2.3.0
./start_ocean.sh

All Options

| Option | Description | | -------------------------- | ----------------------------------------------------------------------------------------------- | | --no-node | Start up Ocean without the Node Building Block. | | --no-elasticsearch | Start up Ocean without the elasticsearch Building Block. | | --with-typesense | Start up Ocean with Typesense | | --no-ipfs | Start up Ocean without the ipfs Building Block | | --with-dashboard | Start up Ocean with the dashboard Building Block. | | --force-pull | Force pulling the latest revision of the used Docker images. |

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.

Node

This Building Block can be disabled by setting the --no-node flag.

| Hostname | External Port | Internal URL | Local URL | Description | | --------------- | ------------- | -------------------- | --------------------- | ----------------------------------------------------- | | node | 8000:8001 | http://node:8001 | http://localhost:8001 | Node |

Ganache

| Hostname | External Port | Internal URL | Local URL | Description | | ----------- | ------------- | --------------------- | --------------------- | --------------------------------------------------- | | ganache | 8545 | http://ganache:8545 | http://localhost:8545 | |

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

The accounts can be accessed with this seed phrase:

taxi music thumb unique chat sand crew more leg another off lamp

Alternatively, you can pass your own mnemonic with GANACHE_MNEMONIC.

Dashboard

This will start a portainer dashboard with the following admin credentials and connects to the local docker host. This Building Block can be started by setting the --with-dashboard flag.

  • User: admin
  • Password: oceanprotocol

| Hostname | External Port | Internal URL | Local URL | Description | | ----------- | ------------- | --------------------- | --------------------- | --------------------------------------------------- | | dashboard | 9100 | http://dashboard:9100 | http://localhost:9100 | Portainer |

Contributing

See the page titled "Ways to Contribute" in the Ocean Protocol documentation.

Readiness

Several building blocks on barge are going to require some time until they are ready. Watch for the following files to be created:

| Building block | File | Condition | | ----------------------------------------- | ------------------------------- | -------------- | | ocean-contracts | ${OCEAN_HOME}/ocean-contracts/artifacts/ready | | c2d | ${OCEAN_HOME}/ocean-c2d/ready | | | c2d | ${OCEAN_HOME}/ocean-c2d/imagesready | Only if WAIT_FOR_C2DIMAGES == 'yeah' |

Certs

Registry certs were created using the following commands:

openssl genrsa 2048 > registry.key
openssl req -new -x509 -nodes -sha1 -days 3650 -key registry.key -out registry.crt -addext 'subjectAltName = IP:172.15.0.11'

License

Copyright 2023 Ocean Protocol Foundation

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.
View on GitHub
GitHub Stars102
CategoryDevelopment
Updated5d ago
Forks42

Languages

Shell

Security Score

100/100

Audited on Mar 17, 2026

No findings