centos7にgethをインストールする
golangのインストール
sudo yum install -y epel-release
sudo yum install -y golang gmp-devel git
gethのコンパイル
git clone https://github.com/ethereum/go-ethereum
cd go-ethereum
make geth
sudo cp build/bin/geth /usr/local/bin
初回起動
geth --fast
データディレクトリ
ls ~/.ethereum/
永続化
/etc/systemd/system/geth.service
[Unit]
Description=go-ethereum
After=syslog.target network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/geth --rpc --rpcaddr "localhost" --rpcport "8545" --rpcapi "eth,net,web3"
WorkingDirectory=/home/centos
KillMode=process
Restart=always
User=centos
Group=centos
[Install]
WantedBy=multi-user.target
起動・終了
sudo systemctl start geth
sudo systemctl stop geth