I have build a Ethereum Full Node in Ubuntu 18.04. geth
is running through the following command:
nohup geth --rpcaddr 127.0.0.1 -rpcport 8545 --rpc -rpcapi "wb3,admin,eth,personal,net" --ws --wsaddr 127.0.0.1 --wsport 8546 --wsorigins "*" --datadir "/data/ethereum" --syncmode fast --maxpeers 10000 --cache 8196 >> geth.log 2>&1 &
one line of geth.log content:
INFO [06-06|00:59:22.250] Imported new block headers count=1 elapsed=6.793ms number=10206927 hash="92683d…04062d"
truffle
is configured as the following:
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: "*", // Any network (default: none)
}
In truffle console, when I use command web3.eth.getBlockNumber().then(console.log)
, it just returns
0
undefined
Why is it not 10206927(from geth.log) or a close number?
Thanks in advance!