let multichain = require("multichain-node")({
port: 6001,
host:'localhost',
user:'myuser',
pass:'mypassword'
});
multichain.getInfo((error,info) => {
if(error){
throw error;
}
console.log(info);
})
output:version: '1.0',
nodeversion: 10000901,
protocolversion: 10008,
chainname: 'chain1',
description: 'chain1',
protocol: 'multichain',
port: 6001,
setupblocks: 60,
nodeaddress: '[email protected]:6001',
burnaddress: '1XXXXXXWh4XXXXXXXyXXXXXXZdXXXXXXYjGhfn',
incomingpaused: false,
miningpaused: false,
walletversion: 60000,
balance: 0,
walletdbversion: 2,
reindex: false,
blocks: 127,
timeoffset: 0,
connections: 0,
proxy: '',
difficulty: 6e-8,
testnet: false,
keypoololdest: 1506490805,
keypoolsize: 2,
paytxfee: 0,
relayfee: 0,
errors: '' }
此輸出在命令提示顯示,我怎樣才能在瀏覽器中執行該代碼無法運行在
你想做什麼,這段代碼不適合瀏覽器在我看來,multichain只是爲服務器工作 – Carson