• Stars
    star
    230
  • Rank 168,743 (Top 4 %)
  • Language
    Java
  • Created over 7 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Spring Boot Starter for web3j

web3j Spring Boot Starter

Build Status

Integrate web3j into your Spring Boot applications via Spring's dependency injection.

Getting started

A sample application is available here

To use, create a new Spring Boot Application, and include the following dependencies:

Maven:

<dependency>
    <groupId>org.web3j</groupId>
    <artifactId>web3j-spring-boot-starter</artifactId>
    <version>4.0.3</version>
</dependency>

Gradle:

compile ('org.web3j:web3j-spring-boot-starter:4.0.3')

Now Spring can inject web3j instances for you where ever you need them:

@Autowired
private Web3j web3j;

No additional configuration is required if you want to connect via HTTP to the default URL http://localhost:8545.

Otherwise simply add the address of the endpoint in your application properties:

# An infura endpoint
web3j.client-address = https://rinkeby.infura.io/

# Or, an IPC endpoing
web3j.client-address = /path/to/file.ipc

Admin clients

If you wish to make use of the personal module methods that are common to both Parity and Geth
to manage accounts, enable the admin client:

web3j.admin-client = true

Then Spring can inject admin clients:

@Autowired
private Admin admin;

HTTP client configuration

Some Ethereum operations take longer than the default HTTP timeout set by the OkHttp3 library used by web3j. To configure those timeouts set the web3j httpTimeoutSeconds property:

web3j.httpTimeoutSeconds = 600  

This sets all three OkHttp3 timeouts: connect, read, and write.

Valid values are any non-negative integer.

A value of '0' means: no timeout.

Note: This is not required for transacting with web3j.

Further information

For further information on web3j, please refer to the web3j home page.

More Repositories

1

web3j

Lightweight Java and Android library for integration with Ethereum clients
Java
4,890
star
2

sample-project-gradle

Sample web3j project using Gradle
Java
269
star
3

web3j-maven-plugin

web3j Maven plugin
Java
112
star
4

web3j-quorum

web3j integration layer for JP Morgan's Quorum
Java
109
star
5

libp2p

libp2p implementation in Kotlin for JVM platforms
Kotlin
78
star
6

web3j-evm

A library for running an embedded Ethereum EVM in-process on a JVM
Kotlin
61
star
7

web3j-cli

Command-line interface for web3j
Java
53
star
8

svm

Solidity Version Manager. Like nvm or jabba, but for Solidity. Cross platform.
Kotlin
48
star
9

examples

Example code supporting articles
Java
48
star
10

web3j-gradle-plugin

web3j Gradle plugin
Java
38
star
11

web3j-docs

Web3j documentation repository.
35
star
12

sample-project-maven

Sample web3j Maven project
Java
34
star
13

web3j-openapi

OpenAPI compliant service generator for Solidity Smart contracts
Solidity
33
star
14

Intellij-solidity-debugger

Kotlin
27
star
15

web3j-unit

Smart contract testing framework via integrated EVM and various Ethereum clients
Kotlin
22
star
16

solidity-gradle-plugin

Gradle plugin providing tasks to compile Solidity contracts.
Solidity
21
star
17

web3j-corda

Lightweight JVM library for integrating with Corda
Kotlin
14
star
18

web3j-sokt

Kotlin-based wrapper for multiple installations of the solidity compiler (solc)
Kotlin
12
star
19

web3j-eth2

Web3j integrations for Ethereum 2.0 (Eth2) network
Kotlin
10
star
20

web3j-evmexample

Minimal example for getting started with web3j-evm
Java
8
star
21

web3j.github.io

web3j web site
JavaScript
6
star
22

web3j-aion

web3j integration with the Aion network
Kotlin
5
star
23

web3j-unitexample

Minimal example for getting started with web3j-unit
Java
4
star
24

web3j-openapi-gradle-plugin

Kotlin
4
star
25

web3j-workshop-2019

JAX London 2019 Web3j Workshop
Java
4
star
26

ion

Java bindings for the Ion Interoperability Framework
Solidity
4
star
27

web3j-deployer-demo

Demo usage of web3j-deployer
Java
3
star
28

web3j-deployer

Library to define, configure and run Ethereum contract deployments and transactions
Kotlin
3
star
29

web3j-deployer-plugin

Gradle plugin for web3j-deployer
Kotlin
2
star
30

fabric

Kotlin
2
star
31

solidity-darwin-binaries

Static binaries of the Solidity compiler for macOS
2
star
32

web3j-unit-docker-compose-example

Example to spin up VMWare Concord using docker-compose to test contracts in web3j-unit
Java
2
star
33

homebrew-web3j

web3j homebrew tap
Ruby
2
star
34

aion-samples

web3j Aion integration samples
Java
1
star
35

epirus-gradle-plugin

Gradle Plugin for the Epirus Platform.
Kotlin
1
star
36

.github

Share workflow templates, secrets, and self-hosted runners.
1
star
37

quorum-spring-boot-starter

A Spring Boot starter for working with Quorum
1
star
38

build-tools

Internal build tools for our projects
Java
1
star