无需root权限手工运行NewChain只读节点
The original tutorial requires sudo privilege to install and run a newchain read-only node.
This short how-to tells about how to do it with a normal user account.
- Hardware
- 8GB memory or more (it is really memory hungry)
- 100GB storage or more
- OS
- Ubuntu 20.04 LTS
$ cd ~
$ mkdir newchain
$ cd newchain
Know the latest version:
$ wget https://release.cloud.diynova.com/newton/newchain/latest.txt
$ export newchain_version=`cat latest.txt`
Download the runtime
$ wget https://release.cloud.diynova.com/newton/newchain/${newchain_version}/linux/geth
$ wget https://release.cloud.diynova.com/newton/newchain/${newchain_version}/linux/geth.sha256
and verify it:
$ sha256sum -c geth.sha256
then make it executable:
$ chmod +x geth
Download the configuraiton pack
$ export newchain_deploy_latest_version="v20200526"
$ export newchain_mainnet_deploy_file="newchain-mainnet-$newchain_deploy_latest_version.tar.gz"
$ wget https://release.cloud.diynova.com/newton/newchain-deploy/mainnet/${newchain_mainnet_deploy_file}
$ wget https://release.cloud.diynova.com/newton/newchain-deploy/mainnet/${newchain_mainnet_deploy_file}.sha256
and verify it:
$ sha256sum -c ${newchain_mainnet_deploy_file}.sha256
then unpack it:
$ tar xvfz newchain-mainnet-v20200526.tar.gz
$ mkdir mainnet/nodedata
$ ./geth --datadir ./mainnet/nodedata init mainnet/share/newchainmain.json
Modify mainnet/conf/node.toml with the following changes:
- Change DatasetDir to /home/{USERNAME}/newchain/.ethash
- Change DataDir to /home/{USERNAME}/newchain/mainnet/nodedata
Please replace the {USERNAME} above with your linux account name.
$ ./geth --config ./mainnet/conf/node.toml
Bingo. You should have seen the node is started to download the blockchain data.
$ ./geth attach ~/newchain/mainnet/nodedata/geth.ipc
Type eth.syncing and you'll see:
> eth.syncing
{
currentBlock: 88412,
highestBlock: 15596231,
knownStates: 0,
pulledStates: 0,
startingBlock: 0
}
Well done.