From ec4155cca497e2ed3c38e8b2c9428f60a933a4ad Mon Sep 17 00:00:00 2001 From: MadelineMurray <43356962+MadelineMurray@users.noreply.github.com> Date: Mon, 29 Jul 2019 12:46:24 +1000 Subject: [PATCH] Added content on deploying for production (#1774) Signed-off-by: Adrian Sutton --- .../Getting-Started-Onchain-Permissioning.md | 10 +++++++ .../Onchain-Permissioning.md | 14 +++++---- .../Onchain-Permissioning/Production.md | 29 +++++++++++++++++++ mkdocs.yml | 1 + 4 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 docs/Permissions/Onchain-Permissioning/Production.md diff --git a/docs/Permissions/Onchain-Permissioning/Getting-Started-Onchain-Permissioning.md b/docs/Permissions/Onchain-Permissioning/Getting-Started-Onchain-Permissioning.md index 925ee9d28..cf9c4889f 100644 --- a/docs/Permissions/Onchain-Permissioning/Getting-Started-Onchain-Permissioning.md +++ b/docs/Permissions/Onchain-Permissioning/Getting-Started-Onchain-Permissioning.md @@ -6,6 +6,9 @@ description: Setting up and using onchain Permissioning The following steps describe bootstrapping a local permissioned network using a Pantheon node and a development server to run the Permissioning Management Dapp. +!!! note + In production, a webserver is required to [host the Permissioning Management Dapp](Production.md). + To start a network with onchain permissioning: 1. [Install pre-requisites](#pre-requisites) @@ -13,6 +16,7 @@ To start a network with onchain permissioning: 1. [Set environment variables](#set-environment-variables) 1. [Start first node with onchain permissioning and the JSON-RPC HTTP service enabled](#onchain-permissioning-command-line-options) 1. [Clone the permissioning contracts repository and install dependencies](#clone-contracts-and-install-dependencies) +1. [Build project](#build-project) 1. [Deploy the permissioning contracts](#deploy-contracts) 1. [Start the development server for the Permissioning Management Dapp](#start-the-permissioning-management-dapp) 1. [Add the first node to the nodes whitelist](#update-nodes-whitelist) @@ -101,6 +105,9 @@ to enable onchain nodes permissioning * [--permissions-nodes-contract-address](../../Reference/Pantheon-CLI-Syntax.md#permissions-nodes-contract-address) set to the address of the Node Ingress contract in the genesis file (`"0x0000000000000000000000000000000000009999"`) +Start your first node with command line options to enable onchain permissioning and the JSON-RPC HTTP host and port +matching environment variable `PANTHEON_NODE_PERM_ENDPOINT`. + ## Clone Project and Install Dependencies 1. Clone the `permissioning-smart-contracts` repository: @@ -139,6 +146,9 @@ The migration logs the addresses of the Admin and Rules contracts. ## Start the Development Server for the Permissioning Management Dapp +!!! note + In production, a webserver is required to [host the Permissioning Management Dapp](Production.md). + 1. In the `permissioning-smart-contracts` directory, start the web server serving the Dapp: ```bash diff --git a/docs/Permissions/Onchain-Permissioning/Onchain-Permissioning.md b/docs/Permissions/Onchain-Permissioning/Onchain-Permissioning.md index 42e347b44..dbab03f43 100644 --- a/docs/Permissions/Onchain-Permissioning/Onchain-Permissioning.md +++ b/docs/Permissions/Onchain-Permissioning/Onchain-Permissioning.md @@ -7,7 +7,7 @@ Onchain permissioning uses smart contracts to store and maintain the node, accou Using onchain permissioning enables all nodes to read the whitelists from a single source, the blockchain. !!! important - The dependency chain for our implementation of onchain permissioning includes [web3j](https://github.com/web3j/web3j) which is + The dependency chain for our implementation of onchain permissioning includes [web3js](https://github.com/ethereum/web3.js/) which is LGPL licensed. ## Permissioning Contracts @@ -24,6 +24,10 @@ Node Rules and Account Rules contracts. The Ingress contracts are deployed to st * Admin - stores the list of admin accounts and admin list operations (for example, add and remove). There is one list of admin accounts for node and accounts. +!!! note + The permissioning smart contracts are currently in the process of going through a third party audit. + Please [contact us](https://pegasys.tech/contact/) before using in a production environment. + ## Permissioning Management Dapp The [Permissioning Management Dapp](Getting-Started-Onchain-Permissioning.md) is provided to view @@ -37,13 +41,11 @@ and maintain the whitelists. Permissioning implements three whitelists: -* [Accounts](Getting-Started-Onchain-Permissioning.md#update-accounts-or-admin-accounts-whitelists) can submit -transactions to the network +* Accounts can submit transactions to the network -* [Nodes](Getting-Started-Onchain-Permissioning.md#update-nodes-whitelist) can participate in the network +* Nodes can participate in the network -* [Admins](Getting-Started-Onchain-Permissioning.md#update-accounts-or-admin-accounts-whitelists) are accounts that -can update the accounts and nodes whitelists +* Admins are accounts that can update the accounts and nodes whitelists ## Bootnodes diff --git a/docs/Permissions/Onchain-Permissioning/Production.md b/docs/Permissions/Onchain-Permissioning/Production.md new file mode 100644 index 000000000..870e3d182 --- /dev/null +++ b/docs/Permissions/Onchain-Permissioning/Production.md @@ -0,0 +1,29 @@ +description: Deploying Permissioning Management Dapp for production + + +# Deploying Permissioning Management Dapp for Production + +To deploy the Permissioning Management dapp for production: + +1. Get the most recent release (tarball or zip) from the [projects release page](https://github.com/PegaSysEng/permissioning-smart-contracts/releases/latest). + +1. Unpack the distribution into a directory available to your webserver. + +1. In the root of the directory to which the distribution was unpacked, add a file called `config.json` replacing +the placeholders. + + ```json tab="config.json" + { + "accountIngressAddress": "
", + "nodeIngressAddress": "
", + "networkId": "" + } + ``` + +1. On your webserver, host the contents of the directory as static files and direct root requests to `index.html` + +## Starting a Production Permissioned Network + +Follow the procedure as for [Getting Started with Onchain Perissioning](Getting-Started-Onchain-Permissioning.md) +but do not perform the steps using `yarn` to install, build, and start the development server. Instead follow the procedure above to +deploy the Permissioning Management dapp to your webserver. \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index bca484960..7abeb858d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -115,6 +115,7 @@ nav: - Onchain Permissioning: - Overview: Permissions/Onchain-Permissioning/Onchain-Permissioning.md - Getting Started with Onchain Permissioning: Permissions/Onchain-Permissioning/Getting-Started-Onchain-Permissioning.md + - Deploying Management Dapp for Production: Permissions/Onchain-Permissioning/Production.md - Updating Whitelists: Permissions/Onchain-Permissioning/Updating-Whitelists.md - Using Pantheon: - Transactions: