GithubHelp home page GithubHelp logo

isabella232 / web3j-eth2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from web3j/web3j-eth2

0.0 0.0 0.0 698 KB

Web3j integrations for Ethereum 2.0 (Eth2) network

Home Page: https://www.web3labs.com

Kotlin 97.13% Shell 2.87%

web3j-eth2's Introduction

Web3j Ethereum 2.0

Web3j - Ethereum 2.0

This project contains Ethereum 2.0 related modules.

At the moment it only contains the Beacon Node API client.

Beacon Node API Client

Web3j client library for the Eth2 Beacon Node API.

Dependencies

Quickstart

You can add the library to your project using either Gradle or Maven.

Maven

<dependency>
  <groupId>org.web3j.eth2</groupId>
  <artifactId>beacon-node-api</artifactId>
  <version>1.0.0</version>
</dependency>

Gradle

implementation 'org.web3j.eth2:beacon-node-api:1.0.0'

Create a service pointing to your Beacon Chain node:

var service = new BeaconNodeService("http://public-mainnet-node.ethereum.org/api");

Build a client instance using the client factory:

var client = BeaconNodeClientFactory.build(service);

That's it! You can start using the client to call the node endpoints, for instance:

client.getBeacon().getBlocks().findById(NamedBlockId.HEAD);

Test and build

Run this command on a console:

./gradlew build

Integration tests

This library is tested against different Beacon Node API nodes to ensure that it works on all of them. At the moment the tests run against Lighthouse and Teku.

Other Beacon Node implementations providing Docker images such as Nimbus and Prysm will be included in the future.

To run the integration tests, you'll need Docker running. Unless you pull the images manually, you will also need to define these variables in order to pull the Docker images from the Docker Hub registry:

  • registry.username
  • registry.password

Check the Docker client API for more information on configuration options.

Run this command on a console:

./gradlew integrationTest

web3j-eth2's People

Contributors

xaviarias 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.