Skip to content

Commit

Permalink
update: release v1.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
POPPIN-FUMI committed Oct 21, 2023
1 parent 2b6aa3c commit 7ab0316
Show file tree
Hide file tree
Showing 6 changed files with 262 additions and 64 deletions.
122 changes: 61 additions & 61 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.5",
"version": "1.5.6",
"description": "Solana Validator CLI SOLV",
"main": "dist/index.js",
"repository": "https://github.com/EpicsDAO/solv",
Expand Down
98 changes: 98 additions & 0 deletions resource/solv/v1.5.5/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#!/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() {
echo "Creating user 'solv'..."
sudo adduser solv
sudo usermod -aG sudo solv
}

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
98 changes: 98 additions & 0 deletions resource/solv/v1.5.6/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#!/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() {
echo "Creating user 'solv'..."
sudo adduser solv
sudo usermod -aG sudo solv
}

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
4 changes: 3 additions & 1 deletion src/cli/setup/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { makeServices } from './makeServices'
import { setupPermissions } from './userPermissions'
import { umount } from '../mt/umount'
import { getPreferredDisk } from '../mt/getLargestDisk'
import { startSolana } from '../start/startSolana'

export const setup = () => {
try {
Expand All @@ -29,7 +30,7 @@ export const setup = () => {
setupSwap(fileSystem)
setupDirs()
setupPermissions()
startValidator()
startValidator(true)
makeServices()
setupKeys()
const cmds = [
Expand All @@ -40,6 +41,7 @@ export const setup = () => {
for (const line of cmds) {
spawnSync(line, { shell: true, stdio: 'inherit' })
}
startSolana()
return true
} catch (error) {
throw new Error(`setup Error: ${error}`)
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.5'
export const VERSION = '1.5.6'

0 comments on commit 7ab0316

Please sign in to comment.