### Run Keplr example Source: https://docs.sentinel.co/sdk/javascript Installs dependencies and starts the Keplr example development server. After running, navigate to http://127.0.0.1:3000/ to use the example. ```bash cd examples/keplr npm i npm run dev ``` -------------------------------- ### Complete VPN Workflow Source: https://docs.sentinel.co/sdk/python A full example demonstrating how to initialize the SDK, query a node, subscribe, start a session, and establish a VPN connection. ```python import json from sentinel_protobuf.sentinel.types.v1.price_pb2 import Price from sentinel_sdk.sdk import SDKInstance from sentinel_sdk.types import Status, NodeType, TxParams from sentinel_sdk.utils import search_attribute # 1. Initialize the SDK sdk = SDKInstance( grpcaddr="grpc.sentinel.co", grpcport=9090, secret="your mnemonic phrase" ) # 2. Query and select a node nodes = sdk.nodes.QueryNodes(Status.ACTIVE) node = nodes[0] node_status = json.loads(sdk.nodes.QueryNodeStatus(node)) print(f"Node: {node.address}, Type: {node_status['result']['type']}") # 3. Subscribe to the node max_price = Price(denom="udvpn", value="1000000") tx = sdk.nodes.SubscribeToNode( node_address=node.address, price=max_price, gigabytes=1, hours=0, tx_params=TxParams(), ) tx_response = sdk.nodes.wait_for_tx(tx["hash"]) subscription_id = search_attribute( tx_response, "sentinel.node.v3.EventCreateSubscription", "id" ) # 4. Start a session from the subscription tx = sdk.subscriptions.StartSession( subscription_id=int(subscription_id), address=node.address, ) tx_response = sdk.subscriptions.wait_for_tx(tx["hash"]) session_id = search_attribute( tx_response, "sentinel.session.v3.EventStart", "id" ) # 5. Post the session to establish VPN connection result = sdk.nodes.PostSession( session_id=int(session_id), remote_url=node.remote_url, node_type=NodeType(node_status["result"]["type"]) ) print(result) ``` -------------------------------- ### Run Node.js example Source: https://docs.sentinel.co/sdk/javascript Installs dependencies and runs the Node.js example using ts-node. Requires ts-node to be available in the project. ```bash cd examples/node npm i ts-node main.ts ``` -------------------------------- ### Install and run via git clone (Option B) Source: https://docs.sentinel.co/sdk/plan-manager Clone and run for contributors. Requires Node.js 20+ and a mnemonic in `.env`. After `npm start`, open http://localhost:3003. ```bash git clone https://github.com/Sentinel-Bluebuilder/sentinel-plan-manager.git cd sentinel-plan-manager npm install cp .env.example .env # then edit .env and paste your mnemonic npm start ``` -------------------------------- ### V2Ray client lifecycle with sentinel-go-sdk Source: https://docs.sentinel.co/sdk/golang Shows the V2Ray client lifecycle: create with NewClient, then Init, Setup, and Start. The remaining lifecycle methods (Stop, Wait, Cleanup, Statistics) are the same as the WireGuard example. ```go import ( "github.com/sentinel-official/sentinel-go-sdk/v2ray" ) v2rayClient := v2ray.NewClient("v2ray-client", appDir, v2rayConfig) if err := v2rayClient.Init(false); err != nil { log.Fatal(err) } if err := v2rayClient.Setup(ctx); err != nil { log.Fatal(err) } ctx, err := v2rayClient.Start(context.Background()) if err != nil { log.Fatal(err) } // Same lifecycle: Stop(), Wait(), Cleanup(), Statistics() ``` -------------------------------- ### Docker Setup for Cosmovisor Source: https://docs.sentinel.co/full-node-setup/docker/dockerfiles Docker instructions to copy the state-sync script, set permissions, and install Cosmovisor with environment variables. ```dockerfile # Replicate the state-sync-sentvisor script for mainnet COPY state-sync-sentvisor.sh /home/sentinel/sentinelhub WORKDIR /home/sentinel/sentinelhub # Modify permissions to enable script run USER root RUN chown sentinel state-sync-sentvisor.sh &&\ chmod 700 state-sync-sentvisor.sh &&\ ln -s /home/sentinel/go/bin/cosmovisor /usr/local/bin/ USER sentinel # Install Cosmovisor RUN go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest &&\ mkdir -p ~/.sentinelhub/cosmovisor &&\ mkdir -p ~/.sentinelhub/cosmovisor/genesis &&\ mkdir -p ~/.sentinelhub/cosmovisor/genesis/bin &&\ mkdir -p ~/.sentinelhub/cosmovisor/upgrades &&\ echo "# Cosmovisor Environmental Variables" >> ~/.bashrc &&\ echo "export DAEMON_NAME=sentinelhub" >> ~/.bashrc &&\ echo "export DAEMON_HOME=$HOME/.sentinelhub" >> ~/.bashrc &&\ echo "export DAEMON_ALLOW_DOWNLOAD_BINARIES=false" >> ~/.bashrc &&\ echo "export DAEMON_LOG_BUFFER_SIZE=512" >> ~/.bashrc &&\ echo "export DAEMON_RESTART_AFTER_UPGRADE=true" >> ~/.bashrc &&\ echo "export UNSAFE_SKIP_BACKUP=true" >> ~/.bashrc &&\ cp /home/sentinel/go/bin/sentinelhub ~/.sentinelhub/cosmovisor/genesis/bin ``` -------------------------------- ### Quick Start: Connect and Disconnect with Sentinel VPN Source: https://docs.sentinel.co/sdk/blue-js Example showing how to import the SDK, register cleanup handlers, connect to a WireGuard tunnel using a mnemonic, and disconnect. The `connectAuto` function returns a session ID and logs progress steps. ```javascript import { connectAuto, disconnect, registerCleanupHandlers } from 'sentinel-dvpn-sdk'; registerCleanupHandlers(); const result = await connectAuto({ mnemonic: process.env.MNEMONIC, serviceType: 'wireguard', onProgress: (step, detail) => console.log(`[${step}] ${detail}`), }); console.log(`Connected: session ${result.sessionId}, IP changed`); await disconnect(); ``` -------------------------------- ### Install Sentinel Go SDK with go get Source: https://docs.sentinel.co/sdk/golang Install the Sentinel Go SDK using the Go module system. Run this command in your project directory to add the SDK as a dependency. ```go go get github.com/sentinel-official/sentinel-go-sdk ``` -------------------------------- ### Start Command Syntax Source: https://docs.sentinel.co/sentinel-hub/commands/list Syntax for starting the Sentinel Hub node. ```bash sentinelhub start [flags] ``` -------------------------------- ### WireGuard client lifecycle with sentinel-go-sdk Source: https://docs.sentinel.co/sdk/golang Shows the full WireGuard client lifecycle: create with NewClient and WithDevice, then Init, Setup, Start, Statistics, Stop, and Cleanup. Requires an existing appDir and wgConfig. ```go import ( "github.com/sentinel-official/sentinel-go-sdk/wireguard" ) wgClient := wireguard.NewClient("wg-client", appDir, wgConfig). WithDevice("wg0") // Initialize configuration files if err := wgClient.Init(false); err != nil { log.Fatal(err) } // Set up the interface if err := wgClient.Setup(ctx); err != nil { log.Fatal(err) } // Start the VPN tunnel ctx, err := wgClient.Start(context.Background()) if err != nil { log.Fatal(err) } // Get traffic statistics (rxBytes, txBytes) rx, tx, err := wgClient.Statistics(ctx) fmt.Printf("RX: %d bytes, TX: %d bytes\n", rx, tx) // Stop and clean up wgClient.Stop() wgClient.Cleanup() ``` -------------------------------- ### Install blue-agent-connect Source: https://docs.sentinel.co/sdk/ai-connect Use npm to install the library in your project. ```bash npm install blue-agent-connect ``` -------------------------------- ### Install Golang on Ubuntu Source: https://docs.sentinel.co/full-node-setup/hub-setup Install the Go programming language using apt. ```bash sudo apt install -y golang-go ``` -------------------------------- ### Run dvpn-node-manager.sh with sudo bash Source: https://docs.sentinel.co/dvpn-nodes/setup/automated Executes the script with sudo bash to start the installation process. If Docker is not installed, it will be installed and the system will reboot. After installation, running the script again allows modifying settings and managing the wallet or node. ```bash sudo bash dvpn-node-manager.sh ``` -------------------------------- ### Start Backend Service Source: https://docs.sentinel.co/sdk/x402 Commands to configure the environment and start the backend development server. ```bash cd api cp .env.example .env # Fill in: SENTINEL_OPERATOR_MNEMONIC, SENTINEL_PLAN_ID, PAYMENT_CONTRACT_ADDRESS npm install npm run dev ``` -------------------------------- ### Install and run with npm (Option A) Source: https://docs.sentinel.co/sdk/plan-manager One-shot install via npm. Requires Node.js 20+ and a Cosmos wallet mnemonic. After install, verify with `plans --help`, create `.env` with `MNEMONIC=...`, then run `npx sentinel-plan-manager` (or the node command). ```bash npm install -g sentinel-plan-manager plans --help # verify install echo "MNEMONIC=word1 word2 ... word24" > .env npx sentinel-plan-manager # or: node $(npm root -g)/sentinel-plan-manager/server.js ``` -------------------------------- ### Start Prometheus service Source: https://docs.sentinel.co/node-monitoring/metrics/prometheus Starts the Prometheus service using systemd. Run this after installation to launch Prometheus. ```bash sudo systemctl start prometheus.service ``` -------------------------------- ### Start Promtail service Source: https://docs.sentinel.co/node-monitoring/logs/promtail Starts the Promtail service immediately. ```bash sudo systemctl start promtail.service ``` -------------------------------- ### Manage leases with sdk.lease (StartLease, RenewLease, UpdateLease, EndLease) Source: https://docs.sentinel.co/sdk/python Use the lease module to start, renew, update, and end leases against nodes. Requires Price and RenewalPricePolicy from sentinel_protobuf. The example shows creating a max_price with denom 'udvpn' and value '1000000', then performing each operation with a subscription_id of 42. ```python from sentinel_protobuf.sentinel.types.v1.price_pb2 import Price from sentinel_protobuf.sentinel.types.v1.renewal_pb2 import RenewalPricePolicy max_price = Price(denom="udvpn", value="1000000") # Start a lease against a node tx = sdk.lease.StartLease( node="sentnode1...", hours=720, max_price=max_price, renewal=RenewalPricePolicy.RENEWAL_PRICE_POLICY_IF_LESSER_OR_EQUAL, ) # Renew an existing lease tx = sdk.lease.RenewLease( subscription_id=42, hours=720, max_price=max_price, ) # Update a lease's renewal price policy tx = sdk.lease.UpdateLease( subscription_id=42, renewal=RenewalPricePolicy.RENEWAL_PRICE_POLICY_IF_LESSER_OR_EQUAL, ) # End a lease tx = sdk.lease.EndLease(subscription_id=42) ``` -------------------------------- ### Example node startup logs Source: https://docs.sentinel.co/dvpn-nodes/setup/manual/node-run Example output from the node logs showing successful startup, including configuration validation, service initialization, and node registration. The logs show the node was already registered and details were updated successfully. ```text 2025-10-26T04:55:44Z INF Validating configuration 2025-10-26T04:55:44Z INF Setting up node 2025-10-26T04:55:44Z INF Setting up context 2025-10-26T04:55:44Z INF Initializing context 2025-10-26T04:55:44Z INF Setting up blockchain client 2025-10-26T04:55:44Z INF Initializing blockchain client keyring.backend=test keyring.name=sentinel rpc.addr=https://rpc.sentinel.co:443 rpc.chain_id=sentinelhub-2 tx.from_name=key-1 2025-10-26T04:55:44Z INF Setting up database 2025-10-26T04:55:44Z INF Initializing database file=/root/.sentinel-dvpnx/data.db 2025-10-26T04:55:44Z INF Setting up GeoIP client 2025-10-26T04:55:44Z INF Initializing GeoIP client 2025-10-26T04:55:44Z INF Setting up oracle client 2025-10-26T04:55:44Z INF Initializing oracle client name=coingecko 2025-10-26T04:55:44Z INF Setting up service 2025-10-26T04:55:44Z INF Initializing service type=wireguard 2025-10-26T04:55:44Z INF Checking service status 2025-10-26T04:55:44Z INF Setting up account addr 2025-10-26T04:55:44Z INF Retrieving addr for key name=key-1 2025-10-26T04:55:44Z INF Querying account information addr=sent1x4faeeu8lqjnnjywa89j9xv34h0wm2yre96uc 2025-10-26T04:55:45Z INF Setting up scheduler 2025-10-26T04:55:45Z INF Initializing scheduler 2025-10-26T04:55:45Z INF Registering scheduler worker interval=5m0s name=best_rpc_addr 2025-10-26T04:55:45Z INF Registering scheduler worker interval=6h0m0s name=geoip_location 2025-10-26T04:55:45Z INF Registering scheduler worker interval=6h0m0s name=node_prices_update 2025-10-26T04:55:45Z INF Registering scheduler worker interval=55m0s name=node_status_update 2025-10-26T04:55:45Z INF Registering scheduler worker interval=1h55m0s name=session_usage_sync_with_blockchain 2025-10-26T04:55:45Z INF Registering scheduler worker interval=2s name=session_usage_sync_with_database 2025-10-26T04:55:45Z INF Registering scheduler worker interval=5s name=session_usage_validate 2025-10-26T04:55:45Z INF Registering scheduler worker interval=5m0s name=session_validate 2025-10-26T04:55:45Z INF Registering scheduler worker interval=168h0m0s name=speedtest 2025-10-26T04:55:45Z INF Setting up API server 2025-10-26T04:55:45Z INF Initializing API server 2025-10-26T04:55:45Z INF Starting node 2025-10-26T04:55:45Z INF Node already registered addr=sentnode1x4faeeu8lqjnnjywa89j9xv34h0wm2y541aum2 2025-10-26T04:55:45Z INF Updating node details gigabyte_prices=udvpn:0.002500000000000000,12500000 hourly_prices=udvpn:0.005000000000000000,25000000 remote_addrs=["123.456.7.8:19781"] 2025-10-26T04:55:50Z INF Node details updated successfully addr=sentnode1x4faeeu8lqjnnjywa89j9xv34h0wm2y541aum2 2025-10-26T04:55:50Z INF Starting service 2025-10-26T04:55:50Z INF Starting scheduler 2025-10-26T04:55:50Z INF Starting API server 2025-10-26T04:55:50Z INF Node started successfully ``` -------------------------------- ### Install Go and Configure Environment Variables Source: https://docs.sentinel.co/full-node-setup/docker/dockerfiles Installs the Go programming language and appends the necessary GOROOT, GOPATH, and GOBIN paths to the .bashrc file. ```bash apt install golang-go -y &&\ echo 'export GOROOT=/usr/lib/go' >> .bashrc &&\ echo 'export GOPATH=${HOME}/go' >> .bashrc &&\ echo 'export GOBIN=${GOPATH}/bin' >> .bashrc &&\ echo 'export PATH=${PATH}:${GOROOT}/bin:${GOBIN}' >> .bashrc ``` -------------------------------- ### Start a Session for a Subscription Source: https://docs.sentinel.co/sentinel-hub/commands/transactions/subplan Start a session for a subscription and node. ```bash sentinelhub tx vpn subscription start-session \ \ \ --from \ --chain-id sentinelhub-2 \ --gas-prices 0.5udvpn \ --gas 300000 \ --node https://rpc.sentinel.co:443 ``` -------------------------------- ### Enable and Start Service Source: https://docs.sentinel.co/node-monitoring/metrics/exporters/cosmos-node-exporter Commands to reload systemd, enable the service on boot, and start it. ```bash sudo systemctl daemon-reload ``` ```bash sudo systemctl enable cosmos-node-exporter.service ``` ```bash sudo systemctl start cosmos-node-exporter.service ``` -------------------------------- ### Enable and start services Source: https://docs.sentinel.co/full-node-setup/validate/restake/setup-config Commands to enable and start the systemd service and timer. ```bash sudo systemctl enable restake.service sudo systemctl enable restake.timer sudo systemctl start restake.timer ``` -------------------------------- ### Install Docker on Linux Source: https://docs.sentinel.co/dvpn-nodes/setup/manual/docker-setup Install Docker on a Linux system by installing dependencies, fetching the official installation script, running it, enabling the Docker service, adding the current user to the docker group, and applying the group change with a new login session. ```bash sudo apt install --yes curl git openssl ``` ```bash curl -fsSL get.docker.com -o ${HOME}/get-docker.sh ``` ```bash sudo sh ${HOME}/get-docker.sh ``` ```bash sudo systemctl enable --now docker ``` ```bash sudo usermod -aG docker $(whoami) ``` ```bash sudo -i -u $(whoami) ``` -------------------------------- ### Start Cosmovisor service Source: https://docs.sentinel.co/full-node-setup/upgrade Start the Cosmovisor service after the binary replacement. ```bash sudo systemctl start cosmovisor ``` -------------------------------- ### Start dVPN node with start parameter Source: https://docs.sentinel.co/dvpn-nodes/setup/automated Starts the dVPN node container using the start parameter. ```bash sudo bash dvpn-node-manager.sh start ``` -------------------------------- ### sentinelhub init syntax and example Source: https://docs.sentinel.co/sentinel-hub/commands/list Initializes validator's and node's configuration files. The example initializes a node with moniker 'my-node'. ```bash sentinelhub init [moniker] [flags] ``` ```bash sentinelhub init my-node ``` -------------------------------- ### Start Loki service Source: https://docs.sentinel.co/node-monitoring/logs/loki Starts the Loki service. ```bash sudo systemctl start loki.service ``` -------------------------------- ### Start Alertmanager service Source: https://docs.sentinel.co/node-monitoring/metrics/alertmanager Start the Alertmanager service immediately. ```bash sudo systemctl start alertmanager.service ``` -------------------------------- ### Example: Mount volume for sentinel_mainnet Source: https://docs.sentinel.co/full-node-setup/docker/mount-volume Concrete example of mounting /home/mystuff from the host to /mnt inside a container named sentinel_mainnet using the sentinel:mainnet image. Files placed in /home/mystuff will be accessible at /mnt. ```bash docker run -dit \ --name sentinel_mainnet \ -v /home/mystuff:/mnt \ sentinel:mainnet ``` -------------------------------- ### Verify Go installation Source: https://docs.sentinel.co/dvpn-cli/get-started Check that Go is correctly installed on your system. ```bash go version ``` -------------------------------- ### Start a Session with a Node Source: https://docs.sentinel.co/sentinel-hub/commands/transactions/subplan Start a session directly with a node. ```bash sentinelhub tx vpn node start-session \ \ --from \ --chain-id sentinelhub-2 \ --gas-prices 0.5udvpn \ --gas 300000 \ --node https://rpc.sentinel.co:443 ``` -------------------------------- ### Install build dependencies on Debian/Ubuntu Source: https://docs.sentinel.co/sdk/python Install necessary build tools on Debian or Ubuntu systems before installing the SDK to support native dependencies. ```bash sudo apt install build-essential autoconf automake libtool pkg-config python3-dev ``` -------------------------------- ### Install UFW Firewall Source: https://docs.sentinel.co/dvpn-nodes/setup/manual/preliminary Install the Uncomplicated Firewall (UFW) on the server. ```bash sudo apt install ufw ``` -------------------------------- ### Install Cosmovisor with go install Source: https://docs.sentinel.co/full-node-setup/system-unit Install Cosmovisor using the standard command. If a sonic-related error occurs, retry with the -ldflags="-checklinkname=0" flag. The binary is generated in the go/bin/ folder. ```bash go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest ``` ```bash go install -ldflags="-checklinkname=0" cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest ``` -------------------------------- ### Start sessions with NodeStartSession and SubscriptionStartSession Source: https://docs.sentinel.co/sdk/golang Convenience methods that construct the message, broadcast, and parse the result in a single call. NodeStartSession starts a session on a node with parameters for size, duration, and max price; SubscriptionStartSession starts from an existing subscription. Both return the new session ID. ```go // Start a session on a node - returns the new session ID sessionID, err := client.NodeStartSession( context.Background(), nodeAddr, // target node address 10, // gigabytes 24, // hours maxPrice, // maximum acceptable price ) if err != nil { log.Fatal(err) } fmt.Printf("Session ID: %d\n", sessionID) // Start a session from an existing subscription sessionID, err := client.SubscriptionStartSession( context.Background(), subscriptionID, nodeAddr, ) ``` -------------------------------- ### Install required packages Source: https://docs.sentinel.co/full-node-setup/hub-setup Install the necessary system packages for building and running Sentinel Hub. ```bash sudo apt install curl git jq make unzip gcc -y ``` -------------------------------- ### Query VPN Provider Params Example Output Source: https://docs.sentinel.co/sentinel-hub/commands/query/vpn Example output from the query vpn provider-params command. Shows the deposit amount and denom, and the staking share. ```yaml params: deposit: amount: "25000000000" denom: udvpn staking_share: "0.200000000000000000" ``` -------------------------------- ### upgrade-info.json example Source: https://docs.sentinel.co/full-node-setup/upgrade Example content of the upgrade-info.json file that Cosmovisor uses to trigger the upgrade. The height must match the upgrade block height. ```json {"name":"v12_0_0","time":"0001-01-01T00:00:00Z","height":23997755} ``` -------------------------------- ### Install UFW and OpenSSH Source: https://docs.sentinel.co/full-node-setup/server-setup Installs the UFW firewall and OpenSSH server on the server machine. ```bash sudo apt install ufw openssh-server ``` -------------------------------- ### Install sudo Source: https://docs.sentinel.co/full-node-setup/server-setup Installs the sudo package, required for granting administrative privileges to the new user. ```bash apt install sudo ``` -------------------------------- ### Start a session by paying the node Source: https://docs.sentinel.co/dvpn-cli/commands/transaction Start a new session by directly paying the node using gigabytes and denomination flags. ```bash sentinel-dvpncli tx session-start \ --gigabytes 1 \ --denom udvpn \ --tx.from-name ``` -------------------------------- ### Install dvpn-node-manager .deb package Source: https://docs.sentinel.co/dvpn-nodes/setup/automated Installs the downloaded .deb package and all required dependencies. Run this after downloading the package. ```bash sudo apt install /var/cache/apt/archives/dvpn-node-manager_latest.deb ``` -------------------------------- ### Start session via client.nodeStartSession or client.node.startSession Source: https://docs.sentinel.co/sdk/javascript Start a session by calling nodeStartSession directly on the client or via the node submodule. Both methods handle signing and broadcasting automatically. The args include fee "auto" and a memo. ```typescript import { TxNodeStartSession } from "@sentinel-official/sentinel-js-sdk"; import Long from "long"; const args: TxNodeStartSession = { from: account.address, nodeAddress: sentnode, gigabytes: Long.fromString(gigabytes, true), fee: "auto", memo: "hello from js-sdk", maxPrice: ... } // call directly const tx1 = client.nodeStartSession(args) // use submodule const tx2 = client.node.startSession(args) ``` -------------------------------- ### Install TMKMS with softsign feature and link binary Source: https://docs.sentinel.co/full-node-setup/validate/tmkms/setup-config Compile and install TMKMS from source using the softsign feature, then create a symbolic link for system-wide access. The installation uses the --features=softsign flag; the yubihsm feature is an alternative but not covered here. ```bash cd $HOME git clone https://github.com/iqlusioninc/tmkms.git cd $HOME/tmkms cargo install tmkms --features=softsign tmkms init config tmkms softsign keygen ./config/secrets/secret_connection_key ``` ```bash sudo ln -s /home/${USER}/.cargo/bin/tmkms /usr/local/bin/ ``` -------------------------------- ### Build and install the binary from source file Source: https://docs.sentinel.co/dvpn-cli/get-started Navigate to the extracted directory, compile the code, and link the binary. ```bash cd sentinel-dvpncli-X.X.X make install sudo ln -s "${HOME}/sentinel-dvpncli" /usr/local/bin/sentinel-dvpncli ``` -------------------------------- ### Start a session using an existing subscription Source: https://docs.sentinel.co/dvpn-cli/commands/transaction Start a session by referencing an existing subscription ID. ```bash sentinel-dvpncli tx session-start \ --subscription-id \ --tx.from-name ``` -------------------------------- ### Install Rust and source environment Source: https://docs.sentinel.co/full-node-setup/validate/tmkms/install-dependencies Installs Rust via rustup and then sources the environment file so the cargo and rustc commands are available in the current shell. Select option 1 (default) during the rustup installation. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` ```bash source $HOME/.cargo/env ``` -------------------------------- ### Query VPN Providers Example Output Source: https://docs.sentinel.co/sentinel-hub/commands/query/vpn Example output from the query vpn providers command. Shows pagination with next_key and total, and a list of providers with their details. ```yaml pagination: next_key: ARTve9qg1kymseR8GKZL43WHc5QSYw== total: "0" providers: - address: sentprov1gjkdw8arm54sv7xdhjxnx30lcya4alhfktuxyy description: SOLAR dVPN identity: 6257A55EA42BA680 name: SOLAR dVPN status: active status_at: "2023-08-18T12:10:36.572027592Z" website: https://labs.solar - address: sentprov1gatdlpdc4fadckccypjfnam2a4rcmum55q46zn description: "" identity: sentprov12kyhkw2xsc8g3t8dtz569c6fn2qejmzs92s07h name: apiVPN (Staging) status: active status_at: "2023-12-29T07:24:24.274968530Z" website: https://apivpn.io ``` -------------------------------- ### Install System Dependencies Source: https://docs.sentinel.co/dvpn-nodes/setup/manual/preliminary Update package lists and install required software dependencies on the server. ```bash sudo apt update && sudo apt upgrade -y sudo apt install -y curl git golang-github-pelletier-go-toml jq make ``` -------------------------------- ### CLI commands for first-run setup Source: https://docs.sentinel.co/sdk/plan-manager CLI equivalent of the 6-step first-run workflow. Requires a registered provider and a created plan. Costs ~0.5 P2P per provider registration and plan creation, ~1-2 P2P per node link, and ~0.1 P2P per fee grant. ```bash plans wallet info plans provider register plans plan create --gb 10 --days 30 --price-udvpn 500000 plans plan status 1 plans batch-link sentnode1abc...,sentnode1def... plans feegrant grant-subscribers --spend-limit-dvpn 10 --expiration-days 30 ``` -------------------------------- ### Install Sentinel SDK via pip Source: https://docs.sentinel.co/sdk/python Use pip to install the sentinel-sdk package. ```bash pip install sentinel-sdk ``` -------------------------------- ### Start a session using a plan Source: https://docs.sentinel.co/dvpn-cli/commands/transaction Start a session by referencing a plan ID and specifying renewal policy. ```bash sentinel-dvpncli tx session-start \ --plan-id \ --denom udvpn \ --renewal-price-policy \ --tx.from-name ``` -------------------------------- ### Query balances via REST GET request Source: https://docs.sentinel.co/apis/interact-rest Example of using curl to perform a GET request to the balances endpoint for a specific address. ```bash curl \ -X GET \ -H "Content-Type: application/json" \ https://lcd.sentinel.co/cosmos/bank/v1beta1/balances/ ``` -------------------------------- ### Build and install the binary from repository Source: https://docs.sentinel.co/dvpn-cli/get-started Compile the source code and create a symbolic link to the binary in /usr/local/bin. ```bash make install sudo ln -s "${HOME}/sentinel-dvpncli" /usr/local/bin/sentinel-dvpncli ``` -------------------------------- ### Install Package in Editable Mode Source: https://docs.sentinel.co/sdk/python Installs the package in editable mode using pip. ```bash pip install --editable . ``` -------------------------------- ### Install Pre-commit Hooks Source: https://docs.sentinel.co/sdk/python Installs pre-commit and sets up the git hooks to enforce PEP 8 standards. ```bash pip install pre-commit pre-commit install ``` -------------------------------- ### Manage Sessions Source: https://docs.sentinel.co/sdk/python Shows how to start a session, update it with bandwidth proof, and end an active session. ```python # Start a session for a subscription tx = sdk.subscriptions.StartSession( subscription_id=42, address="sentnode1..." ) tx_response = sdk.subscriptions.wait_for_tx(tx["hash"]) # Submit a bandwidth / duration proof for an active session tx = sdk.sessions.UpdateSession( session_id=1, download_bytes=12345, upload_bytes=6789, duration_seconds=3600, signature=signed_proof, ) tx_response = sdk.sessions.wait_for_tx(tx["hash"]) # End (cancel) a session tx = sdk.sessions.EndSession(session_id=1) tx_response = sdk.sessions.wait_for_tx(tx["hash"]) ``` -------------------------------- ### Query Slashing Signing Infos Example Output Source: https://docs.sentinel.co/sentinel-hub/commands/query/slashing Example output of the signing-infos query, showing a list of validators with their signing details. ```yaml - address: sentvalcons1q9jjdfk9k7um92cq9h0g4l8gakr22ajctvna0s index_offset: "13577037" jailed_until: "1970-01-01T00:00:00Z" missed_blocks_counter: "14" start_height: "816474" tombstoned: false - address: sentvalcons1qndsswpyazytqyyq27kv5wnvhge29df9a9zd87 index_offset: "14393512" jailed_until: "1970-01-01T00:00:00Z" missed_blocks_counter: "0" start_height: "0" tombstoned: false - address: sentvalcons1qcs7ryy6yvzjr9e0znp8ag6lhk40een0hl02f7 index_offset: "11906379" jailed_until: "1970-01-01T00:00:00Z" missed_blocks_counter: "0" start_height: "2486030" tombstoned: false - address: sentvalcons1q6u9fjdyh4xruktfsx28xcfee6cc39k3ksz4wc index_offset: "2" jailed_until: "2021-05-30T17:33:58.356338487Z" missed_blocks_counter: "2" start_height: "678" tombstoned: false - address: sentvalcons1q76wdhndyn04wy936f3qhn58y2rsellq8vvny3 index_offset: "12076617" jailed_until: "1970-01-01T00:00:00Z" missed_blocks_counter: "18" start_height: "416424" tombstoned: false ``` -------------------------------- ### Query Slashing Signing Info Example Output Source: https://docs.sentinel.co/sentinel-hub/commands/query/slashing Example output of the signing-info query for a specific validator, showing its signing details. ```yaml address: sentvalcons1709nq56aj0he8vdttlzkqnrjlmcgr9g7hlutf4 index_offset: "1690513" jailed_until: "1970-01-01T00:00:00Z" missed_blocks_counter: "5" start_height: "12702964" tombstoned: false ``` -------------------------------- ### Start node with --unsafe-skip-upgrades Source: https://docs.sentinel.co/full-node-setup/upgrade Start the node with the --unsafe-skip-upgrades flag at the upgrade height to skip the upgrade and continue syncing. Replace with the actual upgrade height. ```bash sentinelhub start --unsafe-skip-upgrades ``` -------------------------------- ### Link new sentinelhub binary Source: https://docs.sentinel.co/full-node-setup/upgrade Link the new sentinelhub binary to the system path. Use the Ubuntu path or the manual installation path depending on your setup. ```bash # For Ubuntu installation sudo ln -s "${GOBIN}/sentinelhub" /usr/bin/sentinelhub # For manual installation sudo ln -s "${GOBIN}/sentinelhub" /usr/local/bin/sentinelhub ``` -------------------------------- ### Install system dependencies with apt Source: https://docs.sentinel.co/full-node-setup/validate/tmkms/install-dependencies Updates the package list and installs the required system packages (git, build-essential, ufw, curl, jq, snapd) with automatic confirmation. ```bash sudo apt update && \ sudo apt install git build-essential ufw curl jq snapd --yes ``` -------------------------------- ### Query VPN Provider Info Example Output Source: https://docs.sentinel.co/sentinel-hub/commands/query/vpn Example output from the query vpn provider command. Shows a single provider object with address, description, identity, name, status, status_at, and website. ```yaml provider: address: sentprov1gjkdw8arm54sv7xdhjxnx30lcya4alhfktuxyy description: SOLAR dVPN identity: 6257A55EA42BA680 name: SOLAR dVPN status: active status_at: "2023-08-18T12:10:36.572027592Z" website: https://labs.solar ``` -------------------------------- ### Full Sentinel VPN client example (C#) Source: https://docs.sentinel.co/sdk/dotnet Full example of creating a VPN client with Sentinel SDK. It restores a wallet from a mnemonic, configures options (1 GB, full tunnel, console logger), subscribes to events, auto-connects to a node in DE or US with WireGuard, verifies the external IP, and disconnects. Uses `using` statements for deterministic cleanup. ```csharp using Sentinel.SDK.Core; using Sentinel.SDK.Node; // 1. Create or restore wallet using var wallet = SentinelWallet.FromMnemonic("your twelve word mnemonic phrase goes here ..."); // 2. Create VPN client with options using var vpn = new SentinelVpnClient(wallet, new SentinelVpnOptions { Gigabytes = 1, FullTunnel = true, Logger = new ConsoleSdkLogger(), }); // 3. Subscribe to events for UI binding vpn.Progress += (_, e) => Console.WriteLine($"[{e.Step}] {e.Detail}"); vpn.Connected += (_, e) => Console.WriteLine($"Connected to {e.NodeAddress}"); vpn.Disconnected += (_, e) => Console.WriteLine($"Disconnected: {e.Reason}"); vpn.Error += (_, e) => Console.WriteLine($"Error [{e.Code}]: {e.Message}"); // 4. Auto-pick best node and connect var result = await vpn.ConnectAutoAsync(new ConnectAutoOptions { Countries = ["DE", "US"], ServiceType = "wireguard", MaxAttempts = 3, }); Console.WriteLine($"VPN active! Node: {result.NodeAddress}, Session: {result.SessionId}"); // 5. Verify traffic is routed through VPN var verify = await vpn.VerifyConnectionAsync(); Console.WriteLine($"External IP: {verify.ExternalIp}"); // 6. Disconnect (or let Dispose handle it) await vpn.DisconnectAsync(); ``` -------------------------------- ### TMKMS successful signing logs Source: https://docs.sentinel.co/full-node-setup/validate/tmkms/run-tmkms-val Example TMKMS logs after the validator is started, showing successful connection and PreCommit signing. The unverified peer ID warning is expected and does not prevent signing. ```log 2022-03-08T23:46:06.208451Z INFO tmkms::connection::tcp: KMS node ID: 948f8fee83f7715f99b8b8a53d746ef00e7b0d9e 2022-03-08T23:46:06.210568Z INFO tmkms::session: [sentinelhub-2@tcp://123.456.789.000:26659] connected to validator successfully 2022-03-08T23:46:06.210604Z WARN tmkms::session: [sentinelhub-2@tcp://123.456.789.000:26659]: unverified validator peer ID! (ba44dd36899602e255b04e3608e5ef0fe4bc5f5b) 2022-03-08T23:46:15.929787Z INFO tmkms::session: [sentinelhub-2@tcp://123.456.789.000:26659] signed PreCommit: at h/r/s 3399910/0/2 (0 ms) 2022-03-08T23:46:17.344579Z INFO tmkms::session: [sentinelhub-2@tcp://123.456.789.000:26659] signed PreCommit: at h/r/s 3399911/0/2 (0 ms) 2022-03-08T23:46:22.367627Z INFO tmkms::session: [sentinelhub-2@tcp://123.456.789.000:26659] signed PreCommit: at h/r/s 3399912/0/2 (0 ms) 2022-03-08T23:46:27.409777Z INFO tmkms::session: [sentinelhub-2@tcp://123.456.789.000:26659] signed PreCommit: at h/r/s 3399913/0/2 (0 ms) 2022-03-08T23:46:32.442300Z INFO tmkms::session: [sentinelhub-2@tcp://123.456.789.000:26659] signed PreCommit: at h/r/s 3399914/0/2 (0 ms) 2022-03-08T23:46:37.452162Z INFO tmkms::session: [sentinelhub-2@tcp://123.456.789.000:26659] signed PreCommit: at h/r/s 3399915/0/2 (0 ms) ``` -------------------------------- ### Get node information with nodeClient.GetInfo Source: https://docs.sentinel.co/sdk/golang Retrieve node metadata such as address, capacity, location, peer count, service type, and version. The example prints the service type using GetServiceType(). ```go info, err := nodeClient.GetInfo() if err != nil { log.Fatal(err) } fmt.Printf("Service Type: %s\n", info.GetServiceType()) ``` -------------------------------- ### ClientService Interface Source: https://docs.sentinel.co/sdk/golang The ClientService interface defines the lifecycle methods for all VPN clients in the SDK. It provides a consistent API for initialization, setup, start, stop, wait, cleanup, and statistics retrieval. ```APIDOC ## ClientService Interface ### Description Defines the lifecycle API for all VPN clients (WireGuard, V2Ray, OpenVPN). ### Methods - **Type()** (ServiceType) - Returns the service type. - **IsRunning()** (bool, error) - Checks if the client is running. - **Init(force bool)** (error) - Initializes configuration files. - **Setup(ctx context.Context)** (error) - Sets up the VPN interface. - **Start(parent context.Context)** (context.Context, error) - Starts the VPN tunnel and returns a derived context. - **Stop()** (error) - Stops the VPN tunnel. - **Wait(ctx context.Context)** (error) - Waits for the client to stop. - **Cleanup()** (error) - Cleans up resources. - **Statistics(ctx context.Context)** (int64, int64, error) - Returns received and transmitted bytes. ``` -------------------------------- ### Configure scrape targets in prometheus.yml Source: https://docs.sentinel.co/node-monitoring/metrics/prometheus Example prometheus.yml scrape configuration with jobs for monitoring hardware metrics, validator hardware and internal metrics, and Cosmos validator and node exporters. Replace placeholder IPs with actual addresses. Remember to add new jobs when installing additional exporters. ```yaml scrape_configs: # Monitoring Node with prometheus installed - job_name: "monitor-hardware-metrics" ​ # current machine ip and port static_configs: - targets: ["localhost:9100"] ​ # Validator Host Hardware Metrics - job_name: "validator-hardware-metrics" ​ # validator ip and port static_configs: - targets: ["validator_ip:9100"] ​ # Validator Internal Metrics - job_name: "validator-internal-metrics" ​ # validator ip and port static_configs: - targets: ["validator_ip:26660"] # Cosmos Validator Exporter - job_name: "cosmos-validator-exporter" # validator ip and port static_configs: - targets: [":9560"] # Cosmos Node Exporter - job_name: "cosmos-node-exporter" # validator ip and port static_configs: - targets: [":9500"] ``` -------------------------------- ### Create Configuration File Source: https://docs.sentinel.co/node-monitoring/metrics/exporters/cosmos-node-exporter Initialize the config.toml file for the exporter. ```bash nano config.toml ``` -------------------------------- ### Launch Sentinel HUB Source: https://docs.sentinel.co/sentinel-hub/build Execute the installed binary from the terminal. ```bash sentinelhub ``` -------------------------------- ### Install Blue JS SDK with npm Source: https://docs.sentinel.co/sdk/blue-js Install the Blue JavaScript SDK package using npm. This is the standard installation command for the SDK. ```bash npm install blue-js-sdk ``` -------------------------------- ### StartSession Source: https://docs.sentinel.co/sdk/python Starts a session from an existing subscription. The transaction is signed and broadcast, and the response is awaited. ```APIDOC ## StartSession ### Description Starts a session from an existing subscription. The transaction is signed and broadcast, and the response is awaited. ### Method SDK method call ### Endpoint `sdk.subscriptions.StartSession` ### Parameters - **subscription_id** (integer) - Required - The ID of the subscription to start a session for. - **address** (string) - Required - The address of the node. ### Request Example ```python tx = sdk.subscriptions.StartSession( subscription_id=42, address="sentnode1..." ) ``` ### Response #### Success Response - **hash** (string) - The transaction hash. #### Response Example ```python tx_response = sdk.subscriptions.wait_for_tx(tx["hash"]) ``` ``` -------------------------------- ### Set up sentinelhub.service systemd unit Source: https://docs.sentinel.co/full-node-setup/system-unit Create and enable the sentinelhub.service systemd unit. Open the unit file with nano, paste the provided unit configuration, then reload systemd and enable autostart. The unit runs the sentinelhub binary directly; you handle chain upgrades manually. ```bash sudo nano /etc/systemd/system/sentinelhub.service ``` ```ini [Unit] Description=Sentinel Hub Daemon After=network.target [Service] User=sentinel Type=simple # For Ubuntu installation ExecStart=/usr/bin/sentinelhub start # For Manual installation ExecStart=/usr/local/bin/sentinelhub start Restart=on-failure StartLimitInterval=0 RestartSec=5 LimitNOFILE=1048576 LimitMEMLOCK=2048132 [Install] WantedBy=multi-user.target ``` ```bash sudo systemctl daemon-reload ``` ```bash sudo systemctl enable sentinelhub.service ``` -------------------------------- ### Enable service autostart Source: https://docs.sentinel.co/node-monitoring/missed-blocks-checker Enable the service to start automatically on boot. ```bash sudo systemctl enable missed-blocks-checker.service ``` -------------------------------- ### Start a VPN Lease Source: https://docs.sentinel.co/sentinel-hub/commands/transactions/subplan Initiates a lease with a node for a specified duration in hours. ```bash sentinelhub tx vpn lease start-lease \ \ \ --from \ --chain-id sentinelhub-2 \ --gas-prices 0.5udvpn \ --gas 300000 \ --node https://rpc.sentinel.co:443 ``` -------------------------------- ### Start service Source: https://docs.sentinel.co/node-monitoring/missed-blocks-checker Start the Missed Blocks Checker service. ```bash sudo systemctl start missed-blocks-checker.service ``` -------------------------------- ### Enable Promtail service autostart Source: https://docs.sentinel.co/node-monitoring/logs/promtail Enables the Promtail service to start automatically at boot. ```bash sudo systemctl enable promtail.service ``` -------------------------------- ### Create client from config with core/config Source: https://docs.sentinel.co/sdk/golang Creates a client from a structured configuration object. Uses config.DefaultConfig(), validates it, and passes it to core.NewClientFromConfig. The Config struct contains KeyringConfig, QueryConfig, RPCConfig, and TxConfig sub-configurations. ```go import ( "github.com/sentinel-official/sentinel-go-sdk/core" "github.com/sentinel-official/sentinel-go-sdk/core/config" ) cfg := config.DefaultConfig() // Customize as needed // cfg.RPC, cfg.Tx, cfg.Keyring, cfg.Query are sub-configs if err := cfg.Validate(); err != nil { log.Fatal(err) } client, err := core.NewClientFromConfig(cfg) if err != nil { log.Fatal(err) } ``` -------------------------------- ### Start a stopped node container Source: https://docs.sentinel.co/dvpn-nodes/setup/manual/node-run Starts the dvpnx container if it is stopped. ```bash docker start dvpnx ```