1
This commit is contained in:
parent
5dce28c31e
commit
d497beaa23
@ -1 +0,0 @@
|
||||
../web3dbspider/res
|
@ -103,18 +103,6 @@ async function init() {
|
||||
traverseMetaList('BcEventDb', (dbConf, idx) => {
|
||||
app.registerDb('BcEventDb' + idx, dbConf);
|
||||
});
|
||||
traverseMetaList('Web3WebHooks', (item, idx) => {
|
||||
if (item['instance_id'] == app.getInstanceId()) {
|
||||
web3ServiceConf = item;
|
||||
item['nets'].forEach((netId) => {
|
||||
const netDir = configDir + 'nets/' + netId + '/';
|
||||
web3ConfHash[netId] = {
|
||||
'Web3': utils.readJsonFromFile(netDir + 'web3.json'),
|
||||
'Contract': utils.readJsonFromFile(netDir + 'contract.json')
|
||||
};
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -148,52 +136,14 @@ function traverseMetaList(name, cb) {
|
||||
}
|
||||
}
|
||||
|
||||
function getWeb3Conf(netId) {
|
||||
const keys = Object.keys(web3ConfHash);
|
||||
for (let i = 0; i < keys.length; ++i) {
|
||||
if (keys[i] == netId) {
|
||||
return web3ConfHash[keys[i]]['Web3'];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function getWeb3WebHooksConf() {
|
||||
return web3ServiceConf;
|
||||
}
|
||||
|
||||
function getContractsConf(netId) {
|
||||
const keys = Object.keys(web3ConfHash);
|
||||
for (let i = 0; i < keys.length; ++i) {
|
||||
if (keys[i] == netId) {
|
||||
return web3ConfHash[keys[i]]['Contract'];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function getNetList() {
|
||||
const netList = [];
|
||||
const keys = Object.keys(web3ConfHash);
|
||||
for (let i = 0; i < keys.length; ++i) {
|
||||
netList.push(keys[i]);
|
||||
}
|
||||
return netList;
|
||||
}
|
||||
|
||||
function getNetDir(netId) {
|
||||
const netDir = configDir + 'nets/' + netId + '/';
|
||||
return netDir;
|
||||
}
|
||||
|
||||
exports.init = init;
|
||||
|
||||
exports.getMetaByKey = getMetaByKey;
|
||||
exports.traverseMetaList = traverseMetaList;
|
||||
exports.callMetaStatic = callMetaStatic;
|
||||
|
||||
exports.getWeb3Conf = getWeb3Conf;
|
||||
exports.getWeb3WebHooksConf = getWeb3WebHooksConf;
|
||||
exports.getContractsConf = getContractsConf;
|
||||
exports.getNetList = getNetList;
|
||||
exports.getNetDir = getNetDir;
|
||||
|
Loading…
x
Reference in New Issue
Block a user