5 Star 18 Fork 1

区块链技术与应用联合实验室 / RCJava-core

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README
Apache-2.0

RCJava-core

SVG SVG


目录


项目介绍

  1. Java SDK for RepChain,包括构造签名交易、提交签名交易、查询交易或块数据等链信息、同步块数据、订阅出块事件,及其他的一些工具类。
  2. 签名交易包括三种类型:1、部署合约类型的交易;2、调用合约类型的交易;3、修改合约状态类型的交易。
  3. 注册用户通过签名交易可以管理合约生命周期以及合约方法的权限

目录结构

  • src/main目录下
    com
      └── rcjava
          ├── client
          ├── contract
          ├── exception
          ├── gm
          ├── protos
          ├── sign
          ├── sync
          ├── tran
          ├── util
          └── ws
    • com.rcjava.client 主要用来构造与RepChain交互的客户端,客户端可以用来提交签名交易、获取交易或块数据、订阅出块事件

    • com.rcjava.contract 主要用来构造与RepChain交互的客户端,客户端可以用来部署升级合约、修改合约状态、调用合约

    • com.rcjava.exception 自定义的一些异常

    • com.rcjava.gm 定义了GMProvider

    • com.rcjava.protos protoBuf generated messages

    • com.rcjava.sign 主要是加密相关的工具类,包括签名与Hash等

    • com.rcjava.tran 用来构建签名交易

    • com.rcjava.sync 用来同步区块数据

    • com.rcjava.tran 用来构建签名交易

    • com.rcjava.util 主要是封装了一些工具类

      • CertUtil 证书相关工具类
      • GmUtil 国密相关工具类
      • KeyUtil key操作相关的工具类
      • PemUtil Pem操作相关的工具类
    • com.rcjava.ws 利用websocket订阅块事件

  • src/test
    • 主要是签名给交易构造与提交、权限管理、区块同步和相关工具类等的测试用例,用户可参考此示例代码来构造交易、提交交易以及使用相关工具类

安装教程

  1. 项目基于MAVEN构建,需搭建好MAVEN环境

    • 若使用命令行,到官网下载

      gitee-download

    • 使用IDE(idea/eclipse)插件

      如果maven官方镜像仓库比较慢,请在settings.xml或pom.xml中配置镜像

  2. jdk1.8+

    推荐使用Zulu-Jdk

  3. 下载项目

    • 如果没有安装Git环境,直接download项目到本地开发环境中
    • 如果安装有Git,使用命令git clone,clone项目到本地开发环境中
  4. mvn clean install 打包rcjava-core为jar包,并install到本地maven仓库

  5. 其他项目就可以通过如下方式使用rcjava-core了

    <dependency>
    	<groupId>repchain</groupId>
    	<artifactId>rcjava-core</artifactId>
    	<version>2.0.1-SNAPSHOT</version>
    </dependency>

使用JitPack安装

  • step1:

    <repositories>
    	<repository>
    		<id>jitpack.io</id>
    		<url>https://jitpack.io</url>
    	</repository>
    </repositories>
  • step2:

    <dependency>
    	<groupId>com.gitee.BTAJL</groupId>
    	<artifactId>RCJava-core</artifactId>
    	<version>2.0.1-SNAPSHOT</version>
    </dependency>

