Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A91y/pinoc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

73 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Pinoc CLI Logo

Pinoc

Setup Solana Pinocchio projects blazingly fast ⚑

Crates.io License: Apache 2.0 Rust Downloads

Built by:

Twitter Twitter

πŸš€ What is Pinoc?

A modern Rust CLI to bootstrap Solana Pinocchio programs with built-in build, deploy, and testing tools.

Why Pinoc?

  • Zero Configuration: Get started in seconds with sensible defaults
  • Best Practices: Project structure follows Solana development conventions
  • Developer Experience: Intuitive commands that feel natural
  • Production Ready: Built-in testing, deployment, and key management

✨ Key Features

  • πŸ—οΈ Instant Project Scaffolding - Create production-ready projects in seconds
  • πŸ“ Optimized Structure - Best-practice directory layout out of the box
  • πŸ”¨ Unified Commands - Build, test, and deploy with simple commands
  • 🧹 Smart Cleaning - Clean build artifacts while preserving keypairs
  • πŸ“¦ Package Discovery - Find and add Pinocchio packages effortlessly
  • πŸ§ͺ Built-in Testing - Comprehensive testing with mollusk-svm
  • πŸ” Keypair Management - Automatic generation and secure storage
  • πŸ”‘ Program ID Sync - Keep your program IDs consistent automatically
  • βš™οΈ Configuration Management - Simple deployment configuration with Pinoc.toml

πŸ“¦ Installation

Quick Install (Recommended)

cargo install pinoc

Alternative Methods

From GitHub (Latest)
cargo install --git https://github.com/a91y/pinoc --force
From Source
git clone https://github.com/a91y/pinoc.git
cd pinoc
cargo build --release
cargo install --path .

🎯 Quick Start

# Install pinoc
cargo install pinoc

# Create a new project
pinoc init my_awesome_app

# Navigate to your project
cd my_awesome_app

# Build and test
pinoc build
pinoc test

# Deploy to Solana
pinoc deploy

That's it! You now have a fully functional Solana program ready for development.

πŸ“‹ Command Reference

Command Description Example
pinoc init <name> Create a new project pinoc init my_app
pinoc build Build your program pinoc build
pinoc test Run tests pinoc test
pinoc deploy Deploy to Solana pinoc deploy --cluster devnet
pinoc clean Clean build artifacts pinoc clean
pinoc add <package> Add a package pinoc add some_package
pinoc search [query] Search packages pinoc search database
pinoc keys list List program keypairs pinoc keys list
pinoc keys sync Sync program IDs pinoc keys sync
pinoc help Show help pinoc help

Command Options

  • pinoc init <name> --no-git - Skip git initialization
  • pinoc init <name> --no-boilerplate - Create minimal project structure
  • pinoc clean --no-preserve - Clean everything including keypairs
  • pinoc deploy --cluster <cluster> --wallet <path> - Override deployment settings

πŸ“‚ Project Structure

Standard Project

my_project/
β”œβ”€β”€ Cargo.toml              # Project configuration
β”œβ”€β”€ README.md               # Documentation
β”œβ”€β”€ .gitignore              # Git ignore rules
β”œβ”€β”€ Pinoc.toml              # Deployment configuration
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ lib.rs              # Main library
β”‚   β”œβ”€β”€ entrypoint.rs       # Program entrypoint
β”‚   β”œβ”€β”€ errors.rs           # Error definitions
β”‚   β”œβ”€β”€ instructions/       # Program instructions
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   └── initialize.rs
β”‚   └── states/             # Account states
β”‚       β”œβ”€β”€ mod.rs
β”‚       β”œβ”€β”€ state.rs
β”‚       └── utils.rs
β”œβ”€β”€ tests/
β”‚   └── tests.rs            # Unit tests
└── target/deploy/
    └── my_project-keypair.json  # Program keypair

Minimal Project (--no-boilerplate)

Perfect for quick prototypes or learning:

my_minimal_project/
β”œβ”€β”€ Cargo.toml              # Minimal configuration
β”œβ”€β”€ README.md               # Basic documentation
β”œβ”€β”€ .gitignore              # Git ignore rules
β”œβ”€β”€ Pinoc.toml              # Deployment configuration
β”œβ”€β”€ src/
β”‚   └── lib.rs              # Minimal program structure
└── target/deploy/
    └── my_minimal_project-keypair.json

πŸ”§ Advanced Usage

Configuration Management

Pinoc uses Pinoc.toml for deployment settings:

[provider]
cluster = "localhost"
wallet = "~/.config/solana/id.json"

Override settings per deployment:

# Deploy to devnet with custom wallet
pinoc deploy --cluster devnet --wallet ./custom-keypair.json

Key Management

Keep your program IDs synchronized:

# Check key consistency
pinoc keys list

# Sync program ID in lib.rs with keypair
pinoc keys sync

Example output:

βœ… Program key is already consistent!
πŸ”‘ Program ID: 9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM
πŸ“ No update needed in src/lib.rs

Smart Cleaning

Clean build artifacts while preserving important files:

# Clean target directory (preserves keypairs)
pinoc clean

# Clean everything including keypairs
pinoc clean --no-preserve

πŸ”— Prerequisites

Ensure you have these tools installed:

🀝 Contributing

We welcome contributions! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Test thoroughly
  5. Commit with clear messages (git commit -m 'Add amazing feature')
  6. Push to your branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Development Setup

git clone https://github.com/a91y/pinoc.git
cd pinoc
cargo build --release
cargo install --path .

# Test your changes
pinoc init test-project
cd test-project
pinoc build

πŸ“„ License

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

πŸ†˜ Support & Community


Made with ❀️ by the Solana community

⭐ Star us on GitHub if Pinoc helps you build faster!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published