Giter Club home page Giter Club logo

quorum-local-raft-network's Introduction

Quorum-local-RAFT-network

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.

Setup a minimal local quorum network with 3 nodes using raft consensus algorithm without tx manager (does not support private transactions).

Quorum local

Build a local Quorum network based on the 7-nodes example and simplified to 3 nodes with only Raft consensus without tx manager.

To run these sample network, you must have the following installed:

Run the 3 nodes in containers

run: docker-compose up -d

3 Docker Containers

  1. quorum_raft_node1_1
    • RPC Port: 22000
    • WS Port: 23000
  2. quorum_raft_node2_1
    • RPC Port: 22001
    • WS Port: 23001
  3. quorum_raft_node3_1
    • RPC Port: 22002
    • WS Port: 23002

access to geth of nodes: docker exec -it <container_name> geth attach ./qdata/dd/geth.ipc

stop: docker-compose stop

remove: docker-compose down -v

sample command in geth console

# get node account
> eth.accounts[0]
"0xed9d02e382b34818e88b88a309c7fe71e65f419d"
# get latest block
> eth.getBlock("latest")
# expect output
{
  difficulty: 131072,
  extraData: "0x000...500",
  gasLimit: 3757178881,
  gasUsed: 21000,
  hash: "0xbf2...3d4",
  logsBloom: "0x000...0000",
  miner: "0x000...000",
  mixHash: "0x000...000",
  nonce: "0x0000000000000000",
  number: 1,
  parentHash: "0x6a6...3a2",
  receiptsRoot: "0x056..2d2",
  sha3Uncles: "0x1dc...347",
  size: 726,
  stateRoot: "0x9c0...e58",
  timestamp: 1611559851631510500,
  totalDifficulty: 131072,
  transactions: ["0xeeb...b63"],
  transactionsRoot: "0xc90...215",
  uncles: []
}
# send ethereum in wei
> eth.sendTransaction({from: eth.accounts[0],to: "0x7aa4a14286a25e3a275d7a122c23dc3c107a636a", value: "1000000000000000"})
"0x182bd52c8184ccc9a177c2f0346d5407c6e828649cae8dd5e941029ade81291d"
# get Balance in ether
> eth.getBalance("0x7aa4a14286a25e3a275d7a122c23dc3c107a636a")
1000000000000000
# get Balance in ether
> web3.fromWei(eth.getBalance(eth.accounts[0]), "ether")
999999999.998
# example send in ether
> eth.sendTransaction({from: eth.accounts[0],to: "0x7aa...36a", value: web3.fromWei(1000, "ether")})

quorum-local-raft-network's People

Contributors

masdxi avatar majdt51 avatar jpbu avatar marc0olo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.