使用说明

  • 搭建好RepChain

  • 推荐使用secp256r1生成密钥对(当然也可以使用其他curves

    // 打印出Jdk可支持的曲线
    // --add-exports=java.base/sun.security.util=ALL-UNNAMED
    public static void printSunCurves() {
        Collection curves = CurveDB.getSupportedCurves();
        curves.forEach(System.out::println);
    }
  • 注册账户证书

    • 向管理员(RepChain中的用户)申请注册账户和证书到RepChain,注册账户和证书的示例可参考/src/test/java/com/rcjava/did/SignerOperationTest.java
  • 构建签名交易

    交易的签名算法根据对应RepChain版本进行设置

    1. RepChain-V1.1.1及之前版本使用SHA1withECDSA,之后使用SHA256withECDSA
    • 使用tran/impl下的具体类

      • InvokeTran

        // 标识账户证书
        Peer.CertId certId = Peer.CertId.newBuilder()
                  // 调用者账户号
            			.setCreditCode("identity-net:121000005l35120456")
                  // 证书标识,对应于先前注册的证书名
            			.setCertName("node1")
            			.build(); // 签名ID
        
        // 这个是给转账交易示范用的,此ID需要与repchain合约部署的一致
        Peer.ChaincodeId contractAssetsId = Peer.ChaincodeId.newBuilder()
                  // 合约名
            			.setChaincodeName("ContractAssetsTPL")
                  // 合约版本号
            			.setVersion(1)
           				.build();
        Transfer transfer = new Transfer("identity-net:121000005l35120456", "identity-net:12110107bi45jh675g", 5);
        
        // 合约方法参数
        Peer.ChaincodeInput chaincodeInput = Peer.ChaincodeInput.newBuilder()
          							// 合约方法
                        .setFunction("transfer")
          							// 合约方法实参
                        .addArgs(JSON.toJSONString(transfer))
                        .build();
        
        InvokeTran invokeTran = InvokeTran.newBuilder()
            			      .setTxid("1234567890")
                        .setChaincodeInput(chaincodeInput)
                        .setCertId(certId)
                        .setChaincodeId(contractAssetsId)
                        .setPrivateKey(privateKey)
                        .setSignAlgorithm("SHA256withECDSA")
                        .build();
         Peer.Transaction transaction = invokeTran.getSignedTran();
         // 其他方式:
         // Peer.Transaction transaction_2 = invokeTran.getSignedTran(privateKey, "sha256withecdsa");
         // Peer.Transaction transaction_4 = RCTranSigner.getSignedTran(invokeTran, privateKey, "sha256withecdsa");
      • CidStateTran

        参考InvokeTran的构建

      • DeployTran

        参考InvokeTran的构建

    • 使用TranCreator构建具体的交易

      • 构建InvokeTran

        // 标识账户证书
        Peer.CertId certId = Peer.CertId.newBuilder()
            			.setCreditCode("identity-net:121000005l35120456")
            			.setCertName("node1")
            			.build(); // 签名ID
        
        // 这个是给转账交易示范用的,此ID需要与repchain合约部署的一致
        Peer.ChaincodeId contractAssetsId = Peer.ChaincodeId.newBuilder()
            			.setChaincodeName("ContractAssetsTPL")
            			.setVersion(1)
           				.build();
        Transfer transfer = new Transfer("identity-net:121000005l35120456", "identity-net:12110107bi45jh675g", 5);
        // 合约方法参数
        Peer.ChaincodeInput chaincodeInput = Peer.ChaincodeInput.newBuilder()
                        .setFunction("transfer")
                        .addArgs(JSON.toJSONString(transfer))
                        .build();
        TranCreator tranCreator = TranCreator.newBuilder()
            			.setPrivateKey(privateKey)
            			.setSignAlgorithm("SHA256withECDSA")
            			.build();
        String tranId = "UUID";
        Peer.Transaction tran = tranCreator.createInvokeTran(tranId, certId, contractAssetsId, "transfer", JSON.toJSONString(transfer), 0, "");
      • CidStateTran

        参考InvokeTran的构建

      • DeployTran

        参考InvokeTran的构建

  • 提交签名交易

    • 使用同步方式

      用来提交签名交易的客户端:TranPostClient

      public JSONObject postSignedTran(String tranHexString) {/***/}
      public JSONObject postSignedTran(Transaction tran) {/***/}
      • 使用Hex字符串的方式

        TranPostClient tranPostClient = new TranPostClient("localhost:9081");
        // -------------------------------
            /****构建签名交易 Transaction tran ****/
        // -------------------------------
        String tranHex = Hex.encodeHexString(tran.toByteArray());
        JSONObject res = tranPostClient.postSignedTran(tranHex);
      • 使用字节块提交

        TranPostClient tranPostClient = new TranPostClient("localhost:9081");
        // -------------------------------
            /****构建签名交易 Transaction tran ****/
        // -------------------------------
        JSONObject res = tranPostClient.postSignedTran(tran);

      如果RepChain端开启了https单向或双向认证,则需要使用如下方式构建TranPostClient

      SSLContext sslContext = SSLContexts.custom()
                  .loadTrustMaterial(new File("jks/jdk13/121000005l35120456.node1.jks"), "123".toCharArray(), new TrustSelfSignedStrategy())
                  .loadKeyMaterial(new File("jks/jdk13/121000005l35120456.node1.jks"), "123".toCharArray(), "123".toCharArray())
                  .build();
      // sslContext可根据具体情况来针对性的构建
      TranPostClient tranPostClient = new TranPostClient("localhost:9081", sslContext);
    • 使用异步方式

      用来异步提交签名交易的客户端:TranPostAsyncClient

      public Future<HttpResponse> postSignedTran(String tranHexString) {/***/}
      public Future<HttpResponse> postSignedTran(Transaction tran) {/***/}
      • 使用Hex字符串的方式

        TranPostAsyncClient tranPostClient = new TranPostAsyncClient("localhost:9081");
        // -------------------------------
            /****构建签名交易 Transaction tran ****/
        // -------------------------------
        String tranHex = Hex.encodeHexString(tran.toByteArray());
        Future<HttpResponse> responseFuture = tranPostClient.postSignedTran(tranHex);
      • 使用字节块提交

        TranPostAsyncClient tranPostClient = new TranPostAsyncClient("localhost:9081");
        // -------------------------------
            /****构建签名交易 Transaction tran ****/
        // -------------------------------
        Future<HttpResponse> responseFuture = tranPostClient.postSignedTran(tran);
      • 从future中解析数据,默认超时时间20s

        HttpResponse httpResponse = responseFuture.get(20, TimeUnit.SECONDS);
        JSONObject result = TranPostAsyncClient.resolveHttpResponseFuture(responseFuture);

      如果RepChain端开启了https单向或双向认证,则需要使用如下方式构建TranPostAsyncClient

      SSLContext sslContext = SSLContexts.custom()
                  .loadTrustMaterial(new File("jks/jdk13/121000005l35120456.node1.jks"), "123".toCharArray(), new TrustSelfSignedStrategy())
                  .loadKeyMaterial(new File("jks/jdk13/121000005l35120456.node1.jks"), "123".toCharArray(), "123".toCharArray())
                  .build();
      // sslContext可根据具体情况来针对性的构建
      TranPostAsyncClient tranPostClient = new TranPostAsyncClient("localhost:9081", sslContext);
  • 使用ContractClient

    使用ContractClient部署升级合约、修改合约状态、调用合约,可选用具体方法,下面例子中的方法只是其中之一

    CertId certId = CertId.newBuilder().setCreditCode("identity-net:121000005l35120456").setCertName("node1").build();
    // 这个是给转账交易示范用的,此ID需要与RepChain合约部署的一致
    ChaincodeId contractAssetsId = ChaincodeId.newBuilder().setChaincodeName("ContractAssetsTPL").setVersion(1).build();
    // privateKey是与certId标识的证书对应的用户私钥
    ContractUser user = new ContracUser(certId, privateKey);
    ContractClient contractClient = new ContractClient("localhost:9081", contractAssetsId, user);
    Transfer transfer = new Transfer("identity-net:121000005l35120456", "identity-net:12110107bi45jh675g", 5);
    contractClient.invokeContract("transfer", JSON.toJSONString(transfer));

    如果RepChain端开启了https单向或双向认证,则需要使用如下方式构建ContractClient

    SSLContext sslContext = SSLContexts.custom()
                .loadTrustMaterial(new File("jks/jdk13/121000005l35120456.node1.jks"), "123".toCharArray(), new TrustSelfSignedStrategy())
                .loadKeyMaterial(new File("jks/jdk13/121000005l35120456.node1.jks"), "123".toCharArray(), "123".toCharArray())
                .build();
    ......
    ContractClient client = new ContractClient(host, contractAssetsId, user, sslContext);
  • 查询交易数据

    使用ChainInfoClient构建查询客户端,用来获取链信息的客户端

    ChainInfoClient chainInfoClient = new ChainInfoClient("localhost:9081");
    String txid = "1234567890";
    // 底层使用Json构建
    Transaction tran = chainInfoClient.getTranByTranId(txid);
    // 底层直接获取字节块构建
    Transaction tran = chainInfoClient.getTranStreamByTranId(txid);

    如果RepChain端开启了https单向或双向认证,则需要使用如下方式构建ChaininfoClient

    SSLContext sslContext = SSLContexts.custom()
                .loadTrustMaterial(new File("jks/jdk13/121000005l35120456.node1.jks"), "123".toCharArray(), new TrustSelfSignedStrategy())
                .loadKeyMaterial(new File("jks/jdk13/121000005l35120456.node1.jks"), "123".toCharArray(), "123".toCharArray())
                .build();
    // sslContext可根据具体情况来针对性的构建
    ChainInfoClient chainInfoClient = new ChainInfoClient("localhost:9081", sslContext);
  • 查询块数据

    使用ChainInfoClient构建查询客户端

    • 根据区块高度查询区块数据

      ChainInfoClient chainInfoClient = new ChainInfoClient("localhost:9081");
      // 查询链信息
      BlockchainInfo blockchainInfo = chainInfoClient.getChainInfo();
      // 使用Json构建
      Block block = chainInfoClient.getBlockByHeight(5);
      // 直接获取字节块构建
      Block block = chainInfoClient.getBlockStreamByHeight(5) 
      // 根据区块高度获取区块头
      BlockHeader blockHeader = chainInfoClient.getBlockHeaderByHeight(1)
    • 根据区块hash查询区块数据

      ChainInfoClient chainInfoClient = new ChainInfoClient("localhost:9081");
      // 查询链信息
      BlockchainInfo blockchainInfo = chainInfoClient.getChainInfo();
      // 根据区块HASH获取区块
      Block block = chainInfoClient.getBlockByBlockHash(Base64.encodeBase64String(block.getHeader().getHashPresent().toByteArray()));
      // 根据区块HASH获取区块头
      BlockHeader blockHeader = chainInfoClient.getBlockHeaderByBlockHash(Base64.encodeBase64String(block.getHeader().getHashPresent().toByteArray()));
  • 查询其他数据

    使用ChainInfoClient构建查询客户端

    • 查询链中组网的节点数目

      ChainInfoClient chainInfoClient = new ChainInfoClient("localhost:9081");
      NodesNum nodeNum = chainInfoClient.getChainInfoNode();
    • 根据交易ID查询交易以及交易所在区块高度

      ChainInfoClient chainInfoClient = new ChainInfoClient("localhost:9081");
      // 根据交易ID查询交易以及交易所在区块高度
      ChainInfoClient.TranInfoAndHeight tranInfoAndHeight = chainInfoClient.getTranInfoAndHeightByTranId("1234567890");
    • 直接查询状态数据

      ChainInfoClient chainInfoClient = new ChainInfoClient("localhost:9081");
      // 查询LevelDB
      Object leveldbRes = chainInfoClient.queryDB("identity-net", "ContractAssetsTPL", "", "121000005l35120456");
    • 查询交易入块后的结果

    ChainInfoClient chainInfoClient = new ChainInfoClient("localhost:9081");
    // 查询交易入块后的结果
    TransactionResult tranRes = chainInfoClient.getTranResultByTranId("1234567890")
    // 查询交易和交易入块后的结果(state数据)
    TranAndTranResult tranAndTranResult = chainInfoClient.getTranAndResultByTranId("1376cbbf-edc1-463b-82af-e643d2257159");

    如果RepChain端开启了https单向或双向认证,则需要使用如下方式构建ChainInfoClient

    ChainInfoClient chainInfoClient = new ChainInfoClient("localhost:9081", sslContext);
  • 同步块数据

    使用sync/SyncService构建同步服务,从指定高度开始同步,一直到最新高度,思路是:定时<拉>(基于http服务)和<推拉>结合(基于ws+http服务)的方式来同步区块,即订阅(基于ws/wss)与拉取(基于http/https)相结合的方案来保证区块同步的实时性,该方案可以防止相应节点ws服务崩溃,使用示例请参考SyncServiceTest

    1. 使用host、syncInfo、syncListener(实现该接口,可将区块存储到数据库中)初始化
    2. 初始化之后,就可以启动同步服务
    3. SyncListener中,如果保存区块出现问题,要throw SyncBlockException
    SyncInfo syncInfo = new SyncInfo(locHeight, locBlkHash);
    
    SyncService syncService = SyncService.newBuilder()
                .setHost("localhost:9081")
                .setSyncInfo(syncInfo)
                .setSyncListener("SyncListener实例")
                .build();
    Thread thread = new Thread(syncService::start);
    thread.start();

    如果RepChain端开启了https单向或双向认证,则需要使用如下方式构建SyncService

    SyncInfo syncInfo = new SyncInfo(locHeight, locBlkHash);
    
    SyncService syncService = SyncService.newBuilder()
      					.setHost("localhost:9081")
                .setSyncInfo(syncInfo)
                .setSyncListener("SyncListener实例")
      		      .setSslContext(sslContext) // 此处需要设置sslContext
                .build();
  • 订阅块事件

    使用client/RSubClient构建客户端,使用观察者模式

    1. 创建BlockObserver实例
    2. 创建BlockListener实例(可使用工具类BlockListenerUtil获取-->每个host只有唯一的1个listener)
    3. 向BlockListener中注册BlockObserver
    // 获取block监听,使用 host 获取一个监听,每个 host 对应一个监听
    // 也可以自己去实例化
    blkListener = BlockListenerUtil.getListener(host);
    // event 监听,并回调给具体的实现类
    blkListener.registerBlkObserver("BlockObserver实例");
    RSubClient rSubClient = new RSubClient(host, blkListener);
    // 若RepChain开启了https单向或双向认证
    // RSubClient rSubClient = new RSubClient(host, blkListener, sslContext);
    rSubClient.connect();
  • 解析区块的StateMap里的数据(指RepChain的proto文件中定义的结构数据,如Signer、Certificate、Operate、Authorize)需要用到rc-proto.jar(RepChain端proto-scala编译好的class),可从本页面右侧"发行版"找到打包好的对应版本

    1. 从release中下载对应版本的rc-proto.jar

    2. rc-proto.jar安装到本地maven库

      mvn install:install-file -DgroupId=repchain -DartifactId=rc-proto -Dversion=2.0.0 -Dpackaging=jar -Dfile=rc-proto.jar
    3. 在项目中引入依赖

      <dependency>
          <groupId>repchain</groupId>
          <artifactId>rc-proto</artifactId>
          <version>2.0.0</version>
      </dependency>
    4. 通过StateUtil工具类来解析

  • 国密的引入和使用

    1. 国密ssl包需要额外引入,暂时未开源

    2. 具体使用示例可参考src/test/java/com.rcjava.client.gm/TranPostGmClientTestsrc/test/java/com.rcjava.client.gm/ChainInfoGmClientTest

    • 国密ssl

      1. 继承src/main/java/com.rcjava.gm.GMProvider,或手动来安装Provider

        Security.insertProviderAt((Provider) Class.forName("org.bouncycastle.jce.provider.BouncyCastleProvider").newInstance(), 1);
        Security.insertProviderAt((Provider) Class.forName("org.bouncycastle.jsse.provider.BouncyCastleJsseProvider").newInstance(), 2);
      2. 构建国密SSLContext

        SSLContext sslContext = SSLContextBuilder.create()
                .setProtocol("GMSSLv1.1").setProvider("BCJSSE")
                .setKeyStoreType("PKCS12")
                .setKeyManagerFactoryAlgorithm("PKIX")
                .loadTrustMaterial(new File("pfx/mytruststore.pfx"), "changeme".toCharArray(), new TrustSelfSignedStrategy())
                .loadKeyMaterial(new File("pfx/215159697776981712.node1.pfx"), "123".toCharArray(), "123".toCharArray())
                .build();
      3. 构建交易提交客户端或查询客户端

        TranPostClient tranPostClient = new TranPostClient("192.168.2.69:9081", sslContext);
        ChainInfoClient chainInfoClient = new ChainInfoClient("192.168.2.69:9081", sslContext);
    • 使用国密构造数字签名交易

      1. 与上面构造签名交易类似,只需要将签名算法改为"sm3withsm2"即可

        TranCreator tranCreator = TranCreator.newBuilder().setPrivateKey(privateKey).setSignAlgorithm("SM3WITHSM2").build();
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

RCJava-core(RepChain Client Library for Java),RepChain的客户端开发包Java语言版本,可用来构造并提交交易,获取链信息,同步区块数据等 expand collapse
Java and 2 more languages
Apache-2.0
Cancel

Contributors

All

Activities

Load More
can not load any more
Java
1
https://gitee.com/BTAJL/RCJava-core.git
git@gitee.com:BTAJL/RCJava-core.git
BTAJL
RCJava-core
RCJava-core
master

Search