Compare commits

..

No commits in common. "af3895a5f0da4bb5bf3a0c4b3401f8196f9b747d" and "e184819d161a98e267909589ab0e8b132e5e9620" have entirely different histories.

3 changed files with 12 additions and 23 deletions

2
Cargo.lock generated
View File

@ -1186,7 +1186,7 @@ dependencies = [
[[package]]
name = "casper-runtime"
version = "3.5.18"
version = "3.5.17"
dependencies = [
"casper-runtime-constants",
"frame-benchmarking",

View File

@ -6,7 +6,6 @@ Documentation=https://git.ghostchain.io/ghostchain/ghost-node
[Service]
EnvironmentFile=-/etc/default/ghost
ExecStart=/usr/bin/ghost $GHOST_CLI_ARGS
ReadWritePaths=/var/lib/ghost
User=ghost
Restart=always
RestartSec=30

View File

@ -9,7 +9,7 @@ SKIP_BUILD=false
SET_ENVIRONMENT=false
EXECUTABLE_PATH="/usr/bin/"
SPECIFICATION_PATH="/etc/ghost/"
BASE_PATH="/var/lib/ghost"
NODE_PATH="/var/lib/ghost"
SPECIFICATION_NAME="casper"
TARGET="release"
@ -86,12 +86,11 @@ help() {
echo -e "-m, --make-global\n\tStore compiled ghost executable and chain specification globally."
echo -e "-a, --set-arguments\n\tPrepare CLI arguments for running ghost node."
echo -e "-k, --check-keys\n\tCheck if your keys are already included in 'ghosties' file."
echo -e "-y, --insert-keys\n\tInsert session keys to the keystore via JSON RPC."
echo -e "-r, --insert-keys\n\tInsert session keys to the keystore via JSON RPC."
echo -e "-r, --release\n\tCompile node with '--release' flag."
echo -e "-p, --profile\n\tCompile node with '--profile [PROFILE]' flag."
echo -e "-f, --features\n\tCompilation features '--features=\"FEATURE1,FEATURE2\"'"
echo -e "-e, --executable-path\n\tPath to the executable ('/usr/lib/' is default)."
echo -e "-s, --base-path\n\tPath to the folder with chain database ('/var/lib/ghost' is default)."
echo -e "-e, --executable-path\n\tPath to executable ('/usr/lib/' is default)."
echo -e "-c, --specification-path\n\tPath to specification ('/etc/ghost' is default)."
echo -e "-n, --specification-name\n\tSpecification name to be used ('casper' is default)."
echo -e "-h, --help\n\tPrints help information."
@ -150,12 +149,7 @@ while [ $# -gt 0 ]; do
if [[ "$1" != *=* ]]; then shift; fi
SPECIFICATION_PATH=$(echo ${1#*=}/ | tr -s /)
;;
--base-path*|-?)
if [[ "$1" != *=* ]]; then shift; fi
BASE_PATH=$(echo ${1#*=}/ | tr -s /)
;;
--specification-name*|-n*)
if [[ "$1" != *=* ]]; then shift; fi
--specification-name*|-n*) if [[ "$1" != *=* ]]; then shift; fi
SPECIFICATION_NAME="${1#*=}"
;;
--help|-h)
@ -265,7 +259,6 @@ fi
if [[ $MAKE_GLOBAL = true ]]; then
cd $PROJECT_FOLDER
echo "[+] trying to copy executable to '$EXECUTABLE_PATH'"
sudo cp target/$TARGET/ghost $EXECUTABLE_PATH
cp service/chain-specs/$SPECIFICATION_NAME.json $SPECIFICATION_PATH
@ -289,24 +282,21 @@ if [ $UNIT_FILE = true ]; then
echo "[!] user ghost not found"
if prompt "[?] do you want to create ghost user? (NOT RECOMMENDED: current $(whoami))"; then
sudo useradd --system --create-home $user_name
if [ ! -d $BASE_PATH ]; then
echo "[+] create folder for the node at '$BASE_PATH'"
sudo mkdir $BASE_PATH
if [ ! -d $NODE_PATH ]; then
echo "[+] create folder for the node at '$NODE_PATH'"
sudo mkdir $NODE_PATH
fi
else
user_name=$(whoami)
fi
echo "[+] make $user_name owner of $BASE_PATH"
sudo chown -R "$user_name:" $BASE_PATH
sudo chown $user_name $NODE_PATH
echo "[+] write permission to '$NODE_PATH'"
fi
cp packaging/template.service /tmp/$unit_name
sed -i -e "s/User=ghost/User=$user_name/g" /tmp/$unit_name
sed -i -e "s#/ReadWritePaths=/var/lib/ghost#/ReadWritePaths=$BASE_PATH#g" /tmp/$unit_name
echo "[+] prepare unit file for the $unit_name"
sudo cp packaging/template.service /etc/systemd/system/$unit_name
echo "[+] reloading systemd because of updated unit file"
sudo systemctl daemon-reload
if prompt "[?] do you want to start the $unit_name?"; then
@ -357,7 +347,7 @@ if [[ $ARGUMENTS = true ]]; then
fi
# default for now
CLI_ARGS+=("--base-path=$BASE_PATH")
CLI_ARGS+=("--base-path=$NODE_PATH")
CLI_ARGS+=("--state-pruning=archive")
CLI_ARGS+=("--blocks-pruning=archive")
CLI_ARGS+=("--rpc-methods=auto")
@ -366,7 +356,7 @@ if [[ $ARGUMENTS = true ]]; then
CLI_ARGS+=("--no-mdns")
CLI_ARGS+=("--no-hardware-benchmarks")
echo "[+] trying to save GHOST_CLI_ARGS=\"$(IFS=' '; echo "${CLI_ARGS[*]}")\"" > /tmp/ghost
echo "GHOST_CLI_ARGS=\"$(IFS=' '; echo "${CLI_ARGS[*]}")\"" > /tmp/ghost
sudo cp /tmp/ghost /etc/default/ghost
rm /tmp/ghost
echo "[+] new CLI arguments stored in '/etc/default/ghost'"