diff --git a/source/base/src/main/resources/log4j2.xml b/source/base/src/main/resources/log4j2.xml
deleted file mode 100644
index 26f090d7..00000000
--- a/source/base/src/main/resources/log4j2.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/source/deployment/deployment-gateway/src/main/resources/scripts/startup.sh b/source/deployment/deployment-gateway/src/main/resources/scripts/startup.sh
index db75a6ad..44a1a528 100644
--- a/source/deployment/deployment-gateway/src/main/resources/scripts/startup.sh
+++ b/source/deployment/deployment-gateway/src/main/resources/scripts/startup.sh
@@ -5,5 +5,5 @@ GATEWAY=$(ls $HOME/lib | grep deployment-gateway-)
if [ ! -n "$GATEWAY" ]; then
echo "GateWay Is Null !!!"
else
- nohup java -jar -server $HOME/lib/$GATEWAY -c $HOME/config/gateway.conf $* > gw.out 2>&1 &
+ nohup java -jar -server -Dgateway.log=$HOME $HOME/lib/$GATEWAY -c $HOME/config/gateway.conf $* >$HOME/bin/gw.out 2>&1 &
fi
\ No newline at end of file
diff --git a/source/deployment/deployment-peer/src/main/resources/scripts/ledger-init.sh b/source/deployment/deployment-peer/src/main/resources/scripts/ledger-init.sh
index d0c3f5f2..660676e8 100644
--- a/source/deployment/deployment-peer/src/main/resources/scripts/ledger-init.sh
+++ b/source/deployment/deployment-peer/src/main/resources/scripts/ledger-init.sh
@@ -5,5 +5,5 @@ boot_file=$(ls $HOME/libs | grep tools-initializer-booter-)
if [ ! -n "$boot_file" ]; then
echo "tools-initializer-booter is null"
else
- java -jar $HOME/libs/$boot_file -l $HOME/config/init/local.conf -i $HOME/config/init/ledger.init $*
-fi
+ java -jar -server -Dinit.log=$HOME $HOME/libs/$boot_file -l $HOME/config/init/local.conf -i $HOME/config/init/ledger.init $*
+fi
\ No newline at end of file
diff --git a/source/deployment/deployment-peer/src/main/resources/scripts/startup.sh b/source/deployment/deployment-peer/src/main/resources/scripts/startup.sh
index 371b8d78..d0fdd3d5 100644
--- a/source/deployment/deployment-peer/src/main/resources/scripts/startup.sh
+++ b/source/deployment/deployment-peer/src/main/resources/scripts/startup.sh
@@ -5,5 +5,5 @@ PEER=$(ls $HOME/system | grep deployment-peer-)
if [ ! -n "$PEER" ]; then
echo "Peer Is Null !!!"
else
- nohup java -jar -server -Xmx2g -Xms2g $HOME/system/$PEER -home=$HOME -c $HOME/config/ledger-binding.conf -p 7080 $* &
+ nohup java -jar -server -Xmx2g -Xms2g -Dpeer.log=$HOME $HOME/system/$PEER -home=$HOME -c $HOME/config/ledger-binding.conf -p 7080 $* >$HOME/bin/peer.out 2>&1 &
fi
\ No newline at end of file
diff --git a/source/gateway/src/main/resources/log4j2.xml b/source/gateway/src/main/resources/log4j2.xml
index d81fe1dc..6b49c3e9 100644
--- a/source/gateway/src/main/resources/log4j2.xml
+++ b/source/gateway/src/main/resources/log4j2.xml
@@ -13,12 +13,12 @@
-
+
-
+
@@ -27,8 +27,8 @@
-
+
@@ -38,8 +38,8 @@
-
+
@@ -51,7 +51,7 @@
-
+
diff --git a/source/peer/src/main/java/com/jd/blockchain/peer/PeerServerBooter.java b/source/peer/src/main/java/com/jd/blockchain/peer/PeerServerBooter.java
index 8e7811a0..aba98521 100644
--- a/source/peer/src/main/java/com/jd/blockchain/peer/PeerServerBooter.java
+++ b/source/peer/src/main/java/com/jd/blockchain/peer/PeerServerBooter.java
@@ -58,8 +58,12 @@ public class PeerServerBooter {
if (ledgerBindConfigFile == null) {
ConsoleUtils.info("Load build-in default configuration ...");
ClassPathResource configResource = new ClassPathResource("ledger-binding.conf");
- InputStream in = configResource.getInputStream();
- ledgerBindingConfig = LedgerBindingConfig.resolve(in);
+
+ try (InputStream in = configResource.getInputStream()) {
+ ledgerBindingConfig = LedgerBindingConfig.resolve(in);
+ } catch (Exception e) {
+ throw e;
+ }
} else {
ConsoleUtils.info("Load configuration,ledgerBindConfigFile position="+ledgerBindConfigFile);
File file = new File(ledgerBindConfigFile);
diff --git a/source/peer/src/main/java/com/jd/blockchain/peer/web/PeerTimeTasks.java b/source/peer/src/main/java/com/jd/blockchain/peer/web/PeerTimeTasks.java
index 698fb584..dc5c77ec 100644
--- a/source/peer/src/main/java/com/jd/blockchain/peer/web/PeerTimeTasks.java
+++ b/source/peer/src/main/java/com/jd/blockchain/peer/web/PeerTimeTasks.java
@@ -107,14 +107,17 @@ public class PeerTimeTasks implements ApplicationContextAware {
}
private LedgerBindingConfig loadLedgerBindingConfig() throws Exception {
- LedgerBindingConfig ledgerBindingConfig;
+ LedgerBindingConfig ledgerBindingConfig = null;
ledgerBindConfigFile = PeerServerBooter.ledgerBindConfigFile;
LOGGER.debug("Load LedgerBindConfigFile path = {}",
ledgerBindConfigFile == null ? "Default" : ledgerBindConfigFile);
if (ledgerBindConfigFile == null) {
ClassPathResource configResource = new ClassPathResource("ledger-binding.conf");
- InputStream in = configResource.getInputStream();
- ledgerBindingConfig = LedgerBindingConfig.resolve(in);
+ try (InputStream in = configResource.getInputStream()) {
+ ledgerBindingConfig = LedgerBindingConfig.resolve(in);
+ } catch (Exception e) {
+ throw e;
+ }
} else {
File file = new File(ledgerBindConfigFile);
ledgerBindingConfig = LedgerBindingConfig.resolve(file);
diff --git a/source/peer/src/main/resources/log4j2.xml b/source/peer/src/main/resources/log4j2.xml
index b3630520..3f7b9d7a 100644
--- a/source/peer/src/main/resources/log4j2.xml
+++ b/source/peer/src/main/resources/log4j2.xml
@@ -13,12 +13,12 @@
-
+
-
+
@@ -27,8 +27,8 @@
-
+
@@ -38,8 +38,8 @@
-
+
@@ -51,7 +51,7 @@
-
+
diff --git a/source/sdk/sdk-samples/src/main/java/com/jd/blockchain/sdk/samples/SDKDemo_Constant.java b/source/sdk/sdk-samples/src/main/java/com/jd/blockchain/sdk/samples/SDKDemo_Constant.java
index 3ee48e47..f0237cec 100644
--- a/source/sdk/sdk-samples/src/main/java/com/jd/blockchain/sdk/samples/SDKDemo_Constant.java
+++ b/source/sdk/sdk-samples/src/main/java/com/jd/blockchain/sdk/samples/SDKDemo_Constant.java
@@ -7,37 +7,37 @@ import java.io.File;
public class SDKDemo_Constant {
- public static final String GW_IPADDR = "127.0.0.1";
-// public static final String GW_IPADDR = "192.168.151.41";
-
- public static final int GW_PORT = 11000;
-// public static final int GW_PORT = 18081;
-
- public static final String[] PUB_KEYS = {
- "3snPdw7i7PjVKiTH2VnXZu5H8QmNaSXpnk4ei533jFpuifyjS5zzH9",
- "3snPdw7i7PajLB35tEau1kmixc6ZrjLXgxwKbkv5bHhP7nT5dhD9eX",
- "3snPdw7i7PZi6TStiyc6mzjprnNhgs2atSGNS8wPYzhbKaUWGFJt7x",
- "3snPdw7i7PifPuRX7fu3jBjsb3rJRfDe9GtbDfvFJaJ4V4hHXQfhwk"};
-
- public static final String[] PRIV_KEYS = {
- "177gjzHTznYdPgWqZrH43W3yp37onm74wYXT4v9FukpCHBrhRysBBZh7Pzdo5AMRyQGJD7x",
- "177gju9p5zrNdHJVEQnEEKF4ZjDDYmAXyfG84V5RPGVc5xFfmtwnHA7j51nyNLUFffzz5UT",
- "177gjtwLgmSx5v1hFb46ijh7L9kdbKUpJYqdKVf9afiEmAuLgo8Rck9yu5UuUcHknWJuWaF",
- "177gk1pudweTq5zgJTh8y3ENCTwtSFsKyX7YnpuKPo7rKgCkCBXVXh5z2syaTCPEMbuWRns"};
+// public static final String GW_IPADDR = "127.0.0.1";
+ public static final String GW_IPADDR = "192.168.151.41";
+// public static final int GW_PORT = 11000;
+ public static final int GW_PORT = 18081;
// public static final String[] PUB_KEYS = {
-// "3snPdw7i7PXvEDgq96QyzcKhfWL4mgYspzKwvgXiuAidWb2rkRMgDY",
+// "3snPdw7i7PjVKiTH2VnXZu5H8QmNaSXpnk4ei533jFpuifyjS5zzH9",
// "3snPdw7i7PajLB35tEau1kmixc6ZrjLXgxwKbkv5bHhP7nT5dhD9eX",
// "3snPdw7i7PZi6TStiyc6mzjprnNhgs2atSGNS8wPYzhbKaUWGFJt7x",
// "3snPdw7i7PifPuRX7fu3jBjsb3rJRfDe9GtbDfvFJaJ4V4hHXQfhwk"};
//
// public static final String[] PRIV_KEYS = {
-// "177gjsxj2ezADGthZ4tGqWeCAqRAwtNvesPjRnyKqCb1huU8LKZmJ3HGZNMPKWQJK3DP1B2",
+// "177gjzHTznYdPgWqZrH43W3yp37onm74wYXT4v9FukpCHBrhRysBBZh7Pzdo5AMRyQGJD7x",
// "177gju9p5zrNdHJVEQnEEKF4ZjDDYmAXyfG84V5RPGVc5xFfmtwnHA7j51nyNLUFffzz5UT",
// "177gjtwLgmSx5v1hFb46ijh7L9kdbKUpJYqdKVf9afiEmAuLgo8Rck9yu5UuUcHknWJuWaF",
// "177gk1pudweTq5zgJTh8y3ENCTwtSFsKyX7YnpuKPo7rKgCkCBXVXh5z2syaTCPEMbuWRns"};
+
+ public static final String[] PUB_KEYS = {
+ "3snPdw7i7PXvEDgq96QyzcKhfWL4mgYspzKwvgXiuAidWb2rkRMgDY",
+ "3snPdw7i7PajLB35tEau1kmixc6ZrjLXgxwKbkv5bHhP7nT5dhD9eX",
+ "3snPdw7i7PZi6TStiyc6mzjprnNhgs2atSGNS8wPYzhbKaUWGFJt7x",
+ "3snPdw7i7PifPuRX7fu3jBjsb3rJRfDe9GtbDfvFJaJ4V4hHXQfhwk"};
+
+ public static final String[] PRIV_KEYS = {
+ "177gjsxj2ezADGthZ4tGqWeCAqRAwtNvesPjRnyKqCb1huU8LKZmJ3HGZNMPKWQJK3DP1B2",
+ "177gju9p5zrNdHJVEQnEEKF4ZjDDYmAXyfG84V5RPGVc5xFfmtwnHA7j51nyNLUFffzz5UT",
+ "177gjtwLgmSx5v1hFb46ijh7L9kdbKUpJYqdKVf9afiEmAuLgo8Rck9yu5UuUcHknWJuWaF",
+ "177gk1pudweTq5zgJTh8y3ENCTwtSFsKyX7YnpuKPo7rKgCkCBXVXh5z2syaTCPEMbuWRns"};
+
public static final String PASSWORD = "abc";
public static final byte[] readChainCodes(String contractZip) {
diff --git a/source/sdk/sdk-samples/src/main/java/com/jd/blockchain/sdk/samples/SDK_Threads_KvInsert_Demo.java b/source/sdk/sdk-samples/src/main/java/com/jd/blockchain/sdk/samples/SDK_Threads_KvInsert_Demo.java
new file mode 100644
index 00000000..c4924af3
--- /dev/null
+++ b/source/sdk/sdk-samples/src/main/java/com/jd/blockchain/sdk/samples/SDK_Threads_KvInsert_Demo.java
@@ -0,0 +1,56 @@
+package com.jd.blockchain.sdk.samples;
+
+import com.jd.blockchain.ledger.*;
+import com.jd.blockchain.utils.codec.Base58Utils;
+
+import java.util.Random;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+public class SDK_Threads_KvInsert_Demo extends SDK_Base_Demo {
+
+ public static void main(String[] args) throws Exception {
+ new SDK_Threads_KvInsert_Demo().executeThreadsInsert();
+ }
+
+ public void executeThreadsInsert() throws Exception {
+
+ final int MAX = 30;
+
+ final String dataAddress = "LdeNqP4S88t1YjkGQaCGbX95ygD6hA2B6yjp6";
+
+ ExecutorService threadPool = Executors.newFixedThreadPool(50);
+
+ final CountDownLatch latch = new CountDownLatch(MAX);
+
+ for (int i = 0; i < MAX; i++) {
+
+ threadPool.execute(() -> {
+ TransactionTemplate txTemp = blockchainService.newTransaction(ledgerHash);
+
+ String key = System.currentTimeMillis() + "-" +
+ System.nanoTime() + "-" +
+ new Random(Thread.currentThread().getId()).nextInt(1024);
+
+ txTemp.dataAccount(dataAddress).setText(key,"value1",-1);
+
+ // TX 准备就绪
+ PreparedTransaction prepTx = txTemp.prepare();
+ prepTx.sign(adminKey);
+
+ // 提交交易;
+ TransactionResponse response = prepTx.commit();
+
+ System.out.printf("Key = %s, Result = %s \r\n", key, response.isSuccess());
+
+ latch.countDown();
+
+ });
+ }
+
+ latch.await();
+ System.out.println("It is Over !!!");
+ System.exit(0);
+ }
+}
diff --git a/source/test/test-integration/runtime/LdeNezHHwrWNFYWF5n6RrbdyCoSPWZUreDhvv_0.mdl b/source/test/test-integration/runtime/LdeNezHHwrWNFYWF5n6RrbdyCoSPWZUreDhvv_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNezHHwrWNFYWF5n6RrbdyCoSPWZUreDhvv_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNf7W5SZ1Xh1KXoQcbPEdPDM21nUsEp8zFN_0.mdl b/source/test/test-integration/runtime/LdeNf7W5SZ1Xh1KXoQcbPEdPDM21nUsEp8zFN_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNf7W5SZ1Xh1KXoQcbPEdPDM21nUsEp8zFN_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNgxFpbzqTH3ZouX5vPv7A9M7pGWUjGJAan_0.mdl b/source/test/test-integration/runtime/LdeNgxFpbzqTH3ZouX5vPv7A9M7pGWUjGJAan_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNgxFpbzqTH3ZouX5vPv7A9M7pGWUjGJAan_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNhGKHXohv3Bme6YgqPkETVQwDetmNFcdPK_0.mdl b/source/test/test-integration/runtime/LdeNhGKHXohv3Bme6YgqPkETVQwDetmNFcdPK_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNhGKHXohv3Bme6YgqPkETVQwDetmNFcdPK_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNhpKuGE7bsrCsARipmdhFD7AGFFVkvzT6e_0.mdl b/source/test/test-integration/runtime/LdeNhpKuGE7bsrCsARipmdhFD7AGFFVkvzT6e_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNhpKuGE7bsrCsARipmdhFD7AGFFVkvzT6e_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNi3yqaJ5G3N2rGLZbXLXJ1XF6ajiyXbdkR_0.mdl b/source/test/test-integration/runtime/LdeNi3yqaJ5G3N2rGLZbXLXJ1XF6ajiyXbdkR_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNi3yqaJ5G3N2rGLZbXLXJ1XF6ajiyXbdkR_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNigyUzWXAySKzQH8W74sjXcQykK6Ss1eEH_0.mdl b/source/test/test-integration/runtime/LdeNigyUzWXAySKzQH8W74sjXcQykK6Ss1eEH_0.mdl
new file mode 100644
index 00000000..a161392e
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNigyUzWXAySKzQH8W74sjXcQykK6Ss1eEH_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNjhemDjb3aSg3SpMRzqUrhFZDygUNsKA3o_0.mdl b/source/test/test-integration/runtime/LdeNjhemDjb3aSg3SpMRzqUrhFZDygUNsKA3o_0.mdl
new file mode 100644
index 00000000..a161392e
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNjhemDjb3aSg3SpMRzqUrhFZDygUNsKA3o_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNkJg78L7L1KYv6Cqicqc5SmbCD9Y4bkpez_0.mdl b/source/test/test-integration/runtime/LdeNkJg78L7L1KYv6Cqicqc5SmbCD9Y4bkpez_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNkJg78L7L1KYv6Cqicqc5SmbCD9Y4bkpez_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNmcdMwTeQ73C6MsKbMxhFQ2XCh6bPz7p21_0.mdl b/source/test/test-integration/runtime/LdeNmcdMwTeQ73C6MsKbMxhFQ2XCh6bPz7p21_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNmcdMwTeQ73C6MsKbMxhFQ2XCh6bPz7p21_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNmnQmbpZS2QSXnJ73LeGDJmwkhDhyFsVjJ_0.mdl b/source/test/test-integration/runtime/LdeNmnQmbpZS2QSXnJ73LeGDJmwkhDhyFsVjJ_0.mdl
new file mode 100644
index 00000000..a161392e
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNmnQmbpZS2QSXnJ73LeGDJmwkhDhyFsVjJ_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNmpZN6vXC9i6pyhPpRxmBf7iiaPj7bhvN2_0.mdl b/source/test/test-integration/runtime/LdeNmpZN6vXC9i6pyhPpRxmBf7iiaPj7bhvN2_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNmpZN6vXC9i6pyhPpRxmBf7iiaPj7bhvN2_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNmzy486oNRSzhS2z7QRVvVswxCyaz65wys_0.mdl b/source/test/test-integration/runtime/LdeNmzy486oNRSzhS2z7QRVvVswxCyaz65wys_0.mdl
new file mode 100644
index 00000000..a161392e
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNmzy486oNRSzhS2z7QRVvVswxCyaz65wys_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNnDgXmyep22ZyabbdtdEzCjxFiM9nLDiby_0.mdl b/source/test/test-integration/runtime/LdeNnDgXmyep22ZyabbdtdEzCjxFiM9nLDiby_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNnDgXmyep22ZyabbdtdEzCjxFiM9nLDiby_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNnYU8txmjeRhi9rgiZSwAQHW632Q3rQZue_0.mdl b/source/test/test-integration/runtime/LdeNnYU8txmjeRhi9rgiZSwAQHW632Q3rQZue_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNnYU8txmjeRhi9rgiZSwAQHW632Q3rQZue_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNoENuwCi3bVbhmoFG4w5mggmPsgGtpZMtF_0.mdl b/source/test/test-integration/runtime/LdeNoENuwCi3bVbhmoFG4w5mggmPsgGtpZMtF_0.mdl
new file mode 100644
index 00000000..b9e41e1d
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNoENuwCi3bVbhmoFG4w5mggmPsgGtpZMtF_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNqAMP5kjnciodhTY6Pnf8o5qbBvFkEs25Q_0.mdl b/source/test/test-integration/runtime/LdeNqAMP5kjnciodhTY6Pnf8o5qbBvFkEs25Q_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNqAMP5kjnciodhTY6Pnf8o5qbBvFkEs25Q_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNqr3pRJGZQFTUQgSZ6onhi7FVFDHkUXwd5_0.mdl b/source/test/test-integration/runtime/LdeNqr3pRJGZQFTUQgSZ6onhi7FVFDHkUXwd5_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNqr3pRJGZQFTUQgSZ6onhi7FVFDHkUXwd5_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNrFwJSVujRK7RBizL46WC5cUtudARjfHvT_0.mdl b/source/test/test-integration/runtime/LdeNrFwJSVujRK7RBizL46WC5cUtudARjfHvT_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNrFwJSVujRK7RBizL46WC5cUtudARjfHvT_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNroewGwCBmwFMgxUrEY4WgMq4GA54N82r5_0.mdl b/source/test/test-integration/runtime/LdeNroewGwCBmwFMgxUrEY4WgMq4GA54N82r5_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNroewGwCBmwFMgxUrEY4WgMq4GA54N82r5_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNrpEqQFALAghHSLpjt2Zdx3k6SBqTCVsGA_0.mdl b/source/test/test-integration/runtime/LdeNrpEqQFALAghHSLpjt2Zdx3k6SBqTCVsGA_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNrpEqQFALAghHSLpjt2Zdx3k6SBqTCVsGA_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNsH2ZedzAohTe6xRRZQvKJt4geSFfhmaoX_0.mdl b/source/test/test-integration/runtime/LdeNsH2ZedzAohTe6xRRZQvKJt4geSFfhmaoX_0.mdl
new file mode 100644
index 00000000..a161392e
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNsH2ZedzAohTe6xRRZQvKJt4geSFfhmaoX_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNstg544ncLvc9D94ezXmPFYUq4QoPVkEYL_0.mdl b/source/test/test-integration/runtime/LdeNstg544ncLvc9D94ezXmPFYUq4QoPVkEYL_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNstg544ncLvc9D94ezXmPFYUq4QoPVkEYL_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNsxrjTsagkS53m7AWWKwnpvJ1YUGBGM3mC_0.mdl b/source/test/test-integration/runtime/LdeNsxrjTsagkS53m7AWWKwnpvJ1YUGBGM3mC_0.mdl
new file mode 100644
index 00000000..a161392e
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNsxrjTsagkS53m7AWWKwnpvJ1YUGBGM3mC_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNtFf3HuzSNV2oTyrdHW3XPtmKvHUWpBpyr_0.mdl b/source/test/test-integration/runtime/LdeNtFf3HuzSNV2oTyrdHW3XPtmKvHUWpBpyr_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNtFf3HuzSNV2oTyrdHW3XPtmKvHUWpBpyr_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNtM6R2N5wMgUQw1jDyUZ8gHbaVDFgyMAVN_0.mdl b/source/test/test-integration/runtime/LdeNtM6R2N5wMgUQw1jDyUZ8gHbaVDFgyMAVN_0.mdl
new file mode 100644
index 00000000..b9e41e1d
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNtM6R2N5wMgUQw1jDyUZ8gHbaVDFgyMAVN_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNtY59RJyvx45bj6fjkDocBGB9Nc7Sf4ymf_0.mdl b/source/test/test-integration/runtime/LdeNtY59RJyvx45bj6fjkDocBGB9Nc7Sf4ymf_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNtY59RJyvx45bj6fjkDocBGB9Nc7Sf4ymf_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNu29NacEbeEKCXpDAu1BcU1R54gYVKpJBX_0.mdl b/source/test/test-integration/runtime/LdeNu29NacEbeEKCXpDAu1BcU1R54gYVKpJBX_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNu29NacEbeEKCXpDAu1BcU1R54gYVKpJBX_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNuRZEjx2UN1nmcmGwdx1AqFc3uFaHrKtjX_0.mdl b/source/test/test-integration/runtime/LdeNuRZEjx2UN1nmcmGwdx1AqFc3uFaHrKtjX_0.mdl
new file mode 100644
index 00000000..a161392e
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNuRZEjx2UN1nmcmGwdx1AqFc3uFaHrKtjX_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNv7SiL1nujKFuns1cGmWiaKD49jryjcYeH_0.mdl b/source/test/test-integration/runtime/LdeNv7SiL1nujKFuns1cGmWiaKD49jryjcYeH_0.mdl
new file mode 100644
index 00000000..a161392e
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNv7SiL1nujKFuns1cGmWiaKD49jryjcYeH_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNveXpq25eUxab6N21rJgg4cw7BXvKfm2LV_0.mdl b/source/test/test-integration/runtime/LdeNveXpq25eUxab6N21rJgg4cw7BXvKfm2LV_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNveXpq25eUxab6N21rJgg4cw7BXvKfm2LV_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNvfeFwgRQxftBuUpekDCZJMLFwbWxXpzri_0.mdl b/source/test/test-integration/runtime/LdeNvfeFwgRQxftBuUpekDCZJMLFwbWxXpzri_0.mdl
new file mode 100644
index 00000000..a161392e
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNvfeFwgRQxftBuUpekDCZJMLFwbWxXpzri_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNvpJH7no46KQpnyFyNnR7fxT3hWsUrYdgz_0.mdl b/source/test/test-integration/runtime/LdeNvpJH7no46KQpnyFyNnR7fxT3hWsUrYdgz_0.mdl
new file mode 100644
index 00000000..a161392e
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNvpJH7no46KQpnyFyNnR7fxT3hWsUrYdgz_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNxXeWNfmRAXJX5xPSpgq6JArNrxsPDLgX3_0.mdl b/source/test/test-integration/runtime/LdeNxXeWNfmRAXJX5xPSpgq6JArNrxsPDLgX3_0.mdl
new file mode 100644
index 00000000..a161392e
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNxXeWNfmRAXJX5xPSpgq6JArNrxsPDLgX3_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNxd6yNub5qWhB49eBPGKnwNf5smuhSShDb_0.mdl b/source/test/test-integration/runtime/LdeNxd6yNub5qWhB49eBPGKnwNf5smuhSShDb_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNxd6yNub5qWhB49eBPGKnwNf5smuhSShDb_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNxzTy6YegizyRKxA1EH87wYdHHBDMLqwSZ_0.mdl b/source/test/test-integration/runtime/LdeNxzTy6YegizyRKxA1EH87wYdHHBDMLqwSZ_0.mdl
new file mode 100644
index 00000000..0984c731
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNxzTy6YegizyRKxA1EH87wYdHHBDMLqwSZ_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNy5TGpQhi4pz8jNDX3wz3VABLPuGbcvLin_0.mdl b/source/test/test-integration/runtime/LdeNy5TGpQhi4pz8jNDX3wz3VABLPuGbcvLin_0.mdl
new file mode 100644
index 00000000..a161392e
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNy5TGpQhi4pz8jNDX3wz3VABLPuGbcvLin_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNz6SbUf9WZUFnkcZK3o2qYcTcLPvikMLJz_0.mdl b/source/test/test-integration/runtime/LdeNz6SbUf9WZUFnkcZK3o2qYcTcLPvikMLJz_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNz6SbUf9WZUFnkcZK3o2qYcTcLPvikMLJz_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNzBjCSBy9uQDyYqgiUkpm4zpe1Fs9gEhXK_0.mdl b/source/test/test-integration/runtime/LdeNzBjCSBy9uQDyYqgiUkpm4zpe1Fs9gEhXK_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNzBjCSBy9uQDyYqgiUkpm4zpe1Fs9gEhXK_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNzH3wcSNAJDX5RtaNKFxw6UQJMzdcRQUTp_0.mdl b/source/test/test-integration/runtime/LdeNzH3wcSNAJDX5RtaNKFxw6UQJMzdcRQUTp_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNzH3wcSNAJDX5RtaNKFxw6UQJMzdcRQUTp_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeNzJu2FYBNyZo9Ue757Chjj9vsxYFAnMHSS_0.mdl b/source/test/test-integration/runtime/LdeNzJu2FYBNyZo9Ue757Chjj9vsxYFAnMHSS_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeNzJu2FYBNyZo9Ue757Chjj9vsxYFAnMHSS_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeP11pE4f8TWU5DpqJJVnojuxScK4yRceAiX_0.mdl b/source/test/test-integration/runtime/LdeP11pE4f8TWU5DpqJJVnojuxScK4yRceAiX_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeP11pE4f8TWU5DpqJJVnojuxScK4yRceAiX_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeP1Vzbe3vbn8rjgoGN9FwRGyW6192PASjLS_0.mdl b/source/test/test-integration/runtime/LdeP1Vzbe3vbn8rjgoGN9FwRGyW6192PASjLS_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeP1Vzbe3vbn8rjgoGN9FwRGyW6192PASjLS_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeP2WzejQqJdREjbbpjTsNno863XTvjCemvL_0.mdl b/source/test/test-integration/runtime/LdeP2WzejQqJdREjbbpjTsNno863XTvjCemvL_0.mdl
new file mode 100644
index 00000000..a161392e
Binary files /dev/null and b/source/test/test-integration/runtime/LdeP2WzejQqJdREjbbpjTsNno863XTvjCemvL_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeP2o8X3tnzLUV5kvmnT1rU6tL48Mn9yKnSp_0.mdl b/source/test/test-integration/runtime/LdeP2o8X3tnzLUV5kvmnT1rU6tL48Mn9yKnSp_0.mdl
new file mode 100644
index 00000000..a161392e
Binary files /dev/null and b/source/test/test-integration/runtime/LdeP2o8X3tnzLUV5kvmnT1rU6tL48Mn9yKnSp_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeP3pQGeyQhZJxsHhBu48kaNwYKow4HvdAcA_0.mdl b/source/test/test-integration/runtime/LdeP3pQGeyQhZJxsHhBu48kaNwYKow4HvdAcA_0.mdl
new file mode 100644
index 00000000..ddf9c668
Binary files /dev/null and b/source/test/test-integration/runtime/LdeP3pQGeyQhZJxsHhBu48kaNwYKow4HvdAcA_0.mdl differ
diff --git a/source/test/test-integration/runtime/LdeP3sKx6RrxZVGoYdJAGUrttNMNwWU3JC2NV_0.mdl b/source/test/test-integration/runtime/LdeP3sKx6RrxZVGoYdJAGUrttNMNwWU3JC2NV_0.mdl
new file mode 100644
index 00000000..a161392e
Binary files /dev/null and b/source/test/test-integration/runtime/LdeP3sKx6RrxZVGoYdJAGUrttNMNwWU3JC2NV_0.mdl differ
diff --git a/source/tools/tools-initializer-booter/src/main/java/com/jd/blockchain/tools/initializer/boot/LedgerInitCommandBooter.java b/source/tools/tools-initializer-booter/src/main/java/com/jd/blockchain/tools/initializer/boot/LedgerInitCommandBooter.java
index 0f333e1d..1a25ac34 100644
--- a/source/tools/tools-initializer-booter/src/main/java/com/jd/blockchain/tools/initializer/boot/LedgerInitCommandBooter.java
+++ b/source/tools/tools-initializer-booter/src/main/java/com/jd/blockchain/tools/initializer/boot/LedgerInitCommandBooter.java
@@ -11,6 +11,8 @@ import java.util.List;
public class LedgerInitCommandBooter {
+ private static final String[] JAR_DIRS = new String[]{"libs", "system"};
+
public static void main(String[] args) {
// 加载当前包及../system包下的所有class
load();
@@ -32,7 +34,7 @@ public class LedgerInitCommandBooter {
Method method = URLClassLoader.class.getDeclaredMethod("addURL", URL.class);
boolean accessible = method.isAccessible();
try {
- if (accessible == false) {
+ if (!accessible) {
method.setAccessible(true);
}
// 获取系统类加载器
@@ -64,9 +66,12 @@ public class LedgerInitCommandBooter {
}
File file = new File(currPath);
loadJarFiles.addAll(dirJars(file));
- // 获取上级路径
- String systemPath = file.getParent() + File.separator + "system";
- loadJarFiles.addAll(dirJars(new File(systemPath)));
+
+ for (String jarDir : JAR_DIRS) {
+ // 获取上级路径
+ String jarPath = file.getParent() + File.separator + jarDir;
+ loadJarFiles.addAll(dirJars(new File(jarPath)));
+ }
} catch (Exception e) {
throw new RuntimeException(e);
}
diff --git a/source/tools/tools-initializer/src/main/java/com/jd/blockchain/tools/initializer/LedgerBindingConfig.java b/source/tools/tools-initializer/src/main/java/com/jd/blockchain/tools/initializer/LedgerBindingConfig.java
index 33fa7674..25fc6519 100644
--- a/source/tools/tools-initializer/src/main/java/com/jd/blockchain/tools/initializer/LedgerBindingConfig.java
+++ b/source/tools/tools-initializer/src/main/java/com/jd/blockchain/tools/initializer/LedgerBindingConfig.java
@@ -35,6 +35,8 @@ public class LedgerBindingConfig {
// Participant Attribute Key;
public static final String PARTI_ADDRESS = PARTI_PREFIX + "address";
+ // 参与方名称
+ public static final String PARTI_NAME = PARTI_PREFIX + "name";
public static final String PARTI_PK_PATH = PARTI_PREFIX + "pk-path";
public static final String PARTI_PK = PARTI_PREFIX + "pk";
public static final String PARTI_PASSWORD = PARTI_PREFIX + "pwd";
@@ -47,6 +49,9 @@ public class LedgerBindingConfig {
public static final String DB_CONN = DB_PREFIX + "uri";
public static final String DB_PASSWORD = DB_PREFIX + "pwd";
+ // 账本名字
+ public static final String LEDGER_NAME = "name";
+
// ------------------------------
private Map bindings = new LinkedHashMap<>();
@@ -89,6 +94,7 @@ public class LedgerBindingConfig {
for (int i = 0; i < hashs.length; i++) {
writeLine(builder, "#第 %s 个账本[%s]的配置;", i + 1, hashs[i].toBase58());
BindingConfig binding = getLedger(hashs[i]);
+ writeLedger(builder, hashs[i], binding);
writeParticipant(builder, hashs[i], binding);
writeDB(builder, hashs[i], binding);
writeLine(builder);
@@ -113,11 +119,14 @@ public class LedgerBindingConfig {
// 参与方配置;
String partiAddressKey = String.join(ATTR_SEPERATOR, ledgerPrefix, PARTI_ADDRESS);
String partiPkPathKey = String.join(ATTR_SEPERATOR, ledgerPrefix, PARTI_PK_PATH);
+ String partiNameKey = String.join(ATTR_SEPERATOR, ledgerPrefix, PARTI_NAME);
String partiPKKey = String.join(ATTR_SEPERATOR, ledgerPrefix, PARTI_PK);
String partiPwdKey = String.join(ATTR_SEPERATOR, ledgerPrefix, PARTI_PASSWORD);
writeLine(builder, "#账本的当前共识参与方的节点地址 Address;");
writeLine(builder, "%s=%s", partiAddressKey, stringOf(binding.getParticipant().getAddress()));
+ writeLine(builder, "#账本的当前共识参与方的节点名称 NodeName;");
+ writeLine(builder, "%s=%s", partiNameKey, stringOf(binding.getParticipant().getName()));
writeLine(builder, "#账本的当前共识参与方的私钥文件的保存路径;");
writeLine(builder, "%s=%s", partiPkPathKey, stringOf(binding.getParticipant().getPkPath()));
writeLine(builder, "#账本的当前共识参与方的私钥内容(Base58编码);如果指定了,优先选用此属性,其次是 pk-path 属性;");
@@ -140,6 +149,16 @@ public class LedgerBindingConfig {
writeLine(builder);
}
+ private void writeLedger(StringBuilder builder, HashDigest ledgerHash, BindingConfig binding) {
+ String ledgerPrefix = String.join(ATTR_SEPERATOR, BINDING_PREFIX, ledgerHash.toBase58());
+ // 账本相关信息配置;
+ String ledgerNameKey = String.join(ATTR_SEPERATOR, ledgerPrefix, LEDGER_NAME);
+
+ writeLine(builder, "#账本的名称;");
+ writeLine(builder, "%s=%s", ledgerNameKey, stringOf(binding.getLedgerName()));
+ writeLine(builder);
+ }
+
private static String stringOf(Object obj) {
if (obj == null) {
return "";
@@ -219,11 +238,12 @@ public class LedgerBindingConfig {
// 参与方配置;
String partiAddrKey = String.join(ATTR_SEPERATOR, ledgerPrefix, PARTI_ADDRESS);
String partiPkPathKey = String.join(ATTR_SEPERATOR, ledgerPrefix, PARTI_PK_PATH);
+ String partiNameKey = String.join(ATTR_SEPERATOR, ledgerPrefix, PARTI_NAME);
String partiPKKey = String.join(ATTR_SEPERATOR, ledgerPrefix, PARTI_PK);
String partiPwdKey = String.join(ATTR_SEPERATOR, ledgerPrefix, PARTI_PASSWORD);
- String strPartiAddr = getProperty(props, partiAddrKey, true);
- binding.participant.address = strPartiAddr;
+ binding.participant.address = getProperty(props, partiAddrKey, true);
+ binding.participant.name = getProperty(props, partiNameKey, true);
binding.participant.pkPath = getProperty(props, partiPkPathKey, false);
binding.participant.pk = getProperty(props, partiPKKey, false);
binding.participant.password = getProperty(props, partiPwdKey, false);
@@ -247,6 +267,10 @@ public class LedgerBindingConfig {
String.format("No db connection config of participant of ledger binding[%s]!", ledgerHash));
}
+ // 设置账本名称
+ String ledgerNameKey = String.join(ATTR_SEPERATOR, ledgerPrefix, LEDGER_NAME);
+ binding.ledgerName = getProperty(props, ledgerNameKey, true);
+
return binding;
}
@@ -296,6 +320,9 @@ public class LedgerBindingConfig {
public static class BindingConfig {
+ private String ledgerName;
+
+ // 账本名字
private ParticipantBindingConfig participant = new ParticipantBindingConfig();
private DBConnectionConfig dbConnection = new DBConnectionConfig();
@@ -308,18 +335,35 @@ public class LedgerBindingConfig {
return dbConnection;
}
+ public void setLedgerName(String ledgerName) {
+ this.ledgerName = ledgerName;
+ }
+
+ public String getLedgerName() {
+ return ledgerName;
+ }
}
public static class ParticipantBindingConfig {
private String address;
+ private String name;
+
private String pkPath;
private String pk;
private String password;
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
public String getAddress() {
return address;
}
diff --git a/source/tools/tools-initializer/src/main/java/com/jd/blockchain/tools/initializer/LedgerInitCommand.java b/source/tools/tools-initializer/src/main/java/com/jd/blockchain/tools/initializer/LedgerInitCommand.java
index 8077b6dc..4617076a 100644
--- a/source/tools/tools-initializer/src/main/java/com/jd/blockchain/tools/initializer/LedgerInitCommand.java
+++ b/source/tools/tools-initializer/src/main/java/com/jd/blockchain/tools/initializer/LedgerInitCommand.java
@@ -2,6 +2,8 @@ package com.jd.blockchain.tools.initializer;
import java.io.File;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -52,6 +54,8 @@ public class LedgerInitCommand {
private static final Prompter ANSWER_PROMPTER = new PresetAnswerPrompter("Y");
+ private static final Prompter LOG_PROMPTER = new LogPrompter();
+
/**
* 入口;
*
@@ -65,7 +69,7 @@ public class LedgerInitCommand {
try {
if (argSet.hasOption(MONITOR_OPT)) {
- prompter = ANSWER_PROMPTER;
+ prompter = LOG_PROMPTER;
}
ArgEntry localArg = argSet.getArg(LOCAL_ARG);
@@ -178,7 +182,14 @@ public class LedgerInitCommand {
// generate binding config;
BindingConfig bindingConf = new BindingConfig();
+
+ // 设置账本名称
+ bindingConf.setLedgerName(ledgerInitProperties.getLedgerName());
+
bindingConf.getParticipant().setAddress(ledgerInitProperties.getConsensusParticipant(currId).getAddress());
+ // 设置参与方名称
+ bindingConf.getParticipant().setName(ledgerInitProperties.getConsensusParticipant(currId).getName());
+
String encodedPrivKey = KeyGenCommand.encodePrivKey(privKey, base58Pwd);
bindingConf.getParticipant().setPk(encodedPrivKey);
bindingConf.getParticipant().setPassword(base58Pwd);
diff --git a/source/tools/tools-initializer/src/main/java/com/jd/blockchain/tools/initializer/LedgerInitProperties.java b/source/tools/tools-initializer/src/main/java/com/jd/blockchain/tools/initializer/LedgerInitProperties.java
index fa29ba71..9030eb77 100644
--- a/source/tools/tools-initializer/src/main/java/com/jd/blockchain/tools/initializer/LedgerInitProperties.java
+++ b/source/tools/tools-initializer/src/main/java/com/jd/blockchain/tools/initializer/LedgerInitProperties.java
@@ -25,6 +25,9 @@ public class LedgerInitProperties {
// 账本种子;
public static final String LEDGER_SEED = "ledger.seed";
+ // 账本名称
+ public static final String LEDGER_NAME = "ledger.name";
+
// 声明的账本建立时间;
public static final String CREATED_TIME = "created-time";
// 创建时间的格式;
@@ -61,6 +64,8 @@ public class LedgerInitProperties {
private byte[] ledgerSeed;
+ private String ledgerName;
+
private List consensusParticipants = new ArrayList<>();
private String consensusProvider;
@@ -75,6 +80,10 @@ public class LedgerInitProperties {
return ledgerSeed.clone();
}
+ public String getLedgerName() {
+ return ledgerName;
+ }
+
public long getCreatedTime() {
return createdTime;
}
@@ -159,6 +168,10 @@ public class LedgerInitProperties {
byte[] ledgerSeed = HexUtils.decode(hexLedgerSeed);
LedgerInitProperties initProps = new LedgerInitProperties(ledgerSeed);
+ // 账本名称
+ String ledgerName = PropertiesUtils.getRequiredProperty(props, LEDGER_NAME);
+ initProps.ledgerName = ledgerName;
+
// 创建时间;
String strCreatedTime = PropertiesUtils.getRequiredProperty(props, CREATED_TIME);
try {
diff --git a/source/tools/tools-initializer/src/main/java/com/jd/blockchain/tools/initializer/LogPrompter.java b/source/tools/tools-initializer/src/main/java/com/jd/blockchain/tools/initializer/LogPrompter.java
new file mode 100644
index 00000000..ccc6a850
--- /dev/null
+++ b/source/tools/tools-initializer/src/main/java/com/jd/blockchain/tools/initializer/LogPrompter.java
@@ -0,0 +1,52 @@
+package com.jd.blockchain.tools.initializer;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class LogPrompter implements Prompter {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(LogPrompter.class);
+
+ private static final String ANSWER_DEFAULT = "Yes";
+
+ private boolean debug = true;
+
+ @Override
+ public void info(String format, Object... args) {
+ LOGGER.info(format, args);
+ }
+
+ @Override
+ public void error(String format, Object... args) {
+ LOGGER.error(format, args);
+ }
+
+ @Override
+ public void error(Exception error, String format, Object... args) {
+ if (debug) {
+ error.printStackTrace();
+ LOGGER.error(error.toString());
+ }
+ }
+
+ @Override
+ public String confirm(String format, Object... args) {
+ return confirm("", format, args);
+ }
+
+ @Override
+ public String confirm(String tag, String format, Object... args) {
+ String msg = String.format(format, args);
+ LOGGER.info(msg);
+ return ANSWER_DEFAULT;
+ }
+
+ public boolean isDebug() {
+ return debug;
+ }
+
+ public void setDebug(boolean debug) {
+ this.debug = debug;
+ }
+
+}
\ No newline at end of file
diff --git a/source/tools/tools-initializer/src/main/resources/application.properties b/source/tools/tools-initializer/src/main/resources/application.properties
index 2090d209..16cdc6bf 100644
--- a/source/tools/tools-initializer/src/main/resources/application.properties
+++ b/source/tools/tools-initializer/src/main/resources/application.properties
@@ -1,17 +1,13 @@
server.address=127.0.0.1
server.port=8900
-#server.ssl.key-store=classpath:mykeys.jks
-#server.ssl.key-store-password=abc123
-#server.ssl.key-password=abc123
-
server.tomcat.accesslog.enabled=true
debug=false
+logging.config=classpath:log4j2-init.xml
#logging.file=logs/peer.log
logging.level.com.jd.blockchain=DEBUG
logging.level.org.org.springframework=DEBUG
-spring.mvc.favicon.enabled=false
-
+spring.mvc.favicon.enabled=false
\ No newline at end of file
diff --git a/source/tools/tools-initializer/src/main/resources/banner2.txt b/source/tools/tools-initializer/src/main/resources/banner2.txt
deleted file mode 100644
index f1c960f7..00000000
--- a/source/tools/tools-initializer/src/main/resources/banner2.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-
- 888888 8888888b. 888888b. 888 888 .d8888b. 888 d8b
- "88b 888 "Y88b 888 "88b 888 888 d88P Y88b 888 Y8P
- 888 888 888 888 .88P 888 888 888 888 888
- 888 888 888 8888888K. 888 .d88b. .d8888b 888 888 888 88888b. 8888b. 888 88888b.
- 888 888 888 888 "Y88b 888 d88""88b d88P" 888 .88P 888 888 "88b "88b 888 888 "88b
- 888 888 888 888 888 888 888 888 888 888888K 888 888 888 888 .d888888 888 888 888
- 88P 888 .d88P 888 d88P 888 Y88..88P Y88b. 888 "88b Y88b d88P 888 888 888 888 888 888 888
- 888 8888888P" 8888888P" 888 "Y88P" "Y8888P 888 888 "Y8888P" 888 888 "Y888888 888 888 888
- .d88P
- .d88P"
-888P"
diff --git a/source/tools/tools-initializer/src/main/resources/banner3.txt b/source/tools/tools-initializer/src/main/resources/banner3.txt
deleted file mode 100644
index a8e93d02..00000000
--- a/source/tools/tools-initializer/src/main/resources/banner3.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-
- $$$$$\ $$$$$$$\ $$$$$$$\ $$\ $$\ $$$$$$\ $$\ $$\
- \__$$ |$$ __$$\ $$ __$$\ $$ | $$ | $$ __$$\ $$ | \__|
- $$ |$$ | $$ | $$ | $$ |$$ | $$$$$$\ $$$$$$$\ $$ | $$\ $$ / \__|$$$$$$$\ $$$$$$\ $$\ $$$$$$$\
- $$ |$$ | $$ | $$$$$$$\ |$$ |$$ __$$\ $$ _____|$$ | $$ | $$ | $$ __$$\ \____$$\ $$ |$$ __$$\
-$$\ $$ |$$ | $$ | $$ __$$\ $$ |$$ / $$ |$$ / $$$$$$ / $$ | $$ | $$ | $$$$$$$ |$$ |$$ | $$ |
-$$ | $$ |$$ | $$ | $$ | $$ |$$ |$$ | $$ |$$ | $$ _$$< $$ | $$\ $$ | $$ |$$ __$$ |$$ |$$ | $$ |
-\$$$$$$ |$$$$$$$ | $$$$$$$ |$$ |\$$$$$$ |\$$$$$$$\ $$ | \$$\ \$$$$$$ |$$ | $$ |\$$$$$$$ |$$ |$$ | $$ |
- \______/ \_______/ \_______/ \__| \______/ \_______|\__| \__| \______/ \__| \__| \_______|\__|\__| \__|
-
-
-
diff --git a/source/tools/tools-initializer/src/main/resources/log4j2-init.xml b/source/tools/tools-initializer/src/main/resources/log4j2-init.xml
new file mode 100644
index 00000000..6ef49baf
--- /dev/null
+++ b/source/tools/tools-initializer/src/main/resources/log4j2-init.xml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file