Remote Setup

Remote setup for running & testing ocean.py

This setup does not use barge and uses a remote chain to do the transactions. When the network URL is specified & configured, ocean.py will use components (such as Provider, Aquarius, C2D) according to the expected blockchain.

Here, we do setup for Sepolia. It's similar for other remote chains.

Here, we will:

  1. Configure Networks

  2. Create two accounts - REMOTE_TEST_PRIVATE_KEY1 and 2

  3. Get test ETH on Sepolia

  4. Get test OCEAN on Sepolia

  5. Set envvars

  6. Set up Alice and Bob wallets in Python

Let's go!

1. Configure Networks

1.1 Supported networks

All Ocean chain deployments (Eth mainnet, Polygon, etc) are supported. For any supported network, use the RPC URL of your choice when passing it to the ocean config object.

1.2 RPCs and Infura

In order to obtain API keys for blockchain access, follow up this document for tips & tricks.

If you do have an Infura account

Use the full RPC URL including the base and API key, e.g. for sepolia: https://sepolia.infura.io/v3/<API-KEY>

2. Create EVM Accounts (One-Time)

An EVM account is singularly defined by its private key. Its address is a function of that key. Let's generate two accounts!

In a new or existing console, run Python.

In the Python console:

Then, hit Ctrl-C to exit the Python console.

Now, you have two EVM accounts (address & private key). Save them somewhere safe, like a local file or a password manager.

These accounts will work on any EVM-based chain: production chains like Eth mainnet and Polygon, and testnets like Sepolia. Here, we'll use them for Sepolia.

3. Get (test) ETH on Sepolia

We need the a network's native token to pay for transactions on the network. ETH is the native token for Ethereum mainnet; MATIC is the native token for Polygon, and (test) ETH is the native token for Sepolia.

To get free (test) ETH on Sepolia:

  1. Go to the faucet https://www.alchemy.com/faucets/ethereum-sepolia. Login or create an account on Alchemy.

  2. Request funds for ADDRESS1

  3. Request funds for ADDRESS2

4. Get (test) OCEAN on Sepolia

OCEAN can be used as a data payment token, and locked into veOCEAN for Data Farming / curation. The READMEs show how to use OCEAN in both cases.

To get free (test) OCEAN on Sepolia:

  1. Request funds for ADDRESS1

  2. Request funds for ADDRESS2

You can confirm receiving funds by going to the following url, and seeing your reported OCEAN balance: https://sepolia.etherscan.io/address/0x1B083D8584dd3e6Ff37d04a6e7e82b5F622f3985?a=<ADDRESS1 or ADDRESS2>

5. Set envvars

As usual, Linux/MacOS needs "export" and Windows needs "set". In the console:

Linux & MacOS users:

Windows users:

6. Setup in Python

In your working console, run Python:

In the Python console:

If you get a gas-related error like transaction underpriced, you'll need to change the maxFeePerGas or maxPriorityFeePerGas.

Last updated

Was this helpful?