Skip to content

CryptoMachineGene/solana-hello-world

Repository files navigation

Solana Hello World with Anchor

License: MIT Solana Built with Anchor Rust Terminal Visionaries Only Status

A minimal Solana program built with Anchor, logging Hello, Solana! on-chain.
Fast, local, verifiable — perfect for first-contact with Anchor.

🧩 Stack

  • Rust (smart contracts)
  • Anchor Framework (program + Mocha tests)
  • Solana CLI
  • Node.js + Yarn/NPM
  • Local validator / Devnet setup

⚙️ Quickstart

Build

anchor build

Test

anchor test

You’ll see output like:

Program log: Hello, Solana!

That’s your program running successfully inside Anchor’s local test validator.

🌍 Optional: Deploy to Devnet

solana config set --url https://api.devnet.solana.com
solana airdrop 2
anchor build
anchor deploy

Copy your Program Id from the deploy output and ensure it matches: Anchor.toml → [programs.devnet] programs/solana-hello/src/lib.rs → inside declare_id!()

Project Structure

  • programs/ – Rust smart contracts
  • tests/ – JS/TS test scripts
  • Anchor.toml – project configuration
  • target/idl - Generated IDL after build

Hello, Solana! logged via Anchor.

🧪 Example Test import * as anchor from "@coral-xyz/anchor"; import { Program } from "@coral-xyz/anchor"; import { SolanaHello } from "../target/types/solana_hello";

describe("solana-hello", () => { const provider = anchor.AnchorProvider.env(); anchor.setProvider(provider); const program = anchor.workspace.SolanaHello as Program;

it("Says Hello, Solana!", async () => { const tx = await program.methods.initialize().rpc(); console.log("Transaction Signature:", tx); }); });

Program Overview

Build & Deploy (devnet)

anchor build
anchor keys list
# Anchor.toml has the devnet id set; deploy:
solana program deploy \
  --url https://api.devnet.solana.com \
  --program-id target/deploy/solana_hello_world-keypair.json \
  target/deploy/solana_hello_world.so

💬 Credits Decentralized and minimal. 🛠️ Built by CryptoMachineGene. 🚀 Tracked on-chain. 📡 Logged with love. 💙 Signal only. 📶 Web3 dev mode: ON. 🔧 Push it. Like a dev god. ⚡ Terminal visionaries only. 🧠 Solana supremacy. ☀️

Built. Committed. Anchored. ⛓️ See you in mainnet. 🌐 Goodbye test validator. 👋

📜 License MIT

About

Anchor-based Solana smart contract starter project that deploys a simple on-chain program, runs local tests, and demonstrates core Solana development workflow.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors