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

Merge branch 'master' into feature/github-repo-contents

This commit is contained in:
Troy McConaghy 2018-11-16 10:32:28 +01:00 committed by GitHub
commit 873cc4b6c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,67 +1,60 @@
--- ---
title: Set Up a Marketplace title: Set Up a Marketplace
description: Build and run a data marketplace in the Ocean network. description: Set up and run a data marketplace in the Ocean network.
--- ---
If you want to set up and run a marketplace in the Ocean network, then at a technical level, you must: If you want to set up and run a marketplace in the Ocean network, then at a technical level, you must:
- Build your marketplace application (app) 1. Develop a marketplace application (app).
- Run: 2. Run your marketplace app in production.
- Your marketplace app
- Aquarius
- A database for Aquarius ("OceanDB")
- A local Keeper node
- Maybe Brizo, unless you are working with others (publishers) running Brizo
We expand on all of those things below. **Note: In the early days of the Ocean network, there won't be many marketplaces or publishers, so marketplaces will often also act as publishers.**
## Building Your Marketplace App ## Develop a Marketplace App
An Ocean marketplace app is one of the primary ways that end users use the Ocean network. For example, a data scientist could use a marketplace app to see what data sets and data services a marketplace has on offer. They can use the marketplace app to buy access to data sets or services. An Ocean marketplace app is one of the primary ways that end users use the Ocean network. For example, a data scientist could use a marketplace app to see what data sets and data services (data assets) a marketplace has on offer. They can use the marketplace app to buy access to assets. Publishers make those data assets available.
To build an Ocean marketplace app, you will probably want to use one of the Squid software libraries because they simplify working with the Ocean network. ### Easiest Option: Fork Pleuston
Currently there are Squid libraries for JavaScript, Python and Java.
As an analogy, squid-py is to Ocean like boto3 is to AWS.
Dev example 1: Fork Pleuston (serverless). Use the Docker Compose workflow that Pleuston devs use. [Pleuston](https://github.com/oceanprotocol/pleuston) is a reference marketplace app written in JavaScript, using React and squid-js (which is like a JavaScript SDK for Ocean).
Pleuston has an Apache v2 license, so you can fork it to make your own Ocean marketplace.
Dev example 2: Build a marketplace with a Python server-side (using squid-py) and a web frontend. Use one of the Squid libraries. This option is straightforward because you can follow the dev process used by the Pleuston devs. They already have a Docker Compose setup that runs all the other Ocean components needed for testing a marketplace, e.g. Aquarius, a database for Aquarius, a local Parity Ethereum node, and Brizo.
<hr> Note that Pleuston is a "serverless" app: it runs entirely in the browser and has no server-side component.
Note that you can probably use Docker Compose or similar to run all the other stuff, for now. <repo name="pleuston"></repo>
Old content to scavenge: ### Other Options for Developing a Marketplace App
## Pleuston There are many ways to create an ocean marketplace app. For example, you could use one of the existing e-commerce platforms and frameworks (e.g. WooCommerce, Magento, Shopify). Or you could use a lower-level framework like Django or Vue.js. The main consideration is that you should probably use a programming language with an existing Squid library.
Pleuston is an example Ocean marketplace written in JavaScript using React and Redux. <repo name="squid-js"></repo>
It uses the squid-js library to interact with Ocean network services, such as Keepers, Brizo nodes, Secret Stores, and your own Aquarius node. <repo name="squid-py"></repo>
<repo name="squid-java"></repo>
Pleuston runs entirely in the browser, i.e. Pleuston has no server-side part. It communicates directly with Keepers etc. Note: There are examples of how to use squid-py in the [Tutorials](/tutorials/introduction/). squid-py is to Ocean like boto3 is to AWS.
You _could_ build an Ocean marketplace with a browser-side frontend and a server-side part. Of course, you could always write your own Squid library in the language of your choice. A squid-java library is in development.
For example, the server-side part could be written in Python and it could use the squid-py library.
Currently, there is no explicit example of how to do that, but there are examples of how to use squid-py, e.g. from IPython running in a Jupyter notebook. ## Run Your Marketplace App in Production
See the Tutorials section.
You could even write an entirely server-side marketplace with a command-line interface, but let's not get carried away. Before running your marketplace app in production on the Ocean Mainnet, you may want to test it on the Ocean Testnet.
The Ocean Testnet is similar to the Ocean Mainnet.
The main difference is that there is less risk on the Ocean Testnet.
Note: There's also a squid-java library but it's currently not as full-featured as squid-js and squid-py. **Note: At the time of writing, the Ocean Mainnet hadn't gone live yet, but the Trilobite Testnet was about to go live.**
## Aquarius Some technical differences between local testing and connecting to a live external test/mainnet are:
Aquarius is a software agent used by Marketplaces to store, update, read and delete metadata about assets. The Squid libraries all know how to talk to Aquarius, so you don't need to think about it too much. You just need to make sure you have Aquarius running on a server somewhere. - Local Keeper nodes (Parity user nodes) must connect to the live network of Keepers.
- Your Aquarius and Brizo instances must connect to the live Ocean Secret Store network.
TODO: Add instructions here. Of course, there are many other things that must be handled for live production apps:
## Database for Aquarius - Security of the infrastructure where the software is running
- Monitoring
- Log aggregation, storage and search
- Handling crashes or other faults
At the time of writing, Aquarius worked with three databases: Each of those is a big topic beyond the scope of these docs.
- MongoDB
- Elasticsearch
- BigchainDB
TODO: Outline the pros and cons of each database.