A new version of onchain voting from the Anchor docs.
A decentralized onchain voting system on Solana, where users can vote on their favourite greeting
Unlike the original, we don't the same account to vote multiple times!
This repo provides:
- Full compatibility with the latest Rust, Agave CLI, Node.js, Anchor, and Solana Kit.
- Clean builds with zero warnings or errors.
- Testing via npm and Node.js, avoiding third-party package managers or test runners.
- A web app using Solana Kit in the browser
Verify your local environment with:
bash show-versions.shThis repository was tested with:
OS:
MacOS 15.4.1
Solana CLI:
solana-cli 2.1.21 (src:8a085eeb; feat:1416569292, client:Agave)
Anchor:
anchor-cli 2.1
Node:
v22.14.0
Rust:
rustc 1.86.0 (05f9846f8 2026-03-31)
build-sbf version:
solana-cargo-build-sbf 2.1.21
Using different versions may cause compatibility issues.
-
Clone the repository:
git clone https://github.com/mikemaccana/anchor-election-2026.git cd anchor-election-2026 -
Install dependencies:
npm install
-
Run tests:
anchor test -
Deploy the program:
anchor deploy
See the CHANGELOG for updates and contributor credits.
