# xuper-demo-java-counter **Repository Path**: chunanyong/xuper-demo-java-counter ## Basic Information - **Project Name**: xuper-demo-java-counter - **Description**: 百度超级链的counter java demo例子 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-03-01 - **Last Updated**: 2023-03-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # xuper-demo-java-counter ## 介绍 百度超级链的counter java demo例子 ```shell ##打包获取到 xuper-demo-java-counter.jar 文件 mvn package ##部署java native合约 ./bin/xchain-cli native deploy --account XC1111111111111111@xuper --fee 15587517 --runtime java xuper-demo-java-counter.jar --cname javacounter ##调用合约 ##给key stones 设置数据,increase 和 get 是Counter.java中的方法名称 ./bin/xchain-cli native invoke --method increase -a '{"key":"stones"}' --fee 100 javacounter ./bin/xchain-cli native invoke --method get -a '{"key":"stones"}' --fee 100 javacounter ``` ## 复制项目,修改自己的合约 - 1.合约方法需要有 @ContractMethod 注解,需要有main函数 - 2.git仓库名和pom中的project.name保持一直 - 3.pom中的Main-Class需要和自己项目的main类保持一致