ERC-20 token standard RESTful service using Spring Boot and web3j
Java Shell
Switch branches/tags
Nothing to show
Clone or download
conor10 Merge pull request #2 from JohnChangUK/update-project-to-web3j_3.2.0
Update project to be compatible with Quorum 0.8.0
Latest commit 0f1e6b0 Feb 13, 2018

ERC-20 RESTful service

This application provides a RESTful service for creating and managing ERC-20 tokens. It has been built using Spring Boot, and web3j.

It works with both Geth, Parity, and Quorum.

For Quorum, the RESTful semantics are identical, with the exception that if you wish to create a private transaction, you populate a HTTP header name privateFor with a comma-separated list of public keys


To build a runnable jar file:

./gradlew clean build


Using Java 1.8+:

java -jar build/libs/azure-demo-0.1.jar 

By default the application will log to a file named erc20-web3j.log.


The following default properties are used in the application:

# Port for service to bind to
# Log file path and name

# Endpoint of an Ethereum or Quorum node we wish to use. 
# To use IPC simply provide a file path to the socket, such as /path/to/geth.ipc
# The Ethereum or Quorum address we wish to use when transacting.
# Note - this address must be already unlocked in the client

You can override any of these properties by creating a file name in the root directory of your application, or in config/ relative to your root. If you'd rather use yaml, simply change the filename to application.yml.


All available application endpoints are documented using Swagger.

You can view the Swagger UI at http://localhost:8080/swagger-ui.html. From here you can perform all POST and GET requests easily to facilitate deployment of, transacting with, and querying state of ERC-20 tokens.

alt text


We can use Docker to easily spin up a arbritrary instance of our service connecting to an already running Ethereum or Quorum network.

All you need to do is build the Dockerfile:

docker build -f docker/Dockerfile -t blk-io/erc20-service .

Then either run it with default configuration:

docker run -p 8080:8080 -v "$PWD/logs":/logs blk-io/erc20-service

Or with a custom configuration:

export PORT=8081
docker run -p ${PORT}:${PORT} -v "$PWD/logs":/logs \
    -e ENDPOINT="http://localhost:22001" \
    -e FROMADDR="0xca843569e3427144cead5e4d5999a3d0ccf92b8e" \
    -e PORT="$PORT" \