Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #7620 from EOSIO/merge-release-1.8.1-to-master
Browse files Browse the repository at this point in the history
Merge release 1.8.1 to master
  • Loading branch information
arhag authored Jul 9, 2019
2 parents eb88d03 + 165ed5d commit 1418543
Show file tree
Hide file tree
Showing 20 changed files with 257 additions and 165 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ set( CXX_STANDARD_REQUIRED ON)

set(VERSION_MAJOR 1)
set(VERSION_MINOR 8)
set(VERSION_PATCH 0)
set(VERSION_PATCH 1)
#set(VERSION_SUFFIX develop)

if(VERSION_SUFFIX)
Expand Down
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,22 @@ $ brew remove eosio

#### Ubuntu 18.04 Package Install
```sh
$ wget https://github.com/eosio/eos/releases/download/v1.8.0/eosio_1.8.0-1-ubuntu-18.04_amd64.deb
$ sudo apt install ./eosio_1.8.0-1-ubuntu-18.04_amd64.deb
$ wget https://github.com/eosio/eos/releases/download/v1.8.1/eosio_1.8.1-1-ubuntu-18.04_amd64.deb
$ sudo apt install ./eosio_1.8.1-1-ubuntu-18.04_amd64.deb
```
#### Ubuntu 16.04 Package Install
```sh
$ wget https://github.com/eosio/eos/releases/download/v1.8.0/eosio_1.8.0-1-ubuntu-16.04_amd64.deb
$ sudo apt install ./eosio_1.8.0-1-ubuntu-16.04_amd64.deb
$ wget https://github.com/eosio/eos/releases/download/v1.8.1/eosio_1.8.1-1-ubuntu-16.04_amd64.deb
$ sudo apt install ./eosio_1.8.1-1-ubuntu-16.04_amd64.deb
```
#### Ubuntu Package Uninstall
```sh
$ sudo apt remove eosio
```
#### Centos RPM Package Install
```sh
$ wget https://github.com/eosio/eos/releases/download/v1.8.0/eosio-1.8.0-1.el7.x86_64.rpm
$ sudo yum install ./eosio-1.8.0-1.el7.x86_64.rpm
$ wget https://github.com/eosio/eos/releases/download/v1.8.1/eosio-1.8.1-1.el7.x86_64.rpm
$ sudo yum install ./eosio-1.8.1-1.el7.x86_64.rpm
```
#### Centos RPM Package Uninstall
```sh
Expand All @@ -68,9 +68,10 @@ $ sudo yum remove eosio

#### Build Script Uninstall

If you have previously installed EOSIO using build scripts, you may execute `./scripts/eosio_uninstall.sh` to uninstall.
- Passing `--force` will answer yes to all prompts
- Passing `--full` will remove data directories (be very careful with this)
If you have previously installed EOSIO using build scripts, you can execute `eosio_uninstall.sh` to uninstall.
- Passing `-y` will answer yes to all prompts (does not remove data directories)
- Passing `-f` will remove data directories (be very careful with this)
- Passing in `-i` allows you to specify where your eosio installation is located

## Supported Operating Systems
EOSIO currently supports the following operating systems:
Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/block_header_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ namespace eosio { namespace chain {
} else {
result.active_schedule = active_schedule;
result.producer_to_last_produced = producer_to_last_produced;
result.producer_to_last_produced[prokey.producer_name] = block_num;
result.producer_to_last_produced[prokey.producer_name] = result.block_num;
result.producer_to_last_implied_irb = producer_to_last_implied_irb;
result.producer_to_last_implied_irb[prokey.producer_name] = dpos_proposed_irreversible_blocknum;
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/fc
Submodule fc updated 1 files
+3 −2 src/log/logger_config.cpp
1 change: 1 addition & 0 deletions scripts/.build_vars
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# See install-directory-prompt for logic that sets EOSIO_INSTALL_DIR
export SRC_DIR=${EOSIO_INSTALL_DIR}/src
export OPT_DIR=${EOSIO_INSTALL_DIR}/opt
export VAR_DIR=${EOSIO_INSTALL_DIR}/var
Expand Down
6 changes: 5 additions & 1 deletion scripts/.environment
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ else
export EOSIO_VERSION_FULL="${EOSIO_VERSION_MAJOR}.${EOSIO_VERSION_MINOR}.${EOSIO_VERSION_PATCH}-${EOSIO_VERSION_SUFFIX}"
fi

export EOSIO_INSTALL_DIR="${EOSIO_INSTALL_DIR:-${HOME}/eosio/${EOSIO_VERSION}}"
export CMAKE_REQUIRED_VERSION=$(cat $REPO_ROOT/CMakeLists.txt | grep -E "^[[:blank:]]*cmake_minimum_required[[:blank:]]*\([[:blank:]]*VERSION" | tail -1 | sed 's/.*VERSION //g' | sed 's/ //g' | sed 's/"//g' | cut -d\) -f1)

export EOSIO_INSTALL_DIR="${HOME}/eosio/${EOSIO_VERSION}"
export TEMP_DIR="${TEMP_DIR:-${HOME}/tmp}"

[[ -f ${BUILD_DIR}/CMakeCache.txt ]] && export CACHED_INSTALL_PATH=$(grep "CMAKE_INSTALL_PREFIX:PATH" ${BUILD_DIR}/CMakeCache.txt | cut -d= -f2)

. ./scripts/.build_vars
22 changes: 17 additions & 5 deletions scripts/eosio_build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail
SCRIPT_VERSION=3.0 # Build script version (change this to re-build the CICD image)
SCRIPT_VERSION=3.1 # Build script version (change this to re-build the CICD image)
##########################################################################
# This is the EOSIO automated install script for Linux and Mac OS.
# This file was downloaded from https://github.com/EOSIO/eos
Expand Down Expand Up @@ -111,6 +111,8 @@ if [ $# -ne 0 ]; then
done
fi

export CURRENT_WORKING_DIR=$(pwd) # relative path support

# Ensure we're in the repo root and not inside of scripts
cd $( dirname "${BASH_SOURCE[0]}" )/..

Expand Down Expand Up @@ -147,7 +149,17 @@ execute cd $REPO_ROOT
ensure-submodules-up-to-date

# Check if cmake already exists
( [[ -z "${CMAKE}" ]] && [[ ! -z $(command -v cmake 2>/dev/null) ]] ) && export CMAKE=$(command -v cmake 2>/dev/null)
( [[ -z "${CMAKE}" ]] && [[ ! -z $(command -v cmake 2>/dev/null) ]] ) && export CMAKE=$(command -v cmake 2>/dev/null) && export CMAKE_CURRENT_VERSION=$($CMAKE --version | grep -E "cmake version[[:blank:]]*" | sed 's/.*cmake version //g')
# If it exists, check that it's > required version +
if [[ ! -z $CMAKE_CURRENT_VERSION ]] && [[ $((10#$( echo $CMAKE_CURRENT_VERSION | awk -F. '{ printf("%03d%03d%03d\n", $1,$2,$3); }' ))) -lt $((10#$( echo $CMAKE_REQUIRED_VERSION | awk -F. '{ printf("%03d%03d%03d\n", $1,$2,$3); }' ))) ]]; then
export CMAKE=
if [[ $ARCH == 'Darwin' ]]; then
echo "${COLOR_RED}The currently installed cmake version ($CMAKE_CURRENT_VERSION) is less than the required version ($CMAKE_REQUIRED_VERSION). Cannot proceed."
exit 1
else
echo "${COLOR_YELLOW}The currently installed cmake version ($CMAKE_CURRENT_VERSION) is less than the required version ($CMAKE_REQUIRED_VERSION). We will be installing $CMAKE_VERSION.${COLOR_NC}"
fi
fi

# Use existing cmake on system (either global or specific to eosio)
# Setup based on architecture
Expand Down Expand Up @@ -227,16 +239,16 @@ echo "(_______/(_______)\_______)\_______/(_______)"
echo "=============================================${COLOR_NC}"

echo "${COLOR_GREEN}EOSIO has been successfully built. $(($TIME_END/3600)):$(($TIME_END%3600/60)):$(($TIME_END%60))"
echo "${COLOR_GREEN}You can now install using: ./scripts/eosio_install.sh${COLOR_NC}"
echo "${COLOR_YELLOW}Uninstall with: ./scripts/eosio_uninstall.sh${COLOR_NC}"
echo "${COLOR_GREEN}You can now install using: ${SCRIPT_DIR}/eosio_install.sh${COLOR_NC}"
echo "${COLOR_YELLOW}Uninstall with: ${SCRIPT_DIR}/eosio_uninstall.sh${COLOR_NC}"

echo ""
echo "${COLOR_CYAN}If you wish to perform tests to ensure functional code:${COLOR_NC}"
if $ENABLE_MONGO; then
echo "${BIN_DIR}/mongod --dbpath ${MONGODB_DATA_DIR} -f ${MONGODB_CONF} --logpath ${MONGODB_LOG_DIR}/mongod.log &"
PATH_TO_USE=" PATH=\$PATH:$OPT_DIR/mongodb/bin"
fi
echo "cd ./build &&${PATH_TO_USE} make test" # PATH is set as currently 'mongo' binary is required for the mongodb test
echo "cd ${BUILD_DIR} && ${PATH_TO_USE} make test" # PATH is set as currently 'mongo' binary is required for the mongodb test

echo ""
resources
12 changes: 8 additions & 4 deletions scripts/eosio_install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail
VERSION=2.0
VERSION=2.1
##########################################################################
# This is the EOSIO automated install script for Linux and Mac OS.
# This file was downloaded from https://github.com/EOSIO/eos
Expand Down Expand Up @@ -32,12 +32,15 @@ VERSION=2.0
# https://github.com/EOSIO/eos/blob/master/LICENSE.txt
##########################################################################

# Ensure we're in the repo root and not inside of scripts
cd $( dirname "${BASH_SOURCE[0]}" )/..

# Load eosio specific helper functions
. ./scripts/helpers/eosio.sh

[[ ! $NAME == "Ubuntu" ]] && set -i # Ubuntu doesn't support interactive mode since it uses dash

[[ ! -d $BUILD_DIR ]] && printf "${COLOR_RED}Please run ./eosio_build.sh first!${COLOR_NC}" && exit 1
[[ -f ${BUILD_DIR}/CMakeCache.txt ]] && printf "${COLOR_RED}Please run ${SCRIPT_DIR}/eosio_build.sh first!${COLOR_NC}" && exit 1
echo "${COLOR_CYAN}====================================================================================="
echo "========================== ${COLOR_WHITE}Starting EOSIO Installation${COLOR_CYAN} ==============================${COLOR_NC}"
execute cd $BUILD_DIR
Expand All @@ -57,7 +60,8 @@ printf " \\ \\::/ \\ \\::/ /__/:/ \\__\\/ \\ \\::
printf " \\__\\/ \\__\\/ \\__\\/ \\__\\/ \n\n${COLOR_NC}"

printf "==============================================================================================\\n"
printf "${COLOR_GREEN}EOSIO has been installed into ${EOSIO_INSTALL_DIR}/bin${COLOR_NC}"
printf "\\n${COLOR_YELLOW}Uninstall with: ./scripts/eosio_uninstall.sh${COLOR_NC}\\n"
printf "${COLOR_GREEN}EOSIO has been installed into ${CACHED_INSTALL_PATH}/bin${COLOR_NC}"
printf "\\n${COLOR_YELLOW}Uninstall with: ${SCRIPT_DIR}/eosio_uninstall.sh${COLOR_NC}\\n"
printf "==============================================================================================\\n\\n"
resources

180 changes: 108 additions & 72 deletions scripts/eosio_uninstall.sh
Original file line number Diff line number Diff line change
@@ -1,89 +1,125 @@
#!/usr/bin/env bash
set -eo pipefail
VERSION=2.1
# User input handling
DEP_PROCEED=false
FULL=false

function usage() {
printf "Usage: $0 OPTION...
-i DIR Directory where eosio is installed)
-y Noninteractive mode (answers yes to every prompt)
-f Removal of data directory (be absolutely sure you want to delete it before using this!)
\\n" "$0" 1>&2
exit 1
}

TIME_BEGIN=$( date -u +%s )
if [ $# -ne 0 ]; then
while getopts "i:yf" opt; do
case "${opt}" in
i )
INSTALL_LOCATION=$OPTARG
;;
y )
NONINTERACTIVE=true
PROCEED=true
DEP_PROCEED=true
;;
f )
FULL=true
;;
h )
usage
;;
? )
echo "Invalid Option!" 1>&2
usage
;;
: )
echo "Invalid Option: -${OPTARG} requires an argument." 1>&2
usage
;;
* )
usage
;;
esac
done
fi

export CURRENT_WORKING_DIR=$(pwd) # relative path support

# Ensure we're in the repo root and not inside of scripts
cd $( dirname "${BASH_SOURCE[0]}" )/..

# Load bash script helper functions
. ./scripts/helpers/eosio.sh

usage() {
printf "Usage --- \\n $ %s [ --full ] [ --force ]\\n
--full: Removal of data directory (be absolutely sure you want to delete it before using this!)\\n
--force: Unattended uninstall which works regardless of the eosio directory existence.\\n This helps cleanup dependencies and start fresh if you need to.
\\n" "$0"
}
# Support relative paths : https://github.com/EOSIO/eos/issues/7560
( [[ ! -z $INSTALL_LOCATION ]] && [[ ! $INSTALL_LOCATION =~ ^\/ ]] ) && export INSTALL_LOCATION="${CURRENT_WORKING_DIR}/$INSTALL_LOCATION"

INSTALL_PATHS=()

# User input handling
PROCEED=false
DEP_PROCEED=false
FORCED=false
FULL=false
if [[ $@ =~ [[:space:]]?--force[[:space:]]? ]]; then
echo "[Forcing Unattended Removal: Enabled]"
FORCED=true
PROCEED=true
DEP_PROCEED=true
# -y alone should not remove the data directories and not prompt the user for anything.
# -f alone should remove the data directories after prompting the user if they are sure.
# -f -y should proceed forward with removing the data directories without prompting the user.
if [[ $NONINTERACTIVE == false ]] && $FULL; then
while true; do
read -p "By specifying -f, removal of the eosio data directory will require a resync of data which can take days. Do you wish to proceed? (y/n) " PROCEED
case $PROCEED in
"" ) echo "What would you like to do?";;
0 | true | [Yy]* ) break;;
1 | false | [Nn]* ) exit 0;;
* ) echo "Please type 'y' for yes or 'n' for no.";;
esac
done
fi

export EOSIO_INSTALL_DIR=${INSTALL_LOCATION:-$EOSIO_INSTALL_DIR}

if [[ ! -d "${EOSIO_INSTALL_DIR}" ]]; then
echo "[EOSIO installation ${COLOR_YELLOW}NOT${COLOR_NC} found in ${EOSIO_INSTALL_DIR}]"
else
# As of 1.8.0, we're using a versioned directories under home: https://github.com/EOSIO/eos/issues/6940
echo "[EOSIO installation found: ${EOSIO_INSTALL_DIR}]" && INSTALL_PATHS+=("${EOSIO_INSTALL_DIR}") # EOSIO_INSTALL_DIR set in .environment
while true; do
[[ $NONINTERACTIVE == false ]] && read -p "Do you wish to remove the installation in ${EOSIO_INSTALL_DIR}? (y/n) " PROCEED
case $PROCEED in
"" ) echo "What would you like to do?";;
0 | true | [Yy]* )
# Handle cleanup of data directory
if $FULL; then
## Add both just to be safe
[[ $ARCH == "Darwin" ]] && INSTALL_PATHS+=("${HOME}/Library/Application\ Support/eosio")
[[ $ARCH != "Darwin" ]] && INSTALL_PATHS+=("${HOME}/.local/share/eosio")
fi
# Version < 1.8.0; Before we started using ~/eosio/1.8.x
# Arrays should return with newlines (IFS=\n;helpers.sh) as Application\ Support will split into two
for INSTALL_PATH in ${INSTALL_PATHS[@]}; do
execute rm -rf $INSTALL_PATH
done
echo " - EOSIO Removal Complete"
break;;
1 | false | [Nn]* ) echo " - Cancelled EOSIO Removal!"; exit 1;;
* ) echo "Please type 'y' for yes or 'n' for no.";;
esac
done
fi
if [[ $@ =~ [[:space:]]?--full[[:space:]]? ]]; then
echo "[Full removal (nodeos generated state, etc): Enabled]"
if $FORCED; then
FULL=true
elif [[ $FORCED == false ]]; then

echo "[Removing EOSIO Dependencies]"
if [[ $ARCH == "Darwin" ]]; then
for package in $(cat scripts/eosio_build_darwin_deps | cut -d, -f1 2>/dev/null); do
while true; do
read -p "Removal of the eosio data directory will require a resync of data which can take days. Do you wish to proceed? (y/n) " PROCEED
case $PROCEED in
"" ) echo "What would you like to do?";;
[[ $NONINTERACTIVE == false ]] && read -p "Do you wish to uninstall and unlink all brew installed ${package} versions? (y/n) " DEP_PROCEED
case $DEP_PROCEED in
"") echo "What would you like to do?";;
0 | true | [Yy]* )
FULL=true
break;;
execute brew uninstall $package --force || true
execute brew cleanup -s $package || true
break;;
1 | false | [Nn]* ) break;;
* ) echo "Please type 'y' for yes or 'n' for no.";;
esac
done
fi
done
fi
if [[ ! -z $@ ]] && [[ ! $@ =~ [[:space:]]?--force[[:space:]]? ]] && [[ ! $@ =~ [[:space:]]?--full[[:space:]]? ]]; then usage && exit; fi

# As of 1.8.0, we're using a versioned directories under home: https://github.com/EOSIO/eos/issues/6940
[[ -d "${EOSIO_INSTALL_DIR}" ]] && echo "[EOSIO Installation Found: ${EOSIO_INSTALL_DIR}]" && INSTALL_PATHS+=("${EOSIO_INSTALL_DIR}") # EOSIO_INSTALL_DIR set in .environment

# Removal
while true; do
[[ $FORCED == false ]] && read -p "Do you wish to remove the installation? (y/n) " PROCEED
case $PROCEED in
"" ) echo "What would you like to do?";;
0 | true | [Yy]* )
echo "[Removing EOSIO and Dependencies]"
if [[ $ARCH == "Darwin" ]]; then
for package in $(cat scripts/eosio_build_darwin_deps | cut -d, -f1 2>/dev/null); do
while true; do
[[ $FORCED == false ]] && read -p "Do you wish to uninstall and unlink all brew installed ${package} versions? (y/n) " DEP_PROCEED
case $DEP_PROCEED in
"") echo "What would you like to do?";;
0 | true | [Yy]* )
execute brew uninstall $package --force || true
execute brew cleanup -s $package || true
break;;
1 | false | [Nn]* ) break;;
* ) echo "Please type 'y' for yes or 'n' for no.";;
esac
done
done
fi
# Handle cleanup of data directory
if $FULL; then
## Add both just to be safe
[[ $ARCH == "Darwin" ]] && INSTALL_PATHS+=("${HOME}/Library/Application\ Support/eosio")
[[ $ARCH != "Darwin" ]] && INSTALL_PATHS+=("${HOME}/.local/share/eosio")
fi
# Version < 1.8.0; Before we started using ~/eosio/1.8.x
# Arrays should return with newlines (IFS=\n;helpers.sh) as Application\ Support will split into two
for INSTALL_PATH in ${INSTALL_PATHS[@]}; do
execute rm -rf $INSTALL_PATH
done
echo "[EOSIO Removal Complete]"
break;;
1 | false | [Nn]* ) echo " - Cancelled EOSIO Removal!"; exit 1;;
* ) echo "Please type 'y' for yes or 'n' for no.";;
esac
done
2 changes: 1 addition & 1 deletion scripts/generate_bottle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ echo "class Eosio < Formula
depends_on \"gettext\"
depends_on \"openssl\"
depends_on \"libusb\"
depends_on :macos => :high_sierra
depends_on :macos => :mojave
depends_on :arch => :intel
bottle do
Expand Down
Loading

0 comments on commit 1418543

Please sign in to comment.