Giter Site home page Giter Site logo

blockchain-vote's Introduction

blockchain-vote

Install dependencies

  1. Download and install Docker: https://www.docker.com/products/docker#/mac (or brew install docker)
  2. Download and install Go: https://golang.org/doc/install (or brew install golang)
  3. Download and install Node.js: https://nodejs.org/en/download/

Set up your GO workspace

  1. Create a directory to act as your Go workspace. Suggestion: ~/dev/go.
  2. In your Go workspace mkdir -p src/github.com/
  3. In .../go/src/github.com add the hyperledger Go code:
mkdir hyperledger
cd hyperledger
git clone [email protected]:hyperledger/fabric.git
cd fabric
git fetch
git checkout v0.6
  1. In your ~/.zshrc file add export GOPATH=$HOME/dev/go or whatever that path is.

Run the application

In your dev directory. Assumed for this guide: ~/dev

git clone [email protected]:DecodedCo/blockchain-vote.git
cd blockchain-vote

Docker

Make sure you have Docker running on your mac, then:

cd ~/dev/blockchain-vote/docker-compose
docker pull hyperledger/fabric-peer:latest
docker pull hyperledger/fabric-membersrvc:latest

Wait a few moments then

cd one-peer-one-ca
docker-compose up

Go

Open up a new shell, then:

cd ~/dev/blockchain-vote/golang-chaincode
go build .

Wait a moment then:

CORE_CHAINCODE_ID_NAME=DecodedBlockChain CORE_PEER_ADDRESS=0.0.0.0:7051 ./golang-chaincode

Node

Open up another new shell, then:

cd ~/dev/blockchain-vote/node-server
npm install
npm start

Open a web browser and navigate to localhost:3000

Shutting down

Docker

Open up a fourth shell, then:

cd ~/dev/blockchain-vote/docker-compose/one-peer-one-ca
docker-compose stop

That stops the process and preserves the state of the blockchain. To delete the blockchain, run:

docker rm -f $(docker ps -aq)

Go and Node

The Go chaincode should stop running when the docker container stops. If not, the Go and Node processes can be stopped using ctrl+C

blockchain-vote's People

Contributors

luckylwk avatar marcdavi-es avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blockchain-vote's Issues

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.