add develop.md
This commit is contained in:
parent
3ee7b5bfc7
commit
08da9c63f0
15
DEVELOP.md
Normal file
15
DEVELOP.md
Normal file
@ -0,0 +1,15 @@
|
||||
# Development Guide
|
||||
|
||||
1. install http-server to enable debug at local.
|
||||
|
||||
```bash
|
||||
npm install -g http-server
|
||||
```
|
||||
2. run `npm install` to build the project.
|
||||
3. in `./` folder, use `http-server` to start server
|
||||
4. open the following link to debug.
|
||||
please note, the server address should be checked in the source code of `xxx.html`!
|
||||
```
|
||||
http://127.0.0.1:8080/test/ws.html
|
||||
http://127.0.0.1:8080/test/http.html
|
||||
```
|
13
package.json
13
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@bdware/bdcontract-sdk",
|
||||
"version": "0.3.0-alpha.14",
|
||||
"version": "0.3.0-alpha.15",
|
||||
"description": "BDContract SDK for Node.js and browsers",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
@ -47,5 +47,14 @@
|
||||
"shx": "^0.3.4",
|
||||
"sucrase": "^3.25.0",
|
||||
"typescript": "^4.8.2"
|
||||
}
|
||||
},
|
||||
"directories": {
|
||||
"lib": "lib",
|
||||
"test": "test"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@gitea.internetapi.cn:bdware/bdcontract-sdk-javascript.git"
|
||||
},
|
||||
"author": "caihq@pku.edu.cn"
|
||||
}
|
||||
|
@ -10,17 +10,19 @@
|
||||
document.write(`${string}\n\n`)
|
||||
}
|
||||
|
||||
const url = 'ws://39.104.201.40:18010/SCIDE/SCExecutor'
|
||||
const url = 'ws://127.0.0.1:18000/SCIDE/SCExecutor'
|
||||
|
||||
const client = new bdcontract.WsClient(
|
||||
url,
|
||||
(ev) => {
|
||||
console.log(JSON.stringify(ev))
|
||||
console.log("onOpen:"+JSON.stringify(ev))
|
||||
invokeContract()
|
||||
},
|
||||
(ev, ws) => {
|
||||
console.log(ev.data)
|
||||
},
|
||||
)
|
||||
function invokeContract(){
|
||||
setTimeout(async () => {
|
||||
const status = client.status()
|
||||
console.log(status)
|
||||
@ -42,6 +44,8 @@
|
||||
print(JSON.stringify(data))
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
</script>
|
||||
<link rel="icon" type="image/svg+xml" href="favicon.svg"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user