Web3j Community Update

We’ve spent a good chunk of 2020 with our heads down continually investing in Web3j to improve the Ethereum developer experience for Java and Android developers. This has always been an area close to my heart, and we’ve been fortunate enough to secure funding from the Ethereum Foundation to help supercharge this work.

In this post, I’m going to provide an update on all of the awesome things we’ve been doing over the past few months!

Web3j Documentation Updates

We’ve spent time going through the Web3j documentation restructuring it to make it as user friendly as possible. One of the questions we are always asking ourselves is how to ensure those new to Web3j have the best possible experience when they get started with it. There are a lot of different concepts that people need to learn about Ethereum as well as how to use Web3j.

We’ve now added a new Quickstart page, which is supported by a Getting Started section that allows new users to walk through the process of a number of core concepts, such as running a node, deploying and interacting with a smart contract and working with events.

We’ve also added pages covering the other supplementary Web3j projects, including Web3j OpenAPI, Web3j Unit, Web3j EVM, Sokt plus the Gradle and Maven build plugins.

More complex topics are now contained under their own categories that covers concepts such as privacy techniques and some of the other Ethereum concepts such as ENS, RLP encoding and management APIs.

To complement the documentation updates, we’ve also started publishing Web3j Javadocs. We find that Javadocs are quite a divisive topic - developers either love them or ignore them, but either way as a serious developer framework, it’s important to cater for as many as possible here.

We hope that you’ll find this updated documentation really helpful for your journey with Web3j.

Web3j Solidity Library Dependency Management

One of the features that’s really been a major annoyance for developers writing smart contract code for Java and Android is the lack of dependency management for Solidity libraries. For example, when you want to use a reference ERC20 implementation such as OpenZepplin’s you need to copy and paste the relevant library dependencies into your project manually and then ensure that they are in the correct location to compile.

To solve this problem, we’ve now added support for pulling Solidity dependencies using the ‘@’ annotation so you can use any Solidity source code that has been published to an NPM repository. 

This means that all you need to do to write an ERC20 token is provide the following Solidity code:

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract ERC20Token is ERC20 { 
     constructor() ERC20(“My Token”, “MT”) public {
     }
}

Then using the Web3j Gradle plugin it will take care of pulling down all Solidity dependencies, pulling down a Solidity compiler, generating your Java smart contract wrappers, and even creating an OpenAPI service for it if you combine it with the Web3j OpenAPI plugin!!!

We’re really pleased about all of these smarts going on behind the scenes now. If you’d like to learn more about the dependency management feature, you can check out this blog post and the documentation here.

Web3j Eth2

With the launch of the Eth2 Beacon Chain upon us, we also wanted to start making headway into supporting the new Eth2 network. Given the evolving nature of the Eth2 specs, it was important to wait until the specification had a degree of stability, which in the last few months it achieved.

As a result of this we’ve created the Web3j Eth2 project which is a full JVM client implementation of the Eth2 Beacon Node API using the clean and friendly Web3j syntax that developers are well accustomed to. You can read more about it in the following post, and the project documentation here.

Web3j OpenAPI

Although this isn’t a new piece of work, I wanted to remind everyone about the Web3j OpenAPI project which takes Solidity code and generates a runnable OpenAPI service for clients to deploy and interact with Solidity smart contracts. It’s an awesome piece of engineering which you can read more about in the following post and refer to the documentation here.

The Web3j Community

Finally I wanted to draw everyone’s attention to the Web3 Labs Community Forum where we encourage people to discuss anything to do with Web3j. There’s been a very active Gitter Community for the past few years, but we’d love it if users use the forum over a chat channel, as it enables discussions to form and develop around specific topics making it easier for everyone to contribute to and benefit from the discussion.

What’s Next?

We’ve got plenty more work planned over the coming months for Web3j, but I hope you’ve enjoyed learning more about what we’ve been up to - it’s amazing to see how far we’ve come. Thanks again to the Ethereum Foundation for their contributions to make this work happen - it’s really helped us supercharge the experience for developers.