• Stars
    star
    227
  • Rank 175,900 (Top 4 %)
  • Language
    Java
  • Created almost 8 years ago
  • Updated 8 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
111
star
5

libp2p

libp2p implementation in Kotlin for JVM platforms
Kotlin
78
star
6

svm

Solidity Version Manager. Like nvm or jabba, but for Solidity. Cross platform.
Kotlin
49
star
7

examples

Example code supporting articles
Java
48
star
8

web3j-gradle-plugin

web3j Gradle plugin
Java
38
star
9

sample-project-maven

Sample web3j Maven project
Java
34
star
10

web3j-openapi

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

Intellij-solidity-debugger

Kotlin
27
star
12

solidity-gradle-plugin

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

web3j-corda

Lightweight JVM library for integrating with Corda
Kotlin
14
star
14

web3j-sokt

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

web3j-eth2

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

web3j-evmexample

Minimal example for getting started with web3j-evm
Java
9
star
17

web3j.github.io

web3j web site
JavaScript
6
star
18

web3j-aion

web3j integration with the Aion network
Kotlin
5
star
19

web3j-unitexample

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

web3j-openapi-gradle-plugin

Kotlin
4
star
21

web3j-workshop-2019

JAX London 2019 Web3j Workshop
Java
4
star
22

ion

Java bindings for the Ion Interoperability Framework
Solidity
4
star
23

web3j-deployer-demo

Demo usage of web3j-deployer
Java
3
star
24

web3j-deployer

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

web3j-deployer-plugin

Gradle plugin for web3j-deployer
Kotlin
2
star
26

fabric

Kotlin
2
star
27

solidity-darwin-binaries

Static binaries of the Solidity compiler for macOS
2
star
28

web3j-unit-docker-compose-example

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

homebrew-web3j

web3j homebrew tap
Ruby
2
star
30

aion-samples

web3j Aion integration samples
Java
1
star
31

epirus-gradle-plugin

Gradle Plugin for the Epirus Platform.
Kotlin
1
star
32

.github

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

quorum-spring-boot-starter

A Spring Boot starter for working with Quorum
1
star