From ef709b7b4767ef7abf4516c99205b8d1bb3ba47e Mon Sep 17 00:00:00 2001 From: Srdjan Obucina Date: Tue, 20 Aug 2019 15:46:30 +0200 Subject: [PATCH 1/8] Docker file for Ubuntu 18.04 Base image updated to Unbuntu 18.04 Prerequisite list updated Basic configuration updated --- .dockerignore | 1 + Dockerfile | 37 ++++++++++++++++++++++--------------- 2 files changed, 23 insertions(+), 15 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..378eac25 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +build diff --git a/Dockerfile b/Dockerfile index a3cc326a..b5cf9ad5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,25 @@ -FROM phusion/baseimage:0.9.19 +FROM ubuntu:18.04 MAINTAINER PeerPlays Blockchain Standards Association ENV LANG=en_US.UTF-8 +ENV DEBIAN_FRONTEND=noninteractive RUN \ apt-get update -y && \ apt-get install -y \ - g++ \ autoconf \ + build-essential \ + ca-certificates \ cmake \ + doxygen \ git \ libbz2-dev \ - libreadline-dev \ - libboost-all-dev \ libcurl4-openssl-dev \ - libssl-dev \ libncurses-dev \ - doxygen \ - ca-certificates \ + libreadline-dev \ + libssl-dev \ + libtool \ + ntp \ + wget \ && \ apt-get update -y && \ apt-get install -y fish && \ @@ -28,17 +31,21 @@ WORKDIR /peerplays-core # Compile RUN \ - ( git submodule sync --recursive || \ - find `pwd` -type f -name .git | \ - while read f; do \ - rel="$(echo "${f#$PWD/}" | sed 's=[^/]*/=../=g')"; \ - sed -i "s=: .*/.git/=: $rel/=" "$f"; \ - done && \ - git submodule sync --recursive ) && \ git submodule update --init --recursive && \ + BOOST_ROOT=$HOME/boost_1_67_0 && \ + wget -c 'http://sourceforge.net/projects/boost/files/boost/1.67.0/boost_1_67_0.tar.gz/download' -O boost_1_67_0.tar.gz &&\ + tar -zxvf boost_1_67_0.tar.gz && \ + cd boost_1_67_0/ && \ + ./bootstrap.sh "--prefix=$BOOST_ROOT" && \ + ./b2 install && \ + cd .. && \ + mkdir build && \ + mkdir build/release && \ + cd build/release && \ cmake \ + -DBOOST_ROOT="$BOOST_ROOT" \ -DCMAKE_BUILD_TYPE=Release \ - . && \ + ../.. && \ make witness_node cli_wallet && \ install -s programs/witness_node/witness_node programs/cli_wallet/cli_wallet /usr/local/bin && \ # From 0550711ddf57b5669cc3e5a7715cd8ad68a16a81 Mon Sep 17 00:00:00 2001 From: Srdjan Obucina Date: Tue, 20 Aug 2019 15:51:27 +0200 Subject: [PATCH 2/8] Quick fix: Added missing package pkg-config --- Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index b5cf9ad5..eeb7ab15 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,7 @@ RUN \ libreadline-dev \ libssl-dev \ libtool \ + pkg-config \ ntp \ wget \ && \ @@ -29,7 +30,7 @@ RUN \ ADD . /peerplays-core WORKDIR /peerplays-core -# Compile +# Compile Boost RUN \ git submodule update --init --recursive && \ BOOST_ROOT=$HOME/boost_1_67_0 && \ @@ -38,7 +39,11 @@ RUN \ cd boost_1_67_0/ && \ ./bootstrap.sh "--prefix=$BOOST_ROOT" && \ ./b2 install && \ - cd .. && \ + cd .. + +# Compile Boost +RUN \ + BOOST_ROOT=$HOME/boost_1_67_0 && \ mkdir build && \ mkdir build/release && \ cd build/release && \ From 58b67524bfc611540130987405cde71219ef9bc1 Mon Sep 17 00:00:00 2001 From: Srdjan Obucina Date: Tue, 20 Aug 2019 16:08:05 +0200 Subject: [PATCH 3/8] Docker file updates --- Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index eeb7ab15..b87a25ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,12 @@ FROM ubuntu:18.04 MAINTAINER PeerPlays Blockchain Standards Association ENV LANG=en_US.UTF-8 -ENV DEBIAN_FRONTEND=noninteractive +ENV LANGUAGE en_US.UTF-8 +ENV LC_ALL en_US.UTF-8 + RUN \ apt-get update -y && \ - apt-get install -y \ + DEBIAN_FRONTEND=noninteractive apt-get install -y \ autoconf \ build-essential \ ca-certificates \ @@ -22,8 +24,6 @@ RUN \ ntp \ wget \ && \ - apt-get update -y && \ - apt-get install -y fish && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* @@ -32,7 +32,6 @@ WORKDIR /peerplays-core # Compile Boost RUN \ - git submodule update --init --recursive && \ BOOST_ROOT=$HOME/boost_1_67_0 && \ wget -c 'http://sourceforge.net/projects/boost/files/boost/1.67.0/boost_1_67_0.tar.gz/download' -O boost_1_67_0.tar.gz &&\ tar -zxvf boost_1_67_0.tar.gz && \ @@ -41,9 +40,10 @@ RUN \ ./b2 install && \ cd .. -# Compile Boost +# Compile Peerplays RUN \ BOOST_ROOT=$HOME/boost_1_67_0 && \ + git submodule update --init --recursive && \ mkdir build && \ mkdir build/release && \ cd build/release && \ From 896ac97962a3d719f78820f884ced63e8740eeef Mon Sep 17 00:00:00 2001 From: PBSA Date: Wed, 21 Aug 2019 13:13:46 +0000 Subject: [PATCH 4/8] 5050 fee update and compilation error fix --- libraries/chain/include/graphene/chain/protocol/asset_ops.hpp | 2 +- .../chain/include/graphene/chain/vesting_balance_object.hpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/libraries/chain/include/graphene/chain/protocol/asset_ops.hpp b/libraries/chain/include/graphene/chain/protocol/asset_ops.hpp index 1d158d83..a567c5a1 100644 --- a/libraries/chain/include/graphene/chain/protocol/asset_ops.hpp +++ b/libraries/chain/include/graphene/chain/protocol/asset_ops.hpp @@ -226,7 +226,7 @@ namespace graphene { namespace chain { struct lottery_asset_create_operation : public base_operation { struct fee_parameters_type { - uint64_t lottery_asset = 5000 * GRAPHENE_BLOCKCHAIN_PRECISION; + uint64_t lottery_asset = 20 * GRAPHENE_BLOCKCHAIN_PRECISION; uint32_t price_per_kbyte = 10; /// only required for large lottery names. }; diff --git a/libraries/chain/include/graphene/chain/vesting_balance_object.hpp b/libraries/chain/include/graphene/chain/vesting_balance_object.hpp index 5ae93a4a..8dd346ed 100644 --- a/libraries/chain/include/graphene/chain/vesting_balance_object.hpp +++ b/libraries/chain/include/graphene/chain/vesting_balance_object.hpp @@ -189,7 +189,6 @@ namespace graphene { namespace chain { composite_key< vesting_balance_object, member_offset, - member, member_offset //member //member_offset From 4ade70a239649865d3a4a01341443d5670a913a6 Mon Sep 17 00:00:00 2001 From: Srdjan Obucina Date: Wed, 21 Aug 2019 19:38:06 +0200 Subject: [PATCH 5/8] Dockerfile, set system locale Prevents locale::facet::_S_create_c_locale name error --- Dockerfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b87a25ba..a9ce34fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:18.04 MAINTAINER PeerPlays Blockchain Standards Association -ENV LANG=en_US.UTF-8 +ENV LANG en_US.UTF-8 ENV LANGUAGE en_US.UTF-8 ENV LC_ALL en_US.UTF-8 @@ -9,17 +9,20 @@ RUN \ apt-get update -y && \ DEBIAN_FRONTEND=noninteractive apt-get install -y \ autoconf \ + bash \ build-essential \ ca-certificates \ cmake \ doxygen \ git \ + graphviz \ libbz2-dev \ libcurl4-openssl-dev \ libncurses-dev \ libreadline-dev \ libssl-dev \ libtool \ + locales \ pkg-config \ ntp \ wget \ @@ -27,6 +30,10 @@ RUN \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN \ + sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ + locale-gen + ADD . /peerplays-core WORKDIR /peerplays-core From afab9c28d000af8bf178e50cbb24f6aa0b7a4086 Mon Sep 17 00:00:00 2001 From: obucinac Date: Wed, 21 Aug 2019 19:51:46 +0200 Subject: [PATCH 6/8] Update README.md Docker image info added --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 1c0f1cd5..85a0d276 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,35 @@ cmake -DBOOST_ROOT="$BOOST_ROOT" -DCMAKE_BUILD_TYPE=Release make -j$(nproc) make install # this can install the executable files under /usr/local +``` + +docker build -t peerplays . + +## Docker image + +``` +# Install docker +sudo apt install docker.io + + +# Add current user to docker group +sudo usermod -a -G docker $USER +# You need to restart your shell session, to apply group membership +# Type 'groups' to verify that you are a member of a docker group + + +# Build docker image (from the project root, must be a docker group member) +docker build -t peerplays you. + + +# Start docker image +docker start peerplays + +# Exposed ports +# # rpc service: +# EXPOSE 8090 +# # p2p service: +# EXPOSE 1776 ``` Rest of the instructions on starting the chain remains same. From 818f0b750650a76b22c88c649778630fd782ef42 Mon Sep 17 00:00:00 2001 From: obucinac Date: Wed, 21 Aug 2019 19:55:08 +0200 Subject: [PATCH 7/8] Update README.md Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 85a0d276..2c74db0f 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ sudo usermod -a -G docker $USER # Build docker image (from the project root, must be a docker group member) -docker build -t peerplays you. +docker build -t peerplays # Start docker image From edcb19d53ddf5349cd670dfab9215e813f11f3dd Mon Sep 17 00:00:00 2001 From: obucinac Date: Wed, 21 Aug 2019 19:57:14 +0200 Subject: [PATCH 8/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c74db0f..8207bb29 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ sudo usermod -a -G docker $USER # Build docker image (from the project root, must be a docker group member) -docker build -t peerplays +docker build -t peerplays . # Start docker image