From 4263d216f2c24fd536dc997ec32ee4013f0eb1ad Mon Sep 17 00:00:00 2001 From: Madeline Murray Date: Mon, 2 Nov 2020 12:18:21 +1000 Subject: [PATCH 1/4] WIP Signed-off-by: Madeline Murray --- .../Examples/Private-Network-Example.md | 46 ++++++++----------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/docs/Tutorials/Examples/Private-Network-Example.md b/docs/Tutorials/Examples/Private-Network-Example.md index 72af47cf550..22ee36287b2 100644 --- a/docs/Tutorials/Examples/Private-Network-Example.md +++ b/docs/Tutorials/Examples/Private-Network-Example.md @@ -1,10 +1,10 @@ --- -description: Hyperledger Besu private network example tutorial +description: Quorum dev quickstart tutorial --- -# Private network example tutorial +# Quorum Developer Quickstart tutorial -The private network example uses the Hyperledger Besu Docker image to run a private network of Besu +The Quorum Developer Quickstart uses the Hyperledger Besu Docker image to run a private network of Besu nodes managed by Docker Compose. !!! important @@ -14,44 +14,38 @@ nodes managed by Docker Compose. ## Prerequisites -To run this tutorial, you must have the following installed: - * [Docker and Docker-compose](https://docs.docker.com/compose/install/) +* [Nodejs](https://nodejs.org/en/download/) +* On Windows: + - Windows Subsystem for Linux 2 + - Docker desktop configured to use the WSL2-based engine. - !!! important - - If using [MacOS](https://docs.docker.com/docker-for-mac/) or - [Windows](https://docs.docker.com/docker-for-windows/), set Docker to use up to 6GB of - memory on the _Advanced_ tab in _Preferences_. +!!! important + Ensure you allow Docker up to 4G of memory or 6G if running the privacy examples. + Refer to the _Resources_ section in [Docker for Mac](https://docs.docker.com/docker-for-mac/) and + [Docker Desktop](https://docs.docker.com/docker-for-windows/) for details. * [Git command line](https://git-scm.com/) * [Curl command line](https://curl.haxx.se/download.html) * A web browser that supports [Metamask](https://metamask.io/) (currently Chrome, Firefox, Opera, and Brave), and has the MetaMask plug-in installed. This tutorial uses screenshots from Brave. -## Clone Besu sample networks source code +## Create Docker-compose file -Clone the repository from the `besu-sample-networks` repository: +## Usage -=== "Linux/MacOS" - - ```bash - git clone https://github.com/PegaSysEng/besu-sample-networks.git - ``` +To create the docker-compose file and artifacts, run: -!!!note +```bash +npx quorum-dev-quickstart +``` - To use a specific version of Hyperledger Besu, set the `BESU_VERSION` environment variable. +Follow the prompts displayed to run Hyperledger Besu. Enter `n` for [Codefi Orchestrate](https://docs.orchestrate.consensys.net/en/stable/) +and [private transactions](../../Concepts/Privacy/Privacy-Overview.md). ## Start the network -!!!important - - If running in Windows, run commands from the GitBash shell. - -This tutorial uses [Docker Compose](https://docs.docker.com/compose/) to assemble the images and -run the private network. To build the docker images and run the containers, go to the -`besu-sample-networks` directory and run: +To start the network, go to the installation directory and run: === "Linux/MacOS" From 8d32db76505f9cb412c38b963bde0a76dec31bbc Mon Sep 17 00:00:00 2001 From: Madeline Murray Date: Thu, 5 Nov 2020 18:53:01 +1000 Subject: [PATCH 2/4] updated for quorum developer quickstart Signed-off-by: Madeline Murray --- docs/Tutorials/Examples/Privacy-Example.md | 70 +++++------ .../Examples/Private-Network-Example.md | 110 +++++------------- 2 files changed, 60 insertions(+), 120 deletions(-) diff --git a/docs/Tutorials/Examples/Privacy-Example.md b/docs/Tutorials/Examples/Privacy-Example.md index cc6be9edc19..db1847913d8 100644 --- a/docs/Tutorials/Examples/Privacy-Example.md +++ b/docs/Tutorials/Examples/Privacy-Example.md @@ -2,16 +2,16 @@ description: Hyperledger Besu privacy-enabled private network tutorial --- -# Privacy-enabled private network example tutorial +# Privacy-enabled Quorum Developer Quickstart tutorial The privacy-enabled private network example runs a private network of Hyperledger Besu and Orion nodes managed by Docker Compose. It's an expanded version of the -[private network example](Private-Network-Example.md). +[Quorum Developer Quickstart tutorial](Private-Network-Example.md). You can use the [Block Explorer](Private-Network-Example.md#block-explorer), make [JSON-RPC requests](Private-Network-Example.md#run-json-rpc-requests), and [create transactions using Metamask] as described in the -[private network example](Private-Network-Example.md). This tutorial describes how to use the +[Quorum Developer Quickstart tutorial](Private-Network-Example.md). This tutorial describes how to use the examples provided in the web3js-eea library to [create and send private transactions](#send-private-transactions-and-read-values). @@ -36,26 +36,25 @@ To run this tutorial, you must have the following installed: * [Git command line](https://git-scm.com/) * [Curl command line](https://curl.haxx.se/download.html). -## Clone Besu sample networks source code +## Create Docker-compose file -Clone the repository from the `besu-` repository. +## Usage -=== "Linux/MacOS" +To create the docker-compose file and artifacts, run: - ```bash - git clone https://github.com/PegaSysEng/besu-sample-networks.git - ``` - -!!!note +```bash +npx quorum-dev-quickstart +``` - To use a specific version of Hyperledger Besu, set the `BESU_VERSION` environment variable. +Follow the prompts displayed to run Hyperledger Besu, private transactions, and [logging with ELK](../../HowTo/Monitor/Elastic-Stack.md). +Enter `n` for [Codefi Orchestrate](https://docs.orchestrate.consensys.net/en/stable/). ## Clone web3js-eea libraries -Clone the `PegaSysEng/web3js-eea` library: +Clone the `ConsenSys/web3js-eea` library: ```bash -git clone https://github.com/PegaSysEng/web3js-eea.git +git clone https://github.com/ConsenSys/web3js-eea.git ``` In the `web3js-eea` directory: @@ -70,32 +69,31 @@ npm install If running in Windows, please run commands from the GitBash shell -In the `besu-sample-networks` directory, start the network with privacy enabled: +In the installation directory, start the network: ```bash -./run-privacy.sh +./run.sh ``` The script pulls the Docker images starts the network. Pulling the images takes a few minutes the first time. The network details display. ```bash - Name Command State Ports --------------------------------------------------------------------------------------------------------------------------- -privacy_bootnode_1 /opt/besu/bootnode_sta ... Up 30303/tcp, 8545/tcp, 8546/tcp -privacy_explorer_1 nginx -g daemon off; Up 0.0.0.0:25000->80/tcp -privacy_minernode_1 /opt/besu/node_start.s ... Up 30303/tcp, 8545/tcp, 8546/tcp -privacy_node1_1 /opt/besu/node_start.s ... Up 30303/tcp, 0.0.0.0:20000->8545/tcp, 0.0.0.0:20001->8546/tcp -privacy_node2_1 /opt/besu/node_start.s ... Up 30303/tcp, 0.0.0.0:20002->8545/tcp, 0.0.0.0:20003->8546/tcp -privacy_node3_1 /opt/besu/node_start.s ... Up 30303/tcp, 0.0.0.0:20004->8545/tcp, 0.0.0.0:20005->8546/tcp -privacy_orion1_1 /orion/bin/orion data/data ... Up -privacy_orion2_1 /orion/bin/orion data/data ... Up -privacy_orion3_1 /orion/bin/orion data/data ... Up -privacy_rpcnode_1 /opt/besu/node_start.s ... Up 30303/tcp, 8545/tcp, 8546/tcp -**************************************************************** -JSON-RPC HTTP service endpoint : http://localhost:8545 * -JSON-RPC WebSocket service endpoint : ws://localhost:8546 * -Web block explorer address : http://localhost:25000 * +************************************* +Quorum Dev Quickstart +************************************* +Setting up the index patterns in kibana ................. +---------------------------------- +List endpoints and services +---------------------------------- +JSON-RPC HTTP service endpoint : http://localhost:8545 +JSON-RPC WebSocket service endpoint : ws://localhost:8546 +Web block explorer address : http://localhost:25000/ +Prometheus address : http://localhost:9090/graph +Grafana address : http://localhost:3000/d/XE4V0WGZz/besu-overview?orgId=1&refresh=10s&from=now-30m&to=now&var-system=All +Collated logs using Kibana endpoint : http://localhost:5601/app/kibana#/discover + +For more information on the endpoints and services, refer to README.md in the installation directory. **************************************************************** ``` @@ -147,7 +145,7 @@ Call [`eth_getTransactionReceipt`](../../Reference/API-Methods.md#eth_gettransac === "curl HTTP request" ```bash - curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":[""],"id":1}' + curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":[""],"id":1}' http://localhost:8545 ``` === "Example" @@ -197,11 +195,5 @@ Do one of the following to stop the network: ./remove.sh ``` -* Stop the network and delete the Docker images: - - ```bash - ./delete.sh - ``` - [create transactions using Metamask]: Private-Network-Example.md#create-a-transaction-using-metamask diff --git a/docs/Tutorials/Examples/Private-Network-Example.md b/docs/Tutorials/Examples/Private-Network-Example.md index 2ea6e1e5846..ef9fc085370 100644 --- a/docs/Tutorials/Examples/Private-Network-Example.md +++ b/docs/Tutorials/Examples/Private-Network-Example.md @@ -40,8 +40,9 @@ To create the docker-compose file and artifacts, run: npx quorum-dev-quickstart ``` -Follow the prompts displayed to run Hyperledger Besu. Enter `n` for [Codefi Orchestrate](https://docs.orchestrate.consensys.net/en/stable/) -and [private transactions](../../Concepts/Privacy/Privacy-Overview.md). +Follow the prompts displayed to run Hyperledger Besu and [logging with ELK](../../HowTo/Monitor/Elastic-Stack.md). +Enter `n` for [Codefi Orchestrate](https://docs.orchestrate.consensys.net/en/stable/) and +[private transactions](../../Concepts/Privacy/Privacy-Overview.md). ## Start the network @@ -62,51 +63,39 @@ When the process ends, it lists the running services: ```log ************************************* - Sample Network for Besu at latest + Quorum Dev Quickstart ************************************* + Setting up the index patterns in kibana............ + {"type":"index-pattern","id":"metricbeat","attributes":{"title":"metricbeat-*","timeFieldName":"@timestamp"}, + "references":[],"migrationVersion":{"index-pattern":"7.6.0"},"updated_at":"2020-11-04T10:43:34.252Z", + "version":"WzgsMV0=","namespaces":["default"]}{"success":true,"successCount":7}{"type":"index-pattern", + "id":"besu","attributes":{"title":"besu-*","timeFieldName":"@timestamp"},"references":[],"migrationVersion": + {"index-pattern":"7.6.0"},"updated_at":"2020-11-04T10:43:36.927Z","version":"WzE2LDFd","namespaces": + ["default"]}{"type":"index-pattern","id":"orion","attributes":{"title":"orion-*","timeFieldName":"@timestamp"}, + "references":[],"migrationVersion":{"index-pattern":"7.6.0"},"updated_at":"2020-11-04T10:43:37.982Z","version": + "WzE3LDFd","namespaces":["default"]}{"type":"index-pattern","id":"quorum","attributes":{"title":"quorum-*", + "timeFieldName":"@timestamp"},"references":[],"migrationVersion":{"index-pattern":"7.6.0"},"updated_at": + "2020-11-04T10:43:39.003Z","version":"WzE4LDFd","namespaces":["default"]}{"type":"index-pattern","id": + "tessera","attributes":{"title":"tessera-*","timeFieldName":"@timestamp"},"references":[],"migrationVersion": + {"index-pattern":"7.6.0"},"updated_at":"2020-11-04T10:43:40.053Z","version":"WzE5LDFd","namespaces": + ["default"]} + List endpoints and services ---------------------------------- - Name Command State Ports - ----------------------------------------------------------------------------------------------------------------------------------------------------------- - besu-sample-network_bootnode_1 /opt/besu/bootnode_start.s ... Up 0.0.0.0:30303->30303/tcp, 0.0.0.0:30303->30303/udp, 8545/tcp, 8546/tcp, 8547/tcp - besu-sample-network_elasticsearch_1 /usr/local/bin/docker-entr ... Up 9200/tcp, 9300/tcp - besu-sample-network_explorer_1 nginx -g daemon off; Up 0.0.0.0:25000->80/tcp - besu-sample-network_filebeat_1 /usr/local/bin/docker-entr ... Up - besu-sample-network_grafana_1 /run.sh Up 0.0.0.0:3000->3000/tcp - besu-sample-network_kibana_1 /usr/local/bin/dumb-init - ... Up 0.0.0.0:5601->5601/tcp - besu-sample-network_logstash_1 /usr/local/bin/docker-entr ... Up 5044/tcp, 9600/tcp - besu-sample-network_minernode_1 /opt/besu/node_start.sh -- ... Up 30303/tcp, 8545/tcp, 8546/tcp, 8547/tcp - besu-sample-network_node_1 /opt/besu/node_start.sh -- ... Up 30303/tcp, 8545/tcp, 8546/tcp, 8547/tcp - besu-sample-network_prometheus_1 /bin/prometheus --config.f ... Up 0.0.0.0:9090->9090/tcp - besu-sample-network_redis_1 docker-entrypoint.sh redis ... Up 6379/tcp - besu-sample-network_rpcnode_1 /opt/besu/node_start.sh -- ... Up 30303/tcp, 0.0.0.0:8545->8545/tcp, 8546/tcp, 8547/tcp - Setting up the besu index pattern in kibana - {"type":"index-pattern","id":"besu","attributes":{"title":"besu-*","timeFieldName":"@timestamp"},"references":[],"migrationVersion":{"index-pattern":"6.5.0"},"updated_at":"2019-12-27T04:41:07.665Z","version":"WzMsMV0="} - Orion not running, skipping the orion index pattern in kibana. - ``` - -Followed by a list of the endpoints: - -!!! example "Endpoint list example" - - ```log - **************************************************************** JSON-RPC HTTP service endpoint : http://localhost:8545 JSON-RPC WebSocket service endpoint : ws://localhost:8546 - GraphQL HTTP service endpoint : http://localhost:8547 Web block explorer address : http://localhost:25000/ Prometheus address : http://localhost:9090/graph Grafana address : http://localhost:3000/d/XE4V0WGZz/besu-overview?orgId=1&refresh=10s&from=now-30m&to=now&var-system=All Kibana logs address : http://localhost:5601/app/kibana#/discover + + For more information on the endpoints and services, refer to README.md in the installation directory. **************************************************************** ``` - * Use the **JSON-RPC HTTP service endpoint** to access the RPC node service from your Dapp or from cryptocurrency wallets such as Metamask. * Use the **JSON-RPC WebSocket service endpoint** to access the web socket node service from your Dapp. -* Use the **GraphQL HTTP service endpoint** to access the - [HTTP GraphQL](../../HowTo/Interact/APIs/GraphQL.md) node service from your Dapp. * Use the **Web block explorer address** to display the block explorer web application. View the block explorer by entering the URL in your web browser. * Use the **Prometheus address** to access the @@ -133,12 +122,7 @@ This tutorial uses the Alethio Ethereum Lite Explorer. Access the explorer by copying and pasting the `Web block explorer address` displayed when starting the private network to your browser. -The block explorer displays a summary of the private network: - -![Block Explorer](../../images/ExplorerSummary.png) - -See that the explorer indicates six peers: the four regular nodes, the mining node, and the -bootnode. +The block explorer displays a summary of the private network, indicating four peers. Click the block number to the right of **Best Block** to display the block details: @@ -181,7 +165,7 @@ time you run the network. Run the following command from the host shell: ```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":1}' +curl -X POST --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":1}' http://localhost:8545 ``` The result specifies the client version: @@ -207,29 +191,27 @@ Peers are the number of other nodes connected to the RPC node. Poll the peer count using `net_peerCount`: ```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":1}' +curl -X POST --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":1}' http://localhost:8545 ``` -The result indicates that there are six peers: +The result indicates that there are four peers: ```json { "jsonrpc" : "2.0", "id" : 1, - "result" : "0x6" + "result" : "0x4" } ``` -### Request the most recently mined block number +### Request the most recent block number Call `eth_blockNumber` to retrieve the number of the most recent block: ```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' +curl -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' http://localhost:8545 ``` -The result provides the most recently mined block: - ```json { "jsonrpc" : "2.0", @@ -238,41 +220,7 @@ The result provides the most recently mined block: } ``` -The hexadecimal value `0x8b8` translates to `2232` in decimal, the number of mined blocks so far. - -### Check the miner account balance - -Call `eth_getBalance` to retrieve the balance of the mining address (coinbase) defined in the miner -node: - -```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xfe3b557e8fb62b89f4916b721be55ceb828dbd73","latest"],"id":1}' -``` - -The result specifies the miner account balance: - -```json -{ - "jsonrpc" : "2.0", - "id" : 1, - "result" : "0x79f905c6fd34e80000" -} -``` - -!!!info - - 0x79f905c6fd34e80000 = 2250000000000000000000 Wei (2250 Ether). - -!!!tip - - Use a [unit converter](https://www.etherchain.org/tools/unitConverter) to translate values from - Wei to Ether. - -Wait a few seconds until there are new mined blocks then call `eth_getBalance` again. The balance -increases, meaning the miner address successfully received the mining reward. - -You can also view this information in the block explorer. It does exactly the same thing as this -call, connecting to the RPC node using HTTP JSON-RPC, and displaying information on a web page. +The hexadecimal value `0x8b8` translates to `2232` in decimal, the number of blocks so far. ## Create a transaction using MetaMask From 6ae81d8f9cce95fd93b21efcc0bd028d1c99395d Mon Sep 17 00:00:00 2001 From: Madeline Murray Date: Thu, 5 Nov 2020 20:50:31 +1000 Subject: [PATCH 3/4] build Signed-off-by: Madeline Murray --- docs/Tutorials/Examples/Privacy-Example.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Tutorials/Examples/Privacy-Example.md b/docs/Tutorials/Examples/Privacy-Example.md index db1847913d8..19b7f95350b 100644 --- a/docs/Tutorials/Examples/Privacy-Example.md +++ b/docs/Tutorials/Examples/Privacy-Example.md @@ -178,7 +178,7 @@ with a `contractAddress` of `null`. } } ``` - + ## Stop the network Do one of the following to stop the network: @@ -194,6 +194,6 @@ Do one of the following to stop the network: ```bash ./remove.sh ``` - + [create transactions using Metamask]: Private-Network-Example.md#create-a-transaction-using-metamask From 75c8a579e367bfbe753bd63e05395e1acc62ba74 Mon Sep 17 00:00:00 2001 From: Madeline Murray Date: Thu, 5 Nov 2020 20:56:58 +1000 Subject: [PATCH 4/4] lint Signed-off-by: Madeline Murray --- docs/Tutorials/Examples/Privacy-Example.md | 8 ++++---- docs/Tutorials/Examples/Private-Network-Example.md | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/Tutorials/Examples/Privacy-Example.md b/docs/Tutorials/Examples/Privacy-Example.md index 19b7f95350b..f15943e962d 100644 --- a/docs/Tutorials/Examples/Privacy-Example.md +++ b/docs/Tutorials/Examples/Privacy-Example.md @@ -47,7 +47,7 @@ npx quorum-dev-quickstart ``` Follow the prompts displayed to run Hyperledger Besu, private transactions, and [logging with ELK](../../HowTo/Monitor/Elastic-Stack.md). -Enter `n` for [Codefi Orchestrate](https://docs.orchestrate.consensys.net/en/stable/). +Enter `n` for [Codefi Orchestrate](https://docs.orchestrate.consensys.net/en/stable/). ## Clone web3js-eea libraries @@ -80,7 +80,7 @@ first time. The network details display. ```bash ************************************* -Quorum Dev Quickstart +Quorum Dev Quickstart ************************************* Setting up the index patterns in kibana ................. ---------------------------------- @@ -178,7 +178,7 @@ with a `contractAddress` of `null`. } } ``` - + ## Stop the network Do one of the following to stop the network: @@ -194,6 +194,6 @@ Do one of the following to stop the network: ```bash ./remove.sh ``` - + [create transactions using Metamask]: Private-Network-Example.md#create-a-transaction-using-metamask diff --git a/docs/Tutorials/Examples/Private-Network-Example.md b/docs/Tutorials/Examples/Private-Network-Example.md index ef9fc085370..4a0553e4e24 100644 --- a/docs/Tutorials/Examples/Private-Network-Example.md +++ b/docs/Tutorials/Examples/Private-Network-Example.md @@ -17,8 +17,8 @@ nodes managed by Docker Compose. * [Docker and Docker-compose](https://docs.docker.com/compose/install/) * [Nodejs](https://nodejs.org/en/download/) * On Windows: - - Windows Subsystem for Linux 2 - - Docker desktop configured to use the WSL2-based engine. + * Windows Subsystem for Linux 2 + * Docker desktop configured to use the WSL2-based engine. !!! important Ensure you allow Docker up to 4G of memory or 6G if running the privacy examples. @@ -42,7 +42,7 @@ npx quorum-dev-quickstart Follow the prompts displayed to run Hyperledger Besu and [logging with ELK](../../HowTo/Monitor/Elastic-Stack.md). Enter `n` for [Codefi Orchestrate](https://docs.orchestrate.consensys.net/en/stable/) and -[private transactions](../../Concepts/Privacy/Privacy-Overview.md). +[private transactions](../../Concepts/Privacy/Privacy-Overview.md). ## Start the network @@ -92,6 +92,7 @@ When the process ends, it lists the running services: For more information on the endpoints and services, refer to README.md in the installation directory. **************************************************************** ``` + * Use the **JSON-RPC HTTP service endpoint** to access the RPC node service from your Dapp or from cryptocurrency wallets such as Metamask. * Use the **JSON-RPC WebSocket service endpoint** to access the web socket node service from your