lacchain / lacchain-docker

Apache License 2.0
10 stars 4 forks source link

LACChain Network Docker

Prerequisites

To run these tutorials, you must have the following installed:

⚠️ Note: If on MacOS or Windows, please ensure that you allow docker to use upto 4G of memory or 6G if running Privacy examples under the Resources section. The Docker for Mac and Docker Desktop sites have details on how to do this at the "Resources" heading
⚠️ Note: This has only been tested on Windows 10 Build 18362 and Docker >= 17.12.2

Description

There are multiple examples in this repo, and each has a POA example. You can choose the default setup which comprises a 4 node network with the Block Explorer and our Prometheus & Grafana dashboard to track the progress of the chain; or the whole setup with logging via ELK.
Please use the following use cases personas as guidelines only:

All the architecture diagrams below generally use the POA (IBFT2) setup, to view the architecture diagrams for the POW (ethash) setup please see the images folder, where the files share the same name but have different suffixes.

Start Services and Network

./run.sh starts all the docker containers in POA mode

./run.sh -v -w starts all the docker containers in POA mode using the IBFT2 Consensus algorithm

There are two parameters -v and -w parameters which specify the number of validators and writers nodes, respectively.

Basic 4 Node Network with Block Explorer and Prometheus & Grafana to track the progress of your chain

Use this scenario:

Image basic

Where the node details are as follows:

Name Besu Node address Orion node key Node URL
node1 0x866b0df7138daf807300ed9204de733c1eb6d600 9QHwUJ6uK+FuQMzFSXIo7wOLCGFZa0PiF771OLX5c1o= http://localhost:20000
node2 0xa46f0935de4176ffeccdeecaf3c6e3ca03e31b22 qVDsbJh2UluZOePxbXAL49g0S0s2gGlJ3ftQceMlchU= http://localhost:20002
node3 0x998c8bc11c28b667e4b1930c3fe3c9ab1cde3c52 T1ItOQxwgY1pTW6YXb2EbKXYkK4saBEys3CfJ2OIKHs= http://localhost:20004
Testing Privacy between Orion nodes
Prerequisites

Follow the eeajs-multinode-example which deploys an EventEmitter contract and then sends a couple of Private Transaction from Node1 -> Node2 (& vice versa) with an arbitrary value (1000).

At the end of both transactions, it then reads all three Orion nodes to check the value at an address, and you should observe that only Node1 & Node2 have this information becuase they were involved in the transaction and that Orion3 responds with a 0x value for reads at those addresses

There is an additional erc20 token example that you can also test with: executing node example/erc20.js deploys a HumanStandardToken contract and transfers 1 token to node2.

This can be verified from the data field of the logs which is 1.

Prerequisites

Image basic_permissioning

Stop Services and Network

./stop.sh stops all the docker containers created.

Remove stopped containers and volumes

./remove.sh stops and removes all the containers and volumes.

Copyright 2020 LACChain

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.