Skip to content

swetharepakula/fabric-chaincode-evm

 
 

Repository files navigation

Hyperledger Fabric Shim for node.js chaincodes

This is the project for the fabric chaincode shim for the Burrow EVM.

Please see the draft and evolving design document in FAB-6590.

Running the Proxy:

Clone this repo to $GOPATH/src/github.com/hyperledger/fabric-chaincode-evm and make sure you have checked out the Tutorial branch.

In the root directory of this repo (fabric-chaincode-evm) run:

ETHSERVER_CONFIG=<path to cluster sdk config> go run main.go

NOTE You need a GO Version that is less 1.9.4.

Optional Environment Variables:

PORT              -- Proxy will run on the port specified on the environment variable. Default is 5000.
ETHSERVER_USER    -- Proxy will use the user id specfied on the environment variable. The user id corresponds to the name of the directories under the crypto-config/peerOrganizations/org1.example.com/users/Default is USER1.
ETHSERVER_CHANNEL -- Proxy will use the channel specified on the environment variable. Default is channel1

Instructions to Run the Sample Voting App:

NOTE You need the node.js library web3 version 0.20.2 installed.

Set Environment Vairables

Use environment variables to choose what fabproxy to for the app to contact.

ETHSERVER_USER=User1 # App will use http://localhost:5000 as its provider
ETHSERVER_USER=User2 # App will use http://localhost:5001 as its provider

Using the App

node voter/app.js <command> <args>
  Available Commands:
    deploy                                            # Deploys the Voting Contract
    giveRightToVote <contract-address> <user-address> # Allow <user-address> to vote
    vote <contract-address> <proposal-number>         # Vote for <proposal-number>

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License

Releases

No releases published

Packages

No packages published

Languages

  • Go 59.2%
  • JavaScript 39.7%
  • Shell 1.1%