Local Setup
Local setup for running & testing ocean.py
On this page, we continue our journey from installation part, to do setup for local testing. Local setup means that we will use Ganache as local blockchain where we can effectuate transactions and all the services point to this network.
⚠️ Ocean local setup uses Docker, which is fine for Linux/Ubuntu but plays badly with MacOS and Windows. If you are on these, you’ll want remote setup.
Here are the following steps for configuring ocean.py on Ganache network using barge.
Prerequisites
Ahoy there, matey! 🌊⚓️ When it comes to setting up ocean.py locally, we're diving into the world of Docker containers. These clever containers hold the trusty local blockchain nodes (Ganache) and the mighty Ocean middleware (Aquarius metadata cache and Provider to aid in consuming data assets). But fear not, for a smooth sailing experience, you'll need to ensure the following Docker components are shipshape and ready to go:
Docker 🐳
Oh, and don't forget to allow those non-root users to join in on the fun! 🙅♂️
So hoist the anchor, prepare your Docker crew, and let's embark on an exciting voyage with ocean.py! 🚢⛵️
1. Download barge and run services
Ocean barge
runs ganache (local blockchain), Provider (data service), and Aquarius (metadata cache).
Barge helps you quickly become familiar with Ocean, because the local blockchain has low latency and no transaction fees.\
In a new console:
Let barge do its magic and wait until the blockchain is fully synced. That means when you start to see continuously eth_blockNumber
2. Set envvars
From here on, go to a console different than Barge. (E.g. the console where you installed Ocean, or a new one.)
First, ensure that you're in the working directory, with venv activated:
For this tutorial Alice is the publisher of the dataset and Bob is the consumer of the dataset. As a Linux user, you'll use "export
" for setting the private keys. In the same console:
3. Setup in Python
In the same console, run Python console:
In the Python console:
Last updated