• Stars
    star
    269
  • Rank 152,662 (Top 4 %)
  • Language
    Java
  • Created about 7 years ago
  • Updated over 2 years ago

Reviews

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

Repository Details

Sample web3j project using Gradle

web3j Sample Project

This project provides a very simple starter application for working with web3j and the test Ethereum network (testnet) known as Rinkeby.

The demo deploys a hello world smart contract which contains a greeting message. The current greeting message can be read and modified in the smart contract.

In order to run this demo, three pieces of information are required:

  1. Ethereum client (or node) endpoint. The simplest thing to do is request a free access token from Infura.
  2. A wallet file. This can be generated using the Epirus CLI.
  3. Some Ether. This can be requested from the Rinkeby Faucet.

Once these details have been added to the main Application class, you'll be good to go.

Functionality

This application demonstrates a number of core features of web3j and Ethereum:

  • Connecting to a node on the Ethereum network
  • Loading an Ethereum wallet file
  • Sending Ether from one address to another
  • Deploying a smart contract to the network
  • Reading a value from the deployed smart contract
  • Updating a value in the deployed smart contract
  • Viewing an event logged by the smart contract

Background

This application has purposefully been kept as simple as possible with the aim of demonstrating how to deploy and work with a smart contract on the decentralised Ethereum network.

If you require further background information about the above configuration items for the project you can refer to the below.

For a more comprehensive overview, I recommend you read the Java Magazine Article, watch the YouTube talk, and read all of the documentation.

Smart contracts

The contained smart contract is based on the Greeter contract example, with the addition that the value stored in the Greeter can be modified.

The associated Java smart contract wrapper is named Greeter.

For more background on smart contracts, refer to the smart contracts section of the docs.

Infura

If you don't want to sign up to Infura, and would like to run a node yourself, there are instructions in the getting started section of the docs.

Testnets

For more information on the different Ethereum test networks (or testnets), refer to the testnet overview in the docs.

Ether

For background on Ether, refer to the transactions overview section of the docs.

Wallets and transaction signing

For a more technical overview of working with wallet files, refer to the Offline transaction signing section of the docs.

Viewing requests

A logback configuration is included in the project dependencies allowing the logging of protocol messages if required. To enable, simply change the following line in the logback configuration to read:

<logger name="org.web3j.protocol" level="DEBUG"/>

More Repositories

1

web3j

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

web3j-spring-boot-starter

Spring Boot Starter for web3j
Java
227
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