1
This commit is contained in:
parent
2fb6b8f513
commit
478508cb95
@ -152,7 +152,23 @@ function traverseMetaList(name, cb) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getWeb3Conf(netId) {
|
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 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() {
|
function getNetList() {
|
||||||
@ -176,4 +192,6 @@ exports.traverseMetaList = traverseMetaList;
|
|||||||
exports.callMetaStatic = callMetaStatic;
|
exports.callMetaStatic = callMetaStatic;
|
||||||
|
|
||||||
exports.getWeb3Conf = getWeb3Conf;
|
exports.getWeb3Conf = getWeb3Conf;
|
||||||
|
exports.getContractsConf = getContractsConf;
|
||||||
exports.getNetList = getNetList;
|
exports.getNetList = getNetList;
|
||||||
|
exports.getNetDir = getNetDir;
|
||||||
|
@ -14,8 +14,10 @@ class BlockChain extends BaseService {
|
|||||||
#bc = null;
|
#bc = null;
|
||||||
|
|
||||||
static async staticInit() {
|
static async staticInit() {
|
||||||
metaFactory.getNetList().forEach((netId) => {
|
metaFactory.getNetList().forEach(async (netId) => {
|
||||||
console.log(netId);
|
const bc = new bcClass(netId);
|
||||||
|
netIdHash[netId] = bc;
|
||||||
|
await bc.init();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user