├── lib ├── libsdtsm.so ├── libsdtsmjni.so ├── netty-handler-4.1.26.Final-SNAPSHOT.jar ├── gossip-base-0.1.3-incubating-SNAPSHOT.jar ├── gossip-transport-udp-0.1.3-incubating-SNAPSHOT.jar ├── gossip-protocol-jackson-0.1.3-incubating-SNAPSHOT.jar └── netty-tcnative-openssl-static-2.0.9.Final-SNAPSHOT-linux-x86_64.jar ├── src ├── main │ ├── resources │ │ ├── 演示文件20180731.rar │ │ ├── szca │ │ │ ├── sk-test │ │ │ └── signcert.pem │ │ └── applicationContext.xml │ ├── java │ │ └── org │ │ │ └── bcia │ │ │ └── julongchain │ │ │ ├── core │ │ │ ├── ledger │ │ │ │ ├── IQueryResultsIterator.java │ │ │ │ ├── IKeyValue.java │ │ │ │ ├── LedgerContext.java │ │ │ │ ├── kvledger │ │ │ │ │ ├── txmgmt │ │ │ │ │ │ ├── statedb │ │ │ │ │ │ │ ├── statecouchdb │ │ │ │ │ │ │ │ └── BatchableDocument.java │ │ │ │ │ │ │ └── IVersionedDBProvider.java │ │ │ │ │ │ ├── privacyenabledstate │ │ │ │ │ │ │ ├── IDBProvider.java │ │ │ │ │ │ │ └── PvtUpdateBatch.java │ │ │ │ │ │ └── validator │ │ │ │ │ │ │ └── valinternal │ │ │ │ │ │ │ └── InternalValidator.java │ │ │ │ │ └── history │ │ │ │ │ │ └── IHistoryQueryExecutor.java │ │ │ │ ├── CompositeKeyFormatException.java │ │ │ │ ├── IKeyModification.java │ │ │ │ ├── IStateListener.java │ │ │ │ ├── sceventmgmt │ │ │ │ │ └── ISmartContractLifecycleEventListener.java │ │ │ │ └── PvtCollFilter.java │ │ │ ├── smartcontract │ │ │ │ ├── shim │ │ │ │ │ ├── fsm │ │ │ │ │ │ ├── ICallback.java │ │ │ │ │ │ ├── CallbackType.java │ │ │ │ │ │ ├── exceptions │ │ │ │ │ │ │ ├── NotInTransitionException.java │ │ │ │ │ │ │ ├── UnknownEventException.java │ │ │ │ │ │ │ ├── InTrasistionException.java │ │ │ │ │ │ │ ├── AsyncException.java │ │ │ │ │ │ │ ├── CancelledException.java │ │ │ │ │ │ │ ├── InvalidEventException.java │ │ │ │ │ │ │ └── NoTransitionException.java │ │ │ │ │ │ ├── CBDesc.java │ │ │ │ │ │ └── Transitioner.java │ │ │ │ │ ├── ledger │ │ │ │ │ │ ├── IQueryResultsIterator.java │ │ │ │ │ │ ├── IKeyValue.java │ │ │ │ │ │ ├── CompositeKeyFormatException.java │ │ │ │ │ │ └── IKeyModification.java │ │ │ │ │ └── impl │ │ │ │ │ │ └── NextStateInfo.java │ │ │ │ ├── accesscontrol │ │ │ │ │ ├── CertMapper.java │ │ │ │ │ └── Authenticator.java │ │ │ │ └── node │ │ │ │ │ └── ReadWriteRunningUtil.java │ │ │ ├── container │ │ │ │ ├── api │ │ │ │ │ ├── IPrelaunchFunc.java │ │ │ │ │ ├── IFormatter.java │ │ │ │ │ └── IBuildSpecFactory.java │ │ │ │ └── scintf │ │ │ │ │ └── ISCSupport.java │ │ │ ├── deliverservice │ │ │ │ └── blocksprovider │ │ │ │ │ ├── IMessageCryptoService.java │ │ │ │ │ ├── ILedgerInfo.java │ │ │ │ │ ├── IStreamClient.java │ │ │ │ │ ├── IBlocksDeliverer.java │ │ │ │ │ └── IBlocksProvider.java │ │ │ ├── events │ │ │ │ ├── IPolicyCheckerProvider.java │ │ │ │ ├── IDeliverPolicyChecker.java │ │ │ │ ├── IDeliverHandler.java │ │ │ │ └── IDeliverEventsServer.java │ │ │ ├── common │ │ │ │ └── smartcontractprovider │ │ │ │ │ ├── SmartContractProviderFactory.java │ │ │ │ │ └── ISmartContractCacheSupport.java │ │ │ ├── commiter │ │ │ │ └── ICommitterValidator.java │ │ │ ├── aclmgmt │ │ │ │ └── AclManagement.java │ │ │ ├── ssc │ │ │ │ └── ISystemSmartContract.java │ │ │ ├── node │ │ │ │ └── INodeSupport.java │ │ │ └── endorser │ │ │ │ └── IPrivateDataDistributor.java │ │ │ ├── images │ │ │ ├── zookeeper │ │ │ │ └── Dockerfile │ │ │ ├── kafka │ │ │ │ └── Dockerfile │ │ │ ├── couchdb │ │ │ │ └── Dockerfile │ │ │ ├── buildenv │ │ │ │ └── Dockerfile │ │ │ ├── tomcat │ │ │ │ └── Dockerfile │ │ │ ├── cli │ │ │ │ └── Dockerfile │ │ │ ├── baseos │ │ │ │ └── Dockerfile │ │ │ ├── tools │ │ │ │ └── Dockerfile │ │ │ ├── consenter │ │ │ │ └── Dockerfile │ │ │ ├── node │ │ │ │ └── Dockerfile │ │ │ └── scenv │ │ │ │ └── Dockerfile │ │ │ ├── msp │ │ │ ├── entity │ │ │ │ └── VerifyOptions.java │ │ │ ├── ISigningIdentity.java │ │ │ ├── IMspManager.java │ │ │ └── util │ │ │ │ └── MspConstant.java │ │ │ ├── common │ │ │ ├── ledger │ │ │ │ ├── IPrunePolicy.java │ │ │ │ └── blockledger │ │ │ │ │ ├── IWriter.java │ │ │ │ │ └── IReader.java │ │ │ ├── protos │ │ │ │ ├── GroupHeaderExtensionVO.java │ │ │ │ └── IProtoVO.java │ │ │ ├── resourceconfig │ │ │ │ └── config │ │ │ │ │ ├── INodePoliciesConfig.java │ │ │ │ │ ├── IApisConfig.java │ │ │ │ │ ├── IResourcesConfig.java │ │ │ │ │ ├── NodePoliciesConfig.java │ │ │ │ │ └── ISmartContractsConfig.java │ │ │ ├── deliver │ │ │ │ ├── IAccessControlSupport.java │ │ │ │ ├── IExpiresAtFunc.java │ │ │ │ ├── IPolicyChecker.java │ │ │ │ ├── ISupportManager.java │ │ │ │ ├── ISender.java │ │ │ │ ├── IDeliverHandlerSupport.java │ │ │ │ └── ISupport.java │ │ │ ├── groupconfig │ │ │ │ ├── config │ │ │ │ │ ├── IOrganizationConfig.java │ │ │ │ │ ├── IConsortiumsConfig.java │ │ │ │ │ └── IApplicationOrgConfig.java │ │ │ │ ├── capability │ │ │ │ │ ├── IGroupCapabilities.java │ │ │ │ │ ├── IConsenterCapabilities.java │ │ │ │ │ └── IApplicationCapabilities.java │ │ │ │ └── value │ │ │ │ │ └── IConfigValue.java │ │ │ ├── policies │ │ │ │ ├── config │ │ │ │ │ ├── IConfigPolicy.java │ │ │ │ │ ├── ImplicitMetaAllPolicy.java │ │ │ │ │ └── ImplicitMetaAnyPolicy.java │ │ │ │ ├── IPolicyProvider.java │ │ │ │ └── policy │ │ │ │ │ └── IPolicy.java │ │ │ ├── localmsp │ │ │ │ └── ILocalSigner.java │ │ │ ├── genesis │ │ │ │ └── IGenesisBlockFactory.java │ │ │ └── tools │ │ │ │ └── cryptogen │ │ │ │ ├── bean │ │ │ │ └── UserSpec.java │ │ │ │ └── cmd │ │ │ │ └── ICryptoGenCmd.java │ │ │ ├── gossip │ │ │ ├── CertStore.java │ │ │ ├── api │ │ │ │ ├── ISubChannelSelectionCriteria.java │ │ │ │ ├── INodeSuspector.java │ │ │ │ └── ISecurityAdvisor.java │ │ │ ├── discovery │ │ │ │ ├── IIdentifier.java │ │ │ │ ├── IDisclosurePolicy.java │ │ │ │ ├── ISieve.java │ │ │ │ └── IEnvelopeFilter.java │ │ │ ├── comm │ │ │ │ ├── IConnFactory.java │ │ │ │ ├── IHandler.java │ │ │ │ └── IOnError.java │ │ │ ├── common │ │ │ │ └── IMessageAcceptor.java │ │ │ ├── gossip │ │ │ │ ├── IForwardFunction.java │ │ │ │ ├── IGossipFunction.java │ │ │ │ ├── IBatchingEmitter.java │ │ │ │ ├── ISigner.java │ │ │ │ ├── IVerifier.java │ │ │ │ └── IFilter.java │ │ │ ├── filter │ │ │ │ └── IRoutingFilter.java │ │ │ ├── Node3.java │ │ │ ├── Node4.java │ │ │ ├── Node1.java │ │ │ └── Node2.java │ │ │ ├── csp │ │ │ ├── intfs │ │ │ │ └── opts │ │ │ │ │ ├── IKeyGenOpts.java │ │ │ │ │ ├── IHashOpts.java │ │ │ │ │ ├── IRngOpts.java │ │ │ │ │ ├── IDecrypterOpts.java │ │ │ │ │ ├── IEncrypterOpts.java │ │ │ │ │ ├── IKeyDerivOpts.java │ │ │ │ │ ├── IKeyImportOpts.java │ │ │ │ │ ├── IKeyOpts.java │ │ │ │ │ ├── IAlgorithmOpts.java │ │ │ │ │ └── ISignerOpts.java │ │ │ ├── gmt0016 │ │ │ │ ├── excelsecu │ │ │ │ │ ├── bean │ │ │ │ │ │ └── GmAsymKey.java │ │ │ │ │ └── common │ │ │ │ │ │ ├── DeviceState.java │ │ │ │ │ │ └── Permissions.java │ │ │ │ └── ftsafe │ │ │ │ │ ├── util │ │ │ │ │ ├── GMRngOpts.java │ │ │ │ │ └── IGMHashOpts.java │ │ │ │ │ ├── IGMT0016KeyImportOpts.java │ │ │ │ │ ├── symmetry │ │ │ │ │ └── ISymmKeyGenOpts.java │ │ │ │ │ ├── IGMT0016Csp.java │ │ │ │ │ └── IGMT0016FactoryOpts.java │ │ │ ├── gm │ │ │ │ ├── dxct │ │ │ │ │ ├── RngOpts.java │ │ │ │ │ ├── sm4 │ │ │ │ │ │ ├── SM4DecrypterOpts.java │ │ │ │ │ │ └── SM4EncrypterOpts.java │ │ │ │ │ ├── GmKeyImportOpts.java │ │ │ │ │ └── IGmFactoryOpts.java │ │ │ │ └── sdt │ │ │ │ │ ├── sm4 │ │ │ │ │ ├── SM4EncrypterOpts.java │ │ │ │ │ └── SM4DecrypterOpts.java │ │ │ │ │ └── sm3 │ │ │ │ │ └── SM3HashOpts.java │ │ │ └── pkcs11 │ │ │ │ ├── IPKCS11Csp.java │ │ │ │ └── sw │ │ │ │ └── IPKCS11SwFactoryOpts.java │ │ │ ├── node │ │ │ ├── common │ │ │ │ └── client │ │ │ │ │ └── IAdminClient.java │ │ │ └── cmd │ │ │ │ └── INodeCmd.java │ │ │ ├── tools │ │ │ └── configtxgen │ │ │ │ └── ConfigtxGenConstant.java │ │ │ ├── consenter │ │ │ ├── consensus │ │ │ │ └── kafka │ │ │ │ │ └── JavaKafkaSimpleConsumerAPITest.java │ │ │ ├── entity │ │ │ │ ├── ConfigMessage.java │ │ │ │ └── NormalMessage.java │ │ │ └── common │ │ │ │ ├── cmd │ │ │ │ └── IConsenterCmd.java │ │ │ │ ├── bootstrap │ │ │ │ └── IHelper.java │ │ │ │ ├── msgprocessor │ │ │ │ └── IStandardGroupSupport.java │ │ │ │ └── multigroup │ │ │ │ └── IMutableResources.java │ │ │ └── events │ │ │ ├── producer │ │ │ └── IEventProcessor.java │ │ │ └── consumer │ │ │ └── IEventAdapter.java │ └── proto │ │ ├── common │ │ └── ledger.proto │ │ └── node │ │ └── node.proto └── test │ └── java │ └── org │ └── bcia │ └── julongchain │ ├── common │ ├── ssh │ │ └── SshDockerTest.java │ ├── localmsp │ │ └── impl │ │ │ └── LocalSignerTest.java │ ├── util │ │ └── proto │ │ │ └── ProposalUtilsTest.java │ └── policycheck │ │ └── cauthdsl │ │ └── PolicyParserTest.java │ ├── msp │ ├── util │ │ └── LoadLocalMspFilesTest.java │ ├── mspconfig │ │ └── MspConfigFactoryTest.java │ └── ConfigBuilderTest.java │ ├── BaseJunit4Test.java │ ├── csp │ └── gm │ │ └── dxct │ │ └── util │ │ ├── CryptoUtilTest.java │ │ └── FileKeyStoreTest.java │ ├── consenter │ ├── consensus │ │ ├── singleton │ │ │ └── SingletonTest.java │ │ └── kafka │ │ │ └── JavaKafkaSimpleConsumerAPITest.java │ ├── ConsenterTest.java │ └── common │ │ ├── localconfig │ │ └── ConsenterConfigFactoryTest.java │ │ ├── deliver │ │ └── DeliverClientTest.java │ │ ├── server │ │ └── ConsenterServerTest.java │ │ └── broadcast │ │ └── BroadcastClientTest.java │ ├── tools │ └── configtxgen │ │ └── entity │ │ └── GenesisConfigFactoryTest.java │ └── core │ ├── commiter │ └── CommitterServerTest.java │ ├── ssc │ └── SystemSmartContractManagerTest.java │ └── ledger │ └── kvledger │ └── history │ └── historydb │ └── IHistoryDBProviderTest.java ├── msp ├── keystore │ └── 542934af5d4a6b6a1e23583e0aa7cb62f638d68d42676eb941684f5e75c784fb_sk ├── admincerts │ └── node0-cert.pem ├── signcerts │ └── node0-cert.pem ├── cacerts │ └── ca.org1.example.com-cert.pem └── tlscacerts │ └── tlsca.org1.example.com-cert.pem ├── .gitignore ├── config ├── config.yaml └── Dockerfile └── Notice.md /lib/libsdtsm.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JulongChain/julongchain/HEAD/lib/libsdtsm.so -------------------------------------------------------------------------------- /lib/libsdtsmjni.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JulongChain/julongchain/HEAD/lib/libsdtsmjni.so -------------------------------------------------------------------------------- /src/main/resources/演示文件20180731.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JulongChain/julongchain/HEAD/src/main/resources/演示文件20180731.rar -------------------------------------------------------------------------------- /lib/netty-handler-4.1.26.Final-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JulongChain/julongchain/HEAD/lib/netty-handler-4.1.26.Final-SNAPSHOT.jar -------------------------------------------------------------------------------- /lib/gossip-base-0.1.3-incubating-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JulongChain/julongchain/HEAD/lib/gossip-base-0.1.3-incubating-SNAPSHOT.jar -------------------------------------------------------------------------------- /src/test/java/org/bcia/julongchain/common/ssh/SshDockerTest.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.common.ssh; 2 | 3 | public class SshDockerTest { 4 | 5 | } -------------------------------------------------------------------------------- /lib/gossip-transport-udp-0.1.3-incubating-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JulongChain/julongchain/HEAD/lib/gossip-transport-udp-0.1.3-incubating-SNAPSHOT.jar -------------------------------------------------------------------------------- /lib/gossip-protocol-jackson-0.1.3-incubating-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JulongChain/julongchain/HEAD/lib/gossip-protocol-jackson-0.1.3-incubating-SNAPSHOT.jar -------------------------------------------------------------------------------- /lib/netty-tcnative-openssl-static-2.0.9.Final-SNAPSHOT-linux-x86_64.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JulongChain/julongchain/HEAD/lib/netty-tcnative-openssl-static-2.0.9.Final-SNAPSHOT-linux-x86_64.jar -------------------------------------------------------------------------------- /msp/keystore/542934af5d4a6b6a1e23583e0aa7cb62f638d68d42676eb941684f5e75c784fb_sk: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MDMCAQAwDAYIKoEcz1UBgi0FAAQgDJjJ6LOswCdHZ1yfTgWrH5zMgS+YC+Hge91R 3 | 8Xouq4E= 4 | -----END PRIVATE KEY----- 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Example user template template 3 | ### Example user template 4 | 5 | # IntelliJ project files 6 | .idea 7 | *.iml 8 | out 9 | gen 10 | target 11 | 12 | /.idea/* 13 | /output.log 14 | /.gitignore 15 | 16 | output.log.2018-03-15 17 | output.log.2018-03-17 18 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/ledger/IQueryResultsIterator.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. All Rights Reserved. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Modified by Dingxuan sunianle on 2018-03-01 7 | */ 8 | 9 | package org.bcia.julongchain.core.ledger; 10 | 11 | public interface IQueryResultsIterator extends Iterable, AutoCloseable { } 12 | 13 | -------------------------------------------------------------------------------- /src/main/resources/szca/sk-test: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQg9tZvfDwiXRhcH7sm 3 | HJq5bk3Yrr+ApEgrzyFhhXc/shugCgYIKoEcz1UBgi2hRANCAAQmAUV5K/n2F1hB 4 | 9DPxbcfTOit6XdOsyJYp8M5eTSoHLhrmPQ/51zESAojyl7dsPTj7tBrDDXj9MyMI 5 | h0AfBMhG 6 | -----END PRIVATE KEY----- 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/smartcontract/shim/fsm/ICallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp., DTCC All Rights Reserved. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Modified java_package and other contents by Dingxuan on 2018-08-30 7 | */ 8 | 9 | package org.bcia.julongchain.core.smartcontract.shim.fsm; 10 | 11 | public interface ICallback { 12 | 13 | public void run(Event event); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/smartcontract/shim/ledger/IQueryResultsIterator.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. All Rights Reserved. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Modified java_package and other contents by Dingxuan on 2018-08-30 7 | */ 8 | 9 | package org.bcia.julongchain.core.smartcontract.shim.ledger; 10 | 11 | public interface IQueryResultsIterator extends Iterable, AutoCloseable { } 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/smartcontract/shim/fsm/CallbackType.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp., DTCC All Rights Reserved. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Modified java_package and other contents by Dingxuan on 2018-08-30 7 | */ 8 | 9 | package org.bcia.julongchain.core.smartcontract.shim.fsm; 10 | 11 | public enum CallbackType { 12 | 13 | NONE, 14 | BEFORE_EVENT, 15 | LEAVE_STATE, 16 | ENTER_STATE, 17 | AFTER_EVENT; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/test/java/org/bcia/julongchain/msp/util/LoadLocalMspFilesTest.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.msp.util; 2 | 3 | import org.junit.Test; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * 本地msp文件加载测试 9 | * 10 | * @author zhangmingyang 11 | * @Date: 2018/4/16 12 | * @company Dingxuan 13 | */ 14 | public class LoadLocalMspFilesTest { 15 | 16 | @Test 17 | public void init() { 18 | } 19 | 20 | @Test 21 | public void getPemMaterialFromDir() { 22 | } 23 | } -------------------------------------------------------------------------------- /src/test/java/org/bcia/julongchain/BaseJunit4Test.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain; 2 | 3 | import junit.framework.TestCase; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.ContextConfiguration; 6 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 7 | 8 | @RunWith(SpringJUnit4ClassRunner.class) 9 | @ContextConfiguration(locations = {"classpath:applicationContext.xml"}) 10 | public abstract class BaseJunit4Test extends TestCase { 11 | } 12 | -------------------------------------------------------------------------------- /src/test/java/org/bcia/julongchain/common/localmsp/impl/LocalSignerTest.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.common.localmsp.impl; 2 | 3 | import org.junit.Test; 4 | 5 | /** 6 | * @author zhangmingyang 7 | * @Date: 2018/4/18 8 | * @company Dingxuan 9 | */ 10 | public class LocalSignerTest { 11 | 12 | @Test 13 | public void newSignatureHeader() { 14 | } 15 | 16 | @Test 17 | public void sign() { 18 | LocalSigner localSigner=new LocalSigner(); 19 | localSigner.sign("123".getBytes()); 20 | } 21 | } -------------------------------------------------------------------------------- /src/test/java/org/bcia/julongchain/csp/gm/dxct/util/CryptoUtilTest.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.csp.gm.dxct.util; 2 | 3 | import org.bouncycastle.util.encoders.Hex; 4 | import org.junit.Test; 5 | 6 | import java.io.IOException; 7 | 8 | /** 9 | * 加密辅助类测试 10 | * 11 | * @author zhangmingyang 12 | * @Date: 2018/5/3 13 | * @company Dingxuan 14 | */ 15 | public class CryptoUtilTest { 16 | 17 | @Test 18 | public void publicKeyFileGen() { 19 | } 20 | 21 | @Test 22 | public void privateKeyFileGen() { 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /src/test/java/org/bcia/julongchain/csp/gm/dxct/util/FileKeyStoreTest.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.csp.gm.dxct.util; 2 | 3 | import org.junit.Test; 4 | 5 | /** 6 | * 文件密钥存储测试 7 | * 8 | * @author zhangmingyang 9 | * @Date: 2018/5/3 10 | * @company Dingxuan 11 | */ 12 | public class FileKeyStoreTest { 13 | 14 | @Test 15 | public void readOnly() { 16 | } 17 | 18 | @Test 19 | public void getKey() { 20 | } 21 | 22 | @Test 23 | public void storeKey() { 24 | } 25 | 26 | @Test 27 | public void iteratorPath() { 28 | } 29 | } -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/smartcontract/shim/fsm/exceptions/NotInTransitionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp., DTCC All Rights Reserved. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Modified java_package and other contents by Dingxuan on 2018-08-30 7 | */ 8 | 9 | package org.bcia.julongchain.core.smartcontract.shim.fsm.exceptions; 10 | 11 | public class NotInTransitionException extends Exception { 12 | 13 | public NotInTransitionException() { 14 | super("The transition is inappropriate" 15 | + " because there is no state change in progress"); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/test/java/org/bcia/julongchain/msp/mspconfig/MspConfigFactoryTest.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.msp.mspconfig; 2 | 3 | import org.junit.Test; 4 | 5 | import java.io.FileNotFoundException; 6 | 7 | /** 8 | * Msp配置工厂测试 9 | * 10 | * @author zhangmingyang 11 | * @Date: 2018/4/18 12 | * @company Dingxuan 13 | */ 14 | public class MspConfigFactoryTest { 15 | 16 | @Test 17 | public void loadMspConfig() { 18 | MspConfigFactory.loadMspConfig(); 19 | System.out.println("默认csp配置:" + MspConfigFactory.loadMspConfig().getNode().getCsp().getFactoryOpts().get("gm")); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/smartcontract/shim/fsm/exceptions/UnknownEventException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp., DTCC All Rights Reserved. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Modified java_package and other contents by Dingxuan on 2018-08-30 7 | */ 8 | 9 | package org.bcia.julongchain.core.smartcontract.shim.fsm.exceptions; 10 | 11 | public class UnknownEventException extends Exception { 12 | 13 | public final String event; 14 | 15 | public UnknownEventException(String event) { 16 | super("Event '" + event + "' does not exist"); 17 | this.event = event; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/test/java/org/bcia/julongchain/consenter/consensus/singleton/SingletonTest.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.consenter.consensus.singleton; 2 | 3 | import org.junit.Test; 4 | 5 | /** 6 | * 简单排序测试 7 | * @author zhangmingyang 8 | * @Date: 2018/5/7 9 | * @company Dingxuan 10 | */ 11 | public class SingletonTest { 12 | 13 | @Test 14 | public void order() { 15 | } 16 | 17 | @Test 18 | public void configure() { 19 | } 20 | 21 | @Test 22 | public void start() { 23 | } 24 | 25 | @Test 26 | public void halt() { 27 | } 28 | 29 | @Test 30 | public void handleChain() { 31 | } 32 | } -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/smartcontract/shim/fsm/CBDesc.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp., DTCC All Rights Reserved. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Modified java_package and other contents by Dingxuan on 2018-08-30 7 | */ 8 | 9 | package org.bcia.julongchain.core.smartcontract.shim.fsm; 10 | 11 | public class CBDesc { 12 | 13 | public final CallbackType type; 14 | public final String trigger; 15 | public final ICallback callback; 16 | 17 | public CBDesc(CallbackType type, String trigger, ICallback callback) { 18 | this.type = type; 19 | this.trigger = trigger; 20 | this.callback = callback; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/test/java/org/bcia/julongchain/consenter/ConsenterTest.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.consenter; 2 | 3 | import org.bcia.julongchain.common.exception.ConsenterException; 4 | import org.junit.Test; 5 | 6 | /** 7 | * @author zhangmingyang 8 | * @Date: 2018/3/1 9 | * @company Dingxuan 10 | */ 11 | public class ConsenterTest { 12 | @Test 13 | public void statrTest() throws ConsenterException { 14 | String[] args={"start"}; 15 | Consenter.main(args); 16 | } 17 | @Test 18 | public void versionTest() throws ConsenterException { 19 | String[] args={"version"}; 20 | Consenter.main(args); 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/smartcontract/shim/fsm/exceptions/InTrasistionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp., DTCC All Rights Reserved. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Modified java_package and other contents by Dingxuan on 2018-08-30 7 | */ 8 | 9 | package org.bcia.julongchain.core.smartcontract.shim.fsm.exceptions; 10 | 11 | public class InTrasistionException extends Exception { 12 | 13 | public final String event; 14 | 15 | public InTrasistionException(String event) { 16 | super("Event '" + event + "' is inappropriate because" 17 | + " the previous trasaction had not completed"); 18 | this.event = event; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/smartcontract/shim/fsm/exceptions/AsyncException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp., DTCC All Rights Reserved. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Modified java_package and other contents by Dingxuan on 2018-08-30 7 | */ 8 | 9 | package org.bcia.julongchain.core.smartcontract.shim.fsm.exceptions; 10 | 11 | public class AsyncException extends Exception { 12 | 13 | public final Exception error; 14 | 15 | public AsyncException() { 16 | this(null); 17 | } 18 | 19 | public AsyncException(Exception error) { 20 | super("Async started" + error == null ? 21 | "" : " with error " + error.toString()); 22 | this.error = error; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/test/java/org/bcia/julongchain/tools/configtxgen/entity/GenesisConfigFactoryTest.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.tools.configtxgen.entity; 2 | 3 | import org.bcia.julongchain.BaseJunit4Test; 4 | import org.junit.Test; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | 7 | /** 8 | * 创世区块配置工厂测试类 9 | * 10 | * @author zhouhui 11 | * @date 2018/3/20 12 | * @company Dingxuan 13 | */ 14 | public class GenesisConfigFactoryTest extends BaseJunit4Test { 15 | 16 | @Autowired 17 | private GenesisConfigFactory genesisConfigFactory; 18 | 19 | @Test 20 | public void loadGenesisConfig() throws Exception { 21 | GenesisConfigFactory.getGenesisConfig(); 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/smartcontract/shim/fsm/Transitioner.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp., DTCC All Rights Reserved. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Modified java_package and other contents by Dingxuan on 2018-08-30 7 | */ 8 | 9 | package org.bcia.julongchain.core.smartcontract.shim.fsm; 10 | 11 | import org.bcia.julongchain.core.smartcontract.shim.fsm.exceptions.NotInTransitionException; 12 | 13 | public class Transitioner { 14 | 15 | public void transition(FSM fsm) throws NotInTransitionException { 16 | if (fsm.transition == null) { 17 | throw new NotInTransitionException(); 18 | } 19 | fsm.transition.run(); 20 | fsm.transition = null; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/smartcontract/shim/impl/NextStateInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp., DTCC All Rights Reserved. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Modified java_package and other contents by Dingxuan on 2018-08-30 7 | */ 8 | 9 | package org.bcia.julongchain.core.smartcontract.shim.impl; 10 | 11 | import org.bcia.julongchain.protos.node.SmartContractShim; 12 | 13 | public class NextStateInfo { 14 | 15 | public SmartContractShim.SmartContractMessage message; 16 | public boolean sendToSC; 17 | 18 | public NextStateInfo(SmartContractShim.SmartContractMessage message, boolean sendToSC) { 19 | this.message = message; 20 | this.sendToSC = sendToSC; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/test/java/org/bcia/julongchain/consenter/common/localconfig/ConsenterConfigFactoryTest.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.consenter.common.localconfig; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * consenter配置工厂测试 9 | * 10 | * @author zhangmingyang 11 | * @date 2018/08/26 12 | * @company Dingxuan 13 | */ 14 | public class ConsenterConfigFactoryTest { 15 | 16 | @Test 17 | public void getConsenterConfig() { 18 | ConsenterConfig consenterConfig= ConsenterConfigFactory.getConsenterConfig(); 19 | System.out.println(consenterConfig.getFileLedger().getGroupName()); 20 | } 21 | 22 | @Test 23 | public void loadConsenterConfig() { 24 | } 25 | } -------------------------------------------------------------------------------- /msp/admincerts/node0-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIBwzCCAWegAwIBAgIEKJ1qhTAMBggqgRzPVQGDdQUAMHIxHDAaBgNVBAMTE2Nh 3 | Lm9yZzEuZXhhbXBsZS5jb20xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xCTAH 4 | BgNVBAYTADELMAkGA1UECxMCSkwxCTAHBgNVBAcTADEJMAcGA1UECBMAMQkwBwYD 5 | VQQJEwAwHhcNMTgwODI0MDEzNDQwWhcNMjgwODI0MDEzNDQwWjBJMQkwBwYDVQQJ 6 | EwAxCTAHBgNVBAgTADEJMAcGA1UEBxMAMQswCQYDVQQLEwJKTDEJMAcGA1UEBhMA 7 | MQ4wDAYDVQQDEwVub2RlMDBZMBMGByqGSM49AgEGCCqBHM9VAYItA0IABH/wswHm 8 | k7qWW0+RiP+VORoYxXbWOO/lvqbmptN2/DCmmaMiFOpkG7RHvC5rGAlIPr7oNbyg 9 | vp2wFutoodOhELqjEjAQMA4GA1UdDwEB/wQEAwIHgDAMBggqgRzPVQGDdQUAA0gA 10 | MEUCICqpppwGDxyIhnCj1W22E2/3DAAhI1T0fWMeExCnfXtwAiEAmBau6W7bTz2T 11 | D0lI3o8AaQcMwTHtkvsSzsqmb0n/z+c= 12 | -----END CERTIFICATE----- 13 | -------------------------------------------------------------------------------- /msp/signcerts/node0-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIBwzCCAWegAwIBAgIEKJ1qhTAMBggqgRzPVQGDdQUAMHIxHDAaBgNVBAMTE2Nh 3 | Lm9yZzEuZXhhbXBsZS5jb20xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xCTAH 4 | BgNVBAYTADELMAkGA1UECxMCSkwxCTAHBgNVBAcTADEJMAcGA1UECBMAMQkwBwYD 5 | VQQJEwAwHhcNMTgwODI0MDEzNDQwWhcNMjgwODI0MDEzNDQwWjBJMQkwBwYDVQQJ 6 | EwAxCTAHBgNVBAgTADEJMAcGA1UEBxMAMQswCQYDVQQLEwJKTDEJMAcGA1UEBhMA 7 | MQ4wDAYDVQQDEwVub2RlMDBZMBMGByqGSM49AgEGCCqBHM9VAYItA0IABH/wswHm 8 | k7qWW0+RiP+VORoYxXbWOO/lvqbmptN2/DCmmaMiFOpkG7RHvC5rGAlIPr7oNbyg 9 | vp2wFutoodOhELqjEjAQMA4GA1UdDwEB/wQEAwIHgDAMBggqgRzPVQGDdQUAA0gA 10 | MEUCICqpppwGDxyIhnCj1W22E2/3DAAhI1T0fWMeExCnfXtwAiEAmBau6W7bTz2T 11 | D0lI3o8AaQcMwTHtkvsSzsqmb0n/z+c= 12 | -----END CERTIFICATE----- 13 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/smartcontract/shim/fsm/exceptions/CancelledException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp., DTCC All Rights Reserved. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Modified java_package and other contents by Dingxuan on 2018-08-30 7 | */ 8 | 9 | package org.bcia.julongchain.core.smartcontract.shim.fsm.exceptions; 10 | 11 | public class CancelledException extends Exception { 12 | 13 | public final Exception error; 14 | 15 | public CancelledException() { 16 | this(null); 17 | } 18 | 19 | public CancelledException(Exception error) { 20 | super("The transition was cancelled" + error == null ? 21 | "" : " with error " + error.toString()); 22 | this.error = error; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/smartcontract/shim/fsm/exceptions/InvalidEventException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp., DTCC All Rights Reserved. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Modified java_package and other contents by Dingxuan on 2018-08-30 7 | */ 8 | 9 | package org.bcia.julongchain.core.smartcontract.shim.fsm.exceptions; 10 | 11 | public class InvalidEventException extends Exception { 12 | 13 | public final String event; 14 | public final String state; 15 | 16 | public InvalidEventException(String event, String state) { 17 | super("Event '" + event + "' is innappropriate" 18 | + " given the current state, " + state); 19 | this.event = event; 20 | this.state = state; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/images/zookeeper/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | # 14 | FROM julongchain/julongchain-baseimage 15 | MAINTAINER Julongchain "qkl@dxct.org" 16 | -------------------------------------------------------------------------------- /src/test/java/org/bcia/julongchain/consenter/common/deliver/DeliverClientTest.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.consenter.common.deliver; 2 | 3 | import org.bcia.julongchain.BaseJunit4Test; 4 | import org.junit.Test; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | 7 | /** 8 | * Deliver 客户端测试类 9 | * @author zhangmingyang 10 | * @Date 2018-02-26 11 | * @company Dingxuan 12 | */ 13 | public class DeliverClientTest extends BaseJunit4Test{ 14 | @Autowired 15 | public DeliverClient deliverClient; 16 | @Test 17 | public void send() { 18 | String ip="localhost"; 19 | int port=7050; 20 | String mess="testmessage"; 21 | // deliverClient.send(ip,port,mess); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/test/java/org/bcia/julongchain/core/commiter/CommitterServerTest.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.core.commiter; 2 | 3 | import org.junit.Test; 4 | 5 | /** 6 | * 提交服务测试类 7 | * 8 | * @author zhouhui 9 | * @date 2018/4/19 10 | * @company Dingxuan 11 | */ 12 | public class CommitterServerTest { 13 | 14 | @Test 15 | public void commitWithPrivateData() { 16 | } 17 | 18 | @Test 19 | public void getPrivateDataAndBlockByNum() { 20 | } 21 | 22 | @Test 23 | public void getPrivateDataByNum() { 24 | } 25 | 26 | @Test 27 | public void ledgerHeight() { 28 | } 29 | 30 | @Test 31 | public void getBlocks() { 32 | } 33 | 34 | @Test 35 | public void close() { 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/smartcontract/shim/fsm/exceptions/NoTransitionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp., DTCC All Rights Reserved. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Modified java_package and other contents by Dingxuan on 2018-08-30 7 | */ 8 | 9 | package org.bcia.julongchain.core.smartcontract.shim.fsm.exceptions; 10 | 11 | public class NoTransitionException extends Exception { 12 | 13 | public final Exception error; 14 | 15 | public NoTransitionException() { 16 | this(null); 17 | } 18 | 19 | public NoTransitionException(Exception error) { 20 | super("No transition occurred" + (error == null ? "" : " because of error " + error.toString())); 21 | this.error = error; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /config/config.yaml: -------------------------------------------------------------------------------- 1 | # Copyright IBM Corp. All Rights Reserved. 2 | # 3 | # SPDX-License-Identifier: Apache-2.0 4 | # Modified some contents by Dingxuan on 2018-09-12 5 | # 6 | 7 | organizationalUnitIdentifiers: 8 | certificate: "cacerts/ca.org1.example.com-cert.pem" 9 | organizationalUnitIdentifier: "JL" 10 | 11 | nodeOUs: 12 | isEnable: true 13 | clientOUIdentifier: 14 | # if Certificate is empty, then the certifier identifier will not be enforced 15 | certificate: "cacerts/ca.org1.example.com-cert.pem" 16 | #OrganizationalUnitIdentifier: "OU_client" 17 | organizationalUnitIdentifier: "JL" 18 | nodeOUIdentifier: 19 | certificate: "cacerts/ca.org1.example.com-cert.pem" 20 | organizationalUnitIdentifier: "JL" 21 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/ledger/IKeyValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. All Rights Reserved. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Modified by Dingxuan sunianle on 2018-03-01 7 | */ 8 | 9 | package org.bcia.julongchain.core.ledger; 10 | 11 | /** 12 | * Query Result associating a state key with a value. 13 | * 14 | */ 15 | public interface IKeyValue { 16 | 17 | /** 18 | * Returns the state key. 19 | * 20 | * @return 21 | */ 22 | String getKey(); 23 | 24 | /** 25 | * Returns the state value. 26 | * 27 | * @return 28 | */ 29 | byte[] getValue(); 30 | 31 | /** 32 | * Returns the state value, decoded as a UTF-8 string. 33 | * 34 | * @return 35 | */ 36 | String getStringValue(); 37 | 38 | } -------------------------------------------------------------------------------- /src/test/java/org/bcia/julongchain/consenter/common/server/ConsenterServerTest.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.consenter.common.server; 2 | 3 | import org.junit.Test; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | 6 | import java.io.IOException; 7 | 8 | /** 9 | * consenter服务测试 10 | * @author zhangmingyang 11 | * @Date: 2018/3/1 12 | * @company Dingxuan 13 | */ 14 | public class ConsenterServerTest { 15 | @Autowired 16 | public ConsenterServer consenterServer; 17 | @Test 18 | public void start() throws IOException { 19 | consenterServer.start(); 20 | } 21 | 22 | @Test 23 | public void blockUntilShutdown() throws InterruptedException { 24 | consenterServer.blockUntilShutdown(); 25 | } 26 | } -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/images/kafka/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright Dingxuan. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | FROM julongchain/julongchain-baseimage 16 | MAINTAINER Julongchain "qkl@dxct.org" -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/images/couchdb/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright Dingxuan. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | FROM julongchain/julongchain-baseimage 16 | MAINTAINER Julongchain "qkl@dxct.org" -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/images/buildenv/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright Dingxuan. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | FROM julongchain/julongchain-baseimage 16 | MAINTAINER Julongchain "qkl@dxct.org" 17 | -------------------------------------------------------------------------------- /src/test/java/org/bcia/julongchain/consenter/common/broadcast/BroadcastClientTest.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.consenter.common.broadcast; 2 | 3 | import org.bcia.julongchain.BaseJunit4Test; 4 | import org.junit.Test; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | 7 | /** 8 | * Broadcast客户端测试类 9 | * 10 | * @author zhangmingyang 11 | * @Date 2018-02-26 12 | * @company Dingxuan 13 | */ 14 | public class BroadcastClientTest extends BaseJunit4Test { 15 | @Autowired 16 | public BroadcastClient broadcastClient; 17 | 18 | @Test 19 | public void send() throws Exception { 20 | String ip = "localhost"; 21 | int port = 7050; 22 | String mess = "testmessage"; 23 | //broadCastClient.send(ip,port,mess); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/smartcontract/shim/ledger/IKeyValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. All Rights Reserved. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Modified java_package and other contents by Dingxuan on 2018-08-30 7 | */ 8 | 9 | package org.bcia.julongchain.core.smartcontract.shim.ledger; 10 | 11 | /** 12 | * Query Result associating a state key with a value. 13 | * 14 | */ 15 | public interface IKeyValue { 16 | 17 | /** 18 | * Returns the state key. 19 | * 20 | * @return 21 | */ 22 | String getKey(); 23 | 24 | /** 25 | * Returns the state value. 26 | * 27 | * @return 28 | */ 29 | byte[] getValue(); 30 | 31 | /** 32 | * Returns the state value, decoded as a UTF-8 string. 33 | * 34 | * @return 35 | */ 36 | String getStringValue(); 37 | 38 | } -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/images/tomcat/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright Dingxuan. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | FROM tomcat:8.0-jre8 16 | MAINTAINER Julongchain "qkl@dxct.org" 17 | COPY Demonstration/ /usr/local/tomcat/webapps/Demonstration 18 | COPY server.xml /usr/local/tomcat/conf/ 19 | -------------------------------------------------------------------------------- /msp/cacerts/ca.org1.example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICKTCCAcygAwIBAgIEKS4D6DAMBggqgRzPVQGDdQUAMHIxCTAHBgNVBAkTADEJ 3 | MAcGA1UECBMAMQkwBwYDVQQHEwAxCzAJBgNVBAsTAkpMMQkwBwYDVQQGEwAxGTAX 4 | BgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2NhLm9yZzEuZXhhbXBs 5 | ZS5jb20wHhcNMTgwODI0MDEzNDQwWhcNMjgwODI0MDEzNDQwWjByMQkwBwYDVQQJ 6 | EwAxCTAHBgNVBAgTADEJMAcGA1UEBxMAMQswCQYDVQQLEwJKTDEJMAcGA1UEBhMA 7 | MRkwFwYDVQQKExBvcmcxLmV4YW1wbGUuY29tMRwwGgYDVQQDExNjYS5vcmcxLmV4 8 | YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAE2jTuUZUeyItXO3mb 9 | hca5PGybzyUftP5kWOQbwS9m1esrKMyqXJLessiD0mBrwXWzFBCyux+J/TSTKGuR 10 | 2sbtSqNOMEwwKQYDVR0OBCIEIJ8EP6lOhWGQ5TEQwyEpxoRkvX8S4LxBxXWSzm/V 11 | 2XeBMA8GA1UdJQQIMAYGBFUdJQAwDgYDVR0PAQH/BAQDAgGmMAwGCCqBHM9VAYN1 12 | BQADSQAwRgIhAMDyt01ZqIqmlT+I9ha3P9uxsbH7IJrV4FdEbs1oPko6AiEAzBoR 13 | sLwLthDAqg8hJgD1M180793FeciDvphYYFG6MLg= 14 | -----END CERTIFICATE----- 15 | -------------------------------------------------------------------------------- /msp/tlscacerts/tlsca.org1.example.com-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICLjCCAdKgAwIBAgIECCiEWDAMBggqgRzPVQGDdQUAMHUxCTAHBgNVBAkTADEJ 3 | MAcGA1UECBMAMQkwBwYDVQQHEwAxCzAJBgNVBAsTAkpMMQkwBwYDVQQGEwAxGTAX 4 | BgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHzAdBgNVBAMTFnRsc2NhLm9yZzEuZXhh 5 | bXBsZS5jb20wHhcNMTgwODI0MDEzNDQwWhcNMjgwODI0MDEzNDQwWjB1MQkwBwYD 6 | VQQJEwAxCTAHBgNVBAgTADEJMAcGA1UEBxMAMQswCQYDVQQLEwJKTDEJMAcGA1UE 7 | BhMAMRkwFwYDVQQKExBvcmcxLmV4YW1wbGUuY29tMR8wHQYDVQQDExZ0bHNjYS5v 8 | cmcxLmV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEvPKFZh13 9 | ihVc/PMOM0y5urCJxwGZ5C+tTOhaE5DfAsLK0WXEanr13rlKOdteh+zY4k15xpdg 10 | 1yWquocWZ+EVsqNOMEwwKQYDVR0OBCIEICrJgKy9J/OaR6GjOnhl0Bp/7BvlXKJX 11 | H84nRwRSHXUVMA8GA1UdJQQIMAYGBFUdJQAwDgYDVR0PAQH/BAQDAgGmMAwGCCqB 12 | HM9VAYN1BQADSAAwRQIgR0xF+ENCeRrRc7/DMEeTZqEXEB2UPWQJqrWQVf2t2jIC 13 | IQDH18Nxn1HH0ydfrtMyWmmPLq06Bj03tvbLyB5DUhH80A== 14 | -----END CERTIFICATE----- 15 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/msp/entity/VerifyOptions.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.msp.entity; 17 | 18 | /** 19 | * 验证选项 20 | * @author zhangmingyang 21 | * @Date: 2018/3/15 22 | * @company Dingxuan 23 | */ 24 | public class VerifyOptions { 25 | String DNSName; 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/ledger/IPrunePolicy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.ledger; 17 | 18 | /** 19 | * 支持不同修剪策略的通用接口 20 | * 21 | * @author wanliangbing 22 | * @date 2018/3/7 23 | * @company Dingxuan 24 | */ 25 | public interface IPrunePolicy { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/protos/GroupHeaderExtensionVO.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.protos; 17 | 18 | /** 19 | * 群组头部扩展业务对象 20 | * 21 | * @author zhouhui 22 | * @date 2018/05/26 23 | * @company Dingxuan 24 | */ 25 | public class GroupHeaderExtensionVO { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/ledger/LedgerContext.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.ledger; 17 | 18 | /** 19 | * ISmartContractProvider接口getContext函数的返回类型 20 | * 21 | * @author sunianle 22 | * @date 5/11/18 23 | * @company Dingxuan 24 | */ 25 | public class LedgerContext { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/smartcontract/accesscontrol/CertMapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.smartcontract.accesscontrol; 17 | 18 | /** 19 | * 类描述 20 | * 21 | * @author wanliangbing 22 | * @date 2018/3/26 23 | * @company Dingxuan 24 | */ 25 | public class CertMapper { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/CertStore.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip; 17 | 18 | /** 19 | * 类描述 20 | * 21 | * @author wanliangbing 22 | * @date 2018/08/20 23 | * @company Dingxuan 24 | */ 25 | public class CertStore { 26 | 27 | private byte[] selfIdentity; 28 | 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/ledger/kvledger/txmgmt/statedb/statecouchdb/BatchableDocument.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Dingxuan. All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.ledger.kvledger.txmgmt.statedb.statecouchdb; 17 | 18 | /** 19 | * 批量处理数据的doc 20 | * 21 | * @author sunzongyu 22 | * @date 2018/05/22 23 | * @company Dingxuan 24 | */ 25 | public class BatchableDocument { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/resourceconfig/config/INodePoliciesConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.resourceconfig.config; 17 | 18 | /** 19 | * 节点策略配置接口 20 | * 21 | * @author zhouhui 22 | * @date 2018/4/25 23 | * @company Dingxuan 24 | */ 25 | public interface INodePoliciesConfig { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/container/api/IPrelaunchFunc.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.container.api; 17 | 18 | /** 19 | * 类描述 20 | * 21 | * @author wanliangbing 22 | * @date 2018/4/2 23 | * @company Dingxuan 24 | */ 25 | public interface IPrelaunchFunc { 26 | 27 | void execute(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/container/api/IFormatter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.container.api; 17 | 18 | /** 19 | * 类描述 20 | * 21 | * @author wanliangbing 22 | * @date 2018/4/2 23 | * @company Dingxuan 24 | */ 25 | public interface IFormatter { 26 | 27 | String format(String string); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/deliver/IAccessControlSupport.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.deliver; 17 | 18 | 19 | /** 20 | * 权限控制支持接口 21 | * 22 | * @author zhangmingyang 23 | * @Date: 2018/5/30 24 | * @company Dingxuan 25 | */ 26 | public interface IAccessControlSupport { 27 | long sequence(); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/intfs/opts/IKeyGenOpts.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.csp.intfs.opts; 2 | 3 | /** 4 | * Copyright BCIA. All Rights Reserved. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * 密钥生成选项接口 21 | * 22 | * @author zhanglin, zhangmingyang 23 | * @date 2018-01-25 24 | * @company Dingxuan 25 | */ 26 | 27 | public interface IKeyGenOpts extends IAlgorithmOpts, IKeyOpts { 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/api/ISubChannelSelectionCriteria.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip.api; 17 | 18 | /** 19 | * SubChannelSelectionCriteria 描述了一种用签名从sub-channel选择节点的方法 20 | */ 21 | 22 | public interface ISubChannelSelectionCriteria { 23 | 24 | public Boolean execute(NodeSignature signature); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/resourceconfig/config/IApisConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.resourceconfig.config; 17 | 18 | /** 19 | * API配置接口 20 | * 21 | * @author zhouhui 22 | * @date 2018/4/23 23 | * @company Dingxuan 24 | */ 25 | public interface IApisConfig { 26 | String getPolicy(String apiName); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/resources/szca/signcert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICgTCCAiigAwIBAgIITKPb4V0fqWgwCgYIKoEcz1UBg3UwKjELMAkGA1UEBhMC 3 | Q04xGzAZBgNVBAMMEnRlc3Qgc20yIGxzc3VlciBjYTAeFw0xODA3MTEwNjA0MTda 4 | Fw0yODA2MzAwMTE5MThaMDYxCzAJBgNVBAYTAkNOMQswCQYDVQQIDAJnZDELMAkG 5 | A1UEBwwCc3oxDTALBgNVBAMMBHpteTEwWTATBgcqhkjOPQIBBggqgRzPVQGCLQNC 6 | AAQmAUV5K/n2F1hB9DPxbcfTOit6XdOsyJYp8M5eTSoHLhrmPQ/51zESAojyl7ds 7 | PTj7tBrDDXj9MyMIh0AfBMhGo4IBKjCCASYwDwYDVR0TAQH/BAUwAwEB/zAfBgNV 8 | HSMEGDAWgBQvDTtQhIOaP9+XOFaxQE98oox4pDBcBggrBgEFBQcBAQRQME4wJgYI 9 | KwYBBQUHMAKGGmh0dHA6Ly93d3cuc3pjYS5jb20vY2FjZXJ0MCQGCCsGAQUFBzAB 10 | hhhodHRwOi8vd3d3LnN6Y2EuY29tL29jc3AwOQYDVR0gBDIwMDAuBgUqgQwCATAl 11 | MCMGCCsGAQUFBwIBFhdodHRwOi8vd3d3LnN6Y2EuY29tL2NzcDAqBgNVHR8EIzAh 12 | MB+gHaAbhhlodHRwOi8vd3d3LnN6Y2EuY29tL2NhY3JsMB0GA1UdDgQWBBSHC2t7 13 | 6KEvT5T9xxq4J+KgbKe//jAOBgNVHQ8BAf8EBAMCAYYwCgYIKoEcz1UBg3UDRwAw 14 | RAIgBBP5/yXGvK8oC0HYSNRglPN3KyI0RC+eUCvm2I8PeCECIEhEi6/jZUQ5/Rn3 15 | 8ZI33Vqgbsiu0gOBf73EzJibrT01 16 | -----END CERTIFICATE----- 17 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/deliverservice/blocksprovider/IMessageCryptoService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.deliverservice.blocksprovider; 17 | 18 | /** 19 | * 消息解密服务接口 20 | * 21 | * @author zhangmingyang 22 | * @Date: 2018/5/31 23 | * @company Dingxuan 24 | */ 25 | public interface IMessageCryptoService { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/ledger/CompositeKeyFormatException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. All Rights Reserved. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Modified by Dingxuan sunianle on 2018-03-01 7 | */ 8 | 9 | package org.bcia.julongchain.core.ledger; 10 | 11 | public class CompositeKeyFormatException extends IllegalArgumentException { 12 | private static final long serialVersionUID = 1L; 13 | 14 | private CompositeKeyFormatException(String s) { 15 | super(s); 16 | } 17 | 18 | static CompositeKeyFormatException forInputString(String s, String group, int index) { 19 | return new CompositeKeyFormatException(String.format("For input string '%s', found 'U+%06X' at index %d.", s, group.codePointAt(0), index)); 20 | } 21 | 22 | static CompositeKeyFormatException forSimpleKey(String key) { 23 | return new CompositeKeyFormatException(String.format("First character of the key [%s] contains a 'U+%06X' which is not allowed", key, CompositeKey.NAMESPACE.codePointAt(0))); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/discovery/IIdentifier.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip.discovery; 17 | 18 | /** 19 | * class description 20 | * 21 | * @author wanliangbing 22 | * @date 18-7-24 23 | * @company Dingxuan 24 | */ 25 | public interface IIdentifier { 26 | 27 | public NodeIdentification identifier(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/org/bcia/julongchain/core/ssc/SystemSmartContractManagerTest.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.core.ssc; 2 | 3 | import org.bcia.julongchain.BaseJunit4Test; 4 | import org.junit.Test; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | 7 | /** 8 | * 类描述 9 | * 10 | * @author sunianle 11 | * @date 3/7/18 12 | * @company Dingxuan 13 | */ 14 | public class SystemSmartContractManagerTest extends BaseJunit4Test { 15 | @Autowired 16 | SystemSmartContractManager manager; 17 | @Test 18 | public void registerSysSmartContracts() { 19 | manager.registerSysSmartContracts(); 20 | } 21 | 22 | @Test 23 | public void deploySysSmartContracts() { 24 | } 25 | 26 | @Test 27 | public void deDeploySysSmartContracts() { 28 | } 29 | 30 | @Test 31 | public void isSysSmartContract() { 32 | } 33 | 34 | @Test 35 | public void isWhitelisted() { 36 | } 37 | 38 | @Test 39 | public void getSystemSmartContract() { 40 | } 41 | } -------------------------------------------------------------------------------- /src/test/java/org/bcia/julongchain/common/util/proto/ProposalUtilsTest.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.common.util.proto; 2 | 3 | import org.bcia.julongchain.common.exception.JulongChainException; 4 | import org.junit.Test; 5 | 6 | /** 7 | * 提案工具测试类 8 | * 9 | * @author zhouhui 10 | * @date 2018/3/28 11 | * @company Dingxuan 12 | */ 13 | public class ProposalUtilsTest { 14 | 15 | @Test 16 | public void buildSignedProposal() { 17 | } 18 | 19 | @Test 20 | public void buildSmartContractProposal() { 21 | } 22 | 23 | @Test 24 | public void buildProposalPayload() { 25 | } 26 | 27 | @Test 28 | public void computeProposalTxID() throws JulongChainException { 29 | long beginTime = System.currentTimeMillis(); 30 | String txId = ProposalUtils.computeProposalTxID("zhouhui".getBytes(), "12345678907879887908".getBytes()); 31 | long endTime = System.currentTimeMillis(); 32 | 33 | System.out.println(txId + ",耗时"+ (endTime-beginTime) + "ms"); 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/events/IPolicyCheckerProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.events; 17 | 18 | /** 19 | * 策略检查器提供者 20 | * 21 | * @author zhouhui 22 | * @date 2018/3/21 23 | * @company Dingxuan 24 | */ 25 | public interface IPolicyCheckerProvider { 26 | IDeliverPolicyChecker getPolicyChecker(String resourceName); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/comm/IConnFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip.comm; 17 | 18 | /** 19 | * class description 20 | * 21 | * @author wanliangbing 22 | * @date 18-7-24 23 | * @company Dingxuan 24 | */ 25 | public interface IConnFactory { 26 | public Connection createConnection(String endpoint, byte[] pkiID); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/deliver/IExpiresAtFunc.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.deliver; 17 | 18 | import java.util.Date; 19 | 20 | /** 21 | * 身份过期接口 22 | * 23 | * @author zhangmingyang 24 | * @Date: 2018/5/30 25 | * @company Dingxuan 26 | */ 27 | public interface IExpiresAtFunc { 28 | Date expiresAt(byte[] identityBytes); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/container/api/IBuildSpecFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.container.api; 17 | 18 | import java.io.Reader; 19 | 20 | /** 21 | * 类描述 22 | * 23 | * @author wanliangbing 24 | * @date 2018/4/2 25 | * @company Dingxuan 26 | */ 27 | public interface IBuildSpecFactory { 28 | 29 | Reader execute(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/common/IMessageAcceptor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip.common; 17 | 18 | /** 19 | * class description 20 | * 21 | * @author wanliangbing 22 | * @date 18-7-24 23 | * @company Dingxuan 24 | */ 25 | public interface IMessageAcceptor { 26 | 27 | public Boolean messageAcceptor(Object object); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/groupconfig/config/IOrganizationConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.groupconfig.config; 17 | 18 | /** 19 | * 组织配置接口 20 | * 21 | * @author zhouhui 22 | * @date 2018/3/27 23 | * @company Dingxuan 24 | */ 25 | public interface IOrganizationConfig { 26 | String getName(); 27 | 28 | String getMspId(); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/gmt0016/excelsecu/bean/GmAsymKey.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright BCIA. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.csp.gmt0016.excelsecu.bean; 17 | 18 | /** 19 | * GM0016 国密非对称密钥类 20 | * 21 | * @author chenhao 22 | * @date 2018/4/2 23 | * @company Excelsecu 24 | */ 25 | public class GmAsymKey extends GmKey { 26 | // 签名密钥对或加密密钥对 27 | boolean isSignedKey; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/gossip/IForwardFunction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip.gossip; 17 | 18 | /** 19 | * class description 20 | * 21 | * @author wanliangbing 22 | * @date 18-7-24 23 | * @company Dingxuan 24 | */ 25 | public interface IForwardFunction { 26 | 27 | public void execute(IReceivedMessage receivedMessage); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/images/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright Dingxuan. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | FROM julongchain/julongchain-baseimage 16 | MAINTAINER Julongchain "qkl@dxct.org" 17 | COPY julongchain.jar /root/julongchain 18 | COPY config/ /root/julongchain/config 19 | COPY msp/ /root/julongchain/msp 20 | COPY lib/ /root/julongchain/lib 21 | COPY libsdtsmjni.so /lib 22 | COPY libsdtsm.so /lib 23 | ENV LANG C.UTF-8 24 | WORKDIR /root/julongchain 25 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/ledger/IKeyModification.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. All Rights Reserved. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | Modified by Dingxuan sunianle on 2018-03-01 6 | */ 7 | 8 | package org.bcia.julongchain.core.ledger; 9 | 10 | public interface IKeyModification { 11 | 12 | /** 13 | * Returns the transaction id. 14 | * 15 | * @return 16 | */ 17 | String getTxId(); 18 | 19 | /** 20 | * Returns the key's value at the time returned by {@link #getTimestamp()}. 21 | * 22 | * @return 23 | */ 24 | byte[] getValue(); 25 | 26 | /** 27 | * Returns the key's value at the time returned by {@link #getTimestamp()}, 28 | * decoded as a UTF-8 string. 29 | * 30 | * @return 31 | */ 32 | String getStringValue(); 33 | 34 | /** 35 | * Returns the timestamp of the key modification entry. 36 | * 37 | * @return 38 | */ 39 | java.time.Instant getTimestamp(); 40 | 41 | /** 42 | * Returns the deletion marker. 43 | * 44 | * @return 45 | */ 46 | boolean isDeleted(); 47 | 48 | } -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/discovery/IDisclosurePolicy.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip.discovery; 17 | 18 | /** 19 | * class description 20 | * 21 | * @author wanliangbing 22 | * @date 18-7-24 23 | * @company Dingxuan 24 | */ 25 | public interface IDisclosurePolicy { 26 | 27 | public Object[] execute(NetworkMember remoteNode); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/gossip/IGossipFunction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip.gossip; 17 | 18 | /** 19 | * class description 20 | * 21 | * @author wanliangbing 22 | * @date 18-7-24 23 | * @company Dingxuan 24 | */ 25 | public interface IGossipFunction { 26 | 27 | public void execute(SignedGossipMessage signedGossipMessage); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/org/bcia/julongchain/common/policycheck/cauthdsl/PolicyParserTest.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.common.policycheck.cauthdsl; 2 | 3 | import org.bcia.julongchain.common.exception.PolicyException; 4 | import org.bcia.julongchain.protos.common.Policies; 5 | import org.junit.Test; 6 | 7 | import static org.bcia.julongchain.common.policycheck.cauthdsl.PolicyParser.checkPolicyStr; 8 | import static org.junit.Assert.*; 9 | 10 | /** 11 | * 类描述 12 | * 13 | * @author yuanjun 14 | * @date 11/06/18 15 | * @company Aisino 16 | */ 17 | public class PolicyParserTest { 18 | 19 | @Test 20 | public void fromString() throws PolicyException { 21 | 22 | String policy = "OR(AND('A.member', 'B.member'), OR('C.admin', 'D.member'))"; 23 | String str = PolicyParser.checkPolicyStr(policy); 24 | assertTrue(String.valueOf(str.equals("outof(ID,1,outof(ID,2,'A.member','B.member'),outof(ID,1,'C.admin','D.member'))")),true); 25 | Policies.SignaturePolicyEnvelope envelope = PolicyParser.fromString(policy); 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/groupconfig/capability/IGroupCapabilities.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.groupconfig.capability; 17 | 18 | /** 19 | * 群组支持能力接口 20 | * 21 | * @author zhouhui 22 | * @date 2018/3/27 23 | * @company Dingxuan 24 | */ 25 | public interface IGroupCapabilities { 26 | boolean isSupported(); 27 | 28 | int getMspVersion(); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/intfs/opts/IHashOpts.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.csp.intfs.opts; 2 | 3 | /** 4 | * Copyright BCIA. All Rights Reserved. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * @author zhanglin 21 | * @purpose Define the interface, IHashOpts 22 | * @date 2018-01-25 23 | * @company Dingxuan 24 | */ 25 | 26 | // IHashOpts contains options for hashing with a CSP. 27 | public interface IHashOpts extends IAlgorithmOpts { 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/groupconfig/value/IConfigValue.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.groupconfig.value; 17 | 18 | import com.google.protobuf.Message; 19 | 20 | /** 21 | * 配置项/值接口 22 | * 23 | * @author zhouhui 24 | * @date 2018/3/9 25 | * @company Dingxuan 26 | */ 27 | public interface IConfigValue { 28 | String getKey(); 29 | 30 | Message getValue(); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/smartcontract/shim/ledger/CompositeKeyFormatException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. All Rights Reserved. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Modified java_package and other contents by Dingxuan on 2018-08-30 7 | */ 8 | 9 | package org.bcia.julongchain.core.smartcontract.shim.ledger; 10 | 11 | class CompositeKeyFormatException extends IllegalArgumentException { 12 | private static final long serialVersionUID = 1L; 13 | 14 | private CompositeKeyFormatException(String s) { 15 | super(s); 16 | } 17 | 18 | static CompositeKeyFormatException forInputString(String s, String group, int index) { 19 | return new CompositeKeyFormatException(String.format("For input string '%s', found 'U+%06X' at index %d.", s, group.codePointAt(0), index)); 20 | } 21 | 22 | static CompositeKeyFormatException forSimpleKey(String key) { 23 | return new CompositeKeyFormatException(String.format("First character of the key [%s] contains a 'U+%06X' which is not allowed", key, CompositeKey.NAMESPACE.codePointAt(0))); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/intfs/opts/IRngOpts.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.csp.intfs.opts; 2 | 3 | /** 4 | * Copyright BCIA. All Rights Reserved. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * @author zhanglin 21 | * @purpose Define the interface, IRngOpts 22 | * @date 2018-01-25 23 | * @company Dingxuan 24 | */ 25 | 26 | // The IRngOpts contains options for generating random number with a CSP. 27 | public interface IRngOpts extends IAlgorithmOpts { 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/groupconfig/config/IConsortiumsConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.groupconfig.config; 17 | 18 | import java.util.Map; 19 | 20 | /** 21 | * 多联盟配置定义 22 | * 23 | * @author zhouhui 24 | * @date 2018/3/27 25 | * @company Dingxuan 26 | */ 27 | public interface IConsortiumsConfig { 28 | Map getConsortiumConfigMap(); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/deliver/IPolicyChecker.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.deliver; 17 | 18 | import org.bcia.julongchain.protos.common.Common; 19 | 20 | /** 21 | * 策略检查接口 22 | * 23 | * @author zhangmingyang 24 | * @Date: 2018/5/29 25 | * @company Dingxuan 26 | */ 27 | public interface IPolicyChecker { 28 | void checkPolicy(Common.Envelope envelope, String groupId); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/events/IDeliverPolicyChecker.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.events; 17 | 18 | import org.bcia.julongchain.protos.common.Common; 19 | 20 | /** 21 | * 检查投递策略 22 | * 23 | * @author zhouhui 24 | * @date 2018/3/21 25 | * @company Dingxuan 26 | */ 27 | public interface IDeliverPolicyChecker { 28 | void checkPolicy(Common.Envelope envelope, String groupId); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/intfs/opts/IDecrypterOpts.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.csp.intfs.opts; 2 | 3 | /** 4 | * Copyright BCIA. All Rights Reserved. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * @author zhanglin 21 | * @purpose Define the interface, IDecrypterOpts 22 | * @date 2018-01-25 23 | * @company Dingxuan 24 | */ 25 | 26 | // The IDecrypterOpts contains options for decrypting with a CSP. 27 | public interface IDecrypterOpts extends IAlgorithmOpts { 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/intfs/opts/IEncrypterOpts.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.csp.intfs.opts; 2 | 3 | /** 4 | * Copyright BCIA. All Rights Reserved. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * @author zhanglin 21 | * @purpose Define the interface, IEncrypterOpts 22 | * @date 2018-01-25 23 | * @company Dingxuan 24 | */ 25 | 26 | // The IEncrypterOpts contains options for encrypting with a CSP. 27 | public interface IEncrypterOpts extends IAlgorithmOpts { 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/node/common/client/IAdminClient.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.node.common.client; 17 | 18 | /** 19 | * 管理客户端接口 20 | * 21 | * @author zhouhui 22 | * @date 2018/06/28 23 | * @company Dingxuan 24 | */ 25 | public interface IAdminClient { 26 | /** 27 | * 获取状态值 28 | * 29 | * @return 30 | */ 31 | int getStatus(); 32 | 33 | void close(); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/tools/configtxgen/ConfigtxGenConstant.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.tools.configtxgen; 17 | 18 | /** 19 | * 交易生成常量 20 | * 21 | * @author zhouhui 22 | * @date 2018/06/06 23 | * @company Dingxuan 24 | */ 25 | public class ConfigtxGenConstant { 26 | 27 | public static final String VERSION = "version"; 28 | public static final String CURRENT_VERSION = "1.0"; 29 | } 30 | -------------------------------------------------------------------------------- /config/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright Dingxuan. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | FROM #base_image 16 | COPY pom.xml /root/julongchain 17 | COPY src/ /root/julongchain/src 18 | WORKDIR /root/julongchain 19 | ENV CORE_NODE_ADDRESS #core_node_address# 20 | ENV LANG C.UTF-8 21 | RUN mvn package 22 | RUN rm -rf /root/julongchain/pom.xml 23 | RUN rm -rf /root/julongchain/src 24 | CMD java -jar /root/julongchain/target/julongchain-smartcontract-java-jar-with-dependencies.jar -i #smart_contract_id -a #core_node_address_and_port -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/deliver/ISupportManager.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.deliver; 17 | 18 | import org.bcia.julongchain.consenter.common.multigroup.ChainSupport; 19 | 20 | /** 21 | * 链支持管理接口 22 | * 23 | * @author zhangmingyang 24 | * @Date: 2018/5/29 25 | * @company Dingxuan 26 | */ 27 | public interface ISupportManager { 28 | ChainSupport getChain(String groupId); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/intfs/opts/IKeyDerivOpts.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.csp.intfs.opts; 2 | 3 | /** 4 | * Copyright BCIA. All Rights Reserved. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * @author zhanglin 21 | * @purpose Define the interface, IKeyDerivOpts 22 | * @date 2018-01-25 23 | * @company Dingxuan 24 | */ 25 | 26 | // IKeyDerivOpts contains options for key-derivation with a CSP. 27 | public interface IKeyDerivOpts extends IAlgorithmOpts, IKeyOpts { 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/comm/IHandler.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip.comm; 17 | 18 | import org.bcia.julongchain.gossip.gossip.SignedGossipMessage; 19 | 20 | /** 21 | * class description 22 | * 23 | * @author wanliangbing 24 | * @date 18-7-24 25 | * @company Dingxuan 26 | */ 27 | public interface IHandler { 28 | 29 | public void execute(SignedGossipMessage message); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/gossip/IBatchingEmitter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip.gossip; 17 | 18 | /** 19 | * class description 20 | * 21 | * @author wanliangbing 22 | * @date 18-7-24 23 | * @company Dingxuan 24 | */ 25 | public interface IBatchingEmitter { 26 | 27 | public void add(Object object); 28 | 29 | public void stop(); 30 | 31 | public Integer size(); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/node/cmd/INodeCmd.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package org.bcia.julongchain.node.cmd; 17 | 18 | import org.apache.commons.cli.ParseException; 19 | import org.bcia.julongchain.common.exception.NodeException; 20 | 21 | /** 22 | * 节点命令接口 23 | * 24 | * @author zhouhui 25 | * @date 2018/2/23 26 | * @company Dingxuan 27 | */ 28 | public interface INodeCmd { 29 | 30 | void execCmd(String[] args) throws ParseException, NodeException; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/consenter/consensus/kafka/JavaKafkaSimpleConsumerAPITest.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.consenter.consensus.kafka; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class JavaKafkaSimpleConsumerAPITest { 7 | 8 | public static void main(String[] args) { 9 | KafkaSimpleConsumer example = new KafkaSimpleConsumer(); 10 | 11 | long maxReads = 300; 12 | String topic = "test2"; 13 | int partitionID = 0; 14 | 15 | KafkaTopicPartitionInfo topicPartitionInfo = new KafkaTopicPartitionInfo(topic, partitionID); 16 | List seeds = new ArrayList(); 17 | seeds.add(new KafkaBrokerInfo("10.0.20.91", 9092)); 18 | 19 | try { 20 | example.run(maxReads, topicPartitionInfo, seeds); 21 | } catch (Exception e) { 22 | e.printStackTrace(); 23 | } 24 | 25 | // 获取该topic所属的所有分区ID列表 26 | System.out.println(example.fetchTopicPartitionIDs(seeds, topic, 100000, 64 * 1024, "client-id")); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/comm/IOnError.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip.comm; 17 | 18 | import org.bcia.julongchain.common.exception.JulongChainException; 19 | 20 | /** 21 | * class description 22 | * 23 | * @author wanliangbing 24 | * @date 18-7-24 25 | * @company Dingxuan 26 | */ 27 | public interface IOnError { 28 | 29 | public void execute(JulongChainException error); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/images/baseos/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright Dingxuan. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | FROM ubuntu 16 | MAINTAINER Julongchain "qkl@dxct.org" 17 | RUN apt-get update 18 | RUN apt-get -y install openjdk-8-jdk 19 | RUN apt-get -y install maven 20 | RUN apt-get -y install net-tools 21 | RUN apt-get -y install iputils-ping 22 | RUN apt-get -y install vim 23 | RUN mkdir -p /root/julongchain 24 | WORKDIR /root/julongchain 25 | ENV LANG C.UTF-8 26 | COPY repository/ /root/.m2/repository 27 | 28 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/images/tools/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright Dingxuan. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | FROM julongchain/julongchain-baseimage 16 | MAINTAINER Julongchain "qkl@dxct.org" 17 | ENV JULONGCHAIN_CFG_PATH /etc/bcia/julongchain 18 | VOLUME /etc/bcia/julongchain 19 | ADD payload/sampleconfig.tar.bz2 $JULONGCHAIN_CFG_PATH 20 | COPY payload/cryptogen /usr/local/bin 21 | COPY payload/configtxgen /usr/local/bin 22 | COPY payload/configtxlator /usr/local/bin 23 | COPY payload/peer /usr/local/bin 24 | -------------------------------------------------------------------------------- /src/test/java/org/bcia/julongchain/consenter/consensus/kafka/JavaKafkaSimpleConsumerAPITest.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.consenter.consensus.kafka; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class JavaKafkaSimpleConsumerAPITest { 7 | 8 | public static void main(String[] args) { 9 | KafkaSimpleConsumer example = new KafkaSimpleConsumer(); 10 | 11 | long maxReads = 300; 12 | String topic = "test2"; 13 | int partitionID = 0; 14 | 15 | KafkaTopicPartitionInfo topicPartitionInfo = new KafkaTopicPartitionInfo(topic, partitionID); 16 | List seeds = new ArrayList(); 17 | seeds.add(new KafkaBrokerInfo("10.0.20.91", 9092)); 18 | 19 | try { 20 | example.run(maxReads, topicPartitionInfo, seeds); 21 | } catch (Exception e) { 22 | e.printStackTrace(); 23 | } 24 | 25 | // 获取该topic所属的所有分区ID列表 26 | System.out.println(example.fetchTopicPartitionIDs(seeds, topic, 100000, 64 * 1024, "client-id")); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/policies/config/IConfigPolicy.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.policies.config; 17 | 18 | import org.bcia.julongchain.protos.common.Policies; 19 | 20 | /** 21 | * 配置策略接口 22 | * 23 | * @author zhouhui 24 | * @date 2018/3/8 25 | * @company Dingxuan 26 | */ 27 | public interface IConfigPolicy { 28 | 29 | String getKey(); 30 | 31 | Policies.Policy getValue(); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/discovery/ISieve.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip.discovery; 17 | 18 | import org.bcia.julongchain.gossip.gossip.SignedGossipMessage; 19 | 20 | /** 21 | * class description 22 | * 23 | * @author wanliangbing 24 | * @date 18-7-24 25 | * @company Dingxuan 26 | */ 27 | public interface ISieve { 28 | 29 | public Boolean execute(SignedGossipMessage message); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/gossip/ISigner.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip.gossip; 17 | 18 | import org.bcia.julongchain.common.exception.GossipException; 19 | 20 | /** 21 | * class description 22 | * 23 | * @author wanliangbing 24 | * @date 18-7-24 25 | * @company Dingxuan 26 | */ 27 | public interface ISigner { 28 | 29 | public byte[] execute(byte[] msg) throws GossipException; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/container/scintf/ISCSupport.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.container.scintf; 17 | 18 | import javax.naming.Context; 19 | 20 | /** 21 | * 类描述 22 | * 23 | * @author wanliangbing 24 | * @date 2018/3/18 25 | * @company Dingxuan 26 | */ 27 | public interface ISCSupport { 28 | 29 | void handleSmartContractStream(Context context, ISmartContractStream smartContractStream); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/gm/dxct/RngOpts.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.csp.gm.dxct; 17 | 18 | import org.bcia.julongchain.csp.intfs.opts.IRngOpts; 19 | 20 | /** 21 | * 随机数选项 22 | * 23 | * @author sunianle 24 | * @date 3/27/18 25 | * @company Dingxuan 26 | */ 27 | public class RngOpts implements IRngOpts { 28 | @Override 29 | public String getAlgorithm() { 30 | return "RANDOM"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/events/producer/IEventProcessor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.events.producer; 17 | 18 | import java.util.Map; 19 | 20 | /** 21 | * 事件处理器接口 22 | * 23 | * @author zhouhui 24 | * @date 2018/05/18 25 | * @company Dingxuan 26 | */ 27 | public interface IEventProcessor { 28 | Map getEventConsumers(); 29 | 30 | EventsServerConfig getEventsServerConfig(); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/common/smartcontractprovider/SmartContractProviderFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.common.smartcontractprovider; 17 | 18 | /** 19 | * SmartContractProviderFactory defines a factory interface so 20 | * that the actual implementation can be injected 21 | * @author sunianle 22 | * @date 3/7/18 23 | * @company Dingxuan 24 | */ 25 | public class SmartContractProviderFactory { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/filter/IRoutingFilter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip.filter; 17 | 18 | import org.bcia.julongchain.gossip.discovery.NetworkMember; 19 | 20 | /** 21 | * class description 22 | * 23 | * @author wanliangbing 24 | * @date 18-7-24 25 | * @company Dingxuan 26 | */ 27 | public interface IRoutingFilter { 28 | 29 | public Boolean routingFilter(NetworkMember networkMember); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/localmsp/ILocalSigner.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.localmsp; 17 | 18 | import org.bcia.julongchain.protos.common.Common; 19 | 20 | /** 21 | * 本地msp接口 22 | * 23 | * @author zhangmingyang 24 | * @Date: 2018/3/6 25 | * @company Dingxuan 26 | */ 27 | public interface ILocalSigner { 28 | Common.SignatureHeader newSignatureHeader(); 29 | 30 | byte[] sign(byte[] message); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/smartcontract/shim/ledger/IKeyModification.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. All Rights Reserved. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Modified java_package and other contents by Dingxuan on 2018-08-30 7 | */ 8 | 9 | package org.bcia.julongchain.core.smartcontract.shim.ledger; 10 | 11 | public interface IKeyModification { 12 | 13 | /** 14 | * Returns the transaction id. 15 | * 16 | * @return 17 | */ 18 | String getTxId(); 19 | 20 | /** 21 | * Returns the key's value at the time returned by {@link #getTimestamp()}. 22 | * 23 | * @return 24 | */ 25 | byte[] getValue(); 26 | 27 | /** 28 | * Returns the key's value at the time returned by {@link #getTimestamp()}, 29 | * decoded as a UTF-8 string. 30 | * 31 | * @return 32 | */ 33 | String getStringValue(); 34 | 35 | /** 36 | * Returns the timestamp of the key modification entry. 37 | * 38 | * @return 39 | */ 40 | java.time.Instant getTimestamp(); 41 | 42 | /** 43 | * Returns the deletion marker. 44 | * 45 | * @return 46 | */ 47 | boolean isDeleted(); 48 | 49 | } -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/intfs/opts/IKeyImportOpts.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.csp.intfs.opts; 2 | 3 | /** 4 | * Copyright BCIA. All Rights Reserved. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * @author zhanglin 21 | * @purpose Define the interface, IKeyImportOpts 22 | * @date 2018-01-25 23 | * @company Dingxuan 24 | */ 25 | 26 | // IKeyImportOpts contains options for importing the raw material of a key with a CSP. 27 | public interface IKeyImportOpts extends IAlgorithmOpts, IKeyOpts { 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/Node3.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip; 17 | 18 | import org.bcia.julongchain.common.log.JulongChainLog; 19 | import org.bcia.julongchain.common.log.JulongChainLogFactory; 20 | 21 | /** 22 | * Gossip测试节点,第三个节点 23 | * 24 | * @author wanliangbing 25 | * @date 2018-02-28 26 | * @company Dingxuan 27 | */ 28 | public class Node3 { 29 | private static JulongChainLog log = JulongChainLogFactory.getLog(Node3.class); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/Node4.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip; 17 | 18 | import org.bcia.julongchain.common.log.JulongChainLog; 19 | import org.bcia.julongchain.common.log.JulongChainLogFactory; 20 | 21 | /** 22 | * Gossip测试节点,第四个节点 23 | * 24 | * @author wanliangbing 25 | * @date 2018-02-28 26 | * @company Dingxuan 27 | */ 28 | public class Node4 { 29 | private static JulongChainLog log = JulongChainLogFactory.getLog(Node4.class); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/images/consenter/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright Dingxuan. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | FROM julongchain/julongchain-baseimage 16 | MAINTAINER Julongchain "qkl@dxct.org" 17 | COPY julongchain.jar /root/julongchain 18 | COPY config/ /root/julongchain/config 19 | COPY msp/ /root/julongchain/msp 20 | COPY lib/ /root/julongchain/lib 21 | COPY libsdtsmjni.so /lib 22 | COPY libsdtsm.so /lib 23 | ENV LANG C.UTF-8 24 | WORKDIR /root/julongchain 25 | CMD java -jar /root/julongchain/julongchain.jar consenter start 26 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/Node1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip; 17 | 18 | import org.bcia.julongchain.common.log.JulongChainLog; 19 | import org.bcia.julongchain.common.log.JulongChainLogFactory; 20 | 21 | /** 22 | * Gossip测试节点,第一个节点 23 | * 24 | * @author wanliangbing 25 | * @date 2018-02-28 26 | * @company Dingxuan 27 | */ 28 | public class Node1 { 29 | 30 | private static JulongChainLog log = JulongChainLogFactory.getLog(Node1.class); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/Node2.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip; 17 | 18 | import org.bcia.julongchain.common.log.JulongChainLog; 19 | import org.bcia.julongchain.common.log.JulongChainLogFactory; 20 | 21 | /** 22 | * Gossip测试节点,第二个节点 23 | * 24 | * @author wanliangbing 25 | * @date 2018-02-28 26 | * @company Dingxuan 27 | */ 28 | public class Node2 { 29 | 30 | private static JulongChainLog log = JulongChainLogFactory.getLog(Node2.class); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/bcia/julongchain/msp/ConfigBuilderTest.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.msp; 2 | 3 | import org.bcia.julongchain.msp.util.LoadLocalMspFiles; 4 | 5 | import org.bouncycastle.util.encoders.Base64; 6 | import org.junit.Test; 7 | 8 | import java.security.spec.PKCS8EncodedKeySpec; 9 | 10 | 11 | 12 | /** 13 | * @author zhangmingyang 14 | * @Date: 2018/4/8 15 | * @company Dingxuan 16 | */ 17 | public class ConfigBuilderTest { 18 | 19 | @Test 20 | public void iteratorPath() { 21 | 22 | PKCS8EncodedKeySpec pkcs8EncodedKeySpec=new PKCS8EncodedKeySpec("123".getBytes()); 23 | 24 | byte[] bytes=pkcs8EncodedKeySpec.getEncoded(); 25 | 26 | java.lang.String publiKey=java.lang.String.valueOf(Base64.encode(bytes)); 27 | // new String(Base64.encode(bytes)); 28 | // Base64.encode(bytes); 29 | System.out.println(publiKey); 30 | 31 | } 32 | 33 | @Test 34 | public void init() { 35 | // LoadLocalMspFiles.init("E:/msp"); 36 | // System.out.println(LoadLocalMspFiles.mspMap.get("E:\\msp\\keystore\\privatekey.pem")); 37 | } 38 | } -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/deliverservice/blocksprovider/ILedgerInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.deliverservice.blocksprovider; 17 | 18 | import org.bcia.julongchain.common.exception.ConsenterException; 19 | 20 | /** 21 | * 账本信息接口 22 | * 23 | * @author zhangmingyang 24 | * @Date: 2018/5/31 25 | * @company Dingxuan 26 | */ 27 | public interface ILedgerInfo { 28 | long getLedgerHeight() throws ConsenterException; 29 | } 30 | -------------------------------------------------------------------------------- /src/test/java/org/bcia/julongchain/core/ledger/kvledger/history/historydb/IHistoryDBProviderTest.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.core.ledger.kvledger.history.historydb; 2 | 3 | import org.bcia.julongchain.core.ledger.INodeLedger; 4 | import org.bcia.julongchain.core.ledger.kvledger.history.IHistoryQueryExecutor; 5 | import org.bcia.julongchain.protos.common.Common; 6 | import org.junit.BeforeClass; 7 | import org.junit.Test; 8 | 9 | import static org.junit.Assert.*; 10 | 11 | /** 12 | * 历史数据库提供者测试类 13 | * 14 | * @author sunzongyu 15 | * @date 2018/08/29 16 | * @company Dingxuan 17 | */ 18 | public class IHistoryDBProviderTest { 19 | static INodeLedger l; 20 | static Common.Block block; 21 | static IHistoryQueryExecutor hqe; 22 | static IHistoryDBProvider provider; 23 | 24 | @BeforeClass 25 | public static void setUp() throws Exception { 26 | provider = new HistoryLevelDBProvider(); 27 | } 28 | 29 | 30 | @Test 31 | public void getDBHandle() throws Exception{ 32 | IHistoryDB db = provider.getDBHandle("myGroup"); 33 | assertNotNull(db); 34 | assertEquals(db, provider.getDBHandle("myGroup")); 35 | } 36 | } -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/api/INodeSuspector.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip.api; 17 | 18 | /** 19 | * 类描述 20 | * 21 | * @author wanliangbing 22 | * @date 2018/08/20 23 | * @company Dingxuan 24 | */ 25 | public interface INodeSuspector { 26 | 27 | /** 28 | * NodeSuspector 返回节点不管该节点是否有嫌疑或被取消证书资格 29 | * @param nodeIdentity 30 | * @return 31 | */ 32 | public Boolean execute(byte[] nodeIdentity); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Notice.md: -------------------------------------------------------------------------------- 1 | 声明
2 | 3 | 1、本项目中调用gRPC框架所采用的Protobuf协议中,用到的所有Proto文件等复用了Hyperledger Fabric的Proto文本,并修改了包名和若干内容以适配 4 | 当前项目,同时保留了Hyperledger Fabric的License声明。
5 | 2、本项目中的shim模块复用了Hyperledger Fabric的shim模块的代码,做了部分修改,同时保留了Hyperledger Fabric的License声明。
6 | 3、本项目中其他部分的代码,采用Java语言进行实现,架构和逻辑上参考了Hyperledger Fabric项目(Go语言),并采用Apache 2.0的License协议发布。Hyperledger Fabric 7 | 的Go语言源码采用的License声明如下:
8 | /* 9 | Copyright IBM Corp. All Rights Reserved. 10 | 11 | SPDX-License-Identifier: Apache-2.0 12 | */ 13 | 14 | 和 15 | 16 | /* 17 | Copyright IBM Corp. 2017 All Rights Reserved. 18 | Licensed under the Apache License, Version 2.0 (the "License"); 19 | you may not use this file except in compliance with the License. 20 | You may obtain a copy of the License at 21 | http://www.apache.org/licenses/LICENSE-2.0 22 | Unless required by applicable law or agreed to in writing, software 23 | distributed under the License is distributed on an "AS IS" BASIS, 24 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25 | See the License for the specific language governing permissions and 26 | limitations under the License. 27 | */ -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/resourceconfig/config/IResourcesConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.resourceconfig.config; 17 | 18 | /** 19 | * 资源配置接口 20 | * 21 | * @author zhouhui 22 | * @date 2018/4/23 23 | * @company Dingxuan 24 | */ 25 | public interface IResourcesConfig { 26 | IApisConfig getApiConfig(); 27 | 28 | NodePoliciesConfig getNodePoliciesConfig(); 29 | 30 | ISmartContractsConfig getSmartContractsConfig(); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/events/IDeliverHandler.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.events; 17 | 18 | import org.bcia.julongchain.protos.common.Common; 19 | import org.bcia.julongchain.protos.node.EventsPackage; 20 | 21 | /** 22 | * 投递处理器 23 | * 24 | * @author zhouhui 25 | * @date 2018/3/21 26 | * @company Dingxuan 27 | */ 28 | public interface IDeliverHandler { 29 | EventsPackage.DeliverResponse handle(Common.Envelope envelope); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/consenter/entity/ConfigMessage.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.consenter.entity; 17 | import org.bcia.julongchain.protos.common.Common; 18 | 19 | /** 20 | * 配置消息 21 | * 22 | * @author zhangmingyang 23 | * @date 2018/08/30 24 | * @company Dingxuan 25 | */ 26 | public class ConfigMessage extends Message { 27 | public ConfigMessage(long configSeq, Common.Envelope message){ 28 | super(configSeq, message); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/gmt0016/ftsafe/util/GMRngOpts.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Feitian. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.csp.gmt0016.ftsafe.util; 17 | 18 | import org.bcia.julongchain.csp.intfs.opts.IRngOpts; 19 | 20 | /** 21 | * Class description 22 | * 23 | * @author Ying Xu 24 | * @date 7/4/18 25 | * @company FEITIAN 26 | */ 27 | public class GMRngOpts implements IRngOpts { 28 | 29 | @Override 30 | public String getAlgorithm() { 31 | return ""; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/gossip/IVerifier.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip.gossip; 17 | 18 | import org.bcia.julongchain.common.exception.GossipException; 19 | 20 | /** 21 | * class description 22 | * 23 | * @author wanliangbing 24 | * @date 18-7-24 25 | * @company Dingxuan 26 | */ 27 | public interface IVerifier { 28 | 29 | public void execute(byte[] nodeIdentity, byte[] signature, byte[] message) throws GossipException; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/resourceconfig/config/NodePoliciesConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.resourceconfig.config; 17 | 18 | import org.bcia.julongchain.protos.common.Configtx; 19 | 20 | /** 21 | * 节点策略配置对象 22 | * 23 | * @author zhouhui 24 | * @date 2018/4/19 25 | * @company Dingxuan 26 | */ 27 | public class NodePoliciesConfig implements INodePoliciesConfig { 28 | public NodePoliciesConfig(Configtx.ConfigTree tree) { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/gmt0016/ftsafe/IGMT0016KeyImportOpts.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Feitian. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.csp.gmt0016.ftsafe; 17 | 18 | import org.bcia.julongchain.csp.intfs.opts.IKeyImportOpts; 19 | 20 | /** 21 | * Interface description 22 | * 23 | * @author Ying Xu 24 | * @date 7/4/18 25 | * @company FEITIAN 26 | */ 27 | public interface IGMT0016KeyImportOpts extends IKeyImportOpts { 28 | 29 | public long getAlgID(); 30 | 31 | public int getIndex(); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/gmt0016/ftsafe/symmetry/ISymmKeyGenOpts.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Feitian. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.csp.gmt0016.ftsafe.symmetry; 17 | 18 | import org.bcia.julongchain.csp.intfs.opts.IKeyGenOpts; 19 | 20 | /** 21 | * Interface description 22 | * 23 | * @author Ying Xu 24 | * @date 7/4/18 25 | * @company FEITIAN 26 | */ 27 | public interface ISymmKeyGenOpts extends IKeyGenOpts { 28 | 29 | public int getBitLen(); 30 | 31 | public long getAlgID(); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/ledger/blockledger/IWriter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Dingxuan. All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.ledger.blockledger; 17 | 18 | import org.bcia.julongchain.common.exception.LedgerException; 19 | import org.bcia.julongchain.protos.common.Common; 20 | 21 | /** 22 | * 文件写入接口 23 | * 24 | * @author sunzongyu 25 | * @date 2018/04/26 26 | * @company Dingxuan 27 | */ 28 | public interface IWriter { 29 | /** 30 | * 写入区块 31 | */ 32 | void append(Common.Block block) throws LedgerException; 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/policies/IPolicyProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.policies; 17 | 18 | import org.bcia.julongchain.common.exception.PolicyException; 19 | import org.bcia.julongchain.common.policies.policy.IPolicy; 20 | 21 | /** 22 | * 策略提供者 23 | * 24 | * @author zhouhui 25 | * @date 2018/3/9 26 | * @company Dingxuan 27 | */ 28 | public interface IPolicyProvider { 29 | IPolicy makePolicy(byte[] data) throws PolicyException; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/resourceconfig/config/ISmartContractsConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.resourceconfig.config; 17 | 18 | import org.bcia.julongchain.common.resourceconfig.ISmartContractDefinition; 19 | 20 | /** 21 | * 智能合约集配置接口 22 | * 23 | * @author zhouhui 24 | * @date 2018/4/23 25 | * @company Dingxuan 26 | */ 27 | public interface ISmartContractsConfig { 28 | ISmartContractDefinition getSmartContractByName(String scName); 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/consenter/entity/NormalMessage.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.consenter.entity; 17 | 18 | import org.bcia.julongchain.protos.common.Common; 19 | 20 | /** 21 | * 普通消息 22 | * 23 | * @author zhangmingyang 24 | * @date 2018/08/30 25 | * @company Dingxuan 26 | */ 27 | public class NormalMessage extends Message { 28 | public NormalMessage(long configSeq, Common.Envelope message) { 29 | super(configSeq, message); 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/ledger/kvledger/txmgmt/privacyenabledstate/IDBProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Dingxuan. All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.ledger.kvledger.txmgmt.privacyenabledstate; 17 | 18 | import org.bcia.julongchain.common.exception.LedgerException; 19 | 20 | /** 21 | * DB提供者接口 22 | * 23 | * @author sunzongyu 24 | * @date 2018/04/17 25 | * @company Dingxuan 26 | */ 27 | public interface IDBProvider { 28 | 29 | IDB getDBHandle(String id) throws LedgerException; 30 | 31 | void close() throws LedgerException; 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/gmt0016/ftsafe/IGMT0016Csp.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Feitian. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.csp.gmt0016.ftsafe; 17 | 18 | import org.bcia.julongchain.common.exception.CspException; 19 | import org.bcia.julongchain.csp.intfs.ICsp; 20 | 21 | /** 22 | * Interface description 23 | * 24 | * @author Ying Xu 25 | * @date 7/10/18 26 | * @company FEITIAN 27 | */ 28 | public interface IGMT0016Csp extends ICsp { 29 | 30 | public void finalized() throws CspException; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/pkcs11/IPKCS11Csp.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bcia.julongchain.csp.pkcs11; 18 | 19 | import org.bcia.julongchain.common.exception.JulongChainException; 20 | import org.bcia.julongchain.csp.intfs.ICsp; 21 | 22 | /** 23 | * 基于PKCS11实现的CSP接口定义 24 | * 25 | * @author Ying Xu 26 | * @date 2018/05/21 27 | * @company FEITIAN 28 | */ 29 | public interface IPKCS11Csp extends ICsp { 30 | 31 | public void finalized() throws JulongChainException; 32 | } 33 | -------------------------------------------------------------------------------- /src/main/resources/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/groupconfig/capability/IConsenterCapabilities.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.groupconfig.capability; 17 | 18 | /** 19 | * 共识节点支持能力接口 20 | * 21 | * @author zhouhui 22 | * @date 2018/3/27 23 | * @company Dingxuan 24 | */ 25 | public interface IConsenterCapabilities { 26 | boolean isSupported(); 27 | 28 | boolean isPredictableGroupTemplate(); 29 | 30 | boolean isResubmission(); 31 | 32 | boolean isExpiration(); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/gmt0016/excelsecu/common/DeviceState.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright BCIA. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.csp.gmt0016.excelsecu.common; 17 | 18 | /** 19 | * GM0016 设备状态常数 20 | * 21 | * @author chenhao 22 | * @date 2018/4/2 23 | * @company Excelsecu 24 | */ 25 | public class DeviceState { 26 | public static final int DEV_ABSENT_STATE = 0x00000000; 27 | public static final int DEV_PRESENT_STATE = 0x00000001; 28 | public static final int DEV_UNKNOW_STATE = 0x00000002; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/images/node/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright Dingxuan. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | FROM julongchain/julongchain-baseimage 16 | MAINTAINER Julongchain "qkl@dxct.org" 17 | COPY julongchain.jar /root/julongchain 18 | COPY config/ /root/julongchain/config 19 | COPY msp/ /root/julongchain/msp 20 | COPY lib/ /root/julongchain/lib 21 | COPY smartcontract/ root/julongchain/smartcontract 22 | COPY libsdtsmjni.so /lib 23 | COPY libsdtsm.so /lib 24 | ENV LANG C.UTF-8 25 | WORKDIR /root/julongchain 26 | CMD java -jar /root/julongchain/julongchain.jar node start 27 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/commiter/ICommitterValidator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.commiter; 17 | 18 | import org.bcia.julongchain.common.exception.ValidateException; 19 | import org.bcia.julongchain.protos.common.Common; 20 | 21 | /** 22 | * Committer节点校验器接口 23 | * 24 | * @author zhouhui 25 | * @date 2018/05/23 26 | * @company Dingxuan 27 | */ 28 | public interface ICommitterValidator { 29 | Common.Block validate(Common.Block block) throws ValidateException; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/intfs/opts/IKeyOpts.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.csp.intfs.opts; 2 | 3 | /** 4 | * Copyright BCIA. All Rights Reserved. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * @author zhanglin 21 | * @purpose Define the interface, IKeyOpts 22 | * @date 2018-01-25 23 | * @company Dingxuan 24 | */ 25 | 26 | // The IKeyOpts contains options for keys with a CSP. 27 | public interface IKeyOpts { 28 | 29 | // The isEphemeral returns true if this key is expected to be ephemeral, false otherwise. 30 | boolean isEphemeral(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/genesis/IGenesisBlockFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.genesis; 17 | 18 | import org.bcia.julongchain.common.exception.JulongChainException; 19 | import org.bcia.julongchain.protos.common.Common; 20 | 21 | /** 22 | * 创世区块工厂接口 23 | * 24 | * @author zhouhui 25 | * @date 2018/4/25 26 | * @company Dingxuan 27 | */ 28 | public interface IGenesisBlockFactory { 29 | Common.Block getGenesisBlock(String groupId) throws JulongChainException; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/groupconfig/config/IApplicationOrgConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.groupconfig.config; 17 | 18 | import org.bcia.julongchain.protos.node.Configuration; 19 | 20 | import java.util.List; 21 | 22 | /** 23 | * 应用组织配置接口 24 | * 25 | * @author zhouhui 26 | * @date 2018/3/27 27 | * @company Dingxuan 28 | */ 29 | public interface IApplicationOrgConfig extends IOrganizationConfig { 30 | 31 | List getAnchorNodes(); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/discovery/IEnvelopeFilter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip.discovery; 17 | 18 | import org.bcia.julongchain.gossip.gossip.SignedGossipMessage; 19 | import org.bcia.julongchain.protos.gossip.Message; 20 | 21 | /** 22 | * class description 23 | * 24 | * @author wanliangbing 25 | * @date 18-7-24 26 | * @company Dingxuan 27 | */ 28 | public interface IEnvelopeFilter { 29 | 30 | public Message.Envelope execute(SignedGossipMessage message); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/deliver/ISender.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.deliver; 17 | 18 | 19 | import com.google.protobuf.InvalidProtocolBufferException; 20 | import com.google.protobuf.Message; 21 | import org.bcia.julongchain.common.exception.ConsenterException; 22 | 23 | /** 24 | * 发送者接口 25 | * 26 | * @author zhangmingyang 27 | * @Date: 2018/5/29 28 | * @company Dingxuan 29 | */ 30 | public interface ISender { 31 | void send(Message msg) throws ConsenterException; 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/aclmgmt/AclManagement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.aclmgmt; 17 | 18 | /** 19 | * 类描述 20 | * 21 | * @author sunianle 22 | * @date 3/14/18 23 | * @company Dingxuan 24 | */ 25 | public class AclManagement { 26 | private static IAclProvider provider; 27 | public static synchronized IAclProvider getACLProvider(){ 28 | if(provider==null){ 29 | provider=new AclProvider(); 30 | } 31 | return provider; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/consenter/common/cmd/IConsenterCmd.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.consenter.common.cmd; 17 | 18 | 19 | import org.apache.commons.cli.ParseException; 20 | 21 | /** 22 | * consenter命令行接口 23 | * @author zhangmingyang 24 | * @Date: 2018/3/1 25 | * @company Dingxuan 26 | */ 27 | public interface IConsenterCmd { 28 | /** 29 | * cmd命令执行方法 30 | * @param args 31 | * @throws ParseException 32 | */ 33 | void execCmd(String[] args) throws ParseException; 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/deliverservice/blocksprovider/IStreamClient.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.deliverservice.blocksprovider; 17 | 18 | /** 19 | * 流客户端 20 | * 21 | * @author zhangmingyang 22 | * @Date: 2018/5/31 23 | * @company Dingxuan 24 | */ 25 | public interface IStreamClient extends IBlocksDeliverer { 26 | void updateEndpoints(String[] endpoints); 27 | 28 | String[] getEndpoints(); 29 | 30 | void close(); 31 | 32 | void disConnect(boolean disableEndpoint); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/common/smartcontractprovider/ISmartContractCacheSupport.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.common.smartcontractprovider; 17 | 18 | /** 19 | * 类描述 20 | * 21 | * @author sunianle 22 | * @date 5/11/18 23 | * @company Dingxuan 24 | */ 25 | public interface ISmartContractCacheSupport { 26 | /** 27 | * 获取智能合约 28 | * @param name 29 | * @param version 30 | * @return 31 | */ 32 | ISmartContractPackage getSmartContract(String name,String version); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/intfs/opts/IAlgorithmOpts.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.csp.intfs.opts; 2 | 3 | /** 4 | * Copyright Dingxuan. All Rights Reserved. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * @author zhanglin 21 | * @purpose Define the interface, IAlgorithmOpts 22 | * @date 2018-01-25 23 | * @company Dingxuan 24 | */ 25 | 26 | // IAlgorithmOpts contains options for algorithms with a CSP. 27 | public interface IAlgorithmOpts { 28 | 29 | // The getAlgorithm returns an identifier for algorithms or cipher suites to be used. 30 | String getAlgorithm(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/msp/ISigningIdentity.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.msp; 17 | 18 | /** 19 | * 签名身份接口 20 | * 21 | * @author zhangmingyang 22 | * @Date: 2018/3/8 23 | * @company Dingxuan 24 | */ 25 | public interface ISigningIdentity { 26 | /** 27 | * 对消息进行签名 28 | * 29 | * @param msg 待签名消息 30 | * @return 31 | */ 32 | byte[] sign(byte[] msg); 33 | 34 | /** 35 | * 返回此身份的公共部分 36 | * 37 | * @return 38 | */ 39 | IIdentity getIdentity(); 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/groupconfig/capability/IApplicationCapabilities.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.groupconfig.capability; 17 | 18 | /** 19 | * 应用支持能力接口 20 | * 21 | * @author zhouhui 22 | * @date 2018/3/27 23 | * @company Dingxuan 24 | */ 25 | public interface IApplicationCapabilities { 26 | boolean isSupported(); 27 | 28 | boolean isForbidDuplicateTxId(); 29 | 30 | boolean isResourcesTree(); 31 | 32 | boolean isPrivateGroupData(); 33 | 34 | boolean isValidation(); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/policies/policy/IPolicy.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.policies.policy; 17 | 18 | import org.bcia.julongchain.common.exception.PolicyException; 19 | import org.bcia.julongchain.common.util.proto.SignedData; 20 | 21 | import java.util.List; 22 | 23 | /** 24 | * 策略接口 25 | * 26 | * @author zhouhui 27 | * @date 2018/3/9 28 | * @company Dingxuan 29 | */ 30 | public interface IPolicy { 31 | 32 | void evaluate(List signatureList) throws PolicyException; 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/protos/IProtoVO.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.protos; 17 | 18 | import com.google.protobuf.InvalidProtocolBufferException; 19 | import org.bcia.julongchain.common.exception.ValidateException; 20 | 21 | /** 22 | * Proto消息对象相应的业务对象接口定义 23 | * 24 | * @author zhouhui 25 | * @date 2018/05/26 26 | * @company Dingxuan 27 | */ 28 | public interface IProtoVO { 29 | void parseFrom(T t) throws InvalidProtocolBufferException, ValidateException; 30 | 31 | T toProto(); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/ledger/IStateListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Dingxuan. All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.ledger; 17 | 18 | import org.bcia.julongchain.common.exception.JulongChainException; 19 | import org.bcia.julongchain.protos.ledger.rwset.kvrwset.KvRwset; 20 | 21 | import java.util.List; 22 | 23 | /** 24 | * 状态监听器 25 | * 26 | * @author sunzongyu 27 | * @date 2018/04/16 28 | * @company Dingxuan 29 | */ 30 | public interface IStateListener { 31 | 32 | void handleStateUpdates(String ledgerID, List stateUpdates) throws JulongChainException; 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/smartcontract/node/ReadWriteRunningUtil.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | * 4 | *

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | *

http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | *

Unless required by applicable law or agreed to in writing, software distributed under the 10 | * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 11 | * express or implied. See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.bcia.julongchain.core.smartcontract.node; 15 | 16 | import org.bcia.julongchain.common.log.JulongChainLog; 17 | import org.bcia.julongchain.common.log.JulongChainLogFactory; 18 | 19 | /** 20 | * 类描述 21 | * 22 | * @author wanliangbing 23 | * @date 2018/4/25 24 | * @company Dingxuan 25 | */ 26 | public class ReadWriteRunningUtil { 27 | 28 | private static JulongChainLog logger = JulongChainLogFactory.getLog(ReadWriteRunningUtil.class); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/events/consumer/IEventAdapter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.events.consumer; 17 | 18 | import org.bcia.julongchain.protos.node.EventsPackage; 19 | 20 | import java.util.List; 21 | 22 | /** 23 | * 事件适配器接口 24 | * 25 | * @author zhouhui 26 | * @date 2018/05/19 27 | * @company Dingxuan 28 | */ 29 | public interface IEventAdapter { 30 | List getInterestedEvents(); 31 | 32 | boolean receive(EventsPackage.Event event); 33 | 34 | void disconnected(); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/proto/common/ledger.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | Modified java_package and other contents by Dingxuan on 2018-03-21 17 | */ 18 | syntax = "proto3"; 19 | 20 | option go_package = "github.com/hyperledger/fabric/protos/common"; 21 | option java_package = "org.bcia.julongchain.protos.common"; 22 | 23 | package common; 24 | 25 | // Contains information about the blockchain ledger such as height, current 26 | // block hash, and previous block hash. 27 | message BlockchainInfo { 28 | uint64 height = 1; 29 | bytes currentBlockHash = 2; 30 | bytes previousBlockHash = 3; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/tools/cryptogen/bean/UserSpec.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright BCIA. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.bcia.julongchain.common.tools.cryptogen.bean; 18 | 19 | /** 20 | * crypto-config.yaml 节点配置数据类 users 部分 21 | * 22 | * @author chenhao, liuxifeng 23 | * @date 2018/4/20 24 | * @company Excelsecu 25 | */ 26 | public class UserSpec { 27 | 28 | private int count = 0; 29 | 30 | public int getCount() { 31 | return count; 32 | } 33 | 34 | public void setCount(int count) { 35 | this.count = count; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/deliverservice/blocksprovider/IBlocksDeliverer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.deliverservice.blocksprovider; 17 | 18 | import org.bcia.julongchain.protos.common.Common; 19 | import org.bcia.julongchain.protos.consenter.Ab; 20 | 21 | /** 22 | * 块deliver服务接口 23 | * 24 | * @author zhangmingyang 25 | * @Date: 2018/5/31 26 | * @company Dingxuan 27 | */ 28 | public interface IBlocksDeliverer { 29 | Ab.DeliverResponse recv(); 30 | 31 | void send(Common.Envelope envelope); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/deliver/IDeliverHandlerSupport.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.deliver; 17 | 18 | 19 | import com.google.protobuf.Message; 20 | import org.bcia.julongchain.protos.common.Common; 21 | 22 | 23 | /** 24 | * Deliver服务处理支持接口 25 | * 26 | * @author zhangmingyang 27 | * @Date: 2018/5/29 28 | * @company Dingxuan 29 | */ 30 | public interface IDeliverHandlerSupport { 31 | Message createStatusReply(Common.Status status); 32 | 33 | Message createBlockReply(Common.Block block); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/ssc/ISystemSmartContract.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.ssc; 17 | 18 | import org.bcia.julongchain.core.smartcontract.shim.ISmartContract; 19 | 20 | /** 21 | * 系统智能合约 22 | * 23 | * @author sunianle 24 | * @date 3/7/18 25 | * @company Dingxuan 26 | */ 27 | public interface ISystemSmartContract extends ISmartContract { 28 | void setSystemSmartContractDescriptor(SystemSmartContractDescriptor descriptor); 29 | SystemSmartContractDescriptor getSystemSmartContractDescriptor(); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/gm/sdt/sm4/SM4EncrypterOpts.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright SDT. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.csp.gm.sdt.sm4; 17 | import org.bcia.julongchain.csp.intfs.opts.IEncrypterOpts; 18 | 19 | 20 | /** 21 | * GM SM4加密选项 22 | * 23 | * @author tengxiumin 24 | * @date 2018/05/08 25 | * @company SDT 26 | */ 27 | public class SM4EncrypterOpts implements IEncrypterOpts { 28 | 29 | /** 30 | * 获取算法名称 31 | * @return 算法名称 32 | */ 33 | @Override 34 | public String getAlgorithm() { 35 | return "SM4"; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/ledger/kvledger/txmgmt/validator/valinternal/InternalValidator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Dingxuan. All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.ledger.kvledger.txmgmt.validator.valinternal; 17 | 18 | import org.bcia.julongchain.common.exception.LedgerException; 19 | 20 | /** 21 | * 内部验证器接口 22 | * 23 | * @author sunzongyu 24 | * @date 2018/04/19 25 | * @company Dingxuan 26 | */ 27 | public interface InternalValidator { 28 | /** 29 | * 执行检验并准备更新包 30 | */ 31 | PubAndHashUpdates validateAndPrepareBatch(Block block, boolean doMVCCValidation) throws LedgerException; 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/gm/sdt/sm4/SM4DecrypterOpts.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright SDT. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.csp.gm.sdt.sm4; 17 | 18 | import org.bcia.julongchain.csp.intfs.opts.IDecrypterOpts; 19 | 20 | 21 | /** 22 | * GM SM4解密选项 23 | * 24 | * @author tengxiumin 25 | * @date 2018/05/08 26 | * @company SDT 27 | */ 28 | public class SM4DecrypterOpts implements IDecrypterOpts { 29 | 30 | /** 31 | * 获取算法名称 32 | * @return 算法名称 33 | */ 34 | @Override 35 | public String getAlgorithm() { 36 | return "SM4"; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/images/scenv/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright Dingxuan. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | FROM docker.julongchain.org:5000/julongchain-baseimage:0.8.3-alpha 16 | MAINTAINER Julongchain "qkl@dxct.org" 17 | COPY pom.xml /root/julongchain 18 | COPY src/ /root/julongchain/src 19 | WORKDIR /root/julongchain 20 | ENV CORE_NODE_ADDRESS #core_node_address# 21 | ENV LANG C.UTF-8 22 | RUN mvn package 23 | RUN rm -rf /root/julongchain/pom.xml 24 | RUN rm -rf /root/julongchain/src 25 | CMD java -jar /root/julongchain/target/julongchain-smartcontract-java-jar-with-dependencies.jar -i #smart_contract_id -a #core_node_address_and_port -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/deliverservice/blocksprovider/IBlocksProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.deliverservice.blocksprovider; 17 | 18 | import com.google.protobuf.InvalidProtocolBufferException; 19 | 20 | /** 21 | * 块提供者接口 22 | * 23 | * @author zhangmingyang 24 | * @Date: 2018/5/31 25 | * @company Dingxuan 26 | */ 27 | public interface IBlocksProvider { 28 | void deliverBlocks() throws InvalidProtocolBufferException; 29 | 30 | void updateOrderingEndpoints(String[] endpoints); 31 | 32 | void stop(); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/gm/dxct/sm4/SM4DecrypterOpts.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.csp.gm.dxct.sm4; 17 | 18 | import org.bcia.julongchain.csp.gm.dxct.util.GmCspConstant; 19 | import org.bcia.julongchain.csp.intfs.opts.IDecrypterOpts; 20 | 21 | /** 22 | * sm4解密选项 23 | * 24 | * @author zhangmingyang 25 | * @Date: 2018/4/28 26 | * @company Dingxuan 27 | */ 28 | public class SM4DecrypterOpts implements IDecrypterOpts { 29 | @Override 30 | public String getAlgorithm() { 31 | return GmCspConstant.SM4; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/gm/dxct/sm4/SM4EncrypterOpts.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.csp.gm.dxct.sm4; 17 | 18 | import org.bcia.julongchain.csp.gm.dxct.util.GmCspConstant; 19 | import org.bcia.julongchain.csp.intfs.opts.IEncrypterOpts; 20 | 21 | /** 22 | * sm4 加密选项 23 | * 24 | * @author zhangmingyang 25 | * @Date: 2018/4/28 26 | * @company Dingxuan 27 | */ 28 | public class SM4EncrypterOpts implements IEncrypterOpts { 29 | @Override 30 | public String getAlgorithm() { 31 | return GmCspConstant.SM4; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/ledger/kvledger/history/IHistoryQueryExecutor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Dingxuan. All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.ledger.kvledger.history; 17 | 18 | import org.bcia.julongchain.common.exception.LedgerException; 19 | import org.bcia.julongchain.common.ledger.IResultsIterator; 20 | 21 | /** 22 | * 历史查询器接口 23 | * 24 | * @author sunzongyu 25 | * @date 2018/04/25 26 | * @company Dingxuan 27 | */ 28 | public interface IHistoryQueryExecutor { 29 | 30 | /** 31 | * 查询HistoryDB中数据 32 | */ 33 | IResultsIterator getHistoryForKey(String namespace, String key) throws LedgerException; 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/gm/dxct/GmKeyImportOpts.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.csp.gm.dxct; 17 | 18 | import org.bcia.julongchain.csp.intfs.opts.IKeyImportOpts; 19 | 20 | /** 21 | *国米密钥导入选项 22 | * @author zhangmingyang 23 | * @Date: 2018/4/18 24 | * @company Dingxuan 25 | */ 26 | public class GmKeyImportOpts implements IKeyImportOpts { 27 | @Override 28 | public String getAlgorithm() { 29 | return null; 30 | } 31 | 32 | @Override 33 | public boolean isEphemeral() { 34 | return false; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/gm/sdt/sm3/SM3HashOpts.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright SDT. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.csp.gm.sdt.sm3; 17 | 18 | import org.bcia.julongchain.csp.intfs.opts.IHashOpts; 19 | 20 | /** 21 | * GM SM3哈希选项 22 | * 23 | * @author tengxiumin 24 | * @date 2018/05/14 25 | * @company SDT 26 | */ 27 | public class SM3HashOpts implements IHashOpts { 28 | 29 | public SM3HashOpts() {} 30 | 31 | /** 32 | * 获取算法名称 33 | * @return 算法名称 34 | */ 35 | @Override 36 | public String getAlgorithm() { 37 | return "SM3"; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/pkcs11/sw/IPKCS11SwFactoryOpts.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Feitian. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.csp.pkcs11.sw; 17 | 18 | import org.bcia.julongchain.csp.factory.IFactoryOpts; 19 | 20 | /** 21 | * 基于PKCS11软实现factory接口 22 | * 23 | * @author 24 | * @date 5/25/18 25 | * @company FEITIAN 26 | */ 27 | public interface IPKCS11SwFactoryOpts extends IFactoryOpts { 28 | 29 | // get soft verify flag 30 | public boolean getSoftVerify(); 31 | 32 | // 33 | public boolean getNoImport(); 34 | 35 | // 36 | public String getPath(); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/deliver/ISupport.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.deliver; 17 | 18 | import org.bcia.julongchain.common.ledger.blockledger.IReader; 19 | import org.bcia.julongchain.common.policies.IPolicyManager; 20 | 21 | /** 22 | * support接口,继承权限控制支持接口 23 | * 24 | * @author zhangmingyang 25 | * @Date: 2018/5/29 26 | * @company Dingxuan 27 | */ 28 | public interface ISupport extends IAccessControlSupport { 29 | long sequence(); 30 | 31 | IPolicyManager getPolicyManager(); 32 | 33 | IReader getReader(); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/tools/cryptogen/cmd/ICryptoGenCmd.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright BCIA. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.tools.cryptogen.cmd; 17 | 18 | import org.bcia.julongchain.common.exception.JulongChainException; 19 | 20 | /** 21 | * 命令类接口 22 | * 23 | * @author chenhao, liuxifeng 24 | * @date 2018/4/16 25 | * @company Excelsecu 26 | */ 27 | public interface ICryptoGenCmd { 28 | 29 | /** 30 | * 执行命令 31 | * @param args 命令参数 32 | * @throws JulongChainException 33 | */ 34 | void execCmd(String[] args) throws JulongChainException; 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/consenter/common/bootstrap/IHelper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.consenter.common.bootstrap; 17 | 18 | import org.bcia.julongchain.common.exception.ConsenterException; 19 | import org.bcia.julongchain.protos.common.Common; 20 | 21 | /** 22 | * 获取创世区块接口 23 | * 24 | * @author zhangmingyang 25 | * @Date: 2018/5/9 26 | * @company Dingxuan 27 | */ 28 | public interface IHelper { 29 | /** 30 | * 获取创世区块 31 | * 32 | * @return 33 | */ 34 | Common.Block getGenesisBlock() throws ConsenterException; 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/events/IDeliverEventsServer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.events; 17 | 18 | import org.bcia.julongchain.protos.common.Common; 19 | import org.bcia.julongchain.protos.node.EventsPackage; 20 | 21 | /** 22 | * 投递事件服务接口 23 | * 24 | * @author zhouhui 25 | * @date 2018/3/21 26 | * @company Dingxuan 27 | */ 28 | public interface IDeliverEventsServer { 29 | EventsPackage.DeliverResponse deliverFiltered(Common.Envelope envelope); 30 | 31 | EventsPackage.DeliverResponse deliver(Common.Envelope envelope); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/gm/dxct/IGmFactoryOpts.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.csp.gm.dxct; 17 | import org.bcia.julongchain.csp.factory.IFactoryOpts; 18 | 19 | /** 20 | * 国密工厂选项 21 | * 22 | * @author zhanglin, zhangmingyang 23 | * @date 2018/01/25 24 | * @company Dingxuan 25 | */ 26 | 27 | public interface IGmFactoryOpts extends IFactoryOpts { 28 | 29 | int getSecLevel(); 30 | 31 | String getHashFamily(); 32 | 33 | boolean isEphemeral(); 34 | 35 | String getKeyStorePath(); 36 | 37 | boolean isDummyKeystore(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/gmt0016/ftsafe/IGMT0016FactoryOpts.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Feitian. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.csp.gmt0016.ftsafe; 17 | 18 | import org.bcia.julongchain.csp.factory.IFactoryOpts; 19 | 20 | /** 21 | * Interface description 22 | * 23 | * @author Ying Xu 24 | * @date 7/3/18 25 | * @company FEITIAN 26 | */ 27 | public interface IGMT0016FactoryOpts extends IFactoryOpts { 28 | 29 | public ISKFFactory getSKFFactory(); 30 | 31 | public long getAppHandle(); 32 | 33 | public String getUserPin(); 34 | 35 | public long getDevHandle(); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/ledger/sceventmgmt/ISmartContractLifecycleEventListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Dingxuan. All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.ledger.sceventmgmt; 17 | 18 | import org.bcia.julongchain.common.exception.JulongChainException; 19 | 20 | /** 21 | * 用于分类账本组件以及监听智能合约生命周期 22 | * 23 | * @author sunzongyu 24 | * @date 2018/04/09 25 | * @company Dingxuan 26 | */ 27 | public interface ISmartContractLifecycleEventListener { 28 | 29 | /** 30 | * 执行智能合约部署 31 | */ 32 | void handleSmartContractDeploy(SmartContractDefinition smartContractDefinition, byte[] dbArtifactsTar) throws JulongChainException; 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/gossip/IFilter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip.gossip; 17 | 18 | /** 19 | * class description 20 | * 21 | * @author wanliangbing 22 | * @date 18-7-24 23 | * @company Dingxuan 24 | */ 25 | public abstract class IFilter { 26 | 27 | private byte[] bytes1 = new byte[]{}; 28 | 29 | public abstract Boolean filter(byte[] bytes2); 30 | 31 | public byte[] getBytes1() { 32 | return bytes1; 33 | } 34 | 35 | public void setBytes1(byte[] bytes1) { 36 | this.bytes1 = bytes1; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/gmt0016/excelsecu/common/Permissions.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright BCIA. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.csp.gmt0016.excelsecu.common; 17 | 18 | /** 19 | * GM0016 权限常数 20 | * 21 | * @author chenhao 22 | * @date 2018/4/2 23 | * @company Excelsecu 24 | */ 25 | public class Permissions { 26 | 27 | public static final int SECURE_NEVER_ACCOUNT = 0x00000000; 28 | public static final int SECURE_ADM_ACCOUNT = 0x00000001; 29 | public static final int SECURE_USER_ACCOUNT = 0x00000010; 30 | public static final int SECURE_ANYONE_ACCOUNT = 0x000000FF; 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/msp/IMspManager.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.msp; 17 | 18 | import org.bcia.julongchain.common.exception.MspException; 19 | import org.bcia.julongchain.msp.mgmt.Msp; 20 | 21 | import java.util.Map; 22 | 23 | /** 24 | * msp集合管理接口 25 | * 26 | * @author zhangmingyang 27 | * @Date: 2018/3/6 28 | * @company Dingxuan 29 | */ 30 | public interface IMspManager extends IIdentityDeserializer { 31 | /** 32 | * 根据配置信息设置MSP管理器实例 33 | * 34 | * @param msps 35 | */ 36 | void setup(IMsp[] msps) throws MspException; 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/msp/util/MspConstant.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.msp.util; 17 | 18 | /** 19 | * msp常量 20 | * 21 | * @author zhangmingyang 22 | * @date 2018/07/05 23 | * @company Dingxuan 24 | */ 25 | public class MspConstant { 26 | public final static String IDENTITY = "identity"; 27 | public final static String PUBLIC_KEY = "publickey"; 28 | public final static String CERT = "certificate"; 29 | public final static String OUIDENTIFIER = "organizationalUnitIdentifier"; 30 | public final static String ORGANIZATION_UNIT = "OU"; 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/policies/config/ImplicitMetaAllPolicy.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.policies.config; 17 | 18 | import org.bcia.julongchain.protos.common.Policies; 19 | 20 | /** 21 | * 策略:全部子策略需要满足 22 | * 23 | * @author zhouhui 24 | * @date 2018/3/8 25 | * @company Dingxuan 26 | */ 27 | public class ImplicitMetaAllPolicy extends StandardConfigPolicy { 28 | public ImplicitMetaAllPolicy(String key) { 29 | super(key); 30 | 31 | this.value = buildImplicitMetaPolicy(key, Policies.ImplicitMetaPolicy.Rule.ALL); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/policies/config/ImplicitMetaAnyPolicy.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.policies.config; 17 | 18 | import org.bcia.julongchain.protos.common.Policies; 19 | 20 | /** 21 | * 策略:任一子策略满足即可 22 | * 23 | * @author zhouhui 24 | * @date 2018/3/8 25 | * @company Dingxuan 26 | */ 27 | public class ImplicitMetaAnyPolicy extends StandardConfigPolicy { 28 | public ImplicitMetaAnyPolicy(String key) { 29 | super(key); 30 | 31 | this.value = buildImplicitMetaPolicy(key, Policies.ImplicitMetaPolicy.Rule.ANY); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/ledger/PvtCollFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Dingxuan. All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.ledger; 17 | 18 | import java.util.HashMap; 19 | import java.util.Map; 20 | 21 | /** 22 | * 私有的collection过滤器 23 | * 24 | * @author sunzongyu 25 | * @date 2018/04/09 26 | * @company Dingxuan 27 | */ 28 | public class PvtCollFilter { 29 | private Map fileters = new HashMap<>(); 30 | 31 | public Map getFileters() { 32 | return fileters; 33 | } 34 | 35 | public void setFileters(Map fileters) { 36 | this.fileters = fileters; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/ledger/kvledger/txmgmt/privacyenabledstate/PvtUpdateBatch.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Dingxuan. All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.ledger.kvledger.txmgmt.privacyenabledstate; 17 | 18 | /** 19 | * 私有数据更新包 20 | * 21 | * @author sunzongyu 22 | * @date 2018/04/17 23 | * @company Dingxuan 24 | */ 25 | public class PvtUpdateBatch { 26 | private UpdateMap map; 27 | 28 | public PvtUpdateBatch() { 29 | this.map = new UpdateMap(); 30 | } 31 | 32 | public UpdateMap getMap() { 33 | return map; 34 | } 35 | 36 | public void setMap(UpdateMap map) { 37 | this.map = map; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/node/INodeSupport.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.node; 17 | 18 | import org.bcia.julongchain.common.groupconfig.config.IApplicationConfig; 19 | import org.bcia.julongchain.common.resourceconfig.ISmartContractDefinition; 20 | 21 | /** 22 | * 节点支持对象 23 | * 24 | * @author zhouhui 25 | * @date 2018/06/03 26 | * @company Dingxuan 27 | */ 28 | public interface INodeSupport { 29 | IApplicationConfig getApplicationConfig(String groupId); 30 | 31 | ISmartContractDefinition getSmartContractByName(String groupId, String scName); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/consenter/common/msgprocessor/IStandardGroupSupport.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.consenter.common.msgprocessor; 17 | 18 | import org.bcia.julongchain.common.configtx.IConfigtxValidator; 19 | import org.bcia.julongchain.common.localmsp.ILocalSigner; 20 | 21 | /** 22 | * 标准通道support接口 23 | * 24 | * @author zhangmingyang 25 | * @Date: 2018/5/17 26 | * @company Dingxuan 27 | */ 28 | public interface IStandardGroupSupport extends IConfigtxValidator { 29 | /** 30 | * 获取签名 31 | * @return 32 | */ 33 | ILocalSigner getSigner(); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/consenter/common/multigroup/IMutableResources.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright DingXuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.consenter.common.multigroup; 17 | 18 | import org.bcia.julongchain.common.groupconfig.GroupConfigBundle; 19 | import org.bcia.julongchain.common.groupconfig.IGroupConfigBundle; 20 | 21 | /** 22 | * 不可变资源接口 23 | * 24 | * @author zhangmingyang 25 | * @Date: 2018/5/17 26 | * @company Dingxuan 27 | */ 28 | public interface IMutableResources extends IGroupConfigBundle { 29 | /** 30 | * 群组配置包更新 31 | * @return 32 | */ 33 | GroupConfigBundle update(); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/smartcontract/accesscontrol/Authenticator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.smartcontract.accesscontrol; 17 | 18 | import org.bcia.julongchain.common.exception.SmartContractException; 19 | 20 | /** 21 | * 类描述 22 | * 23 | * @author wanliangbing 24 | * @date 2018/3/26 25 | * @company Dingxuan 26 | */ 27 | public class Authenticator { 28 | 29 | public void disableAccessCheck () { 30 | 31 | } 32 | 33 | public CertAndPrivKeyPair generate(String scName) throws SmartContractException{ 34 | 35 | return new CertAndPrivKeyPair(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/proto/node/node.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright IBM Corp. 2016 All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | Modified java_package and other contents by Dingxuan on 2018-03-13 17 | */ 18 | syntax = "proto3"; 19 | 20 | option java_package = "org.bcia.julongchain.protos.node"; 21 | option go_package = "github.com/hyperledger/fabric/protos/peer"; 22 | 23 | package protos; 24 | 25 | import "node/proposal.proto"; 26 | import "node/proposal_response.proto"; 27 | 28 | message NodeID { 29 | string name = 1; 30 | } 31 | 32 | message NodeEndpoint { 33 | NodeID id = 1; 34 | string address = 2; 35 | } 36 | 37 | service Endorser { 38 | rpc ProcessProposal(SignedProposal) returns (ProposalResponse) {} 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/common/ledger/blockledger/IReader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Dingxuan. All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package org.bcia.julongchain.common.ledger.blockledger; 17 | 18 | import org.bcia.julongchain.common.exception.LedgerException; 19 | import org.bcia.julongchain.protos.consenter.Ab; 20 | 21 | /** 22 | * 文件读取接口 23 | * 24 | * @author sunzongyu 25 | * @date 2018/04/26 26 | * @company Dingxuan 27 | */ 28 | public interface IReader { 29 | 30 | /** 31 | * 返回迭代器 32 | */ 33 | IIterator iterator(Ab.SeekPosition startType) throws LedgerException; 34 | 35 | /** 36 | * 返回block数量 37 | */ 38 | long height() throws LedgerException; 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/endorser/IPrivateDataDistributor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.endorser; 17 | 18 | import org.bcia.julongchain.protos.ledger.rwset.Rwset; 19 | 20 | /** 21 | * 私有数据分发者 22 | * 23 | * @author zhouhui 24 | * @date 2018/3/15 25 | * @company Dingxuan 26 | */ 27 | public interface IPrivateDataDistributor { 28 | /** 29 | * 分发私有数据 30 | * 31 | * @param groupId 32 | * @param txId 33 | * @param privateData 34 | */ 35 | void distributePrivateData(String groupId, String txId, Rwset.TxPvtReadWriteSet privateData); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/core/ledger/kvledger/txmgmt/statedb/IVersionedDBProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.core.ledger.kvledger.txmgmt.statedb; 17 | 18 | import org.bcia.julongchain.common.exception.LedgerException; 19 | 20 | /** 21 | * 操作versionDB接口 22 | * 23 | * @author sunzongyu 24 | * @date 2018/4/9 25 | * @company Dingxuan 26 | */ 27 | public interface IVersionedDBProvider { 28 | 29 | /** 30 | * 获取DB 31 | */ 32 | IVersionedDB getDBHandle(String id) throws LedgerException; 33 | 34 | /** 35 | * 关闭 36 | */ 37 | void close(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/gmt0016/ftsafe/util/IGMHashOpts.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Feitian. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.csp.gmt0016.ftsafe.util; 17 | 18 | import org.bcia.julongchain.csp.intfs.opts.IHashOpts; 19 | 20 | /** 21 | * Interface description 22 | * 23 | * @author Ying Xu 24 | * @date 7/4/18 25 | * @company FEITIAN 26 | */ 27 | public interface IGMHashOpts extends IHashOpts { 28 | 29 | public long getMechanism(); 30 | 31 | public byte[] getSki(); 32 | 33 | public String getPubID(); 34 | 35 | public void setSki(byte[] ski); 36 | 37 | public void setPubID(String pubid); 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/csp/intfs/opts/ISignerOpts.java: -------------------------------------------------------------------------------- 1 | package org.bcia.julongchain.csp.intfs.opts; 2 | 3 | /** 4 | * Copyright BCIA. All Rights Reserved. 5 | *

6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | *

10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | *

12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * @author zhanglin 21 | * @purpose Define the interface, ISignerOpts 22 | * @date 2018-01-25 23 | * @company Dingxuan 24 | */ 25 | 26 | // The ISignerOpts contains options for signing with a CSP. 27 | public interface ISignerOpts extends IAlgorithmOpts { 28 | 29 | // The hashFunc returns an identifier for the hash function used to produce a digest for signing, 30 | // or else zero to indicate that no hashing was done. 31 | String hashFunc(); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/bcia/julongchain/gossip/api/ISecurityAdvisor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright Dingxuan. All Rights Reserved. 3 | *

4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | *

8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | *

10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.bcia.julongchain.gossip.api; 17 | 18 | /** 19 | * SecurityAdvisor 定义一个外部附加的对象来提供安全身份相关的功能 20 | * 21 | * @author wanliangbing 22 | * @date 2018/08/20 23 | * @company Dingxuan 24 | */ 25 | public interface ISecurityAdvisor { 26 | 27 | /** 28 | * OrgByNodeIdentity 返回 OrgIdentityType 对应节点的身份 29 | * 如果发生错误,返回nil 30 | * 这种方法不会验证nodeIdentity 31 | * 验证应当在执行时完成 32 | * @param nodeIdentity 33 | * @return 34 | */ 35 | public byte[] orgByNodeIdentity(byte[] nodeIdentity); 36 | 37 | } 38 | --------------------------------------------------------------------------------