This commit is contained in:
aozhiwei 2023-07-03 21:57:20 +08:00
parent 2068c5f840
commit b810a21eca
5 changed files with 10 additions and 4 deletions

View File

@ -119,6 +119,7 @@ async function init() {
web3ConfHash[netId] = {
'Web3': utils.readJsonFromFile(netDir + 'web3.json'),
'Contract': utils.readJsonFromFile(netDir + 'contract.json'),
'Events': net['events'],
};
});
}
@ -184,7 +185,7 @@ function getNetList() {
const netList = [];
const keys = Object.keys(web3ConfHash);
for (let i = 0; i < keys.length; ++i) {
netList.push(keys[i]);
netList.push(web3ConfHash[keys[i]]);
}
return netList;
}

View File

@ -5,6 +5,7 @@ const sync = require("j7/sync");
const log = require("j7/log");
const metaFactory = require('../metadata/factory');
const bcClass = require('../blockchain');
const BaseService = require('./baseservice');
const netIdHash = {};

View File

@ -12,8 +12,8 @@ function add(clsNames, modName) {
}
async function init() {
add('BlockChain', 'blockchain');
add('PullBcEvent', 'pull_bcevent');
add(['BlockChain'], 'blockchain');
add(['PullBcEvent'], 'pull_bcevent');
}
function create(name, session) {

View File

@ -20,6 +20,7 @@ class BcSpider extends BaseTask {
async initNet(net) {
const events = [];
console.log(net);
net['Events'].forEach
(
(eventConf) => {

View File

@ -14,11 +14,14 @@ function add(clsNames, modName) {
}
async function init() {
add('BcSpider', 'bcspider');
add(['BcSpider'], 'bcspider');
const initTasks = [
'BcSpider'
];
await utils.serial(
[
'BcSpider'
],
async (name) =>
{
const task = create(name);