This commit is contained in:
aozhiwei 2023-06-14 11:09:17 +08:00
parent 268d173927
commit f0be47e8c9
2 changed files with 16 additions and 1 deletions

View File

@ -93,6 +93,10 @@ async function init() {
'', '',
'MarketDb' 'MarketDb'
); );
registerMetaClass(configDir + 'web3service.cluster.json',
'',
'Web3Service'
);
registerMetaClass(resDir + 'item@item.json', registerMetaClass(resDir + 'item@item.json',
'id', 'id',
@ -151,6 +155,15 @@ function getWeb3Conf(netId) {
} }
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) { function getNetDir(netId) {
const netDir = configDir + 'nets/' + netId + '/'; const netDir = configDir + 'nets/' + netId + '/';
return netDir; return netDir;
@ -163,3 +176,4 @@ exports.traverseMetaList = traverseMetaList;
exports.callMetaStatic = callMetaStatic; exports.callMetaStatic = callMetaStatic;
exports.getWeb3Conf = getWeb3Conf; exports.getWeb3Conf = getWeb3Conf;
exports.getNetList = getNetList;

View File

@ -1,6 +1,7 @@
const utils = require('j7/utils'); const utils = require('j7/utils');
const BaseService = require('./baseservice'); const BaseService = require('./baseservice');
const metaFactory = require('../metadata/factory'); const metaFactory = require('../metadata/factory');
const bcClass = require('../blockchain');
const netIdHash = {}; const netIdHash = {};
@ -13,7 +14,7 @@ class BlockChain extends BaseService {
#bc = null; #bc = null;
static async staticInit() { static async staticInit() {
console.log('static init'); console.log(metaFactory.getNetList());
} }
async init(netId) { async init(netId) {