{"id":29027999,"url":"https://github.com/yllvar/pinocchio-counter","last_synced_at":"2026-04-29T10:02:16.555Z","repository":{"id":300793319,"uuid":"1007192457","full_name":"yllvar/pinocchio-counter","owner":"yllvar","description":"A zero-dependency counter program built with Pinocchio, demonstrating how to create efficient Solana programs with minimal overhead.","archived":false,"fork":false,"pushed_at":"2025-06-23T16:08:45.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-23T17:22:57.461Z","etag":null,"topics":["anchor-lang","solana"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yllvar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-23T15:49:35.000Z","updated_at":"2025-06-23T16:12:17.000Z","dependencies_parsed_at":"2025-06-23T17:34:37.790Z","dependency_job_id":null,"html_url":"https://github.com/yllvar/pinocchio-counter","commit_stats":null,"previous_names":["yllvar/pinocchio-counter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yllvar/pinocchio-counter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yllvar%2Fpinocchio-counter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yllvar%2Fpinocchio-counter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yllvar%2Fpinocchio-counter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yllvar%2Fpinocchio-counter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yllvar","download_url":"https://codeload.github.com/yllvar/pinocchio-counter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yllvar%2Fpinocchio-counter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262018773,"owners_count":23245622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anchor-lang","solana"],"created_at":"2025-06-26T07:05:17.266Z","updated_at":"2026-04-29T10:02:16.487Z","avatar_url":"https://github.com/yllvar.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pinocchio Counter - Solana Program\n\n\u003cimg width=\"643\" alt=\"Screenshot 2025-06-24 at 00 06 52\" src=\"https://github.com/user-attachments/assets/847224e1-f88b-4939-b879-d694a347a33e\" /\u003e\n\nA zero-dependency counter program built with Pinocchio, demonstrating how to create efficient Solana programs with minimal overhead.\n\n## Features\n\n- Persistent on-chain counter state\n- Single increment instruction\n- Minimal program size (~35KB with Pinocchio vs ~50KB standard)\n- Zero-copy account deserialization\n- No `solana-program` dependency\n- Example CLI client included\n- Integration test coverage\n\n## Why Pinocchio?\n\nPinocchio provides several advantages for Solana development:\n- 🚀 15-30% smaller program binaries\n- ⚡ 10-20% lower compute unit consumption\n- 🔗 No dependency conflicts\n- 🧩 Flexible memory management options\n- 🔒 `no_std` compatible by default\n\n## Prerequisites\n\n- Rust 1.65.0+\n- Solana CLI 1.18.26+\n- Local validator for testing\n\n```bash\nrustup component add rustfmt\ncargo install solana-cli\ncargo install solana-sbf-tools\n```\n\n## Building and Deploying\n\n1. Build the program:\n```bash\ncargo build-sbf --features bpf-entrypoint\n```\n\n2. Deploy to localnet:\n```bash\nsolana program deploy target/deploy/pinocchio_counter.so\n```\n\n## Program Architecture\n\n```mermaid\nflowchart TD\n    A[Client] --\u003e|Increment Instruction| B[Pinocchio Program]\n    B --\u003e C[Counter Account]\n    C --\u003e|Direct Memory Access| B\n    B --\u003e|Optimized CPI| D[System Program]\n    B --\u003e|Result| A\n```\n\n## Key Pinocchio Features Used\n\n- `entrypoint!` macro for efficient program entry\n- Zero-copy account deserialization\n- Direct memory access patterns\n- `msg!` for logging (no-std compatible)\n- Custom allocator configuration\n\n## Using the CLI Client\n\nRun the example client:\n```bash\ncargo run --bin client\n```\n\nExpected output:\n```\nPayer balance: 0\nCreated counter account: 8bbPDP9RKSF3KWb6wwKgMAngYnGmhV39g8uBp4kuitmD\nIncremented counter\nCurrent counter value: 1\nTransaction CUs consumed: 485\n```\n\n## Testing\n\nRun all tests:\n```bash\ncargo test --features bpf-entrypoint\n```\n\nTest categories:\n- Unit tests (core logic)\n- Integration tests (full program flow)\n- Benchmark tests (CU consumption)\n\n## Performance Characteristics\n\n| Metric | Pinocchio | Standard |\n|--------|-----------|----------|\n| Binary Size | 35KB | 50KB |\n| Increment CU | 480-500 | 550-600 |\n| Account Size | 4 bytes | 4 bytes |\n| Rent Exemption | 0.001 SOL | 0.001 SOL |\n\n## Development Workflow\n\n1. Start local validator:\n```bash\nsolana-test-validator --reset\n```\n\n2. Build and test changes:\n```bash\ncargo build-sbf --features bpf-entrypoint \u0026\u0026 \\\ncargo test --features bpf-entrypoint\n```\n\n3. For benchmarking:\n```bash\nsolana program show --cu \u003cPROGRAM_ID\u003e\n```\n\n## Advanced Configuration\n\nTo enable formatted logging (requires std):\n```toml\n[dependencies]\npinocchio = { version = \"0.7\", features = [\"std\"] }\n```\n\nFor no-alloc mode:\n```rust\nno_allocator!();\n```\n\n## License\n\nApache 2.0\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyllvar%2Fpinocchio-counter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyllvar%2Fpinocchio-counter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyllvar%2Fpinocchio-counter/lists"}