RealPath:
WebPath:
2016/12/28 13:17 (JST) 更新
システム管理 >>

起動・停止

Contents

停止状態の確認

bash
# service bitcoin status
Redirecting to /bin/systemctl status  bitcoin.service
● bitcoin.service - Bitcoin daemon
   Loaded: loaded (/usr/lib/systemd/system/bitcoin.service; disabled; vendor preset: disabled)
   Active: inactive (dead) ← ★止まってる

または
# bitcoin-cli getinfo
error: couldn't connect to server ← ★止まってる

起動

bash
# service bitcoin start
Redirecting to /bin/systemctl start  bitcoin.service

または
# bitcoind -daemon
Bitcoin server starting

起動状態の確認

bash
# service bitcoin status
Redirecting to /bin/systemctl status  bitcoin.service
● bitcoin.service - Bitcoin daemon
   Loaded: loaded (/usr/lib/systemd/system/bitcoin.service; disabled; vendor preset: disabled)
   Active: active (running) since Sat 2016-12-03 01:45:22 JST; 17s ago
  Process: 14603 ExecStart=/usr/sbin/bitcoind -daemon -conf=${CONFIG_FILE} -datadir=${DATA_DIR} -pid=${PID_FILE} $OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 14604 (bitcoind) ← ★動いてる
   CGroup: /system.slice/bitcoin.service
           └─14604 /usr/sbin/bitcoind -daemon -conf=/etc/bitcoin/bitcoin.conf -datadir=/var/lib/bitcoin -p...

Dec 03 01:45:22 sakura-storage2 systemd[1]: Starting Bitcoin daemon...
Dec 03 01:45:22 sakura-storage2 bitcoind[14603]: Bitcoin server starting
Dec 03 01:45:22 sakura-storage2 systemd[1]: Started Bitcoin daemon.

または
# bitcoin-cli getinfo
{
  "version": 130100, ← ★諸々取得できてる時点で動いてる
  "protocolversion": 70014,
  "walletversion": 130000,
  "balance": 0.00000000,
  "blocks": 207352,
  "timeoffset": 0,
  "connections": 8,
  "proxy": "",
  "difficulty": 2649.428900841236,
  "testnet": true,
  "keypoololdest": 1480720910,
  "keypoolsize": 100,
  "paytxfee": 0.00000000,
  "relayfee": 0.00001000,
  "errors": ""
}

ポートの確認

bash
# telnet localhost 8333
Trying ::1...
Connected to localhost.
Escape character is '^]'.

ちゃんと 8333 ポートで待ちうけていることが確認できる。
※テストネットの場合は 18333 で確認すること。

停止

bash
# service bitcoin stop
Redirecting to /bin/systemctl stop  bitcoin.service

または
# bitcoin-cli stop
Bitcoin server stopping