bitcoinj

bitcoinj库是比特币协议的Java实现,它允许它维护钱包和发送/接收事务,而无需比特币核心的本地副本。(The bitcoinj library is a Java implementation of the Bitcoin protocol, which allows it to maintain a wallet and send/receive transactions without needing a local copy of Bitcoin Core.)

Github星跟蹤圖

欢迎使用bitcoinj

bitcoinj库是比特币协议的Java实现,它允许它维护钱包和发送/接收事务,而无需比特币核心的本地副本。 它附带完整的文档和一些示例应用程序,展示如何使用它。

技术

开始

要开始,最好安装最新的JDK和Maven。master 分支的HEAD包含最新的开发代码,并在功能分支上提供各种产品版本。

从命令行构建

执行完整版本的使用

mvn clean package

您也可以运行

mvn site:site

使用JavaDocs等有用的信息生成一个网站。

输出在 target 目录下。

从IDE构建

或者,只需使用IDE导入项目即可。 IntelliJ 具有内置的Maven集成功能,并且具有免费的Community Edition。只需使用 File | New | Project from Existing Sources,并在克隆的项目源代码树的根目录中找到 pom.xml 。

示例应用程序

这些可在 examples 模块中找到。

转发服务

这将下载区块链,并最终打印它生成的比特币地址。

如果您将硬币发送到该地址,它会将其转发到您指定的地址。

cd examples
mvn exec:java -Dexec.mainClass=org.bitcoinj.examples.ForwardingService -Dexec.args="<在此处插入比特币地址>"

请注意,此示例应用不使用检查点,因此初始链同步速度会很慢。您可以创建一个启动的应用程序,并通过包含检查点文件来快速完成初始同步;请参阅文档以了解有关此技术的更多信息。

下一站?

现在您已准备好按照教程进行操作。

主要指標

概覽
名稱與所有者bitcoinj/bitcoinj
主編程語言Java
編程語言Java (語言數: 5)
平台BSD, Cross-platform, Linux, Mac, Solaris, Unix-like, Windows
許可證Apache License 2.0
所有者活动
創建於2013-11-19 04:33:23
推送於2025-06-05 13:58:00
最后一次提交2025-05-24 11:18:57
發布數59
最新版本名稱v0.17 (發布於 2025-02-21 10:38:17)
第一版名稱v0.8 (發布於 2013-04-09 23:24:38)
用户参与
星數5.1k
關注者數306
派生數2.5k
提交數5.4k
已啟用問題?
問題數1251
打開的問題數336
拉請求數503
打開的拉請求數188
關閉的拉請求數1836
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?

Build Status Coverage Status

Visit our IRC channel

Welcome to bitcoinj

The bitcoinj library is a Java implementation of the Bitcoin protocol, which allows it to maintain a wallet and send/receive transactions without needing a local copy of Bitcoin Core. It comes with full documentation and some example apps showing how to use it.

Technologies

  • Java 7+ and Gradle 4.4+ for the core module
  • Java 8+ and Gradle 4.4+ for tools and examples
  • Java 11+ and Gradle 4.10+ for the JavaFX-based wallettemplate
  • Gradle - for building the project
  • Google Protocol Buffers - for use with serialization and hardware communications

Getting started

To get started, it is best to have the latest JDK and Gradle installed. The HEAD of the master branch contains the latest development code and various production releases are provided on feature branches.

Building from the command line

Official builds are currently using with JDK 8, even though the core module is compatible with JDK 7 and later.

To perform a full build (including JavaDocs and unit/integration tests) use JDK 8+

gradle clean build

If you are running JDK 11 or later and Gradle 4.10 or later, the build will automatically include the JavaFX-based wallettemplate module. The outputs are under the build directory.

To perform a full build without unit/integration tests use:

gradle clean assemble

Building from an IDE

Alternatively, just import the project using your IDE. IntelliJ has Gradle integration built-in and has a free Community Edition. Simply use File, New, Project from Existing Sources and locate the build.gradle in the root of the cloned project source tree.

Example applications

These are found in the examples module.

Where next?

Now you are ready to follow the tutorial.

Testing a SNAPSHOT build

Building apps with official releases of bitcoinj is covered in the tutorial.

If you want to develop or test your app with a Jitpack-powered build of the latest master or release-0.15 branch of bitcoinj follow the dynamically-generated instructions for that branch by following the correct link.