by Anton Nashatyrev
Ethereum(J) is the library that can be embedded in any Java/Scala project and to provide full support for Ethereum protocol and sub services
Starting from the earlier 1.2.0 Release Candidate EthereumJ is 100% Homestead compatible
Solidity compiler is now embedded into EthereumJ
Using Solidity contracts is now pretty easy from Java as we embedded
solc compiler (thanks to our collegues from Ethereum-cpp team) into EthereumJ for all supported platforms (Windows, Linux, Mac OS X).
For usage sample please refer to a simple JUnit test: CompilerTest
Handy helper classes to create/invoke/test contracts on a local standalone blockchain
As a next step after embedding the Solidity compiler we added some handy and easy to use helper classes. Now creating and testing a Solidity contract in Java without connecting to any Ethereum network became incredibly easy.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
You may cover any complex Solidity contract with Java unit tests and debug the EVM execution in any complex case.
Performance and memory footprint optimization
We further optimized performance and now first 1M blocks can be imported in less than 1 hour (depending on the hardware). Memory footprint had been also reduced and the node could now be started with
-Xmx256M (with some config changes).
More stable node run
We have fixed amount of bugs, refactored blockchain sync process and made it more reliable, upgraded Windows
LevelDB version to
1.18 (which fixed periodical DB crash)
Adding as maven artifact to your project:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
1 2 3 4 5 6 7
As a starting point for your own project take a look at https://github.com/ether-camp/ethereumj.starter
Running from command line:
1 2 3
Importing project to IntelliJ IDEA:
1 2 3
* File -> New -> Project from existing sources…
* Dialog “Import Project from gradle”: press “OK”
* After building run either
org.ethereum.Start, one of
org.ethereum.samples.* or create your own main.
For reference on all existing options, their description and defaults you may refer to the default config
ethereumj.conf (you may find it in either the library jar or in the source tree
To override needed options you may use one of the following ways:
- put your options to the
user.confto the root of your classpath (as a resource)
- put your options to any file and supply it via
- programmatically by using
- programmatically using by overriding Spring
Note that don’t need to put all the options to your custom config, just those you want to override.