diff --git a/.gitmodules b/.gitmodules index ec3fca5a..7935a520 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,6 +10,7 @@ [submodule "framework"] path = framework url = git@github.com:blockchain-jd-com/jdchain-framework.git + branch = 1b8f848 [submodule "core"] path = core url = git@github.com:blockchain-jd-com/jdchain-core.git diff --git a/build/pack.sh b/build/pack.sh index 34d87ff8..51baae7d 100755 --- a/build/pack.sh +++ b/build/pack.sh @@ -21,7 +21,7 @@ fi echo "--------------- 开始编译打包 ---------------" cd $DEPLOY_DIR -echo "当前目录:`pwd`" +echo "当前目录:$(pwd)" #初始化变量 SKIP_TESTS; if [ ! $SKIP_TESTS ] diff --git a/core b/core index 8910f948..747b2389 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 8910f948e63a668efcff8f062fd2b17eb7f8e09b +Subproject commit 747b23895702fe0e73e9448f4c1633a163f18856 diff --git a/deploy/deploy-gateway/pom.xml b/deploy/deploy-gateway/pom.xml index d85ff5a0..04ded67d 100644 --- a/deploy/deploy-gateway/pom.xml +++ b/deploy/deploy-gateway/pom.xml @@ -45,6 +45,9 @@ org.springframework.boot spring-boot-maven-plugin + + true + diff --git a/deploy/deploy-gateway/src/main/resources/assembly.xml b/deploy/deploy-gateway/src/main/resources/assembly.xml index 09a964df..c1595bd8 100644 --- a/deploy/deploy-gateway/src/main/resources/assembly.xml +++ b/deploy/deploy-gateway/src/main/resources/assembly.xml @@ -24,6 +24,7 @@ docs unix + diff --git a/deploy/deploy-gateway/src/main/resources/config/application-gw.properties b/deploy/deploy-gateway/src/main/resources/config/application-gw.properties index bcf7d476..f29231f9 100644 --- a/deploy/deploy-gateway/src/main/resources/config/application-gw.properties +++ b/deploy/deploy-gateway/src/main/resources/config/application-gw.properties @@ -10,6 +10,22 @@ server.ssl.key-store= server.ssl.key-store-type=PKCS12 server.ssl.key-alias= server.ssl.key-store-password= +server.ssl.protocol= +server.ssl.enabled-protocols= +server.ssl.ciphers= server.ssl.trust-store= server.ssl.trust-store-password= -server.ssl.trust-store-type=JKS \ No newline at end of file +server.ssl.trust-store-type=JKS +server.ssl.hostNameVerifier=NO-OP + +#GM TLS Config +#Enable Condition: http.secure=true && server.ssl.protocol=GMSSLv1.1 +#Example: +#server.ssl.key-store=cert/sm2.node0.both.pfx +#server.ssl.key-store-type=PKCS12 +#server.ssl.key-alias= +#server.ssl.key-store-password=12345678 +#server.ssl.protocol=GMSSLv1.1 +#server.ssl.hostNameVerifier=NO-OP +#server.ssl.enabled-protocols=TLSv1.2,GMSSLv1.1 +#server.ssl.ciphers=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,ECC_SM4_CBC_SM3,ECDHE_SM4_GCM_SM3,ECDHE_SM4_CBC_SM3 diff --git a/deploy/deploy-peer/src/main/resources/assembly.xml b/deploy/deploy-peer/src/main/resources/assembly.xml index 0497bc79..4b0fe58e 100644 --- a/deploy/deploy-peer/src/main/resources/assembly.xml +++ b/deploy/deploy-peer/src/main/resources/assembly.xml @@ -24,6 +24,14 @@ docs unix + + ${basedir}/../../libs/utils/utils-sm-tls/lib + libs + + + ${basedir}/../../core/consensus/consensus-raft/lib + libs + diff --git a/deploy/deploy-peer/src/main/resources/config/application-peer.properties b/deploy/deploy-peer/src/main/resources/config/application-peer.properties index 728ed961..944badce 100644 --- a/deploy/deploy-peer/src/main/resources/config/application-peer.properties +++ b/deploy/deploy-peer/src/main/resources/config/application-peer.properties @@ -14,4 +14,27 @@ server.ssl.key-alias= server.ssl.key-store-password= server.ssl.trust-store= server.ssl.trust-store-password= -server.ssl.trust-store-type=JKS \ No newline at end of file +server.ssl.trust-store-type=JKS + +server.ssl.protocol= +server.ssl.enabled-protocols= +server.ssl.ciphers= +server.ssl.hostNameVerifier=NO-OP + +#GM TLS配置 +#启用条件: server.ssl.enabled=true && server.ssl.protocol=GMSSLv1.1 +#示例: +#server.ssl.enabled=true +#server.ssl.key-store=cert/sm2.node0.both.pfx +#server.ssl.key-store-type=PKCS12 +#server.ssl.key-alias= +#server.ssl.key-store-password=12345678 +#server.ssl.protocol=GMSSLv1.1 +#server.ssl.hostNameVerifier=NO-OP +#server.ssl.enabled-protocols=TLSv1.2,GMSSLv1.1 +#server.ssl.ciphers=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,ECC_SM4_CBC_SM3,ECDHE_SM4_GCM_SM3,ECDHE_SM4_CBC_SM3 + + +management.endpoints.web.exposure.include=prometheus +management.metrics.tags.application=peer + diff --git a/deploy/deploy-peer/src/main/resources/config/init/bftsmart.config b/deploy/deploy-peer/src/main/resources/config/init/bftsmart.config index 3bafbaee..0793149e 100644 --- a/deploy/deploy-peer/src/main/resources/config/init/bftsmart.config +++ b/deploy/deploy-peer/src/main/resources/config/init/bftsmart.config @@ -120,7 +120,7 @@ system.shutdownhook = true system.totalordermulticast.state_transfer = true #Maximum ahead-of-time message not discarded -system.totalordermulticast.highMark = 10000 +system.totalordermulticast.highMark = 50 #Maximum ahead-of-time message not discarded when the replica is still on EID 0 (after which the state transfer is triggered) system.totalordermulticast.revival_highMark = 10 @@ -134,7 +134,7 @@ system.totalordermulticast.timeout_highMark = 200 system.totalordermulticast.log = true system.totalordermulticast.log_parallel = false -system.totalordermulticast.log_to_disk = true +system.totalordermulticast.log_to_disk = false system.totalordermulticast.sync_log = false #Period at which BFT-SMaRt requests the state to the application (for the state transfer state protocol) diff --git a/deploy/deploy-peer/src/main/resources/config/init/ledger.init b/deploy/deploy-peer/src/main/resources/config/init/ledger.init index 327e652f..f968200f 100644 --- a/deploy/deploy-peer/src/main/resources/config/init/ledger.init +++ b/deploy/deploy-peer/src/main/resources/config/init/ledger.init @@ -14,7 +14,7 @@ root-ca-path= created-time=2019-08-01 14:26:58.069+0800 #账本数据底层结构,分为:MERKLE_TREE, KV两种,默认MERKLE_TREE -ledger.data.structure=MERKLE_TREE +ledger.data.structure=KV #----------------------------------------------- # 初始的角色名称列表;可选项; @@ -57,11 +57,20 @@ ledger.data.structure=MERKLE_TREE #----------------------------------------------- #共识服务提供者;必须; -consensus.service-provider=com.jd.blockchain.consensus.bftsmart.BftsmartConsensusProvider - +#consensus.service-provider #共识服务的参数配置;推荐使用绝对路径;必须; +#consensus.conf + +# BFT共识配置 +consensus.service-provider=com.jd.blockchain.consensus.bftsmart.BftsmartConsensusProvider consensus.conf=bftsmart.config +# RAFT共识配置 +#consensus.service-provider=com.jd.blockchain.consensus.raft.RaftConsensusProvider +#consensus.conf=raft.config + +#------------------------------------------------ + #密码服务提供者列表,以英文逗点“,”分隔;必须; crypto.service-providers=com.jd.blockchain.crypto.service.classic.ClassicCryptoService, \ com.jd.blockchain.crypto.service.sm.SMCryptoService diff --git a/deploy/deploy-peer/src/main/resources/config/init/raft/raft.config b/deploy/deploy-peer/src/main/resources/config/init/raft/raft.config new file mode 100644 index 00000000..fbf592ec --- /dev/null +++ b/deploy/deploy-peer/src/main/resources/config/init/raft/raft.config @@ -0,0 +1,45 @@ +system.server.0.network.host=127.0.0.1 +system.server.0.network.port=16000 +system.server.0.network.secure=false +system.server.0.raft.path=/Users/zhangshuang3/Desktop/4nodesTestnet-develop/0 + +system.server.1.network.host=127.0.0.1 +system.server.1.network.port=16010 +system.server.1.network.secure=false +system.server.1.raft.path=/Users/zhangshuang3/Desktop/4nodesTestnet-develop/1 + +system.server.2.network.host=127.0.0.1 +system.server.2.network.port=16020 +system.server.2.network.secure=false +system.server.2.raft.path=/Users/zhangshuang3/Desktop/4nodesTestnet-develop/2 + +system.server.3.network.host=127.0.0.1 +system.server.3.network.port=16030 +system.server.3.network.secure=false +system.server.3.raft.path=/Users/zhangshuang3/Desktop/4nodesTestnet-develop/3 + +system.server.block.max.num=100 +system.server.block.max.bytes=4194304 + +system.server.election.timeout=5000 +system.server.snapshot.interval=1800 + +system.client.configuration.refresh.interval=60000 + +system.server.rpc.connect.timeout=10000 +system.server.rpc.default.timeout=10000 +system.server.rpc.snapshot.timeout=300000 +system.server.rpc.request.timeout=20000 + +system.raft.maxByteCountPerRpc=131072 +system.raft.maxEntriesSize=1024 +system.raft.maxBodySize=524288 +system.raft.maxAppendBufferSize=262144 +system.raft.maxElectionDelayMs=1000 +system.raft.electionHeartbeatFactor=5 +system.raft.applyBatch=32 +system.raft.sync=true +system.raft.syncMeta=false +system.raft.disruptorBufferSize=16384 +system.raft.replicatorPipeline=true +system.raft.maxReplicatorInflightMsgs=256 \ No newline at end of file diff --git a/deploy/deploy-peer/src/main/resources/config/log4j2-peer.xml b/deploy/deploy-peer/src/main/resources/config/log4j2-peer.xml index ebd1df90..698c85c7 100644 --- a/deploy/deploy-peer/src/main/resources/config/log4j2-peer.xml +++ b/deploy/deploy-peer/src/main/resources/config/log4j2-peer.xml @@ -29,6 +29,8 @@ + + diff --git a/explorer b/explorer index 17000891..fbc3375f 160000 --- a/explorer +++ b/explorer @@ -1 +1 @@ -Subproject commit 17000891306cfa3ccd6b32cf8666531ef5ce001f +Subproject commit fbc3375fedf9e6609f37c747e85e42d5b5acc328 diff --git a/framework b/framework index 7a799fd5..f97ec31c 160000 --- a/framework +++ b/framework @@ -1 +1 @@ -Subproject commit 7a799fd5beb7a2e863d4b3668abc852b6ed8d673 +Subproject commit f97ec31c4c698251d1baf9340c832e6f91036044 diff --git a/libs/bft-smart b/libs/bft-smart index 44c1cb2e..1888d5f7 160000 --- a/libs/bft-smart +++ b/libs/bft-smart @@ -1 +1 @@ -Subproject commit 44c1cb2e9b9026229a09256491f2876778fb4c76 +Subproject commit 1888d5f761aefdcd0c68e9682a40a2f349e248e5 diff --git a/libs/httpservice b/libs/httpservice index 2eab93c8..f6f581ba 160000 --- a/libs/httpservice +++ b/libs/httpservice @@ -1 +1 @@ -Subproject commit 2eab93c8009337a0413b8a5dff123b7c0cb2ee8e +Subproject commit f6f581bacc09e102ea042f232fd75fb95ffc1e0e diff --git a/libs/utils b/libs/utils index 595362f7..d6208913 160000 --- a/libs/utils +++ b/libs/utils @@ -1 +1 @@ -Subproject commit 595362f78317d94036ecc1bf36181e5420c4033d +Subproject commit d62089134a7e30d6529d877ef5eb4ee5b756feaf diff --git a/project b/project index d6f3d4b4..8f4a2e6e 160000 --- a/project +++ b/project @@ -1 +1 @@ -Subproject commit d6f3d4b417b346a7c6dcfc37b8de8129b1410ccf +Subproject commit 8f4a2e6e2585944f4db928b7aabfeca28737ef10 diff --git a/test b/test index 35d143cb..4faa6ed1 160000 --- a/test +++ b/test @@ -1 +1 @@ -Subproject commit 35d143cb09abcf27e1ca2443c7a002654d91821c +Subproject commit 4faa6ed191291287fd3c9dff543216c423a577b8 diff --git a/tree.txt b/tree.txt deleted file mode 100644 index 695c4b34..00000000 --- a/tree.txt +++ /dev/null @@ -1,26 +0,0 @@ -[INFO] Scanning for projects... -[WARNING] -[WARNING] Some problems were encountered while building the effective model for com.jd.blockchain:jdchain-parent:pom:1.1.4.RELEASE -[WARNING] 'parent.relativePath' of POM com.jd.blockchain:jdchain-dependencies:1.1.4.RELEASE (F:\gitCode\jdchain-all\jdchain\project\dependencies\pom.xml) points at com.jd.blockchain:jdchain-project instead of org.springframework.boot:spring-boot-starter-parent, please verify your project structure @ com.jd.blockchain:jdchain-dependencies:1.1.4.RELEASE, F:\gitCode\jdchain-all\jdchain\project\dependencies\pom.xml, line 6, column 10 -[WARNING] -[WARNING] Some problems were encountered while building the effective model for com.jd.blockchain:bft-smart:jar:0.6.1.RELEASE -[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 89, column 12 -[WARNING] -[WARNING] Some problems were encountered while building the effective model for com.jd.blockchain:bft-smart:jar:0.6.1.RELEASE -[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 89, column 12 -[WARNING] -[WARNING] Some problems were encountered while building the effective model for com.jd.blockchain:bft-smart:jar:0.6.1.RELEASE -[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 89, column 12 -[WARNING] -[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. -[WARNING] -[WARNING] For this reason, future Maven versions might no longer support building such malformed projects. -[WARNING] -[ERROR] [ERROR] Project 'com.jd.blockchain:utils-serialize:1.2.1.RELEASE' is duplicated in the reactor @ -[ERROR] Project 'com.jd.blockchain:utils-serialize:1.2.1.RELEASE' is duplicated in the reactor -> [Help 1] -[ERROR] -[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. -[ERROR] Re-run Maven using the -X switch to enable full debug logging. -[ERROR] -[ERROR] For more information about the errors and possible solutions, please read the following articles: -[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DuplicateProjectException