From 00bce63b8dab776089175c24b88922f6d246e2ca Mon Sep 17 00:00:00 2001 From: Jamie Hewitt Date: Tue, 22 Jun 2021 13:16:27 +0300 Subject: [PATCH] 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 --- .env.example | 20 +++++++++++++++----- README.md | 11 +++++++++++ docs/advancedSettings.md | 29 +++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 docs/advancedSettings.md diff --git a/.env.example b/.env.example index a44ef8bbb..a9835e185 100644 --- a/.env.example +++ b/.env.example @@ -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" diff --git a/README.md b/README.md index c7b73fc41..4ffc0f81f 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docs/advancedSettings.md b/docs/advancedSettings.md new file mode 100644 index 000000000..572cab143 --- /dev/null +++ b/docs/advancedSettings.md @@ -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. ``. + +## 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).