1 查找现在的进程id
ps -ef| grep geth
或
top | grep geth
2 重启
nohup geth --datadir '/mnt/EthereumData' --allow-insecure-unlock >> geth.log 2>&1 &
3 安装nvm,安装node npm cnpm
nvm安装 cnpm 安装:
npm install -g cnpm -registry=https://registry.npm.taobao.org
安装web3
cnpm install web3
4启动RPC服务。远程连接服务 Geth文档
启动HTTP RPC 
admin.startRPC("127.0.0.1",8546,"*","eth,net,web3,personal,admin,shh,txpool,debug,miner")

stopRPC方法用来关闭当前启动的HTTP RPC端结点。由于一个Geth节点 只能同时启动一个HTTP端结点,因此stopRPC方法不需要参数,其返回 值为一个布尔值,表示端结点是否成功关闭
admin.stopRPC()

5 测试js文件:
vim te.js
获取当前连接的节点个数
const Web3 = require("web3");
var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8546"))
console.log("connected")
web3.eth.net.getPeerCount().then(function(result){
console.log(result)
}).catch(function(err){
console.log(err)
});
执行node te.js 
|