EthereumJ

以太坊黄皮书的Java实现。 对于JSON-RPC和其他客户端功能,请检查Ethereum Harmony。(Java implementation of the Ethereum yellowpaper. For JSON-RPC and other client features check Ethereum Harmony)

  • Owner: ethereum/ethereumj
  • Platform: BSD, Cross-platform, Linux, Mac, Solaris, Unix-like, Windows
  • License:: GNU Lesser General Public License v3.0
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

欢迎来到ethereumj

关于

ethereumj是以太坊协议的纯Java实现。有关以太坊及其目标的更多信息,请访问ethereum.org 以太坊白皮书提供了一个完整的概念性概述,而黄皮书提供了协议的正式定义。

运行EthereumJ

添加为您的Maven项目的依赖项:
 <dependency>
     <groupId>org.ethereum</groupId>
     <artifactId>ethereumj-core</artifactId>
     <version>1.9.0-RELEASE</version>
   </dependency>
或您的Gradle项目:
repositories {
       mavenCentral()
       jcenter()
       maven { url "https://dl.bintray.com/ethereum/maven/" }
   }
   implementation "org.ethereum:ethereumj-core:1.9.+"

作为您自己项目的起点,请查看 https://github.com/ether-camp/ethereumj .starter

构建可执行JAR
git clone https://github.com/ethereum/ethereumj
cd ethereumj
cp ethereumj-core/src/main/resources/ethereumj.conf ethereumj-core/src/main/resources/user.conf
vim ethereumj-core/src/main/resources/user.conf # adjust user.conf to your needs
./gradlew clean fatJar
java -jar ethereumj-core/build/libs/ethereumj-core-*-all.jar
从命令行运行:
> git clone https://github.com/ethereum/ethereumj
> cd ethereumj
> ./gradlew run [-PmainClass=<sample class>]
可选示例尝试:
./gradlew run -PmainClass=org.ethereum.samples.BasicSample
./gradlew run -PmainClass=org.ethereum.samples.FollowAccount
./gradlew run -PmainClass=org.ethereum.samples.PendingStateSample
./gradlew run -PmainClass=org.ethereum.samples.PriceFeedSample
./gradlew run -PmainClass=org.ethereum.samples.PrivateMinerSample
./gradlew run -PmainClass=org.ethereum.samples.TestNetSample
./gradlew run -PmainClass=org.ethereum.samples.TransactionBomb
对于快照构建:

请注意,快照不稳定,目前正在开发中! 如果你还想尝试一下:

  • 增加 https://oss.jfrog.org/libs-snapshot/ 作为构建脚本的存储库
  • 添加依赖项 org.ethereum:ethereumj-core:${VERSION}, 其中 ${VERSION} 类似于 1.9.0-SNAPSHOT 这样的形式。

示例:

<repository>
    <id>jfrog-snapshots</id>
    <name>oss.jfrog.org</name>
    <url>https://oss.jfrog.org/libs-snapshot/</url>
    <snapshots><enabled>true</enabled></snapshots>
</repository>
<!-- ... -->
<dependency>
   <groupId>org.ethereum</groupId>
   <artifactId>ethereumj-core</artifactId>
   <version>1.9.0-SNAPSHOT</version>
</dependency>
将项目导入到IntelliJ IDEA:
> git clone https://github.com/ethereum/ethereumj
> cd ethereumj
> gradlew build

IDEA:

  • File -> New -> 来自现有资源的项目...
  • 选择ethereumj/build.gradle
  • 对话框“Import Project from gradle”:按“OK”
  • 在构建完成之后,运行 org.ethereum.Start , org.ethereum.samples.* 之一或创建自己的main。

配置EthereumJ

有关所有现有选项的参考,其描述和默认值,您可以参考默认配置 ethereumj.conf (您可以在库jar或源代码树中找到 ethereum -core/SRC /主/资源) 要覆盖需要的选项,您可以使用以下方法之一:

  • 将选项放入&lt;工作目录&gt; /config/ethereumj.conf 文件
  • 将 user.conf 放到您的类路径的根目录下(作为资源)
  • 将您的选项放在任何文件中,并通过 -Dethereumj.conf.file=<config1>,<config2>
  • 以编程方式使用 SystemProperties.CONFIG.override*()
  • 通过覆盖 SpringSystemProperties bean 以编程方式使用

请注意,不需要将所有选项都放到您的自定义配置中,只需要将其覆盖即可。

特别感谢

YourKit绝对免费为我们提供了漂亮的分析器。

YourKit通过其全功能的Java Profiler支持开源项目。

YourKit,LLC是 YourKit Java Profiler 的创建者 和 YourKit .NET Profiler , 创新和智能工具来分析Java和.NET应用程序。

联系

通过 Gitter 与我们聊天

许可证

ethereumj是根据 LGPL-V3许可证发布的。

Main metrics

