Skip to content

Commit

Permalink
update: release v1.5.9
Browse files Browse the repository at this point in the history
  • Loading branch information
POPPIN-FUMI committed Oct 24, 2023
1 parent d229ae7 commit e92a8eb
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 49 deletions.
84 changes: 42 additions & 42 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epics-dao/solv",
"version": "1.5.8",
"version": "1.5.9",
"description": "Solana Validator CLI SOLV",
"main": "dist/index.js",
"repository": "https://github.com/EpicsDAO/solv",
Expand Down
103 changes: 103 additions & 0 deletions resource/solv/v1.5.9/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#!/bin/sh

# Constants and configurable variables
SOLANA_VERSION=1.17.2
NODE_VERSION=18.18.1

# This ensures the entire script is downloaded
{
set -e # exit immediately if a command exits with a non-zero status

usage() {
cat 1>&2 <<EOF
Custom Install Script
Creates a new user 'solv', adds the user to the sudo group, logs in as 'solv',
installs nodenv, node $NODE_VERSION, and sets it as the global version.
Additionally, installs the @epics-dao/solv2 package globally.
USAGE:
custom-install-script.sh [FLAGS]
FLAGS:
-h, --help Prints help information
EOF
}

create_user() {
if getent passwd solv >/dev/null 2>&1; then
echo "User 'solv' already exists, skipping..."
else
echo "Creating user 'solv'..."
sudo adduser solv
sudo usermod -aG sudo solv
fi
}


setup_firewall() {
echo "Configuring firewall"
echo "yes" | sudo ufw enable
sudo ufw allow ssh
sudo ufw allow 53
sudo ufw allow 8000:10000/udp
sudo ufw allow 8000:10000/tcp
sudo ufw reload
}


install_nodenv_and_node() {
sudo su - solv <<EOF_SOLV
echo "Installing nodenv..."
git clone https://github.com/nodenv/nodenv.git ~/.nodenv
echo 'export PATH="\$HOME/.nodenv/bin:\$PATH"' >> ~/.profile
echo 'eval "\$(nodenv init -)"' >> ~/.profile
source ~/.profile
echo "Installing node-build..."
git clone https://github.com/nodenv/node-build.git "\$(nodenv root)"/plugins/node-build
echo "Installing node $NODE_VERSION..."
nodenv install $NODE_VERSION
nodenv global $NODE_VERSION
echo "Node installation completed!"
echo "Installing @epics-dao/solv..."
npm i -g @epics-dao/solv
echo "Sourcing ~/.profile..."
source ~/.profile
solv solv
EOF_SOLV
}

install_solana() {
echo "Installing solana..."
SOLV_HOME=$(eval echo ~solv)
export SOLANA_INSTALL_DIR="$SOLV_HOME/.local/share/solana/install"
sudo -u solv sh -c "$(curl -sSfL https://release.solana.com/v${SOLANA_VERSION}/install)"
echo "Solana installation completed!"
}

main() {
for arg in "$@"; do
case "$arg" in
-h|--help)
usage
exit 0
;;
*)
;;
esac
done

create_user
setup_firewall
install_solana
install_nodenv_and_node
echo "Enter solv user password 👇"
su solv
}

main "$@"

} # this ensures the entire script is downloaded
6 changes: 2 additions & 4 deletions src/cli/update/updateSolv.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { spawnSync } from 'child_process'

export const updateSolv = () => {
const cmd = [`sudo apt update`]
spawnSync(cmd.join(' && '), { shell: true, stdio: 'inherit' })
const cmd2 = [`sudo apt -y install solv`]
spawnSync(cmd2.join(' && '), { shell: true, stdio: 'inherit' })
const cmd = `npm i -g @epics-dao/solv`
spawnSync(cmd, { shell: true, stdio: 'inherit' })
}
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const DEFAULT_LANG = 'en'
export const DEFAULT_SOLANA_VERSION = '1.17.2'
export const DEFAULT_SOLANA_VERSION = '1.17.3'
export const DEFAULT_NODE_VERSION = '18.18.1'
export const DEFAULT_DELINQUENT_STAKE = 5
export const DEFAULT_SOLANA_NETWORK = 'testnet'
Expand Down
2 changes: 1 addition & 1 deletion src/lib/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '1.5.8'
export const VERSION = '1.5.9'

0 comments on commit e92a8eb

Please sign in to comment.