• Stars
    star
    102
  • Rank 335,584 (Top 7 %)
  • Language
    Shell
  • License
    Apache License 2.0
  • Created over 6 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🐳 Docker Compose files for the full Ocean Protocol stack

banner

barge

🐳 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 [email protected]: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.

Welcome to Ocean Protocol

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 v1.1.15 172.15.0.14
Aquarius v5.1.4 172.15.0.5 5000 -> 5000
Elasticsearch Aquarius 8.5.1 172.15.0.6
Provider v2.1.3 172.15.0.4 8030 -> 8030
Provider2 v2.1.3 172.15.0.7 8030 -> 8030
RBAC Server main 172.15.0.8 3000 -> 3000
GraphNode graphprotocol/graph-node:v0.28.2 172.15.0.15 9000 -> 8000 ,9001 -> 8001 , 9020 -> 8020, 9030 -> 8030, 9040 -> 8040
Graphipfs ipfs/go-ipfs:v0.4.23 172.15.0.16 5001 -> 5001
Graphpgsql postgres 172.15.0.7 5432 -> 5432
Dashboard portainer/portainer 172.15.0.25 9100 -> 9000
Redis bitnami/redis:latest 172.15.0.18 6379 -> 6379
C2d multiple components 172.15.0.12,172.15.0.13 31000 -> 31000

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
  • PROVIDER_VERSION
  • CONTRACTS_VERSION
  • RBAC_VERSION
  • ELASTICSEARCH_VERSION

For example:

export AQUARIUS_VERSION=v2.0.0
./start_ocean.sh

Log levels

You can specify what type of logs barge should display for Aquarius, Provider or Subgraph by exporting the following environment variables.

  • AQUARIUS_LOG_LEVEL
  • PROVIDER_LOG_LEVEL
  • SUBGRAPH_LOG_LEVEL

Currently, they are all set to INFO.

For example:

export AQUARIUS_LOG_LEVEL=DEBUG
./start_ocean.sh

All Options

Option Description
--no-aquarius Start up Ocean without the aquarius Building Block.
--no-elasticsearch Start up Ocean without the elasticsearch Building Block.
--no-provider Start up Ocean without the provider Building Block.
--no-ipfs Start up Ocean without the ipfs Building Block
--with-provider2 Runs a 2nd provider, on port 8031. This is required for ocean.js/ocean.py integration tests. 2nd Provider will use the same image and parameters (log_level, ipfs gateway, compute gateway, etc) as provider1, but has a different private key
--no-dashboard Start up Ocean without the dashboard Building Block.
--with-rbac Start up Ocean with RBAC Server
--with-thegraph Start up Ocean with graphnode,postgresql and deploys ocean-subgraph
--skip-subgraph-deploy Will skip deployment of ocean-subgraphs
--skip-deploy Start up Ocean without deploying the contracts. Useful when ethereum node already has contracts.
--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.
--exposeip Binds the components to that specific ip. Example: ./start_ocean.sh --exposeip 192.168.0.1
--with-c2d Runs a local C2D Cluster

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.

Aquarius

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.

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

Hostname External Port Internal URL Local URL Description
aquarius 5000 http://aquarius:5000 http://localhost:5000 Aquarius
elasticsearch The Elasticsearch used by Aquarius

Provider

Hostname External Port Internal URL Local URL Description
provider 8030 http://provider:8030 http://localhost:8030

Ganache

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

TheGraph

Hostname External Port Internal URL Local URL Description
graphnode 9000 http://graphnode:9000 http://localhost:9000

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 disabled by setting the --no-dashboard flag.

  • User: admin
  • Password: oceanprotocol
Hostname External Port Internal URL Local URL Description
dashboard 9100 http://dashboard:9100 http://localhost:9100 Portainer

RBAC Server

Hostname External Port Internal URL Local URL Description
rbac 3000 http://rbac:3000 http://localhost:3000

The following addresses are preconfigured for testing: (first 10 addresses from the default mnemonic)

Address Roles
0xe2DD09d719Da89e5a3D0F2549c7E24566e947260 ["user","publisher","consumer"]
0xBE5449a6A97aD46c8558A3356267Ee5D2731ab5e ["user","publisher","consumer"]
0xA78deb2Fa79463945C247991075E2a0e98Ba7A09 ["user","publisher","consumer"]
0x02354A1F160A3fd7ac8b02ee91F04104440B28E7 ["user","publisher","consumer"]
0xe17D2A07EFD5b112F4d675ea2d122ddb145d117B ["user","publisher","consumer"]
0xA32C84D2B44C041F3a56afC07a33f8AC5BF1A071 ["user","publisher","consumer"]
0xFF3fE9eb218EAe9ae1eF9cC6C4db238B770B65CC ["user"]
0x529043886F21D9bc1AE0feDb751e34265a246e47 ["consumer"]
0xe08A1dAe983BC701D05E492DB80e0144f8f4b909 ["publisher"]
0xbcE5A3468386C64507D30136685A99cFD5603135 ["consumer","publisher"]

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.

