百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
E

erc20-rest-service

> 后端框架
开源

使用 Spring Boot 和 web3j 实现 ERC-20 令牌标准 RESTful 服务

186 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

使用 Spring Boot 和 web3j 实现 ERC-20 令牌标准 RESTful 服务

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

Build

To build a runnable jar file:

bash
./gradlew clean build

Run

Using Java 1.8+:

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

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

Configuration

The following default properties are used in the application:

properties
# Port for service to bind to
port=8080
# Log file path and name
logging.file=logs/erc20-rest-service.log

# 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
nodeEndpoint=http://localhost:22000
# The Ethereum or Quorum address we wish to use when transacting.
# Note - this address must be already unlocked in the client
fromAddress=0xed9d02e382b34818e88b88a309c7fe71e65f419d

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

Usage

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.

Docker

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
docker build -f docker/Dockerfile -t blk-io/erc20-service .

Then either run it with default configuration:

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

Or with a custom configuration:

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

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Javablockchainethereumquorumrest

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类后端框架
定价开源

> 相关工具

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架