OpenViSTAI · Agents · Blockchain · Crypto
Menu
Smart Contracts

Simple Solana Smart Contract Example

A public Rust and Solana example repository containing an on-chain program that increments and stores a greeting execution count, plus a Rust client that creates the state account, submits invocation transactions, and reads the result.

Independent OpenViST project profile, based on linked sources.

Simple Solana Smart Contract Example — OpenViST project profile in Smart Contracts.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it as a compact learning example when you want to follow a Solana program invocation from client setup through transaction submission and reading updated on-chain state.

Who it is for

  • Developers learning how Solana programs are deployed and invoked.
  • Rust developers studying a client that interacts with an on-chain program.
  • Readers exploring how Solana accounts hold state for otherwise stateless programs.

Documented uses

  • Deploy a simple Solana program to a configured cluster.
  • Invoke a deployed program from a Rust client.
  • Create and fund an account for program state, then inspect an incrementing counter.
  • Study Borsh serialization and the client-side balance calculation described in the README.
Before you choose

Requirements & limits

The repository is public and licensed under BSD-3-Clause. The README describes a CLI-based local workflow using Rust, Solana, and a local validator.

  • The on-chain program is a small execution counter, not a general-purpose application.
  • The client is written in Rust, unlike the TypeScript client in the referenced Solana hello-world example.
  • The example relies on a funded account for transaction execution and stored state.
  • The README's local workflow requires a validator to remain running while deploying and invoking the program.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Deploy and invoke the counter locally

Run the repository's Solana program on a local validator and use its Rust client to increment and report the stored greeting count.

Before you start

  • Rust and Solana installed.
  • A local Solana validator, left running in the background.
  • A configured Solana CLI and keypair.
  • The account balance needed to pay for transaction execution and state storage.

Steps

  1. Configure the CLI for localhost with solana config set --url localhost.

  2. Create a keypair with solana-keygen new.

  3. Start the local validator with solana-test-validator and leave it running.

  4. Deploy the program with ./run.sh deploy.

  5. Run ./run.sh client; repeat the client command to observe the counter increase.

Expected outcome

The client submits a transaction to the deployed program and reports the greeting count stored in the account; later invocations increase the count.

Guide limitations

  • The program must be deployed before the client can run.
  • The client needs a Solana connection, a funded payer account, and a state account; account storage and transaction execution require funds.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
16 October 2026
Original website title
0xekez/simple-solana-program · Official homepage title · retained in its source language