[software engineering application and practice] JDchain data retrieval

Posted by yankeefan238 on Wed, 29 Dec 2021 22:28:42 +0100

2021SC@SDUSC

1.1. Penetrating retrieval
Penetrating retrieval directly retrieves the required data without re processing by the human brain. You can refer to the concept of Google OneBox. Because of the accuracy of its results, penetrating retrieval can provide accurate materials for big data and artificial intelligence, so as to help big data and artificial intelligence obtain more accurate results.

1.2. Why does blockchain need penetrating retrieval
Blockchain data is rigorous business data. The analysis of business data is conducive to the enhancement of business. At present, simple keyword search can not provide the required business information. In a specific business, the required data can be retrieved quickly and easily to provide support for business analysis. Provide basic data for artificial intelligence and other systems.

Assumptions:

It is assumed that the installed server ip for penetrating search is 192.168 151.40.
It is assumed that the JDChain blockchain gateway browser for penetrating retrieval docking is: http://192.168.151.39:18081
2.1. Install Argus data retrieval system
Unzip the data retrieval system installation package (jdchain-argus-0.8.4. Release. Zip) to the / export/jdchain folder. Download the installation package at: http://storage.jd.com/jd.block.chain/jdchain-argus-0.8.4.RELEASE.zip
Unzip jdchain-argus-0.8 4.RELEASE. zip –d argus

2.2. Installing DGraph database
Download dgraph v1 Version 0.16 and unzip it to the argus folder; Add the argus folder PATH in PATH. Installation package download address: https://github.com/dgraph-io/dgraph/releases/download/v1.0.16/dgraph-linux-amd64.tar.gz

2.3. Modify configuration environment

#URL of DGraph
DGRAPH_URL="127.0.0.1:9090"
#Host IP of ARGUS service
ARGUS_HOST="192.168.151.40"
#Port number used for advanced retrieval;
ARGUS_SEARCH_PORT="10001"
#Port number used for penetrating search;
ARGUS_INDEXER_PORT="8082"
#url corresponding to JDChain gateway
JDCHAIN_GW=http://jdchain-t.jd.com:8081## 2.4.  Start 'DGraph' service

Execute all. In the extracted file SH file and start the Dgraph service. The specific script contents are as follows:

nohup dgraph zero > dgraph_zero.log 2>&1 &
nohup dgraph alpha --lru_mb 1024 --zero localhost:5080 --port_offset 10 --log_dir dgraph_log > dgraph_alpha.log 2>&1 &

So far, the penetrating search service has been started.
3. Remarks
If the advanced retrieval and JDChain blockchain environments are deployed on different machines, the relevant parameters in the JDChain configuration need to be modified

In use, it is found that the user's installation path is Argus_ The path may be different from that in the zip package. An all. Path is provided below to facilitate modifying the configuration version SH, it is convenient for students who try to get what they need according to their own environmental requirements.

#!/usr/bin/env bash

#jdchain's gateway corresponding version: 1.1.2.RELEASE;
DGRAPH_URL="127.0.0.1:9090"
ARGUS_HOST="127.0.0.1"
ARGUS_SEARCH_PORT="10001"
ARGUS_INDEXER_PORT="8082"
JDCHAIN_GW="http://jdchain-t.jd.com:8081"
ARGUS_PATH="/jdchain/argus/argus"

#first download the Dgraph version   : v1.0.16
nohup dgraph zero > dgraph_zero.log 2>&1 &
sleep 2
nohup dgraph alpha --lru_mb 1024 --zero localhost:5080 --port_offset 10 --log_dir dgraph_log > dgraph_alpha.log 2>&1 &
sleep 8
$ARGUS_PATH schema-update  --dgraph $DGRAPH_URL
sleep 2
nohup $ARGUS_PATH api-server --host $ARGUS_HOST --port $ARGUS_SEARCH_PORT --dgraph $DGRAPH_URL --production true> api-server.out 2>&1 &
sleep 2
nohup $ARGUS_PATH task  --dgraph $DGRAPH_URL > task_monitor.log 2>&1 &
sleep 2
nohup $ARGUS_PATH ledger-rdf  --api $JDCHAIN_GW --dgraph $DGRAPH_URL  --production true > converter2.out 2>&1 &
sleep 2
nohup $ARGUS_PATH data  --ledger-host $JDCHAIN_GW --port $ARGUS_INDEXER_PORT --dgraph $DGRAPH_URL --production true > value_indexer.out 2>&1 &

Reference link:
https://zhuanlan.zhihu.com/p/101664039

Topics: Java