This commit is contained in:
aozhiwei 2022-04-14 09:22:29 +08:00
parent 1f037fc318
commit 3a6fda7138
5 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,3 @@
{
"listen_port": 7661
"listen_port": 7671
}

View File

@ -3,6 +3,6 @@
while true
do
read -p '> ' cmd
curl "http://127.0.0.1:8331/webapp/index.php?c=GM&a=execCmd&cmd=${cmd}" |jq .
curl -G -d "cmd=${cmd}" "http://127.0.0.1:8331/webapp/index.php?c=GM&a=execCmd" |jq .
echo ""
done

View File

@ -2,7 +2,7 @@ const app = require('j7/app');
const event = require('j7/event');
const config = require('j7/config');
event.addListener(event.APP_INITIALIZED_EVENT, () => {
event.addListener(event.APP_INITIALIZED_EVENT, async () => {
require('./metadata/factory').init();
await require('./blockchain').init();
require('./middlewares/factory').init();

View File

@ -200,6 +200,10 @@ async function balance(session, params) {
console.log('balance', await bc.getBalance(paymentTokenAddress));
}
async function getPastEvents(session, params) {
const eventName = params[0];
}
async function execCmd(session) {
const cmdLine = session.request('cmd').split('.');
const cmd = cmdLine[0];
@ -216,6 +220,7 @@ function init() {
cmdHash['login'] = login;
cmdHash['buyBox'] = buyBox;
cmdHash['balance'] = balance;
cmdHash['getPastEvents'] = getPastEvents;
}
exports.init = init;

View File

@ -9,6 +9,10 @@ class Session {
this.nowTime = utils.getUtcTime();
}
destory() {
}
getNowTime() {
return this.nowTime;
}