Giter Site home page Giter Site logo

mick-h / erc20-quorum-vm-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from web3labs/erc20-quorum-vm-example

0.0 1.0 0.0 25 KB

ERC-20 token standard RESTful service Quorum demo

Home Page: https://blk.io

Shell 59.72% JavaScript 40.28%

erc20-quorum-vm-example's Introduction

ERC-20 Token Standard REST services on Quorum

Introduction

This sample environment provides RESTful services for creating and managing ERC-20 tokens on top of Quorum.

It provides a 3 node Quorum environment and RESTful service endpoints for interacting with each of those nodes over HTTP. These services are provided via the erc20-rest-service which uses web3j and Spring Boot.

Full transaction privacy is supported.

Usage

If you're using the Azure VM Image, this will configure and start both the Quorum network and the ERC-20 services:

cd ~/erc20-quorum-vm-example
./init.sh

Alternatively, if you have an fresh Ubuntu host (username must be ubuntu):

cd $HOME
git clone https://github.com/blk-io/erc20-quorum-vm-example.git
cd erc20-quorum-vm-example
sudo ./bootstrap.sh
./init.sh

You will be able to access the following endpoints for interacting with the network (please substitute hostnames for your own):

Should you wish to manage the individual environments, you can use the following scripts.

Quorum:

cd ~/3nodes-quorum
./raft-start.sh
# or
./stop.sh

REST services:

cd ~/3nodes-service
./service-start.sh
# or
./service-stop.sh

Quorum node configuration

To facilitate the sending of private transactions between any combination of nodes, a dedicated REST service runs associated with each node.

Node Address Enclave Key Quorum Node Port REST Service Port
1 0xed9d02e382b34818e88b88a309c7fe71e65f419d BULeR8JyUWhiuuCMU/HLA0Q5pzkYT+cHII3ZKBey3Bo= 22000 8080
2 0xca843569e3427144cead5e4d5999a3d0ccf92b8e QfeDAys9MPDs2XHExtc84jKGHxZg/aj52DTh0vtA3Xc= 22001 8081
3 0x0fbdc686b912d7722dc86510934589e0aaf3b55a 1iTZde/ndBHvzhcl7V68x44Vx7pl8nwx9LqnM/AfJUg= 22002 8082

The privateFor HTTP request header should be used for specifying the nodes that a transaction is private between parties. Swagger provides support for specifying this field in addition to the request body attributes.

Azure VM

An Azure VM is available at with this environment pre-configured.

It is recommended that you use this to run this example.

Azure VM setup

Should you wish to setup this environment from scratch in the Azure Cloud, detailed instructions are below.

Install Azure command line tools:

curl -L https://aka.ms/InstallAzureCli | bash

Note: If issues with urllib see Azure/azure-cli#3498 to resolve

Login to Azure:

az login

Create a resource group (use az account list-locations to see avilable locations):

az group create -n "erc20-quorum-group" -l australiaeast

Create ssh keys:

ssh-keygen -t rsa -b 2048 

Create an Azure VM:

az vm create -n erc20-quorum-vm -g erc20-quorum-group --image UbuntuLTS --size Standard_DS1_v2 --public-ip-address-dns-name erc20-quorum --admin-username ubuntu --ssh-key-value ~/.ssh/azure_rsa.pub

Open ports for Swagger UI:

az vm open-port --port 8080 --resource-group erc20-quorum-group --name erc20-quorum-vm --priority 900
az vm open-port --port 8081 --resource-group erc20-quorum-group --name erc20-quorum-vm --priority 901
az vm open-port --port 8082 --resource-group erc20-quorum-group --name erc20-quorum-vm --priority 902

Note: Operation may report failure, but in fact succeed

VM installation

git clone https://github.com/blk-io/erc20-quorum-vm-example.git
cd erc20-quorum-vm-example
sudo ./bootstrap.sh

Troubleshooting

I get the following message after running init.sh:

[*] Starting Constellation nodes
[*] Starting node 1
[*] Starting node 2
[*] Starting node 3
[*] Waiting for nodes to start
[*] Sending test transaction against each node
Fatal: Unable to attach to remote geth: dial unix qdata/dd1/geth.ipc: connect: no such file or directory

Occasionally startup fails, please try re-running init.sh.

erc20-quorum-vm-example's People

Contributors

conor10 avatar

Watchers

 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.