Overview
Name With Ownerethereum/ethereumj
Primary LanguageJava
Program languageJava (Language Count: 2)
PlatformBSD, Cross-platform, Linux, Mac, Solaris, Unix-like, Windows
License:GNU Lesser General Public License v3.0
所有者活动
Created At2014-05-13 07:50:14
Pushed At2022-02-24 15:16:54
Last Commit At2019-04-09 15:34:49
Release Count50
Last Release Name1.12.0 (Posted on )
First Release Name0.5.7 (Posted on )
用户参与
Stargazers Count2.2k
Watchers Count237
Fork Count1.1k
Commits Count5.2k
Has Issues Enabled
Issues Count572
Issue Open Count82
Pull Requests Count478
Pull Requests Open Count10
Pull Requests Close Count140
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Welcome to ethereumj

Gitter
Build Status
Coverage Status

:no_entry: Deprecated :no_entry:

This project is not supported anymore. If you have any question or would like to contribute find us on Gitter.

About

EthereumJ is a pure-Java implementation of the Ethereum protocol. For high-level information about Ethereum and its goals, visit ethereum.org. The ethereum white paper provides a complete conceptual overview, and the yellow paper provides a formal definition of the protocol.

We keep EthereumJ as thin as possible. For JSON-RPC support and other client features check Ethereum Harmony.

Running EthereumJ

Adding as a dependency to your Maven project:
   <dependency>
     <groupId>org.ethereum</groupId>
     <artifactId>ethereumj-core</artifactId>
     <version>1.12.0-RELEASE</version>
   </dependency>
or your Gradle project:
   repositories {
       mavenCentral()
       jcenter()
       maven { url "https://dl.bintray.com/ethereum/maven/" }
   }
   implementation "org.ethereum:ethereumj-core:1.9.+"

As a starting point for your own project take a look at https://github.com/ether-camp/ethereumj.starter

Building an executable JAR
git clone https://github.com/ethereum/ethereumj
cd ethereumj
cp ethereumj-core/src/main/resources/ethereumj.conf ethereumj-core/src/main/resources/user.conf
vim ethereumj-core/src/main/resources/user.conf # adjust user.conf to your needs
./gradlew clean fatJar
java -jar ethereumj-core/build/libs/ethereumj-core-*-all.jar
Running from command line:
> git clone https://github.com/ethereum/ethereumj
> cd ethereumj
> ./gradlew run [-PmainClass=<sample class>]
Optional samples to try:
./gradlew run -PmainClass=org.ethereum.samples.BasicSample
./gradlew run -PmainClass=org.ethereum.samples.FollowAccount
./gradlew run -PmainClass=org.ethereum.samples.PendingStateSample
./gradlew run -PmainClass=org.ethereum.samples.PriceFeedSample
./gradlew run -PmainClass=org.ethereum.samples.PrivateMinerSample
./gradlew run -PmainClass=org.ethereum.samples.TestNetSample
./gradlew run -PmainClass=org.ethereum.samples.TransactionBomb
For snapshot builds:

Please, note, snapshots are not stable and are currently in development! If you still want to try it:

  • Add https://oss.jfrog.org/libs-snapshot/ as a repository to your build script
  • Add a dependency on org.ethereum:ethereumj-core:${VERSION}, where ${VERSION} is of the form 1.13.0-SNAPSHOT.

Example:

<repository>
    <id>jfrog-snapshots</id>
    <name>oss.jfrog.org</name>
    <url>https://oss.jfrog.org/libs-snapshot/</url>
    <snapshots><enabled>true</enabled></snapshots>
</repository>
<!-- ... -->
<dependency>
   <groupId>org.ethereum</groupId>
   <artifactId>ethereumj-core</artifactId>
   <version>1.13.0-SNAPSHOT</version>
</dependency>
Importing project to IntelliJ IDEA:
> git clone https://github.com/ethereum/ethereumj
> cd ethereumj
> gradlew build

IDEA:

  • File -> New -> Project from existing sources…
  • Select ethereumj/build.gradle
  • Dialog “Import Project from gradle”: press “OK”
  • After building run either org.ethereum.Start, one of org.ethereum.samples.* or create your own main.

Configuring EthereumJ

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 ethereum-core/src/main/resources)
To override needed options you may use one of the following ways:

  • put your options to the <working dir>/config/ethereumj.conf file
  • put user.conf to the root of your classpath (as a resource)
  • put your options to any file and supply it via -Dethereumj.conf.file=<your config>, accepts several configs, separated by comma applied in provided order: -Dethereumj.conf.file=<config1>,<config2>
  • programmatically by using SystemProperties.CONFIG.override*()
  • programmatically using by overriding Spring SystemProperties bean

Note that don’t need to put all the options to your custom config, just those you want to override.

Special thanks

YourKit for providing us with their nice profiler absolutely for free.

YourKit supports open source projects with its full-featured Java Profiler.
YourKit, LLC is the creator of YourKit Java Profiler
and YourKit .NET Profiler,
innovative and intelligent tools for profiling Java and .NET applications.

YourKit Logo

Contact

Chat with us via Gitter

License

ethereumj is released under the LGPL-V3 license.