geth搭建私有链,remix连接出现的问题

首先使用单引号geth --datadir ./data/00 --networkid 314590  --port 61910 --rpc --rpcapi 'web3,eth,debug' --rpccorsdomain '* --rpcport 8200 console

使用remix无法连接

然后换成双引号geth --datadir ./data/00 --networkid 314590  --port 61910 --rpc --rpcapi "web3,eth,debug" --rpccorsdomain "*" --rpcport 8200 console

Web3 Provider  处填入如下,http://127.0.0.1:8200,显示can't  detect network.然后creation of SimpleStorage pending

最后把rpcapi中的 debug改为net   geth --datadir ./data/00 --networkid 314590  --port 61910 --rpc --rpcapi "web3,eth,net" --rpccorsdomain "*" --rpcport 8200 console

可以连接了


Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: exceeds block gas limit
    at Object.InvalidResponse (/home/mec/tools/node-v8.9.4-linux-x64/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/errors.js:38:1)
    at /home/mec/tools/node-v8.9.4-linux-x64/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:86:1
    at /home/mec/tools/node-v8.9.4-linux-x64/lib/node_modules/truffle/build/webpack:/~/truffle-migrate/index.js:225:1
    at /home/mec/tools/node-v8.9.4-linux-x64/lib/node_modules/truffle/build/webpack:/~/truffle-provider/wrapper.js:134:1
    at XMLHttpRequest.request.onreadystatechange (/home/mec/tools/node-v8.9.4-linux-x64/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/httpprovider.js:128:1)
    at XMLHttpRequestEventTarget.dispatchEvent (/home/mec/tools/node-v8.9.4-linux-x64/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:64:1)
    at XMLHttpRequest._setReadyState (/home/mec/tools/node-v8.9.4-linux-x64/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:354:1)
    at XMLHttpRequest._onHttpResponseEnd (/home/mec/tools/node-v8.9.4-linux-x64/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:509:1)
    at IncomingMessage. (/home/mec/tools/node-v8.9.4-linux-x64/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:469:1)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1055:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

上面的错误是创世区块genesis.json中的参数gasLimit 设置的太小导致.

module.exports = {
    networks: {
        live: {
            host: "localhost",
            port: 8200,
            network_id: 314590, // 匹配任何network id
            gas: 500000  //设置小一点
         }
    }
};

你可能感兴趣的:(以太坊)