More Repositories

1

market

πŸ§œβ€β™€οΈ THE Data Market
TypeScript
189
star
2

ocean.py

πŸ¦‘ Ocean Protocol's Python library to privately & securely publish, exchange, and consume data.
Python
169
star
3

ocean.js

πŸ¦‘ Ocean Protocol JavaScript library to privately & securely publish, exchange, and consume data.
TypeScript
106
star
4

aquarius

πŸ‹ Off-chain database store for data assets metadata.
Python
101
star
5

contracts

πŸ™ Smart contracts for Ocean Protocol
JavaScript
77
star
6

docs

🐬 Ocean Protocol documentation
JavaScript
61
star
7

react

🎣 React hooks & components on top of ocean.js
TypeScript
30
star
8

ocean-node

TypeScript
29
star
9

provider

REST API for provider of data services
Python
28
star
10

papers

🌊 Ocean Protocol whitepapers
28
star
11

pdr-backend

Instructions & code to run predictoors, traders, more.
Python
26
star
12

ocean-subgraph

πŸ¦€ Ocean Protocol Subgraph
TypeScript
19
star
13

tokengated-next-chatgpt

Web3 Tokengated Chatbot via OpenAI/Langchain/Hugging Face. Powered by Next, Vercel & Supabase.
TypeScript
17
star
14

art

🐬 Ocean Protocol's assets for community distribution
17
star
15

predict-eth

Predict ETH challenges
Python
15
star
16

oceandb-elasticsearch-driver

🐳 OceanDB ElasticSearch Driver (Python)
Python
9
star
17

eslint-config-oceanprotocol

πŸ’… πŸ¦‹ ESLint config for keeping JavaScript consistent across all of Ocean Protocol's projects
JavaScript
9
star
18

operator-engine

Python library allowing to interact with the Kubernetes infrastructure
Python
7
star
19

ipfs

πŸ‘©πŸ½β€πŸš€ Ocean Protocol's public IPFS node & gateway.
TypeScript
7
star
20

jobs

Developer jobs
6
star
21

operator-service

Infrastructure Operator Micro-service
Python
5
star
22

ocean-cli

TypeScript
4
star
23

list-purgatory

😈 Lists tracking assets and accounts in Purgatory, which has consequences in the Ocean Market UI.
4
star
24

uploader_filecoin

Filecoin microservice for DBS
JavaScript
4
star
25

status

🐚 Overview and status checks of all Ocean Protocol RPC network connections.
TypeScript
4
star
26

pm

Zenhub needs each issue associated with one repo. This repo is a workaround, to mark issues that span >1 repos.
4
star
27

uploader_arweave

Arweave microservice for DBS
JavaScript
3
star
28

df-py

veOCEAN & Data Farming backend
Python
3
star
29

fetch

This repository combines Ocean Protocol’s decentralized data ecosystem with Fetch.ai's Autonomous Economic Agents (AEAs). This ensures secure data exchange, privacy preservation, and enables automated business intelligence generation.
Python
3
star
30

token-gating-template

TypeScript
3
star
31

Ocean-Autopilot

Fusing Web3 primitives with AI, Community and Speed to compete in the first ever autonomous racing league
Python
3
star
32

RBAC-Server

Ocean role-based access control server
TypeScript
2
star
33

vw-cli

CLI for VestingWallet
Python
2
star
34

community-numbers

πŸ€– Microservice to cache and expose community numbers. Beep boop.
JavaScript
2
star
35

marketplace-launchpad

Learn how to setup your own data marketplace with blockchain super powers!
JavaScript
2
star
36

dockerhub-proxy

πŸ™ Microservice API endpoint to validate Docker image URLs.
TypeScript
2
star
37

uploader_backend

Decentralized backend storage API
Python
2
star
38

algo_dockers

JavaScript
2
star
39

pybundlr

Simple py driver for bundlr
Python
2
star
40

pdr-websocket

TypeScript
1
star
41

predict-eth-data-sources

A rest api for getting data for predict-eth
Python
1
star
42

pod-publishing

Piece in charge of publishing the data generated by the computing pod
JavaScript
1
star
43

uploader.js

OCEAN Decentralized Backend Storage js Library
TypeScript
1
star
44

df-web

JavaScript
1
star
45

nodes-dashboard

TypeScript
1
star
46

plecos

Utility library to validate metadata
Python
1
star
47

pod-configuration

Piece in charge of preparing the execution of a computing pod
JavaScript
1
star
48

.github

Default community health files for all public repos not using their own default files
1
star
49

circulating-supply-api

JavaScript
1
star
50

uploader-ui-lib

TypeScript
1
star
51

crawler

Python
1
star
52

sapphire.py

Python wrapper for sending transactions in Oasis Sapphire network
Python
1
star
53

uploader-ui

Uploader UI
TypeScript
1
star
54

pdr-art

Ocean Predictoor logos etc
1
star
55

insights

TypeScript
1
star
56

pdr-web

TypeScript
1
star