From f3296ca91746c2751a998b35961d7d460ff4b614 Mon Sep 17 00:00:00 2001 From: danbaruka <46156791+danbaruka@users.noreply.github.com> Date: Tue, 24 Mar 2026 20:54:40 +0400 Subject: [PATCH 1/2] Remove the Safrochain Validator Setup and Maintenance Guide document, streamlining project resources. --- safrochain_validator_guide.md | 286 ---------------------------------- 1 file changed, 286 deletions(-) delete mode 100644 safrochain_validator_guide.md diff --git a/safrochain_validator_guide.md b/safrochain_validator_guide.md deleted file mode 100644 index 3bd0e1a..0000000 --- a/safrochain_validator_guide.md +++ /dev/null @@ -1,286 +0,0 @@ -# Safrochain Validator Setup and Maintenance Guide - -This guide provides a comprehensive and professional walkthrough to setting up and maintaining a validator node on the Safrochain testnet. It includes secure wallet creation, key management, validator registration, profile updates, recovery processes, unjailing procedures, redelegation, and reward handling. - ---- - -## 1. Create a Wallet Using the `file` Keyring - -A validator wallet is necessary to hold funds, sign transactions, and interact with the chain. - -```bash -echo "Enter a name for your validator wallet (e.g., validator):" -read WALLET_NAME -export WALLET_NAME=$WALLET_NAME -safrochaind keys add "$WALLET_NAME" --keyring-backend file -``` - -> πŸ” **Important**: Copy and store the mnemonic phrase securely offline. This is your only recovery method. - -To verify the wallet was created: - -```bash -safrochaind keys list --keyring-backend file -``` - -Get the wallet address: - -```bash -safrochaind keys show "$WALLET_NAME" -a --keyring-backend file -``` - ---- - -## 2. Secure Your Wallet with Encryption - -To protect your key from unauthorized access, export and encrypt it: - -```bash -safrochaind keys export "$WALLET_NAME" --keyring-backend file > "$WALLET_NAME"_key.json -``` - -Encrypt the exported key: - -```bash -gpg -c "$WALLET_NAME"_key.json -``` - -> πŸ’Ύ Store the encrypted `.gpg` file on a secure USB drive, external offline storage, or an encrypted cloud storage location. - ---- - -## 3. Request SAF Test Tokens from the Faucet - -Visit the faucet to fund your wallet with testnet tokens: [https://faucet.safrochain.com](https://faucet.safrochain.com) - -Paste your wallet address and request funds. Then confirm the balance: - -```bash -safrochaind query bank balances $(safrochaind keys show "$WALLET_NAME" -a --keyring-backend file) -``` - ---- - -## 4. Register Your Validator Node - -### Ensure Your Node Is Fully Synced - -```bash -curl http://localhost:26657/status | jq '.result.sync_info.catching_up' -``` - -Output must be `false` before proceeding. - -### Get Validator Consensus Public Key - -```bash -PUBKEY=$(safrochaind tendermint show-validator) -``` - -### Create Configuration File - -```bash -cat > validator.json < -``` - -Once set, use that Keybase ID in the `--identity` flag when editing your validator. - -> βœ… Explorers like Mintscan or Big Dipper may use this information to display an image, website, and social verification next to your validator. - -To change your validator name, description, website, or image identity: - -```bash -safrochaind tx staking edit-validator \ - --moniker "NewMoniker" \ - --identity "YourKeybaseID" \ - --website "https://yourwebsite.com" \ - --details "Professional validator operator." \ - --from "$WALLET_NAME" \ - --chain-id safrochain-testnet \ - --keyring-backend file \ - --fees 5000saf \ - --yes -``` - -> 🎨 The `identity` should be your [Keybase](https://keybase.io) profile to enable validator image display on explorers. - ---- - -## 6. Unjail a Validator (After Downtime) - -If your validator has been jailed due to inactivity or missed blocks: - -```bash -safrochaind tx slashing unjail \ - --from "$WALLET_NAME" \ - --chain-id safrochain-testnet \ - --keyring-backend file \ - --fees 5000saf \ - --gas auto \ - --yes -``` - -Verify validator status: - -```bash -export VALOPER_ADDRESS=$(safrochaind keys show "$WALLET_NAME" --bech val -a --keyring-backend file) -safrochaind query staking validator $VALOPER_ADDRESS -``` - ---- - -## 7. Restore Wallet from Mnemonic - -If you lost access to your machine but have the 24-word mnemonic, recover your wallet: - -```bash -safrochaind keys add "$WALLET_NAME" --recover --keyring-backend file -``` - -Paste your mnemonic phrase when prompted. - ---- - -## 8. Redelegate to Reactivate an Unbonding Validator - -If the validator is unbonding, you must redelegate to bring it back online: - -```bash -safrochaind tx staking delegate $VALOPER_ADDRESS 20000000saf \ - --from "$WALLET_NAME" \ - --keyring-backend file \ - --chain-id safrochain-testnet \ - --fees 5000saf \ - --gas auto \ - --yes -``` - ---- - -## 9. Validator Monitoring: Status, Balance, Rewards - -Set permanent environment variables: - -```bash -export DELEGATOR_ADDRESS=$(safrochaind keys show "$WALLET_NAME" -a --keyring-backend file) -export VALOPER_ADDRESS=$(safrochaind keys show "$WALLET_NAME" --bech val -a --keyring-backend file) -``` - -### Check Validator Status - -```bash -safrochaind query staking validator $VALOPER_ADDRESS -``` - -### Check Wallet Balance - -```bash -safrochaind query bank balances $DELEGATOR_ADDRESS -``` - -### Query Delegator Rewards - -```bash -safrochaind query distribution rewards $DELEGATOR_ADDRESS -``` - -### Withdraw Validator Rewards - -```bash -safrochaind tx distribution withdraw-rewards $VALOPER_ADDRESS \ - --from "$WALLET_NAME" \ - --commission \ - --chain-id safrochain-testnet \ - --keyring-backend file \ - --fees 5000saf \ - --yes -``` - ---- - -## 10. Best Practices and Backup Strategy - -- 🧠 **Always back up your mnemonic securely** (offline or in a fireproof safe). -- πŸ”’ **Encrypt all exported keys** and never leave them on an internet-connected machine. -- πŸ§ͺ **Test your recovery plan** at least once on a test machine. -- βš™οΈ **Use monitoring tools** like Prometheus/Grafana for uptime and slash protection. -- πŸ“ **Organize key material** in a designated, protected folder with restricted permissions. - ---- - -Need help? Join the Safrochain community: - -- [Telegram](https://t.me/safrochain) -- [Discord](https://discord.gg/safrochain) -- [GitHub](https://github.com/safrochain) - -Stay secure, stay active β€” and happy validating on Safrochain πŸš€ - From 22f45840f2573f8b079f678ea3767ae4a5d356bc Mon Sep 17 00:00:00 2001 From: danbaruka <46156791+danbaruka@users.noreply.github.com> Date: Tue, 24 Mar 2026 21:14:55 +0400 Subject: [PATCH 2/2] fix(ci): repair CodeQL workflow for code scanning - Drop crypto-com/cosmos-sdk-codeql pack (pins obsolete codeql/go-all 0.3.6) - Trigger on workflow, CodeQL config, go.mod/sum, and Makefile changes - Add workflow_dispatch for manual runs - Use codeql-action v4 for init/analyze Made-with: Cursor --- .github/workflows/codeql.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 356a545..1228581 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -6,12 +6,23 @@ on: pull_request: paths: - "**.go" + - "go.mod" + - "go.sum" + - "Makefile" + - ".github/workflows/codeql.yml" + - ".github/codeql/**" push: branches: - main - release/** paths: - "**.go" + - "go.mod" + - "go.sum" + - "Makefile" + - ".github/workflows/codeql.yml" + - ".github/codeql/**" + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -37,15 +48,14 @@ jobs: go-version: ${{ env.GO_VERSION }} # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@v4 with: languages: "go" config-file: ./.github/codeql/codeql-config.yml queries: +security-and-quality,github/codeql/go/ql/src/experimental/InconsistentCode/DeferInLoop.ql@main,github/codeql/go/ql/src/experimental/Unsafe/WrongUsageOfUnsafe.ql@main,github/codeql/go/ql/src/experimental/CWE-369/DivideByZero.ql@main - packs: +crypto-com/cosmos-sdk-codeql - name: Build run: make build - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@v4