安装别按照官网上面 npm install web3 下载,我已经吃过一次亏了
npm init
npm install ethereum/web3.js –save
web3.isConnected() #检查结点的连接是否存在web3.reset() #重置web3web3.sha3(string,options) #加密web3.toHex() #将任何值转为hexweb3 = new Web3(new Web3.providers.HttpProvider(“http://localhost:8545”));web3.net.peerCounnt #连接节点的数量web3.eth.defaultBlock #默认地址web3.eth.getBalance() 看这个吧,讲得挺好的 https://bitshuo.com/topic/5954b6764a7a061b785db726