Giter Site home page Giter Site logo

web3j-spring-boot-starter's Introduction

web3j Spring Boot Starter

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>1.2.0</version>
</dependency>

Gradle:

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

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://morden.infura.io/

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

Admin clients

If you wish to make use of the Parity or Geth personal modules to manage accounts, enable the admin client:

web3j.admin-client = true

Then Spring can inject admin clients:

@Autowired
private Parity parity;

Note: This is not required for transacting with web3j.

Further information

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

web3j-spring-boot-starter's People

Contributors

conor10 avatar

Watchers

James Cloos avatar hanmichael avatar  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.