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

GITBOOK-629: Mor changes based on the feedback received

This commit is contained in:
Ana Loznianu 2023-06-28 14:55:20 +00:00 committed by gitbook-bot
parent e3462f62aa
commit ca321b1e35
No known key found for this signature in database
GPG Key ID: 07D2180C7B12D0FF
4 changed files with 12 additions and 144 deletions

View File

@ -73,11 +73,6 @@ Our docs repo can always be improved. If you found a mistake or have an improvem
Do you REALLY love building on Ocean Protocol? Consider joining us full-time! Our openings are listed at [https://github.com/oceanprotocol/jobs](https://github.com/oceanprotocol/jobs).
### Get funding
You might be able to get funding from us for contributing to our core software, building dApps on top of our tech, creating integrations, fixing bugs, doing community outreach, and more. Checkout our active funding programs for more information:
* [**Shipyard**](https://oceanprotocol.com/shipyard) (Ocean curated grants).
* [**Data Challenges**](https://oceanprotocol.com/bounties) (rewards for publishing algorithms and datasets).
Check our [Community Page](https://www.oceanprotocol.com/community) for our social media links where you can join the buzz around Ocean or chat with us directly 😊 Toodles!

View File

@ -120,7 +120,7 @@ networks:
Create the _/etc/systemd/system/docker-compose@aquarius.service_ file then copy and paste the following content to it. This example file could be customized if needed.
```
```yaml
[Unit]
Description=%i service with docker compose
Requires=docker.service
@ -520,7 +520,7 @@ spec:
terminationGracePeriodSeconds: 30
```
Tip: before deployment you can [validate](https://github.com/instrumenta/kubeval) the yaml file.
Tip: before deployment, you can [validate](https://github.com/instrumenta/kubeval) the yaml file.
b. Deploy the configuration

View File

@ -6,20 +6,14 @@ Ocean subgraph allows querying the datatoken, data NFT, and all event informatio
Ocean Subgraph is deployed on top of [graph-node](https://github.com/graphprotocol/graph-node), therefore, in this document, we will show first how to deploy graph-node - either using Docker Engine or Kubernetes - and then how to install Ocean Subgraph on the graph-node system. 
## Deploying Graph-node using Docker Engine and Docker Compose
### Prerequisites
* A server for hosting Graph-node. 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.
* The RPC URLs and API keys for each of the networks to which Ocean Subgraph 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.
### Steps
1. [Create the /etc/docker/compose/graph-node/docker-compose.yml file](deploying-ocean-subgraph.md#1.-create-the-etc-docker-compose-graph-node-docker-compose.yml-file)
@ -29,14 +23,10 @@ Ocean Subgraph is deployed on top of [graph-node](https://github.com/graphprotoc
5. [Check the service's status](deploying-ocean-subgraph.md#5.-check-the-services-status)
6. [Check Ocean Subgraph's service logs](deploying-ocean-subgraph.md#6.-check-ocean-subgraphs-service-logs)
#### 1. Create the /etc/docker/compose/graph-node/docker-compose.yml file
From a terminal console, create the _/etc/docker/compose/graph-node/docker-compose.yml_ file, then copy and paste the following content to it (. Check the comments in the file and replace the fields with the specific values of your implementation. 
_/etc/docker/compose/graph-node/docker-compose.yml_ (annotated - example for `mumbai` network)
```yaml
@ -90,8 +80,6 @@ volumes:
driver: local
```
#### 2. Create the /etc/systemd/system/docker-compose@graph-node.service file
Create the _/etc/systemd/system/docker-compose@graph-node.service_ file then copy and paste the following content to it. This example file could be customized if needed.
@ -117,8 +105,6 @@ ExecStopPost=/usr/bin/env docker-compose -p $PROJECT down
WantedBy=multi-user.target
```
#### 3. Reload the systemd manager configuration
Run the following command to reload the systemd manager configuration
@ -133,8 +119,6 @@ Optionally, you can enable the services to start at boot, using the following co
sudo systemctl enable docker-compose@graph-node.service
```
#### 4. Start graph-node service
To start the Ocean Subgraph service, run the following command:
@ -143,8 +127,6 @@ To start the Ocean Subgraph service, run the following command:
sudo systemctl start docker-compose@graph-node.service
```
#### 5. Check the service's status
Check the status of the service by running the following command. The output of the command should be similar to the one presented here.
@ -172,13 +154,11 @@ Jun 25 17:05:25 testvm systemd[1]: Finished graph-node service with docker compo
```
#### 6. Check graph-node service logs
If needed, use docker CLI to check Ocean Subgraph service logs.
First, chech the container status
First, check the container status
```bash
$ docker ps --format "table {{.Image}}\t{{.Ports}}\t{{.Names}}\t{{.Status}}"
@ -194,8 +174,6 @@ Then, check the logs of the Ocean Subgraph docker container:
docker logs graph-node [--follow]
```
## Deploying graph-node using Kubernetes 
In this example, we will deploy graph-node as a Kubernetes deployment service. [graph-node](https://github.com/graphprotocol/graph-node) has the following dependencies: PostgreSQL and IPFS.
@ -206,16 +184,12 @@ In this example, we will deploy graph-node as a Kubernetes deployment service. [
* Kubernetes with Docker Engine is installed and configured on the server. See [this chapter](setup-server.md#install-kubernetes-with-docker-engine) for information on installing Kubernetes.
* 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.
### Steps
1. [Deploy PostgreSQL](deploying-ocean-subgraph.md#1.-deploy-postgresql)
2. [Deploy IPFS](deploying-ocean-subgraph.md#2.-deploy-ipfs)
3. [Deploy Graph-node](deploying-ocean-subgraph.md#deploy-graph-node)
#### 1. Deploy PostgreSQL
It is recommended to deploy PostgreSQL as helm chart.
@ -224,8 +198,6 @@ References: [https://github.com/bitnami/charts/tree/main/bitnami/postgresql/#ins
Once PostgreSQL pods are running, a database must be created: eg. `mumbai.`
#### 2. Deploy IPFS
The following template can be customized to deploy IPFS statefulset and service.
@ -332,11 +304,9 @@ spec:
- name: gateway
port: 8080
selector:
app: ipfs
app: ipf
```
#### Deploy Graph-node
The following annotated templated can be customized to deploy graph-node deployment and service:
@ -459,39 +429,27 @@ spec:
app: mumbai-graph-nodeyam
```
## Deploy Ocean Subgraph
After you deployed graph-node, either using Kubernetes or Docker Compose, you can proceed to deploy Ocean Subgraph on top of it. 
### Prerequisites
* graph-node up-and-running
### Steps
1. [Install Node.js locally](deploying-ocean-subgraph.md#1.-install-node.js-locally)
2. [Download and extract Ocean-subgraph](deploying-ocean-subgraph.md#2.-download-and-extract-ocean-subgraph)
#### 1. Install Node.js locally
To install Node.js locally, please refer to this [link ](https://nodejs.org/en/download)for instructions.
#### 2. Download and extract Ocean-subgraph
Download and extract [Ocean-subgraph](https://github.com/oceanprotocol/ocean-subgraph) (check [here](https://github.com/oceanprotocol/ocean-subgraph/releases) the available releases).
#### 3. Install dependencies
From the directory where Ocean subgraph was extracted, run the following command:
@ -500,13 +458,11 @@ From the directory where Ocean subgraph was extracted, run the following command
npm i
```
#### 4. Deploy Ocean Subgraph
In the following example we are deploying on Ocean Subgraph on graph-node running for `mumbai` testnet.
In the following example, we are deploying on Ocean Subgraph on graph-node running for `mumbai` testnet.
Note: for `ocean-subgraph` deployment in Kubernetes environment, both `graph-node` and `ipfs` services must be locally forwarded using `kubectl port-forward` command.
Note: for `ocean-subgraph` deployment in the Kubernetes environment, both `graph-node` and `ipfs` services must be locally forwarded using `kubectl port-forward` command.
Run the following command:
@ -745,7 +701,4 @@ Subgraph endpoints:
Queries (HTTP): http://127.0.0.1:8000/subgraphs/name/oceanprotocol/ocean-subgraph
```
Ocean Subgraph is deployed under /subgraphs/name/oceanprotocol/ocean-subgraph/. To access it from the server on which is was deployed, open a browser and go to [http://127.0.0.1:8000/subgraphs/name/oceanprotocol/ocean-subgraph/graphql](http://127.0.0.1:8000/subgraphs/name/oceanprotocol/ocean-subgraph/graphql).
Ocean Subgraph is deployed under /subgraphs/name/oceanprotocol/ocean-subgraph/. To access it from the server on which it was deployed, open a browser and go to [http://127.0.0.1:8000/subgraphs/name/oceanprotocol/ocean-subgraph/graphql](http://127.0.0.1:8000/subgraphs/name/oceanprotocol/ocean-subgraph/graphql).

View File

@ -49,14 +49,12 @@ As mentioned earlier, you can use either an on-premise server or one hosted in t
If you choose to use a server hosted in the cloud, you need to create the server using the user interface provided by the cloud platform. Following is an example of how to create a server in Digitalocean. 
#### Example: Creating an Ubuntu Linux server in the Digitalocean cloud
#### Example: Create an Ubuntu Linux server in the Digitalocean cloud
1. Creating account and setting billing
1. Create an account and set billing
Go to [https://www.digitalocean.com/](https://www.digitalocean.com/) and create an account. Provide the appropriate information for billing and accounting.
2. Create a server
Click on **`Create`** button and choose **`Droplets`** options from dropdown.
@ -83,12 +81,10 @@ Select the region where you want the component to be hosted and a root password.
5. Finish the configuration and create the server
Specify a hostname for the server, specify the project to which you assign the server and then click on `Create Droplet.` 
Specify a hostname for the server, specify the project to which you assign the server, and then click on `Create Droplet.` 
<figure><img src="../.gitbook/assets/image (5).png" alt=""><figcaption><p>Finalize and create the server</p></figcaption></figure>
6. Access the server's console
After the server is ready, select the `Access console` option from the dropdown list to open a terminal window.
@ -99,7 +95,7 @@ After the server is ready, select the `Access console` option from the dropdown
From the terminal window, run the following commands to install Docker and Docker Compose.
```
```bash
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
@ -115,88 +111,12 @@ sudo apt-get update
sudo apt-get install docker-compose-plugin
```
### Install Kubernetes with Docker Engine
Kubernetes is an orchestration engine for containerized applications and the initial setup is dependent on the platform on which it is deployed - presenting how this product must be installed and configured is outside the scope of this document.&#x20;
For cloud deployment, most of the cloud providers have dedicated turnkey solutions for Kubernetes. A comprehensive list of such cloud providers in presented [here](https://kubernetes.io/docs/setup/production-environment/turnkey-solutions/).&#x20;
For cloud deployment, most of the cloud providers have dedicated turnkey solutions for Kubernetes. A comprehensive list of such cloud providers is presented [here](https://kubernetes.io/docs/setup/production-environment/turnkey-solutions/).&#x20;
For an on-premise deployment of Kubernetes, please refer to this [link](https://kubernetes.io/docs/setup/).
Now that the execution environment is prepared and the prerequisites installed, we can proceed to deploy the Ocean's components.
<< test Mermaid Entity Relationship Diagram >>
```mermaid
erDiagram
DDO ||--|{ Metadata : contains
DDO ||--|{ Services : contains
Metadata ||--|{ AlgorithmMetadata : contains
AlgorithmMetadata ||--|{ Container : contains
DDO {
arrayOfString context
string id
string version
number chainID
string nftAddress
Metadata metadata
Services services
Credentials credentials
}
Metadata {
ISODateTimeString created
ISODateTimeString updated
string description
string copyrightHolder
string name
string type
string author
string license
arrayOfString links
string contentLanguage
arrayOfString tags
arrayOfStrings categories
Object additionalInformation
AlgorithmMetadata algorithm
}
AlgorithmMetadata {
string language
string version
ConsumerParameters consumerParameters
Container container
}
Container {
string entrypoint
string image
string tag
string checksum
}
Services {
string id
string type
string name
string description
string datatokenAddress
string serviceEndpoint
Files files
number timeout
Compute compute
ConsumerParameters consumerParameters
Object additionalInformation
}
```