Chio is a command-line tool designed to make it easy to set up and manage Pinocchio projects on Solana. It automates common development tasks including project initialization, building, testing, and deployment with simple commands.
- π Fast project scaffolding with best practices
- π Proper directory structure for Solana/Pinocchio development
- π¨ Simple build, test, and deployment commands
- π» Comprehensive testing environment setup
cargo install --git https://github.com/4rjunc/solana-chio --force
-
Clone the repository
git clone https://github.com/4rjunc/solana-chio.git cd solana-chio
-
Build the tool
cargo build --release
-
Install globally
cargo install --path .
# Initialize a new project
chio init <project-name>
# Build your project
chio build
# Run tests
chio test
# Deploy your program
chio deploy
# Run benchmarks
chio bench
# Get help
chio --help
Create a new Pinocchio project and get started:
# Create a new project
chio init my-pinocchio-app
# Navigate to your project
cd my-pinocchio-app
# Build your project
chio build
# Run tests
chio test
# Run benchmarks
chio bench
When you initialize a project with chio init
, it creates the following structure:
my-project/
βββ Cargo.toml
βββ src/
β βββ lib.rs # Library crate using no_std
β βββ entrypoint.rs # Program entrypoint
β βββ errors.rs # Error definitions
β βββ instructions/ # Program instructions
β β βββ mod.rs
β β βββ deposit.rs
β β βββ withdraw.rs
β βββ states/ # Account state definitions
β βββ mod.rs
β βββ utils.rs
βββ tests/ # Test files
βββ unit_tests.rs
- Generate proper project structure
- Pass user address to testcase file
- Create a comprehensive README template
- Implement
chio build
command
- Implement remaining command wrappers:
chio test
βcargo test --features test-default
chio deploy
βsolana program deploy ./target/debug/<project_name>.so
chio bench
βcargo bench --features bench-default
- Update banner and styling
- Add more sophisticated testing templates
- Improve error handling
- Add configuration options
- proper gitbook for the project
Contributions are welcome! Here's how you can contribute:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Make your changes
- Run tests to ensure everything works
- Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Ensure you have Rust and Cargo installed
- Install Solana CLI tools
- Clone the repository
- Build with
cargo build
- Run with
cargo run -- <command>
This project is licensed under the MIT License - see the LICENSE file for details.