1
This commit is contained in:
parent
2068c5f840
commit
b810a21eca
@ -119,6 +119,7 @@ async function init() {
|
|||||||
web3ConfHash[netId] = {
|
web3ConfHash[netId] = {
|
||||||
'Web3': utils.readJsonFromFile(netDir + 'web3.json'),
|
'Web3': utils.readJsonFromFile(netDir + 'web3.json'),
|
||||||
'Contract': utils.readJsonFromFile(netDir + 'contract.json'),
|
'Contract': utils.readJsonFromFile(netDir + 'contract.json'),
|
||||||
|
'Events': net['events'],
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -184,7 +185,7 @@ function getNetList() {
|
|||||||
const netList = [];
|
const netList = [];
|
||||||
const keys = Object.keys(web3ConfHash);
|
const keys = Object.keys(web3ConfHash);
|
||||||
for (let i = 0; i < keys.length; ++i) {
|
for (let i = 0; i < keys.length; ++i) {
|
||||||
netList.push(keys[i]);
|
netList.push(web3ConfHash[keys[i]]);
|
||||||
}
|
}
|
||||||
return netList;
|
return netList;
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ const sync = require("j7/sync");
|
|||||||
const log = require("j7/log");
|
const log = require("j7/log");
|
||||||
const metaFactory = require('../metadata/factory');
|
const metaFactory = require('../metadata/factory');
|
||||||
const bcClass = require('../blockchain');
|
const bcClass = require('../blockchain');
|
||||||
|
const BaseService = require('./baseservice');
|
||||||
|
|
||||||
const netIdHash = {};
|
const netIdHash = {};
|
||||||
|
|
||||||
|
@ -12,8 +12,8 @@ function add(clsNames, modName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
add('BlockChain', 'blockchain');
|
add(['BlockChain'], 'blockchain');
|
||||||
add('PullBcEvent', 'pull_bcevent');
|
add(['PullBcEvent'], 'pull_bcevent');
|
||||||
}
|
}
|
||||||
|
|
||||||
function create(name, session) {
|
function create(name, session) {
|
||||||
|
@ -20,6 +20,7 @@ class BcSpider extends BaseTask {
|
|||||||
|
|
||||||
async initNet(net) {
|
async initNet(net) {
|
||||||
const events = [];
|
const events = [];
|
||||||
|
console.log(net);
|
||||||
net['Events'].forEach
|
net['Events'].forEach
|
||||||
(
|
(
|
||||||
(eventConf) => {
|
(eventConf) => {
|
||||||
|
@ -14,11 +14,14 @@ function add(clsNames, modName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
add('BcSpider', 'bcspider');
|
add(['BcSpider'], 'bcspider');
|
||||||
const initTasks = [
|
const initTasks = [
|
||||||
'BcSpider'
|
'BcSpider'
|
||||||
];
|
];
|
||||||
await utils.serial(
|
await utils.serial(
|
||||||
|
[
|
||||||
|
'BcSpider'
|
||||||
|
],
|
||||||
async (name) =>
|
async (name) =>
|
||||||
{
|
{
|
||||||
const task = create(name);
|
const task = create(name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user