MyEclipse running bitcoin full node Bitcoinj

Source: Internet
Author: User
Tags serialization

Bitcoinj is the Java implementation of the Bitcoin full node. Unlike the C + + implementation, which is officially recommended by Bitcoin, there is no built-in RPC or command-line interaction at this time.

Its functional interaction is manifested by several example examples, tool, and Walletkit.

For learning or development zone block chain, reading bitcoin source code, understanding its operating principle, learning its development process is a very good way.

Installation Preparation Work
    1. Installing Gradle,gradle is a project building tool, similar to Maven,bitcoinj is built with Gradle.
    2. Install Javafx,javafx is a set of Java graphical Interface library, Bitcoinj in the wallet instance is the interface written in JavaFX.
    3. Installing Protobuf,google Protocol Buffer (abbreviated as PROTOBUF) is a mixed-language data standard within Google Inc. is a lightweight and efficient structured data storage format that can be used for structured data serialization, or serializing. It is ideal for data storage or RPC data interchange formats. It can be used in the communication protocol, data storage and other fields of the language-independent, platform-independent, extensible serialization structure data format. It will also be used in Bitcoinj. Download Bitcoinj

      : Https://github.com/bitcoinj/bitcoinj
      Download the zip package directly to unzip it.

In MyEclipse, select:

Import -> Gradle -> Existing Gradle Project

Select the Bitcoinj directory that you just unzipped in project root directory. The following items will appear after the import is successful:

> bitcoinj> core                # 全节点功能实现> examples            # 几个调用core的例子> tools               # 小工具> walletettemplate    # 一款图形化的wallet
Execute PROTOC to generate related Java files

Many articles on the internet did not mention this point, just import Bitcoinj, the project in many places will be error, because some Java files need to Protoc to generate.

Under command line, enter the following directory Bitcoinj

core -> src -> main -> proto

You can see the following files:

paymentchannel.protopaymentrequest.protopeerseeds.protostoredclientpaymentchannel.protostoredserverpaymentchannel.protowallet.proto

Execute the following command:

protoc --java_out=../java paymentchannel.proto

Each file executes once, in the Java directory in the corresponding package will generate the corresponding Java files, and then refresh the entire project, will no longer error.

MyEclipse running bitcoin full node Bitcoinj

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.