ビットコインノード(Bitcoin core)を Ubuntu 18.04 へ導入
● Bitcoin Core の導入
1. Bitcoin公式のPPAからダウンロード/インストール
$ sudo apt-add-repository ppa:bitcoin/bitcoin -y $ sudo apt-get update -y $ sudo apt-get install bitcoin-qt -y $ sudo apt-get install bitcoind -y
$ sudo apt-add-repository ppa:bitcoin/bitcoin -y Hit:1 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic InRelease Get:2 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] Get:3 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] Get:4 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic-backports/universe Sources [2068 B] Get:5 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [3468 B] Get:6 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB] Get:7 http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu bionic InRelease [15.4 kB] Ign:8 https://artifacts.elastic.co/packages/6.x/apt stable InRelease Hit:9 https://artifacts.elastic.co/packages/6.x/apt stable Release Hit:11 http://ppa.launchpad.net/ethereum/ethereum/ubuntu bionic InRelease Get:12 http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu bionic/main amd64 Packages [2796 B] Get:13 http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu bionic/main Translation-en [1712 B] Fetched 277 kB in 2s (132 kB/s) Reading package lists... Done W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2 W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2 W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2 W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2 W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2 W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2 W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2 W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2 W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2 W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2 $ sudo apt-get update -y Hit:1 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic InRelease Hit:2 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic-updates InRelease Hit:3 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic-backports InRelease Hit:4 http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu bionic InRelease Hit:5 http://security.ubuntu.com/ubuntu bionic-security InRelease Ign:6 https://artifacts.elastic.co/packages/6.x/apt stable InRelease Hit:7 https://artifacts.elastic.co/packages/6.x/apt stable Release Hit:9 http://ppa.launchpad.net/ethereum/ethereum/ubuntu bionic InRelease Reading package lists... Done W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2 W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2 W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2 W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2 W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2 W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2 W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2 W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2 W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2 W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/elastic-6.x.list:1 and /etc/apt/sources.list.d/elastic-6.x.list:2 $ sudo apt-get install bitcoin-qt -y Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: abigen bootnode evm geth linux-aws-headers-4.15.0-1031 puppeth rlpdump wnode Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: libboost-chrono1.65.1 libboost-filesystem1.65.1 libboost-system1.65.1 libboost-thread1.65.1 libdb4.8++ libdouble-conversion1 libevdev2 libevent-core-2.1-6 libevent-pthreads-2.1-6 libgudev-1.0-0 libinput-bin libinput10 libminiupnpc10 libmtdev1 libnorm1 libpgm-5.2-0 libprotobuf10 libqrencode3 libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 libqt5svg5 libqt5widgets5 libsodium23 libwacom-bin libwacom-common libwacom2 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-util1 libxcb-xinerama0 libxcb-xkb1 libxkbcommon-x11-0 libzmq5 qt5-gtk-platformtheme qttranslations5-l10n Suggested packages: minissdpd qt5-image-formats-plugins qtwayland5 The following NEW packages will be installed: bitcoin-qt libboost-chrono1.65.1 libboost-filesystem1.65.1 libboost-system1.65.1 libboost-thread1.65.1 libdb4.8++ libdouble-conversion1 libevdev2 libevent-core-2.1-6 libevent-pthreads-2.1-6 libgudev-1.0-0 libinput-bin libinput10 libminiupnpc10 libmtdev1 libnorm1 libpgm-5.2-0 libprotobuf10 libqrencode3 libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 libqt5svg5 libqt5widgets5 libsodium23 libwacom-bin libwacom-common libwacom2 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-util1 libxcb-xinerama0 libxcb-xkb1 libxkbcommon-x11-0 libzmq5 qt5-gtk-platformtheme qttranslations5-l10n 0 upgraded, 41 newly installed, 0 to remove and 112 not upgraded. Need to get 15.9 MB of archives. After this operation, 62.1 MB of additional disk space will be used. Get:1 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libdouble-conversion1 amd64 2.0.1-4ubuntu1 [33.0 kB] Get:2 http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu bionic/main amd64 libdb4.8++ amd64 4.8.30-bionic3 [601 kB] Get:3 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libqt5core5a amd64 5.9.5+dfsg-0ubuntu1 [2035 kB] Get:4 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libevdev2 amd64 1.5.8+dfsg-1 [29.0 kB] Get:5 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libmtdev1 amd64 1.1.5-1ubuntu3 [13.8 kB] Get:6 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libgudev-1.0-0 amd64 1:232-2 [13.6 kB] Get:7 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libwacom-common all 0.29-1 [36.9 kB] Get:8 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libwacom2 amd64 0.29-1 [17.7 kB] Get:9 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libinput-bin amd64 1.10.4-1 [11.0 kB] Get:10 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libinput10 amd64 1.10.4-1 [86.2 kB] Get:11 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libqt5dbus5 amd64 5.9.5+dfsg-0ubuntu1 [196 kB] Get:12 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libqt5network5 amd64 5.9.5+dfsg-0ubuntu1 [634 kB] Get:13 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libxcb-icccm4 amd64 0.4.1-1ubuntu1 [10.4 kB] Get:14 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libxcb-util1 amd64 0.4.0-0ubuntu3 [11.2 kB] Get:15 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libxcb-image0 amd64 0.4.0-1build1 [12.3 kB] Get:16 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libxcb-keysyms1 amd64 0.4.0-1 [8406 B] Get:17 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libxcb-randr0 amd64 1.13-1 [16.4 kB] Get:18 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libxcb-render-util0 amd64 0.3.9-1 [9638 B] Get:19 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libxcb-xinerama0 amd64 1.13-1 [5256 B] Get:20 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libxcb-xkb1 amd64 1.13-1 [30.1 kB] Get:21 http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu bionic/main amd64 bitcoin-qt amd64 0.17.1-bionic1 [3959 kB] Get:22 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libxkbcommon-x11-0 amd64 0.8.0-1ubuntu0.1 [13.5 kB] Get:23 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libqt5gui5 amd64 5.9.5+dfsg-0ubuntu1 [2566 kB] Get:24 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libqt5widgets5 amd64 5.9.5+dfsg-0ubuntu1 [2203 kB] Get:25 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libqt5svg5 amd64 5.9.5-0ubuntu1 [128 kB] Get:26 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libboost-system1.65.1 amd64 1.65.1+dfsg-0ubuntu5 [10.5 kB] Get:27 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libboost-chrono1.65.1 amd64 1.65.1+dfsg-0ubuntu5 [10.2 kB] Get:28 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libboost-filesystem1.65.1 amd64 1.65.1+dfsg-0ubuntu5 [40.3 kB] Get:29 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libboost-thread1.65.1 amd64 1.65.1+dfsg-0ubuntu5 [43.2 kB] Get:30 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libevent-core-2.1-6 amd64 2.1.8-stable-4build1 [85.9 kB] Get:31 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libevent-pthreads-2.1-6 amd64 2.1.8-stable-4build1 [5228 B] Get:32 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libminiupnpc10 amd64 1.9.20140610-4ubuntu2 [24.1 kB] Get:33 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libprotobuf10 amd64 3.0.0-9.1ubuntu1 [651 kB] Get:34 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/universe amd64 libqrencode3 amd64 3.4.4-1build1 [23.9 kB] Get:35 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/universe amd64 libnorm1 amd64 1.5r6+dfsg1-6 [224 kB] Get:36 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/universe amd64 libpgm-5.2-0 amd64 5.2.122~dfsg-2 [157 kB] Get:37 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libsodium23 amd64 1.0.16-2 [143 kB] Get:38 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 libzmq5 amd64 4.2.5-1ubuntu0.1 [220 kB] Get:39 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 libwacom-bin amd64 0.29-1 [4712 B] Get:40 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 qt5-gtk-platformtheme amd64 5.9.5+dfsg-0ubuntu1 [117 kB] Get:41 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 qttranslations5-l10n all 5.9.5-0ubuntu1 [1485 kB] Fetched 15.9 MB in 16s (1021 kB/s) Extracting templates from packages: 100% Selecting previously unselected package libdouble-conversion1:amd64. (Reading database ... 168071 files and directories currently installed.) Preparing to unpack .../00-libdouble-conversion1_2.0.1-4ubuntu1_amd64.deb ... Unpacking libdouble-conversion1:amd64 (2.0.1-4ubuntu1) ... Selecting previously unselected package libqt5core5a:amd64. Preparing to unpack .../01-libqt5core5a_5.9.5+dfsg-0ubuntu1_amd64.deb ... Unpacking libqt5core5a:amd64 (5.9.5+dfsg-0ubuntu1) ... Selecting previously unselected package libevdev2:amd64. Preparing to unpack .../02-libevdev2_1.5.8+dfsg-1_amd64.deb ... Unpacking libevdev2:amd64 (1.5.8+dfsg-1) ... Selecting previously unselected package libmtdev1:amd64. Preparing to unpack .../03-libmtdev1_1.1.5-1ubuntu3_amd64.deb ... Unpacking libmtdev1:amd64 (1.1.5-1ubuntu3) ... Selecting previously unselected package libgudev-1.0-0:amd64. Preparing to unpack .../04-libgudev-1.0-0_1%3a232-2_amd64.deb ... Unpacking libgudev-1.0-0:amd64 (1:232-2) ... Selecting previously unselected package libwacom-common. Preparing to unpack .../05-libwacom-common_0.29-1_all.deb ... Unpacking libwacom-common (0.29-1) ... Selecting previously unselected package libwacom2:amd64. Preparing to unpack .../06-libwacom2_0.29-1_amd64.deb ... Unpacking libwacom2:amd64 (0.29-1) ... Selecting previously unselected package libinput-bin. Preparing to unpack .../07-libinput-bin_1.10.4-1_amd64.deb ... Unpacking libinput-bin (1.10.4-1) ... Selecting previously unselected package libinput10:amd64. Preparing to unpack .../08-libinput10_1.10.4-1_amd64.deb ... Unpacking libinput10:amd64 (1.10.4-1) ... Selecting previously unselected package libqt5dbus5:amd64. Preparing to unpack .../09-libqt5dbus5_5.9.5+dfsg-0ubuntu1_amd64.deb ... Unpacking libqt5dbus5:amd64 (5.9.5+dfsg-0ubuntu1) ... Selecting previously unselected package libqt5network5:amd64. Preparing to unpack .../10-libqt5network5_5.9.5+dfsg-0ubuntu1_amd64.deb ... Unpacking libqt5network5:amd64 (5.9.5+dfsg-0ubuntu1) ... Selecting previously unselected package libxcb-icccm4:amd64. Preparing to unpack .../11-libxcb-icccm4_0.4.1-1ubuntu1_amd64.deb ... Unpacking libxcb-icccm4:amd64 (0.4.1-1ubuntu1) ... Selecting previously unselected package libxcb-util1:amd64. Preparing to unpack .../12-libxcb-util1_0.4.0-0ubuntu3_amd64.deb ... Unpacking libxcb-util1:amd64 (0.4.0-0ubuntu3) ... Selecting previously unselected package libxcb-image0:amd64. Preparing to unpack .../13-libxcb-image0_0.4.0-1build1_amd64.deb ... Unpacking libxcb-image0:amd64 (0.4.0-1build1) ... Selecting previously unselected package libxcb-keysyms1:amd64. Preparing to unpack .../14-libxcb-keysyms1_0.4.0-1_amd64.deb ... Unpacking libxcb-keysyms1:amd64 (0.4.0-1) ... Selecting previously unselected package libxcb-randr0:amd64. Preparing to unpack .../15-libxcb-randr0_1.13-1_amd64.deb ... Unpacking libxcb-randr0:amd64 (1.13-1) ... Selecting previously unselected package libxcb-render-util0:amd64. Preparing to unpack .../16-libxcb-render-util0_0.3.9-1_amd64.deb ... Unpacking libxcb-render-util0:amd64 (0.3.9-1) ... Selecting previously unselected package libxcb-xinerama0:amd64. Preparing to unpack .../17-libxcb-xinerama0_1.13-1_amd64.deb ... Unpacking libxcb-xinerama0:amd64 (1.13-1) ... Selecting previously unselected package libxcb-xkb1:amd64. Preparing to unpack .../18-libxcb-xkb1_1.13-1_amd64.deb ... Unpacking libxcb-xkb1:amd64 (1.13-1) ... Selecting previously unselected package libxkbcommon-x11-0:amd64. Preparing to unpack .../19-libxkbcommon-x11-0_0.8.0-1ubuntu0.1_amd64.deb ... Unpacking libxkbcommon-x11-0:amd64 (0.8.0-1ubuntu0.1) ... Selecting previously unselected package libqt5gui5:amd64. Preparing to unpack .../20-libqt5gui5_5.9.5+dfsg-0ubuntu1_amd64.deb ... Unpacking libqt5gui5:amd64 (5.9.5+dfsg-0ubuntu1) ... Selecting previously unselected package libqt5widgets5:amd64. Preparing to unpack .../21-libqt5widgets5_5.9.5+dfsg-0ubuntu1_amd64.deb ... Unpacking libqt5widgets5:amd64 (5.9.5+dfsg-0ubuntu1) ... Selecting previously unselected package libqt5svg5:amd64. Preparing to unpack .../22-libqt5svg5_5.9.5-0ubuntu1_amd64.deb ... Unpacking libqt5svg5:amd64 (5.9.5-0ubuntu1) ... Selecting previously unselected package libboost-system1.65.1:amd64. Preparing to unpack .../23-libboost-system1.65.1_1.65.1+dfsg-0ubuntu5_amd64.deb ... Unpacking libboost-system1.65.1:amd64 (1.65.1+dfsg-0ubuntu5) ... Selecting previously unselected package libboost-chrono1.65.1:amd64. Preparing to unpack .../24-libboost-chrono1.65.1_1.65.1+dfsg-0ubuntu5_amd64.deb ... Unpacking libboost-chrono1.65.1:amd64 (1.65.1+dfsg-0ubuntu5) ... Selecting previously unselected package libboost-filesystem1.65.1:amd64. Preparing to unpack .../25-libboost-filesystem1.65.1_1.65.1+dfsg-0ubuntu5_amd64.deb ... Unpacking libboost-filesystem1.65.1:amd64 (1.65.1+dfsg-0ubuntu5) ... Selecting previously unselected package libboost-thread1.65.1:amd64. Preparing to unpack .../26-libboost-thread1.65.1_1.65.1+dfsg-0ubuntu5_amd64.deb ... Unpacking libboost-thread1.65.1:amd64 (1.65.1+dfsg-0ubuntu5) ... Selecting previously unselected package libdb4.8++. Preparing to unpack .../27-libdb4.8++_4.8.30-bionic3_amd64.deb ... Unpacking libdb4.8++ (4.8.30-bionic3) ... Selecting previously unselected package libevent-core-2.1-6:amd64. Preparing to unpack .../28-libevent-core-2.1-6_2.1.8-stable-4build1_amd64.deb ... Unpacking libevent-core-2.1-6:amd64 (2.1.8-stable-4build1) ... Selecting previously unselected package libevent-pthreads-2.1-6:amd64. Preparing to unpack .../29-libevent-pthreads-2.1-6_2.1.8-stable-4build1_amd64.deb ... Unpacking libevent-pthreads-2.1-6:amd64 (2.1.8-stable-4build1) ... Selecting previously unselected package libminiupnpc10:amd64. Preparing to unpack .../30-libminiupnpc10_1.9.20140610-4ubuntu2_amd64.deb ... Unpacking libminiupnpc10:amd64 (1.9.20140610-4ubuntu2) ... Selecting previously unselected package libprotobuf10:amd64. Preparing to unpack .../31-libprotobuf10_3.0.0-9.1ubuntu1_amd64.deb ... Unpacking libprotobuf10:amd64 (3.0.0-9.1ubuntu1) ... Selecting previously unselected package libqrencode3:amd64. Preparing to unpack .../32-libqrencode3_3.4.4-1build1_amd64.deb ... Unpacking libqrencode3:amd64 (3.4.4-1build1) ... Selecting previously unselected package libnorm1:amd64. Preparing to unpack .../33-libnorm1_1.5r6+dfsg1-6_amd64.deb ... Unpacking libnorm1:amd64 (1.5r6+dfsg1-6) ... Selecting previously unselected package libpgm-5.2-0:amd64. Preparing to unpack .../34-libpgm-5.2-0_5.2.122~dfsg-2_amd64.deb ... Unpacking libpgm-5.2-0:amd64 (5.2.122~dfsg-2) ... Selecting previously unselected package libsodium23:amd64. Preparing to unpack .../35-libsodium23_1.0.16-2_amd64.deb ... Unpacking libsodium23:amd64 (1.0.16-2) ... Selecting previously unselected package libzmq5:amd64. Preparing to unpack .../36-libzmq5_4.2.5-1ubuntu0.1_amd64.deb ... Unpacking libzmq5:amd64 (4.2.5-1ubuntu0.1) ... Selecting previously unselected package bitcoin-qt. Preparing to unpack .../37-bitcoin-qt_0.17.1-bionic1_amd64.deb ... Unpacking bitcoin-qt (0.17.1-bionic1) ... Selecting previously unselected package libwacom-bin. Preparing to unpack .../38-libwacom-bin_0.29-1_amd64.deb ... Unpacking libwacom-bin (0.29-1) ... Selecting previously unselected package qt5-gtk-platformtheme:amd64. Preparing to unpack .../39-qt5-gtk-platformtheme_5.9.5+dfsg-0ubuntu1_amd64.deb ... Unpacking qt5-gtk-platformtheme:amd64 (5.9.5+dfsg-0ubuntu1) ... Selecting previously unselected package qttranslations5-l10n. Preparing to unpack .../40-qttranslations5-l10n_5.9.5-0ubuntu1_all.deb ... Unpacking qttranslations5-l10n (5.9.5-0ubuntu1) ... Setting up libdb4.8++ (4.8.30-bionic3) ... Setting up libxcb-xinerama0:amd64 (1.13-1) ... Setting up libpgm-5.2-0:amd64 (5.2.122~dfsg-2) ... Setting up libxcb-render-util0:amd64 (0.3.9-1) ... Setting up libxcb-randr0:amd64 (1.13-1) ... Setting up libxcb-icccm4:amd64 (0.4.1-1ubuntu1) ... Setting up libevent-core-2.1-6:amd64 (2.1.8-stable-4build1) ... Setting up libwacom-common (0.29-1) ... Setting up libdouble-conversion1:amd64 (2.0.1-4ubuntu1) ... Processing triggers for mime-support (3.60ubuntu1) ... Setting up libevdev2:amd64 (1.5.8+dfsg-1) ... Setting up libminiupnpc10:amd64 (1.9.20140610-4ubuntu2) ... Setting up libxcb-util1:amd64 (0.4.0-0ubuntu3) ... Setting up libqrencode3:amd64 (3.4.4-1build1) ... Setting up libnorm1:amd64 (1.5r6+dfsg1-6) ... Setting up libboost-system1.65.1:amd64 (1.65.1+dfsg-0ubuntu5) ... Setting up libprotobuf10:amd64 (3.0.0-9.1ubuntu1) ... Setting up libsodium23:amd64 (1.0.16-2) ... Setting up libevent-pthreads-2.1-6:amd64 (2.1.8-stable-4build1) ... Processing triggers for libc-bin (2.27-3ubuntu1) ... Processing triggers for udev (237-3ubuntu10.13) ... Setting up libboost-thread1.65.1:amd64 (1.65.1+dfsg-0ubuntu5) ... Setting up qttranslations5-l10n (5.9.5-0ubuntu1) ... Setting up libmtdev1:amd64 (1.1.5-1ubuntu3) ... Processing triggers for man-db (2.8.3-2) ... Setting up libboost-chrono1.65.1:amd64 (1.65.1+dfsg-0ubuntu5) ... Setting up libgudev-1.0-0:amd64 (1:232-2) ... Setting up libxcb-keysyms1:amd64 (0.4.0-1) ... Setting up libxcb-xkb1:amd64 (1.13-1) ... Setting up libqt5core5a:amd64 (5.9.5+dfsg-0ubuntu1) ... Setting up libqt5dbus5:amd64 (5.9.5+dfsg-0ubuntu1) ... Setting up libzmq5:amd64 (4.2.5-1ubuntu0.1) ... Setting up libqt5network5:amd64 (5.9.5+dfsg-0ubuntu1) ... Setting up libwacom2:amd64 (0.29-1) ... Setting up libxcb-image0:amd64 (0.4.0-1build1) ... Setting up libboost-filesystem1.65.1:amd64 (1.65.1+dfsg-0ubuntu5) ... Setting up libinput-bin (1.10.4-1) ... Setting up libxkbcommon-x11-0:amd64 (0.8.0-1ubuntu0.1) ... Setting up libwacom-bin (0.29-1) ... Setting up libinput10:amd64 (1.10.4-1) ... Setting up libqt5gui5:amd64 (5.9.5+dfsg-0ubuntu1) ... Setting up qt5-gtk-platformtheme:amd64 (5.9.5+dfsg-0ubuntu1) ... Setting up libqt5widgets5:amd64 (5.9.5+dfsg-0ubuntu1) ... Setting up bitcoin-qt (0.17.1-bionic1) ... Setting up libqt5svg5:amd64 (5.9.5-0ubuntu1) ... Processing triggers for libc-bin (2.27-3ubuntu1) ... $ sudo apt-get install bitcoind -y Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: abigen bootnode evm geth linux-aws-headers-4.15.0-1031 puppeth rlpdump wnode Use 'sudo apt autoremove' to remove them. The following NEW packages will be installed: bitcoind 0 upgraded, 1 newly installed, 0 to remove and 112 not upgraded. Need to get 1918 kB of archives. After this operation, 7136 kB of additional disk space will be used. Get:1 http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu bionic/main amd64 bitcoind amd64 0.17.1-bionic1 [1918 kB] Fetched 1918 kB in 9s (221 kB/s) Selecting previously unselected package bitcoind. (Reading database ... 168884 files and directories currently installed.) Preparing to unpack .../bitcoind_0.17.1-bionic1_amd64.deb ... Unpacking bitcoind (0.17.1-bionic1) ... Setting up bitcoind (0.17.1-bionic1) ... Warning: The home dir /var/lib/bitcoin you specified can't be accessed: No such file or directory Adding system user `bitcoin' (UID 111) ... Adding new group `bitcoin' (GID 115) ... Adding new user `bitcoin' (UID 111) with group `bitcoin' ... Not creating home directory `/var/lib/bitcoin'. bitcoind.service is a disabled or a static unit, not starting it. Processing triggers for man-db (2.8.3-2) ...
2.ユーザー、パスワード暗号化ファイル(rpcauth.py)の作成
$ vi rpcauth.py ############################################################################################# #!/usr/bin/env python3 # Copyright (c) 2015-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import sys import os from random import SystemRandom import base64 import hmac def generate_salt(): # This uses os.urandom() underneath cryptogen = SystemRandom() # Create 16 byte hex salt salt_sequence = [cryptogen.randrange(256) for _ in range(16)] return ''.join([format(r, 'x') for r in salt_sequence]) def generate_password(): """Create 32 byte b64 password""" return base64.urlsafe_b64encode(os.urandom(32)).decode('utf-8') def password_to_hmac(salt, password): m = hmac.new(bytearray(salt, 'utf-8'), bytearray(password, 'utf-8'), 'SHA256') return m.hexdigest() def main(): if len(sys.argv) < 2: sys.stderr.write('Please include username (and an optional password, will generate one if not provided) as an argument.\n') sys.exit(0) username = sys.argv[1] salt = generate_salt() if len(sys.argv) > 2: password = sys.argv[2] else: password = generate_password() password_hmac = password_to_hmac(salt, password) print('String to be appended to bitcoin.conf:') print('rpcauth={0}:{1}${2}'.format(username, salt, password_hmac)) print('Your password:\n{0}'.format(password)) if __name__ == '__main__': main() #############################################################################################
3.ユーザー、パスワードの暗号化
※ rpcauth.py を用いることで RPC で使用する username、passwordを ※ 暗号化し rpcauth 取得する。 $ chmod 755 ./rpcauth.py $ ./rpcauth.py username password
String to be appended to bitcoin.conf: rpcauth=username:af587****************************** Your password: password
4. Bitcoin設定ファイルの修正
$ sudo vi /etc/bitcoin/bitcoin.conf ##### サンプル ##### mainnet=1 HOST=localhost server=1 rpcport=8332 txindex=1 rest=1 rpcauth=username:af587******************************
5. Bitcoin Core サービスの有効化
※ データ格納ディレクトリまたは Bitcoin設定ファイルの指定を変更する場合は、 ※ 先に「サービス設定変更手順」を行うこと。 $ sudo systemctl enable bitcoind.service $ sudo systemctl list-unit-files --type=service | grep bitcoind
▼ bitcoind.service enabled が表示される
6. Bitcoin Core サービスの開始
$ sudo systemctl start bitcoind.service $ sudo systemctl status bitcoind.service
● bitcoind.service - Bitcoin daemon Loaded: loaded (/lib/systemd/system/bitcoind.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2019-03-13 09:48:37 UTC; 5 days ago Main PID: 6567 (bitcoind) Tasks: 14 (limit: 4915) CGroup: /system.slice/bitcoind.service mq6567 /usr/bin/bitcoind -daemon -datadir=/var/lib/bitcoin -conf=/etc/bitcoin/bitcoin.conf -pid=/run/bitcoind/bitcoind.pid Mar 13 09:48:37 ip-172-0-0-1 systemd[1]: Starting Bitcoin daemon... Mar 13 09:48:37 ip-172-0-0-1 systemd[1]: bitcoind.service: Can't open PID file /run/bitcoind/bitcoind.pid (yet?) after start: No such file or directory Mar 13 09:48:37 ip-172-0-0-1 systemd[1]: Started Bitcoin daemon.
7. Bitcoin Core 稼働確認
$ sudo tail -f /var/lib/bitcoin/debug.log $ bitcoin-cli -conf=/etc/bitcoin/bitcoin.conf getblockcount ※ 設定ファイルを指定して起動
2019-03-19T03:47:52Z New outbound peer connected: version: 70015, blocks=567749, peer=11 567749
構築後ウォレットまたはマイニングノードとして作動します。
● サービス設定変更手順
1. Bitcoin Core サービスの無効化
$ sudo systemctl disable bitcoind.service $ sudo systemctl list-unit-files --type=service
▼ bitcoind.service disabled が表示される
2. bitcoindサービス設定ファイルの修正
$ sudo vi /lib/systemd/system/bitcoind.service ※ -datadir または -confを必要に応じ修正 ExecStart=/usr/bin/bitcoind -daemon -datadir=/var/lib/bitcoin -conf=/etc/bitcoin/bitcoin.conf -pid=/run/bitcoind/bitcoind.pid
3. サービス設定ファイルの再読み込み
$ sudo systemctl daemon-reload
これでサービス設定の変更は完了。必要に応じてサービスを起動する。