1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00

GITBOOK-548: Obtaining API Keys for Blockchain Access

This commit is contained in:
mariacarmina.cretu 2023-06-19 14:59:13 +00:00 committed by gitbook-bot
parent ab1fd8cfe7
commit f436dacb86
No known key found for this signature in database
GPG Key ID: 07D2180C7B12D0FF
8 changed files with 35 additions and 17 deletions

View File

@ -53,6 +53,7 @@
* [Retrieve datatoken/data NFT addresses & Chain ID](developers/retrieve-datatoken-address.md) * [Retrieve datatoken/data NFT addresses & Chain ID](developers/retrieve-datatoken-address.md)
* [Barge](developers/barge/README.md) * [Barge](developers/barge/README.md)
* [Local Setup](developers/barge/local-setup-ganache.md) * [Local Setup](developers/barge/local-setup-ganache.md)
* [Obtaining API Keys for Blockchain Access](developers/obtaining-api-keys-for-blockchain-access.md)
* [Build a Marketplace](developers/build-a-marketplace/README.md) * [Build a Marketplace](developers/build-a-marketplace/README.md)
* [Forking Ocean Market](developers/build-a-marketplace/forking-ocean-market.md) * [Forking Ocean Market](developers/build-a-marketplace/forking-ocean-market.md)
* [Customising a Market](developers/build-a-marketplace/customising-your-market.md) * [Customising a Market](developers/build-a-marketplace/customising-your-market.md)

View File

