GithubHelp home page GithubHelp logo

miguelramosfdz / vote-hyperledger-ethereum Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ibm/vote-hyperledger-ethereum

0.0 2.0 0.0 553 KB

Voting DApp using Web3, Solidity, Hyperledger Fabric and Chaincode EVM

License: Apache License 2.0

Shell 100.00%

vote-hyperledger-ethereum's Introduction

Blockchain DApp - {Web3, Ethereum, Solidity, Hyperledger Fabric, Chaincode EVM}

Simple Web3 Hyperledger Fabric - Hyperledger Burrow EVM Voting Decentralized Application

With few clicks, run smart contracts from Solidity onto Ethereum Virtual Machine (EVM) that is embedded into Hyperledger Fabric to compiles these contracts as bytecode, of course, with the help of the chaincode.



Before we start

Make sure to have the following prerequisite tools are installed on your machine: NPM, Node, Go, Docker. Their versions used for this code (respectively): v6.4.1, v10.10.0, v1.9.3 darwin/amd64, v18.06.1-ce.

These scripts in this project have been tried and are macOS compatible but if there are machine issues, then follow the steps here to bring up manually the needed containers, peers and fab3 up and running.

Note: Take into consideration that running ./start/sh will remove existing docker containers and images. If there are no containers or images on your machine, you can comment out the docker stop, rm and rmi in start.sh. The script is removing and adding docker compose yaml file that creates volume for fabric-chaincode-evm, adding needed repos for this project and chmod is to access/enable a file in the cloned repos to be executed.

If you would like to see the steps of everything happening behind the scenes, check here.

STEPS (OR for manual steps - click here)


Read carefully the steps of this tutorial to build a successful setup:

  • STEP 1 - ./start.sh - run this script file

  • STEP 2 - copy/paste the following sections in the same terminal:

1) # COPY/PASTE THIS SECTION IN THE TERMINAL

export CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/[email protected]/msp
export CORE_PEER_ADDRESS=peer0.org1.example.com:7051
export CORE_PEER_LOCALMSPID="Org1MSP"
export CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt


2) # COPY/PASTE THIS SECTION IN THE TERMINAL

peer chaincode install -n evmcc -l golang -v 0 -p github.com/hyperledger/fabric-chaincode-evm/evmcc
peer chaincode instantiate -n evmcc -v 0 -C mychannel -c '{"Args":[]}' -o orderer.example.com:7050 --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem


3) # RUN this script file in a NEW separate terminal

./proxy.sh

# The fab3 proxy will be available at `localhost:5000`.
  • STEP 3 - In a separate terminal, go back to the project's folder and run the web app locally by doing:
1) npm install
2) npm start

Open your browser at localhost:3000 to view the app.




References

License

This code pattern is licensed under the Apache Software License, Version 2. Separate third party code objects invoked within this code pattern are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the Developer Certificate of Origin, Version 1.1 (DCO) and the Apache Software License, Version 2.

Apache Software License (ASL) FAQ

vote-hyperledger-ethereum's People

Contributors

hovig avatar ljbennett62 avatar

Watchers

 avatar  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.