Adding advanced documentation (#687)

* Creating advance documentation file

* adding descriptions of advance features

* fixing small issues

* update RBAC instructions

* update RBAC instructions

* integrating feedback

* reorder example env vars, document in place

* integrating feedback

* additional instructions on RBAC settings

* fixing contents links

Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
This commit is contained in:
Jamie Hewitt 2021-06-22 13:16:27 +03:00 committed by GitHub
parent 04d505da42
commit 00bce63b8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 55 additions and 5 deletions

View File

@ -2,15 +2,25 @@
# "development", "ropsten", "rinkeby", "mainnet", "polygon", "moonbeamalpha"
GATSBY_NETWORK="rinkeby"
## Define a GATSBY_RBAC_URL to implement permission based restrictions
#GATSBY_RBAC_URL="http://localhost:3000"
#GATSBY_INFURA_PROJECT_ID="xxx"
#GATSBY_MARKET_FEE_ADDRESS="0xxx"
#GATSBY_ANALYTICS_ID="xxx"
#GATSBY_PORTIS_ID="xxx"
#
# ADVANCED SETTINGS
#
# Toggle pricing options presented during price creation
#GATSBY_ALLOW_FIXED_PRICING="true"
#GATSBY_ALLOW_DYNAMIC_PRICING="true"
#GATSBY_ALLOW_FREE_PRICING="true"
#GATSBY_ALLOW_FREE_PRICING="false"
# Define RBAC server URL to implement permission based restrictions
#GATSBY_RBAC_URL="http://localhost:3000"
# Enables another asset editing button holder further advanced settings
#GATSBY_ALLOW_ADVANCED_SETTINGS="true"
# Allow/Deny Lists
#GATSBY_CREDENTIAL_TYPE="address"

View File

@ -26,6 +26,7 @@
- [⬆️ Deployment](#-deployment)
- [💖 Contributing](#-contributing)
- [🍴 Forking](#-forking)
- [💻 Advanced Features](#-advanced-features)
- [🏛 License](#-license)
## 🏄 Get Started
@ -374,6 +375,16 @@ Additionally, we would also advise that your retain the text saying "Powered by
Everything else is made open according to the apache2 license. We look forward to seeing your data marketplace!
## 💻 Advanced Features
Ocean Market also includes a number of advanced features that are suitable for an enterprise data market, such as:
- Role based access control
- Allow and deny lists
- Free pricing
[See our seperate guide on advanced features](docs/advancedSettings.md)
## 🏛 License
```text

29
docs/advancedSettings.md Normal file
View File

@ -0,0 +1,29 @@
# Advanced Settings
**Table of Contents**
- [Role based Access Control](#rbac-settings)
- [Allow and Deny lists](#allow-and-deny-list-settings)
- [Free Pricing](#free-pricing-settings)
## RBAC settings
- Setup and host the Ocean role based access control (RBAC) server. Follow the instructions in the [RBAC repository](https://github.com/oceanprotocol/RBAC-Server)
- The RBAC server can store roles in [Keycloak](https://www.keycloak.org/) or a json file.
- In your .env file, set the value of the `GATSBY_RBAC_URL` environmental variable to the URL of the Ocean RBAC server that you have hosted, e.g. `GATSBY_RBAC_URL= "http://localhost:3000"`
- Users of your marketplace will now require the correct role ("user", "consumer", "publisher") to access features in your marketplace. The market will check the role that has been allocated to the user based on the address that they have connected to the market with.
- The following features have been wrapped in the `Permission` component and will be restricted once the `GATSBY_RBAC_URL` has been defined:
- Viewing or searching datasets requires the user to have permison to `browse`
- Purchasing or trading a datatoken, or adding liquidity to a pool require the user to have permison to `consume`
- Publishing a dataset requires the user to have permison to `publish`
- You can change the permission resrictions by either removing the `Permission` component or passing in a different eventType prop e.g. `<Permission eventType="browse">`.
## Allow and Deny List Settings
- To enable allow and deny lists you need to add the following environmental variable to your .env file: `GATSBY_ALLOW_ADVANCED_SETTINGS="true"`
- Publishers in your market will now have the ability to restrict who can consume their datasets.
## Free Pricing Settings
- To allow publishers to set pricing as "Free" you need to add the following environmental variable to your .env file: `GATSBY_ALLOW_FREE_PRICING="true"`
- This allocates the datatokens to the [dispenser contract](https://github.com/oceanprotocol/contracts/blob/main/contracts/dispenser/Dispenser.sol) which dispenses data tokens to users for free. Publishers in your market will now be able to offer their datasets to users for free (excluding gas costs).