mirror of
https://gitee.com/BDWare/contract-java-example.git
synced 2026-01-08 22:49:30 +00:00
add readme
add bdserver-docker add yjs plugin
This commit is contained in:
1
backend/.gitignore
vendored
1
backend/.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
/.DS_Store/
|
||||
ContractDB
|
||||
/build/
|
||||
/cplibs/
|
||||
cplibs
|
||||
|
||||
@@ -5,7 +5,7 @@ buildscript {
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.bdware.bdcontract:simple-ypk-packer:0.5.0"
|
||||
classpath "org.bdware.bdcontract:ypk-deploy-tool:0.5.0"
|
||||
classpath "org.bdware.bdcontract:ypk-deploy-tool:0.5.2"
|
||||
}
|
||||
}
|
||||
plugins {
|
||||
@@ -40,7 +40,7 @@ sourceSets {
|
||||
dependencies {
|
||||
api 'org.apache.logging.log4j:log4j-core:2.17.2'
|
||||
api 'org.apache.logging.log4j:log4j-api:2.17.2'
|
||||
implementation 'org.bdware.sc:cp:1.5.4'
|
||||
implementation 'org.bdware.sc:cp:1.5.7'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ task copyJar(type: Copy, dependsOn: [":backend:jar", ":backend:copyLibs"]) {
|
||||
}
|
||||
def reltivePath = "./backend"
|
||||
//reltivePath="."
|
||||
def currVersion = "1.2.0"
|
||||
def currVersion = "1.3.0"
|
||||
task grepCP(dependsOn: ["copyJar"]) {
|
||||
doLast {
|
||||
org.bdware.datanet.YPKPacker.grepJarByCPVersion("${reltivePath}/build/output/libs", org.bdware.datanet.CPVersion.cp_1_5_3)
|
||||
@@ -94,6 +94,6 @@ task buildYPK(dependsOn: ["buildZip"]) {
|
||||
}
|
||||
task deploy(dependsOn: ["buildYPK"]) {
|
||||
doLast {
|
||||
org.bdware.ypkdeploy.HTTPTool.deployWithYpk("./backend/deployconfig.json", "${reltivePath}/build/contractexample-${currVersion}.ypk")
|
||||
org.bdware.ypkdeploy.HTTPTool.deployWithYpk("${reltivePath}/debugconf.json", "${reltivePath}/build/contractexample-${currVersion}.ypk")
|
||||
}
|
||||
}
|
||||
10
backend/debugconf.json
Normal file
10
backend/debugconf.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"agentAddress": "127.0.0.1:21030",
|
||||
"publicKey": "04180354fdb6507f8ab98ccfbe165ce11da74ba733f81af86ad6d32216b32cf4f797c559d50ceeefbf4c760c3483840471c67471b90acdffb388cd7d496d9a1610",
|
||||
"privateKey": "1d4196947f59532db6f8f4055e58474a48db8f30b476ae3edc66406464521b3b",
|
||||
"ypkPath": "./build/contractexample-1.3.0.ypk",
|
||||
"killBeforeStart": "ContractExample",
|
||||
"createParam": {
|
||||
},
|
||||
"cpHost": "host.docker.internal"
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"agentAddress": "ip:port",
|
||||
"privateKey": "e85ce2f4d8...",
|
||||
"publicKey": "04da01345770b7e09d4774bf6cd67bf90b32eaa09f517c79b2d1f9b8a926",
|
||||
"ypkPath": "./backend/build/contractexample-1.2.0.ypk",
|
||||
"killBeforeStart": "ContractID/ContractName",
|
||||
"createParam": {
|
||||
}
|
||||
}
|
||||
10
backend/src/test/java/HelloTest.java
Normal file
10
backend/src/test/java/HelloTest.java
Normal file
@@ -0,0 +1,10 @@
|
||||
import org.bdware.sc.debugger.DebugMain;
|
||||
import org.junit.Test;
|
||||
|
||||
public class HelloTest {
|
||||
@Test
|
||||
public void run() {
|
||||
DebugMain.runWithConf("./debugconf.json");
|
||||
for (; ; ) ;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,11 @@
|
||||
|
||||
oracle ContractExample {
|
||||
function onCreate(){
|
||||
Global.owner = requester;
|
||||
function onCreate() {
|
||||
Global.owner = requester;
|
||||
}
|
||||
export function callHello(arg) {
|
||||
return org.bdware.sc.contractexample.Hello.call()+requester;
|
||||
}
|
||||
export function getOwner() {
|
||||
return Global.owner;
|
||||
}
|
||||
export function callHello(arg){
|
||||
return Hello.call()+requester;
|
||||
}
|
||||
export function getOwner(){
|
||||
return Global.owner;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user