[Software Engineering and Practice] (1) Installation and deployment of jdchain, general understanding, division of labor within the group

2021SC@SDUSC

1. Download the jdchain source code installation package

Github link: https://gitee.com/jdchain/jdchain .
Official website link: https://ledger.jd.com .

2. Rapid deployment

1. Official complete steps

The JD Chain official website provides a detailed introduction to installation and deployment, which is relatively cumbersome, but it is the basis for other convenient networking methods.

2. Management tools

JD Chain provides an interface-based network initialization startup tool, and the related scripts are manager-startup.sh and manager-shutdown.sh.

Send the operation video: http://storage.jd.com/jd.block.chain/init-jdchain-by-manager-tool.mp4 .

3. Memory-based four-node network

Clone the source code of the JD Chain main project, and switch to the corresponding version branch
. Please refer to the introduction of the main project home page, which contains the introduction of sub-project code pull and project compilation and packaging. Execute under the code root path:

build/build.sh --update --skipTests
can complete all sub-project code pulls, complete compilation and packaging

Run the code under the Samples module.
Refer to the introduction of Samples and run the main method of the TestNet class in sdk-samples to start the memory-based four-node + single-gateway blockchain network environment. The browser address is http:// localhost:11000 .

The test cases in sdk-samples are based on the network environment configuration started by TestNet by default, and can be run directly. Covers most transaction type submissions and transaction queries.

4. Based on the installation package and deployment script

Download the JD Chain installation package.
The way to obtain the installation package:

Download and compile the JD Chain source code, and compile and package according to the instructions on the home page.
Visit the JD Chain official website to download, the version update may not be as fast as the source code.
Script initialization
Copy the testnet.sh script, save it locally, and set the executable permission

The script only passes the test in a specific linux environment. Different system environments may have shell statements or dependency differences. Please modify it as appropriate.
This script can generate multiple nodes and multiple accounts with one click. It is still quite rough at present
. - .RELEASE.zip, jdchain-gateway-.RELEASE.zip compressed package and testnet.sh script are placed in the same directory.

Running testnet.sh directly can automatically initialize the default four-node + single gateway environment, and generate scripts for one-click startup (start.sh) and shutdown (shutdown.sh).

Run start.sh to start the test network, refer to the JD Chain Samples introduction, configure the network environment parameters, and then you can quickly get started with the JD Chain SDK.

3. Understanding of jdchain

JD Chain has three types of nodes: Peer, gateway and client. The Peer node is the master node of the blockchain, participating in consensus and account book operations, etc.; the gateway node (GateWay) communicates with the Peer node, and is responsible for the blockchain browser and message delivery; the client communicates with the gateway, and can write or query the account book, etc. operate.

1. peer node

Bin related commands operate the directory, please configure the execution permission before using

keygen.sh identity generation tool

ledger-init.sh ledger initialization tool

peer-startup.sh node startup script

peer-shutdown.sh node shutdown script

manager-startup.sh management tool startup script

manager-shutdown.sh management tool shutdown script

config The configuration directory of the corresponding command

init
ledger.init
local.conf
bftsmart.config
keys

does not exist when decompressed, it will automatically create ***.priv .pub .pwd when executing the keygen.sh script

log4j2-peer.xml log4j2 configuration, can be modified and replaced according to the actual situation
`
ledger-binding.conf does not exist when decompressed, it will be generated after the ledger-init.sh script is successfully executed

docs related documents save directory

The libs project depends on third-party and non-system dependent packages to save the path

System project running system package save path

runtime does not exist when decompressed, and stores runtime data

manager management tool running package

logs log

2. gateway node

`JD Chain-gateway-${version}.zip, the structure of the installation package after decompression is as follows:
bin
startup.sh
startup script

shutdown.sh stops the script

config

gateway.conf gateway configuration

log4j2-gw.xml log4j2 configuration, can be modified and replaced according to the actual situation

The jar package path required for lib runtime

logs log

runtime does not exist when decompressed, and stores runtime data

Fourth, the division of labor within the group

Code module of jdchain

Our team divided the code into four modules and decided the task assignment in the form of lottery.
I was assigned to the third data ledger module , but if other modules are needed later, it will be marked.

Guess you like

Origin blog.csdn.net/weixin_45932150/article/details/120526948