Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
POPPIN-FUMI committed Dec 27, 2024
1 parent 3c85a37 commit cca180f
Show file tree
Hide file tree
Showing 56 changed files with 2,465 additions and 19 deletions.
75 changes: 61 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,24 @@ SLV is a toolkit for Solana developers. It provides a set of tools to help
developers build, test, and deploy Solana Validatros and Solana-based
applications.

In the newly revamped slv, you can complete all configurations from a remote
machine—no more direct node logins required. This approach ensures that only
essential packages are installed on the node, leaving behind no unnecessary
clutter. We’ve also introduced Ansible Playbooks & Jinja Template for Linux
configuration, allowing us to manage and migrate multiple validators with
greater efficiency and security.

Additionally, the new slv always uses a dummy key (an invalid key named
“unstaked-identity.json”) for its initial startup. Once you confirm everything
is running smoothly, you simply set the actual Identity and switch to the active
key. Following this consistent flow helps prevent double votes and ensures
you’re prepared in case the node ever becomes unreachable.

We’ll continue to provide method documentation along the way, and we look
forward to your ongoing support!

[Validators DAO Discord](https://discord.gg/X4BgkBHavp)

## Dependencies

- OS MacOS or Linux
Expand All @@ -40,12 +58,20 @@ slv Install script will install the following dependencies.

Please install the following dependencies manually if install script fails.

## Installation
## Installation & Validator Launch

Install slv CLI

```bash
curl -fsSL https://storage.slv.dev/slv/install | sh
slv validator init
slv validator deploy
```

## Usage

```bash
slv v --help
```

## Deploy Solana Validator Testnet with Firedancer
Expand All @@ -57,7 +83,7 @@ This command will prompt you to provide necessary information to deploy.
New slv Deployment is always use `unstaked-keypair.json` for the identity key.
This is the best practice to avoid double voting, and etc.

So Please make sure to set the aurhorized identity key with `identity.json`
So Please make sure to set the aurhorized identity key with `slv v set:identity`
after the deployment.

### Input Server's Default Username
Expand Down Expand Up @@ -161,13 +187,20 @@ from the vote account.
```bash
? Please Enter Your Vote Account's Authrority Key › <your-authority-pubkey>
✔︎ Validator testnet config saved to /Users/fumi/.slv/config.validator.testnet.yml
Now you can deploy with:
$ slv v deploy -n testnet
```
### Confirm the Configuration and Deploy
Now your configuration is saved to `~/.slv/config.validator.testnet.yml`.
### Deploy the Solana Validator
Once you confirm the configuration, the deployment will start.
```bash
slv v deploy -n testnet
Your Testnet Validators Settings:
┌────────────────┬──────────────────────────────────────────────┐
│ Identity Key │ EjDwu2Czy8eWEYRuNwtjniYks47Du3KNJ6JY9rs3aFSV │
Expand All @@ -182,15 +215,7 @@ Your Testnet Validators Settings:
├────────────────┼──────────────────────────────────────────────┤
│ Version │ 0.302.20104 │
└────────────────┴──────────────────────────────────────────────┘
Now you can deploy with:
$ slv v deploy -n testnet
```
All set! You can deploy the Solana Validator with the following command.
```bash
slv v deploy -n testnet
? Do you want to continue? (Y/n) › Yes
```
It's done! Your Solana Validator is now deployed. It will take some time to
Expand Down Expand Up @@ -229,6 +254,30 @@ validator.
slv v restart -n testnet --pubkey <your-identity-pubkey> --rm
```

### slv Validator Commands

```bash
Usage: slv validator
Version: 0.3.1

Description:

Manage Solana Validator Nodes

Options:

-h, --help - Show this help.

Commands:

init - Initialize a new validator
deploy - Deploy Validators
list - List validators
set:identity - Set Validator Identity
set:unstaked - Set Validator Identity to Unstaked Key Stop/Change Identity/Start
restart - Restart validator
```

### Community Support

If you have any questions or need help, please join our Discord community.
Expand All @@ -243,8 +292,6 @@ If you have any questions or need help, please join our Discord community.
progress)
- [] Add `slv validator setup --shredstream` for ShredStream Node Build (in
progress)
- [] add `slv validator migrate` for Solana Validator Migration from `solv4` (in
progress)
- [] Add CI/CD pipeline (Github Actions) for `slv` Release (in progress)
- [] Add `slv bot` for gRPC Geyser Client (in progress)
- [] Add `slv swap` for Solana Token Swap (in progress)
Expand Down
2 changes: 1 addition & 1 deletion cli/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slv/cli",
"version": "0.2.0",
"version": "0.3.1",
"exports": "./dist/exe",
"publish": {
"include": ["src"],
Expand Down
3 changes: 2 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
"test": "deno test -A",
"s": "deno run -A cli/src/index.ts",
"dev": "deno run -A --watch cli/src/index.ts",
"build:all": "deno task build && deno task upload:script && deno task upload:exe && deno task upload:template",
"build": "deno task build:linux & deno task build:mac",
"build:linux": "deno compile -A --target x86_64-unknown-linux-gnu --no-check --output dist/slv-x86_64-unknown-linux-gnu-exe cli/src/index.ts && tar -czvf dist/slv-x86_64-unknown-linux-gnu-exe.tar.gz dist/slv-x86_64-unknown-linux-gnu-exe",
"build:mac": "deno compile -A --target x86_64-apple-darwin --no-check --output dist/slv-x86_64-apple-darwin-exe cli/src/index.ts && tar -czvf dist/slv-x86_64-apple-darwin-exe.tar.gz dist/slv-x86_64-apple-darwin-exe",
"upload:script": "cd ./sh/ && aws --endpoint-url=https://278a7109e511280594fe6a2ebb778333.r2.cloudflarestorage.com/slv s3 cp install s3://slv/ --content-disposition 'attachment; filename=install'",
"upload:exe": "deno run -A cli/uploadExe.ts",

"upload:template": "tar -czf dist/template.tar.gz ./template/0.2.0 && deno run -A cli/uploadTemplate.ts"
"upload:template": "tar -czf dist/template.tar.gz ./template/0.3.1 && deno run -A cli/uploadTemplate.ts"
},
"imports": {
"@/": "./",
Expand Down
137 changes: 137 additions & 0 deletions sh/0.3.0/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
#!/bin/bash

set -e

VERSION="0.3.0"
BASE_URL="https://storage.slv.dev/slv"

detect_platform() {
uname_out="$(uname -s)"
case "${uname_out}" in
Linux*) platform="x86_64-unknown-linux-gnu"; osfamily="linux";;
Darwin*) platform="x86_64-apple-darwin"; osfamily="darwin";;
CYGWIN*|MINGW*|MSYS*|Windows*) platform="x86_64-pc-windows-msvc"; osfamily="windows";;
*) echo "Unsupported platform: ${uname_out}" && exit 1;;
esac
}

install_slv() {
echo "Detecting platform..."
detect_platform
echo "Platform detected: $platform"

DOWNLOAD_URL="${BASE_URL}/${VERSION}/${platform}-exe.tar.gz"
TEMPLATE_URL="${BASE_URL}/template/${VERSION}/template.tar.gz"
INSTALL_DIR="/usr/local/bin"
TEMPLATE_DIR="$HOME/.slv/template"
TEMP_DIR=$(mktemp -d)

if [ "$platform" == "x86_64-pc-windows-msvc" ]; then
INSTALL_DIR="$HOME/.local/bin"
mkdir -p "$INSTALL_DIR"
fi

echo "Temporary directory: $TEMP_DIR"

echo "Downloading slv from $DOWNLOAD_URL..."
curl -fsSL "$DOWNLOAD_URL" -o "$TEMP_DIR/slv.tar.gz"

echo "Downloading templates from $TEMPLATE_URL..."
curl -fsSL "$TEMPLATE_URL" -o "$HOME/.slv/template.tar.gz"

echo "Extracting slv..."
tar -xzvf "$TEMP_DIR/slv.tar.gz" -C "$TEMP_DIR" --strip-components=1

echo "Extracting templates..."
tar -xzvf "$HOME/.slv/template.tar.gz" -C "$HOME/.slv" --strip-components=1
mkdir -p "$HOME/.slv/template"
echo "Copying templates to $HOME/.slv/template"

SLV_FILE="$TEMP_DIR/slv-x86_64-apple-darwin-exe"
TEMPLATE_DL_DIR="$HOME/.slv/"

if [ ! -f "$SLV_FILE" ]; then
echo "Error: Extracted file not found."
exit 1
fi

echo "Installing slv..."
if [ ! -d "$INSTALL_DIR" ]; then
echo "$INSTALL_DIR does not exist. Creating it..."
sudo mkdir -p "$INSTALL_DIR"
fi

if [ "$platform" == "x86_64-pc-windows-msvc" ]; then
sudo mv "$SLV_FILE" "$INSTALL_DIR/slv.exe"
else
sudo mv "$SLV_FILE" "$INSTALL_DIR/slv"
sudo chmod +x "$INSTALL_DIR/slv"
fi

echo "Cleaning up..."
rm -rf "$TEMP_DIR"
rm -rf "$TEMP_DIR2"

echo "slv has been installed successfully!"
echo "Ensure $INSTALL_DIR is in your PATH."
if [ "$platform" == "x86_64-pc-windows-msvc" ]; then
echo "Windows users, add $INSTALL_DIR to your PATH manually."
fi
mkdir -p ~/.slv/keys
slv -P
}

install_dependencies() {
if ! command -v python3 >/dev/null 2>&1; then
echo "Python3 not found. Installing..."
if [ "$osfamily" = "linux" ]; then
# Distribution check
# Ubuntu/Debian
if command -v apt-get >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install -y python3 python3-pip
# RHEL/CentOS
elif command -v yum >/dev/null 2>&1; then
sudo yum install -y python3 python3-pip
else
echo "No known package manager found. Please install Python3 manually."
exit 1
fi
elif [ "$osfamily" = "darwin" ]; then
# macOS
if command -v brew >/dev/null 2>&1; then
brew update
brew install python3
else
echo "Homebrew not found. Please install Homebrew or Python3 manually."
exit 1
fi
elif [ "$osfamily" = "windows" ]; then
echo "Windows environment detected. Please install Python3 manually (e.g. via choco)."
# Windows coming soon
fi
else
echo "Python3 is already installed."
fi

if ! command -v pip3 >/dev/null 2>&1; then
echo "pip3 not found. Please ensure python3-pip is installed."
exit 1
fi


if ! command -v ansible >/dev/null 2>&1; then
echo "Ansible not found. Installing via pip3..."
pip3 install --user ansible
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.profile
source ~/.profile
else
echo "Ansible is already installed."
fi

echo "Python3 and Ansible installation completed."
}

install_dependencies
install_slv

Loading

0 comments on commit cca180f

Please sign in to comment.