@ -0,0 +1,21 @@
---
description: 🧑🏽‍💻 Remote Development Environment for Ocean Protocol
---
# Obtaining API Keys for Blockchain Access
This article points out an alternative for configuring remote networks on Ocean Protocol components: the libraries, Provider, Aquarius, Subgraph, without using Barge services.
### Obtaining API key for Ethereum node provider
Ocean Protocol's smart contracts are deployed on EVM-compatible networks. Using an API key provided by a third-party Ethereum node provider allows you to interact with the Ocean Protocol's smart contracts on the supported networks without requiring you to host a local node.
Choose any API provider of your choice. Some of the commonly used are:
* [Infura](https://infura.io/)
* [Alchemy](https://www.alchemy.com/)
* [Moralis](https://moralis.io/)
The supported networks are listed [here](../discover/networks/).
Let's configure the remote setup for the mentioned components in the following sections.

View File

@ -1,22 +1,12 @@
# Configuration # Configuration
### Obtaining API key for Ethereum node provider For obtaining the API keys for blockchain access and set the correct environment variables, please consult [this section](http://localhost:5000/o/mTcjMqA4ylf55anucjH8/s/zQlpIJEeu8x5yl0OLuXn/) first and after proceed with the next steps.
Ocean Protocol's smart contracts are deployed on EVM-compatible networks. Using an API key provided by a third-party Ethereum node provider allows you to interact with the Ocean Protocol's smart contracts on the supported networks without requiring you to host a local node.
Choose any API provider of your choice. Some of the commonly used are:
* [Infura](https://infura.io/)
* [Alchemy](https://www.alchemy.com/)
* [Moralis](https://moralis.io/)
The supported networks are listed [here](../../discover/networks/).
### Create a directory ### Create a directory
Let's start with creating a working directory where we store the environment variable file, configuration files and the scripts. Let's start with creating a working directory where we store the environment variable file, configuration files and the scripts.
``` ```bash
mkdir my-ocean-project mkdir my-ocean-project
cd my-ocean-project cd my-ocean-project
``` ```
@ -102,10 +92,12 @@ Let's install Oceanjs library into your current project by running:
{% tabs %} {% tabs %}
{% tab title="Terminal" %} {% tab title="Terminal" %}
{% code overflow="wrap" %}
```bash ```bash
npm init npm init
npm i @oceanprotocol/lib@latest dotenv crypto-js ethers@5.7.4 @truffle/hdwallet-provider npm i @oceanprotocol/lib@latest dotenv crypto-js ethers@5.7.4 @truffle/hdwallet-provider
``` ```
{% endcode %}
{% endtab %} {% endtab %}
{% endtabs %} {% endtabs %}

View File

@ -83,6 +83,8 @@ For all users: to use EWC, add the following to network-config.yaml:
#### 1.5 RPCs and Infura #### 1.5 RPCs and Infura
In order to obtain API keys for blockchain access, follow up [this document](http://localhost:5000/o/mTcjMqA4ylf55anucjH8/s/zQlpIJEeu8x5yl0OLuXn/) for tips & tricks.
The config file's default RPCs point to Infura, which require you to have an Infura account with corresponding token `WEB3_INFURA_PROJECT_ID`. The config file's default RPCs point to Infura, which require you to have an Infura account with corresponding token `WEB3_INFURA_PROJECT_ID`.
**If you do have an Infura account** **If you do have an Infura account**

View File

@ -12,7 +12,7 @@ Aquarius consists of two parts:\
* A server for hosting Aquarius. See [this guide](setup-server.md) on creating a server. * A server for hosting Aquarius. See [this guide](setup-server.md) on creating a server.
* Docker and Docker compose are installed. Click [here](https://docs.docker.com/engine/install/) to view guide on installing docker. * Docker and Docker compose are installed. Click [here](https://docs.docker.com/engine/install/) to view guide on installing docker.
* [Obtain an API key](../ocean-libraries/configuration.md#obtaining-api-key-for-ethereum-node-provider) * [Obtain an API key](http://localhost:5000/o/mTcjMqA4ylf55anucjH8/s/zQlpIJEeu8x5yl0OLuXn/)
### Create a working directory ### Create a working directory

View File

@ -3,6 +3,7 @@
### Prerequisites ### Prerequisites
* A server for hosting Ocean Marketplace. See [this guide](setup-server.md) on creating a server. * A server for hosting Ocean Marketplace. See [this guide](setup-server.md) on creating a server.
* Obtain API key for wanted blockchain. See [this guide](https://app.gitbook.com/o/mTcjMqA4ylf55anucjH8/s/BTXXhmDGzR0Xgj13fyfM/\~/changes/548/developers/obtaining-api-keys-for-blockchain-access) for this.
### Push your customized Ocean Market code to your Git repository ### Push your customized Ocean Market code to your Git repository
@ -19,11 +20,12 @@ cd my-marketplace
If you already created the .env file as instructed in ...(link to customize the market chapter), you can skip this step, otherwise copy the below content into the \`.env\` file. If you already created the .env file as instructed in ...(link to customize the market chapter), you can skip this step, otherwise copy the below content into the \`.env\` file.
{% code title=".env" %} {% code title=".env" overflow="wrap" %}
``` ```
# Update this value if your Market should use custom Aquarius # Update this value if your Market should use custom Aquarius
NEXT_PUBLIC_METADATACACHE_URI=https://v4.aquarius.oceanprotocol.com NEXT_PUBLIC_METADATACACHE_URI=https://v4.aquarius.oceanprotocol.com
# Provide INFURA project ID from the obtained API key for NEXT_PUBLIC_INFURA_PROJECT_ID
#NEXT_PUBLIC_INFURA_PROJECT_ID="xxx" #NEXT_PUBLIC_INFURA_PROJECT_ID="xxx"
#NEXT_PUBLIC_MARKET_FEE_ADDRESS="0xxx" #NEXT_PUBLIC_MARKET_FEE_ADDRESS="0xxx"
#NEXT_PUBLIC_PUBLISHER_MARKET_ORDER_FEE="1" #NEXT_PUBLIC_PUBLISHER_MARKET_ORDER_FEE="1"

View File

@ -8,7 +8,7 @@ Ocean subgraph allows querying the datatoken, dataNFT, and all event information
* A server for hosting Ocean subgraph. See [this guide](setup-server.md) on creating a server. * A server for hosting Ocean subgraph. See [this guide](setup-server.md) on creating a server.
* Docker and Docker compose are installed. Click [here](https://docs.docker.com/engine/install/) to view guide on installing docker. * Docker and Docker compose are installed. Click [here](https://docs.docker.com/engine/install/) to view guide on installing docker.
* [Obtain an API key](../ocean-libraries/configuration.md#obtaining-api-key-for-ethereum-node-provider) * [Obtain an API key](https://app.gitbook.com/o/mTcjMqA4ylf55anucjH8/s/BTXXhmDGzR0Xgj13fyfM/\~/changes/548/developers/obtaining-api-keys-for-blockchain-access)
### Create a working directory ### Create a working directory

View File

@ -20,7 +20,7 @@ In this guide, we will deploy Provider for two chains: Goerli (Ethereum test net
* A server for hosting Ocean Marketplace. See [this guide](setup-server.md) for how to create a server; * A server for hosting Ocean Marketplace. See [this guide](setup-server.md) for how to create a server;
* Docker Compose and Docker Engine are installed and configured on the server. See [this guide](setup-server.md#install-docker-engine-and-docker-compose) for how to install these products. * Docker Compose and Docker Engine are installed and configured on the server. See [this guide](setup-server.md#install-docker-engine-and-docker-compose) for how to install these products.
* The RPC URLs and API keys for each of the networks to which the Provider will be connected. See <mark style="background-color:red;">this guide</mark> for how to obtain the URL and the API key. * The RPC URLs and API keys for each of the networks to which the Provider will be connected. See[ this guide](https://app.gitbook.com/o/mTcjMqA4ylf55anucjH8/s/BTXXhmDGzR0Xgj13fyfM/\~/changes/548/developers/obtaining-api-keys-for-blockchain-access) for how to obtain the URL and the API key.
* The private key which will be used by Provider to encrypt/decrypt URLs. * The private key which will be used by Provider to encrypt/decrypt URLs.
### Steps ### Steps