FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

SOL-Strategies/doublezero-version-sync: Automated doublezero version synchronization · GitHub

Repository files navigation

doublezero-version-sync

A simple version synchronization manager for DoubleZero, keeping your installed version in sync with the recommended version for your cluster (testnet/mainnet-beta).

A validator client counterpart exists at solana-validator-version-sync

Installation

From Source

git clone https://github.com/sol-strategies/doublezero-version-sync.git
cd doublezero-version-sync
make build

Download pre-built binary

Download the latest release from the Releases page.

Usage

Run Once

doublezero-version-sync --config config.yaml run

Run Continuously

# can run this command as a systemd service
doublezero-version-sync --config config.yaml run --on-interval 1h

Configuration

Create a configuration file (e.g., config.yml) with the following options (see config.yml for a working example):

log:
  level: info  # optional, default: info, one of debug|info|warn|error|fatal
  format: text # optional, default: text, one of text|logfmt|json

validator:
  enabled_when_active: false     # optional, default: false - sync only when validator is passive
  rpc_url: http://localhost:8899 # optional; omit to disable validator role checks

  # Preferred: resolve the active validator identity from this vote account via getVoteAccounts.
  # Both current and delinquent vote accounts are considered.
  vote_account_pubkey: <VOTE_ACCOUNT_PUBKEY>

  # Optional explicit passive identity. Public keys avoid reading private key material.
  # identities:
  #   passive_pubkey: <PASSIVE_IDENTITY_PUBKEY>

cluster:
  name: mainnet-beta # one of mainnet-beta|testnet

doublezero:
  version_constraint: ">= 0.6.9, < 0.7.2" # required - example version constraint
  bin: /path/to/bin/doublezero            # optional, default: doublezero

sync:
  # Commands to run when there is a version change. They will run in the order they are declared.  
  # cmd, args, and environment values can be template strings and will be interpolated with the following variables:
  #  .ClusterName      cluster the DoubleZero instance is running on (testnet/mainnet-beta)
  #  .CommandIndex     index of the command in the commands array (zero-based)
  #  .CommandsCount    count of commands in the commands array
  #  .VersionFrom      current installed version
  #  .VersionTo        sync target version (semver format, e.g., "0.7.1")
  #  .PackageVersionTo package version string for installation (e.g., "0.7.1-1" for Debian/Ubuntu)
  commands:
    - name: "install-doublezero"                                      # required - vanity name for logging purposes
      allow_failure: false                               # optional, default:false - when true, errors are logged and subsequent commands executed
      stream_output: true                                # optional, default: false - when true, command output streamed
      disabled: false                                    # optional, default: false - when true, command skipped
      cmd: /usr/bin/apt-get                              # required, supports templated string
      args: ["install", "-y", "doublezero={{ .PackageVersionTo }}"] # optional, supports templated strings
      environment:                                       # optional, environment variables to pass to cmd, values support templated strings
        DEBIAN_FRONTEND: noninteractive
    # ...

When validator.rpc_url is configured, exactly one active identity source must be configured:

  • validator.vote_account_pubkey (preferred) dynamically resolves the active identity from the network.
  • validator.identities.active_pubkey uses a configured identity public key directly.
  • validator.identities.active is the legacy path to an active identity keypair file.

The passive identity is optional. Configure at most one of validator.identities.passive_pubkey or the legacy validator.identities.passive keypair path. In vote-account mode, a local non-active identity without any vote account is considered passive. A local identity voting for another account is unknown and syncing is refused. In static active-key mode without an explicit passive identity, any non-active identity is considered passive. When an explicit passive identity is configured, any identity matching neither active nor passive is unknown.

A static, file-free configuration is also supported:

validator:
  enabled_when_active: false
  rpc_url: http://localhost:8899
  identities:
    active_pubkey: <ACTIVE_IDENTITY_PUBKEY>
    passive_pubkey: <PASSIVE_IDENTITY_PUBKEY>

Legacy active and passive keypair paths remain supported for compatibility. The application warns at startup when either is configured and recommends the equivalent public-key or vote-account configuration.

Development

Prerequisites

  • Go 1.26.5 or later
  • Make

Local Development

# Build and run locally
make build
make dev

# Build for all platforms
make build-all

# Run tests
make test

# Clean build artifacts
make clean

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Automated doublezero version synchronization

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages


Back | FazBrowse Home | New Git URL