Skip to content

Commit 617726b

Browse files
Updated for Quorum developer quickstart (#543)
* WIP Signed-off-by: Madeline Murray <[email protected]> * updated for quorum developer quickstart Signed-off-by: Madeline Murray <[email protected]> * build Signed-off-by: Madeline Murray <[email protected]> * lint Signed-off-by: Madeline Murray <[email protected]> Co-authored-by: Madeline Murray <[email protected]>
1 parent 152f6ed commit 617726b

File tree

2 files changed

+78
-143
lines changed

2 files changed

+78
-143
lines changed

docs/Tutorials/Examples/Privacy-Example.md

Lines changed: 31 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
description: Hyperledger Besu privacy-enabled private network tutorial
33
---
44

5-
# Privacy-enabled private network example tutorial
5+
# Privacy-enabled Quorum Developer Quickstart tutorial
66

77
The privacy-enabled private network example runs a private network of Hyperledger Besu and Orion
88
nodes managed by Docker Compose. It's an expanded version of the
9-
[private network example](Private-Network-Example.md).
9+
[Quorum Developer Quickstart tutorial](Private-Network-Example.md).
1010

1111
You can use the [Block Explorer](Private-Network-Example.md#block-explorer), make
1212
[JSON-RPC requests](Private-Network-Example.md#run-json-rpc-requests), and
1313
[create transactions using Metamask] as described in the
14-
[private network example](Private-Network-Example.md). This tutorial describes how to use the
14+
[Quorum Developer Quickstart tutorial](Private-Network-Example.md). This tutorial describes how to use the
1515
examples provided in the web3js-eea library to
1616
[create and send private transactions](#send-private-transactions-and-read-values).
1717

@@ -36,26 +36,25 @@ To run this tutorial, you must have the following installed:
3636
* [Git command line](https://git-scm.com/)
3737
* [Curl command line](https://curl.haxx.se/download.html).
3838

39-
## Clone Besu sample networks source code
39+
## Create Docker-compose file
4040

41-
Clone the repository from the `besu-` repository.
41+
## Usage
4242

43-
=== "Linux/MacOS"
43+
To create the docker-compose file and artifacts, run:
4444

45-
```bash
46-
git clone https://github.com/PegaSysEng/besu-sample-networks.git
47-
```
48-
49-
!!!note
45+
```bash
46+
npx quorum-dev-quickstart
47+
```
5048

51-
To use a specific version of Hyperledger Besu, set the `BESU_VERSION` environment variable.
49+
Follow the prompts displayed to run Hyperledger Besu, private transactions, and [logging with ELK](../../HowTo/Monitor/Elastic-Stack.md).
50+
Enter `n` for [Codefi Orchestrate](https://docs.orchestrate.consensys.net/en/stable/).
5251

5352
## Clone web3js-eea libraries
5453

55-
Clone the `PegaSysEng/web3js-eea` library:
54+
Clone the `ConsenSys/web3js-eea` library:
5655

5756
```bash
58-
git clone https://github.com/PegaSysEng/web3js-eea.git
57+
git clone https://github.com/ConsenSys/web3js-eea.git
5958
```
6059

6160
In the `web3js-eea` directory:
@@ -70,32 +69,31 @@ npm install
7069

7170
If running in Windows, please run commands from the GitBash shell
7271

73-
In the `besu-sample-networks` directory, start the network with privacy enabled:
72+
In the installation directory, start the network:
7473

7574
```bash
76-
./run-privacy.sh
75+
./run.sh
7776
```
7877

7978
The script pulls the Docker images starts the network. Pulling the images takes a few minutes the
8079
first time. The network details display.
8180

8281
```bash
83-
Name Command State Ports
84-
--------------------------------------------------------------------------------------------------------------------------
85-
privacy_bootnode_1 /opt/besu/bootnode_sta ... Up 30303/tcp, 8545/tcp, 8546/tcp
86-
privacy_explorer_1 nginx -g daemon off; Up 0.0.0.0:25000->80/tcp
87-
privacy_minernode_1 /opt/besu/node_start.s ... Up 30303/tcp, 8545/tcp, 8546/tcp
88-
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
89-
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
90-
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
91-
privacy_orion1_1 /orion/bin/orion data/data ... Up
92-
privacy_orion2_1 /orion/bin/orion data/data ... Up
93-
privacy_orion3_1 /orion/bin/orion data/data ... Up
94-
privacy_rpcnode_1 /opt/besu/node_start.s ... Up 30303/tcp, 8545/tcp, 8546/tcp
95-
****************************************************************
96-
JSON-RPC HTTP service endpoint : http://localhost:8545 *
97-
JSON-RPC WebSocket service endpoint : ws://localhost:8546 *
98-
Web block explorer address : http://localhost:25000 *
82+
*************************************
83+
Quorum Dev Quickstart
84+
*************************************
85+
Setting up the index patterns in kibana .................
86+
----------------------------------
87+
List endpoints and services
88+
----------------------------------
89+
JSON-RPC HTTP service endpoint : http://localhost:8545
90+
JSON-RPC WebSocket service endpoint : ws://localhost:8546
91+
Web block explorer address : http://localhost:25000/
92+
Prometheus address : http://localhost:9090/graph
93+
Grafana address : http://localhost:3000/d/XE4V0WGZz/besu-overview?orgId=1&refresh=10s&from=now-30m&to=now&var-system=All
94+
Collated logs using Kibana endpoint : http://localhost:5601/app/kibana#/discover
95+
96+
For more information on the endpoints and services, refer to README.md in the installation directory.
9997
****************************************************************
10098
```
10199

@@ -147,7 +145,7 @@ Call [`eth_getTransactionReceipt`](../../Reference/API-Methods.md#eth_gettransac
147145
=== "curl HTTP request"
148146
149147
```bash
150-
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["<TransactionHash>"],"id":1}' <JSON-RPC Endpoint>
148+
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["<TransactionHash>"],"id":1}' http://localhost:8545
151149
```
152150
153151
=== "Example"
@@ -197,11 +195,5 @@ Do one of the following to stop the network:
197195
./remove.sh
198196
```
199197
200-
* Stop the network and delete the Docker images:
201-
202-
```bash
203-
./delete.sh
204-
```
205-
206198
<!-- Links -->
207199
[create transactions using Metamask]: Private-Network-Example.md#create-a-transaction-using-metamask

docs/Tutorials/Examples/Private-Network-Example.md

Lines changed: 47 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
description: Hyperledger Besu private network example tutorial
2+
description: Quorum dev quickstart tutorial
33
---
44

5-
# Private network example tutorial
5+
# Quorum Developer Quickstart tutorial
66

7-
The private network example uses the Hyperledger Besu Docker image to run a private network of Besu
7+
The Quorum Developer Quickstart uses the Hyperledger Besu Docker image to run a private network of Besu
88
nodes managed by Docker Compose.
99

1010
!!! important
@@ -14,44 +14,39 @@ nodes managed by Docker Compose.
1414

1515
## Prerequisites
1616

17-
To run this tutorial, you must have the following installed:
18-
1917
* [Docker and Docker-compose](https://docs.docker.com/compose/install/)
18+
* [Nodejs](https://nodejs.org/en/download/)
19+
* On Windows:
20+
* Windows Subsystem for Linux 2
21+
* Docker desktop configured to use the WSL2-based engine.
2022

21-
!!! important
22-
23-
If using [MacOS](https://docs.docker.com/docker-for-mac/) or
24-
[Windows](https://docs.docker.com/docker-for-windows/), set Docker to use up to 6GB of
25-
memory on the _Advanced_ tab in _Preferences_.
23+
!!! important
24+
Ensure you allow Docker up to 4G of memory or 6G if running the privacy examples.
25+
Refer to the _Resources_ section in [Docker for Mac](https://docs.docker.com/docker-for-mac/) and
26+
[Docker Desktop](https://docs.docker.com/docker-for-windows/) for details.
2627

2728
* [Git command line](https://git-scm.com/)
2829
* [Curl command line](https://curl.haxx.se/download.html)
2930
* A web browser that supports [Metamask](https://metamask.io/) (currently Chrome, Firefox, Opera,
3031
and Brave), and has the MetaMask plug-in installed. This tutorial uses screenshots from Brave.
3132

32-
## Clone Besu sample networks source code
33+
## Create Docker-compose file
3334

34-
Clone the repository from the `besu-sample-networks` repository:
35-
36-
=== "Linux/MacOS"
35+
## Usage
3736

38-
```bash
39-
git clone https://github.com/PegaSysEng/besu-sample-networks.git
40-
```
37+
To create the docker-compose file and artifacts, run:
4138

42-
!!!note
39+
```bash
40+
npx quorum-dev-quickstart
41+
```
4342

44-
To use a specific version of Hyperledger Besu, set the `BESU_VERSION` environment variable.
43+
Follow the prompts displayed to run Hyperledger Besu and [logging with ELK](../../HowTo/Monitor/Elastic-Stack.md).
44+
Enter `n` for [Codefi Orchestrate](https://docs.orchestrate.consensys.net/en/stable/) and
45+
[private transactions](../../Concepts/Privacy/Privacy-Overview.md).
4546

4647
## Start the network
4748

48-
!!!important
49-
50-
If running in Windows, run commands from the GitBash shell.
51-
52-
This tutorial uses [Docker Compose](https://docs.docker.com/compose/) to assemble the images and
53-
run the private network. To build the docker images and run the containers, go to the
54-
`besu-sample-networks` directory and run:
49+
To start the network, go to the installation directory and run:
5550

5651
=== "Linux/MacOS"
5752

@@ -68,51 +63,40 @@ When the process ends, it lists the running services:
6863

6964
```log
7065
*************************************
71-
Sample Network for Besu at latest
66+
Quorum Dev Quickstart
7267
*************************************
68+
Setting up the index patterns in kibana............
69+
{"type":"index-pattern","id":"metricbeat","attributes":{"title":"metricbeat-*","timeFieldName":"@timestamp"},
70+
"references":[],"migrationVersion":{"index-pattern":"7.6.0"},"updated_at":"2020-11-04T10:43:34.252Z",
71+
"version":"WzgsMV0=","namespaces":["default"]}{"success":true,"successCount":7}{"type":"index-pattern",
72+
"id":"besu","attributes":{"title":"besu-*","timeFieldName":"@timestamp"},"references":[],"migrationVersion":
73+
{"index-pattern":"7.6.0"},"updated_at":"2020-11-04T10:43:36.927Z","version":"WzE2LDFd","namespaces":
74+
["default"]}{"type":"index-pattern","id":"orion","attributes":{"title":"orion-*","timeFieldName":"@timestamp"},
75+
"references":[],"migrationVersion":{"index-pattern":"7.6.0"},"updated_at":"2020-11-04T10:43:37.982Z","version":
76+
"WzE3LDFd","namespaces":["default"]}{"type":"index-pattern","id":"quorum","attributes":{"title":"quorum-*",
77+
"timeFieldName":"@timestamp"},"references":[],"migrationVersion":{"index-pattern":"7.6.0"},"updated_at":
78+
"2020-11-04T10:43:39.003Z","version":"WzE4LDFd","namespaces":["default"]}{"type":"index-pattern","id":
79+
"tessera","attributes":{"title":"tessera-*","timeFieldName":"@timestamp"},"references":[],"migrationVersion":
80+
{"index-pattern":"7.6.0"},"updated_at":"2020-11-04T10:43:40.053Z","version":"WzE5LDFd","namespaces":
81+
["default"]}
82+
7383
List endpoints and services
7484
----------------------------------
75-
Name Command State Ports
76-
-----------------------------------------------------------------------------------------------------------------------------------------------------------
77-
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
78-
besu-sample-network_elasticsearch_1 /usr/local/bin/docker-entr ... Up 9200/tcp, 9300/tcp
79-
besu-sample-network_explorer_1 nginx -g daemon off; Up 0.0.0.0:25000->80/tcp
80-
besu-sample-network_filebeat_1 /usr/local/bin/docker-entr ... Up
81-
besu-sample-network_grafana_1 /run.sh Up 0.0.0.0:3000->3000/tcp
82-
besu-sample-network_kibana_1 /usr/local/bin/dumb-init - ... Up 0.0.0.0:5601->5601/tcp
83-
besu-sample-network_logstash_1 /usr/local/bin/docker-entr ... Up 5044/tcp, 9600/tcp
84-
besu-sample-network_minernode_1 /opt/besu/node_start.sh -- ... Up 30303/tcp, 8545/tcp, 8546/tcp, 8547/tcp
85-
besu-sample-network_node_1 /opt/besu/node_start.sh -- ... Up 30303/tcp, 8545/tcp, 8546/tcp, 8547/tcp
86-
besu-sample-network_prometheus_1 /bin/prometheus --config.f ... Up 0.0.0.0:9090->9090/tcp
87-
besu-sample-network_redis_1 docker-entrypoint.sh redis ... Up 6379/tcp
88-
besu-sample-network_rpcnode_1 /opt/besu/node_start.sh -- ... Up 30303/tcp, 0.0.0.0:8545->8545/tcp, 8546/tcp, 8547/tcp
89-
Setting up the besu index pattern in kibana
90-
{"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="}
91-
Orion not running, skipping the orion index pattern in kibana.
92-
```
93-
94-
Followed by a list of the endpoints:
95-
96-
!!! example "Endpoint list example"
97-
98-
```log
99-
****************************************************************
10085
JSON-RPC HTTP service endpoint : http://localhost:8545
10186
JSON-RPC WebSocket service endpoint : ws://localhost:8546
102-
GraphQL HTTP service endpoint : http://localhost:8547
10387
Web block explorer address : http://localhost:25000/
10488
Prometheus address : http://localhost:9090/graph
10589
Grafana address : http://localhost:3000/d/XE4V0WGZz/besu-overview?orgId=1&refresh=10s&from=now-30m&to=now&var-system=All
10690
Kibana logs address : http://localhost:5601/app/kibana#/discover
91+
92+
For more information on the endpoints and services, refer to README.md in the installation directory.
10793
****************************************************************
10894
```
10995

11096
* Use the **JSON-RPC HTTP service endpoint** to access the RPC node service from your Dapp or from
11197
cryptocurrency wallets such as Metamask.
11298
* Use the **JSON-RPC WebSocket service endpoint** to access the web socket node service from your
11399
Dapp.
114-
* Use the **GraphQL HTTP service endpoint** to access the
115-
[HTTP GraphQL](../../HowTo/Interact/APIs/GraphQL.md) node service from your Dapp.
116100
* Use the **Web block explorer address** to display the block explorer web application. View the
117101
block explorer by entering the URL in your web browser.
118102
* Use the **Prometheus address** to access the
@@ -139,12 +123,7 @@ This tutorial uses the Alethio Ethereum Lite Explorer.
139123
Access the explorer by copying and pasting the `Web block explorer address` displayed when starting
140124
the private network to your browser.
141125

142-
The block explorer displays a summary of the private network:
143-
144-
![Block Explorer](../../images/ExplorerSummary.png)
145-
146-
See that the explorer indicates six peers: the four regular nodes, the mining node, and the
147-
bootnode.
126+
The block explorer displays a summary of the private network, indicating four peers.
148127

149128
Click the block number to the right of **Best Block** to display the block details:
150129

@@ -187,7 +166,7 @@ time you run the network.
187166
Run the following command from the host shell:
188167

189168
```bash
190-
curl -X POST --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":1}' <http-rpc-endpoint>
169+
curl -X POST --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":1}' http://localhost:8545
191170
```
192171

193172
The result specifies the client version:
@@ -213,29 +192,27 @@ Peers are the number of other nodes connected to the RPC node.
213192
Poll the peer count using `net_peerCount`:
214193

215194
```bash
216-
curl -X POST --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":1}' <http-rpc-endpoint>
195+
curl -X POST --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":1}' http://localhost:8545
217196
```
218197

219-
The result indicates that there are six peers:
198+
The result indicates that there are four peers:
220199

221200
```json
222201
{
223202
"jsonrpc" : "2.0",
224203
"id" : 1,
225-
"result" : "0x6"
204+
"result" : "0x4"
226205
}
227206
```
228207

229-
### Request the most recently mined block number
208+
### Request the most recent block number
230209

231210
Call `eth_blockNumber` to retrieve the number of the most recent block:
232211

233212
```bash
234-
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' <http-rpc-endpoint>
213+
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' http://localhost:8545
235214
```
236215

237-
The result provides the most recently mined block:
238-
239216
```json
240217
{
241218
"jsonrpc" : "2.0",
@@ -244,41 +221,7 @@ The result provides the most recently mined block:
244221
}
245222
```
246223

247-
The hexadecimal value `0x8b8` translates to `2232` in decimal, the number of mined blocks so far.
248-
249-
### Check the miner account balance
250-
251-
Call `eth_getBalance` to retrieve the balance of the mining address (coinbase) defined in the miner
252-
node:
253-
254-
```bash
255-
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xfe3b557e8fb62b89f4916b721be55ceb828dbd73","latest"],"id":1}' <http-rpc-endpoint>
256-
```
257-
258-
The result specifies the miner account balance:
259-
260-
```json
261-
{
262-
"jsonrpc" : "2.0",
263-
"id" : 1,
264-
"result" : "0x79f905c6fd34e80000"
265-
}
266-
```
267-
268-
!!!info
269-
270-
0x79f905c6fd34e80000 = 2250000000000000000000 Wei (2250 Ether).
271-
272-
!!!tip
273-
274-
Use a [unit converter](https://www.etherchain.org/tools/unitConverter) to translate values from
275-
Wei to Ether.
276-
277-
Wait a few seconds until there are new mined blocks then call `eth_getBalance` again. The balance
278-
increases, meaning the miner address successfully received the mining reward.
279-
280-
You can also view this information in the block explorer. It does exactly the same thing as this
281-
call, connecting to the RPC node using HTTP JSON-RPC, and displaying information on a web page.
224+
The hexadecimal value `0x8b8` translates to `2232` in decimal, the number of blocks so far.
282225

283226
## Create a transaction using MetaMask
284227

0 commit comments

Comments
 (0)