Skip to content

Simplify your Solana Native Program development with this easy-to-use template. Ideal for developers seeking a simple, efficient development process without the need for frameworks like Anchor.

Notifications You must be signed in to change notification settings

jdaviderb/solana-native-program-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Motivation

This template is designed to simplify the development of Solana Native Programs, particularly for those not using specific frameworks like Anchor. It offers a testing structure similar to Anchor Framework, aiming to facilitate the development and testing phases of Solana Native Programs.

Features of This Template

  • Jest for Testing: Integrates Jest for end-to-end testing. This setup automates the building of your program and the initialization of solana-test-validator.
  • Log Accessibility: Access your program's logs during testing in e2e/validator.log for insights into its behavior.
  • Configurable Keypair Path: While the default keypair location is in the root directory (program.json), you have the option to customize the path in e2e/package.json.

Getting Started

Pre-requisites

How to Use This Template

  1. Clone the Repository: Start by cloning this repository to your local machine.
  2. Generate Keypair:
    • The test suite looks for the program's keypair in program.json in the project's root.
    • To generate this keypair, use solana-keygen new -o program.json.
    • If you prefer a different path for the keypair, modify the configuration in e2e/package.json under the solana section.

Running End-to-End Tests

  1. Go to the E2E Folder: Navigate to the E2E folder in the cloned repository.
  2. Install Dependencies: Run npm install to install all necessary Node.js dependencies.
  3. Run Tests: Start the end-to-end testing with npm run test.

How to deploy:

By default, the program is located in target/sbf-solana-solana/release/solana_program.so, so you could use the command solana program deploy <PROGRAM_FILEPATH> to deploy your program.

Structure

.
├── Cargo.lock
├── Cargo.toml
├── README.md
├── e2e
│   ├── tests # E2E Testing
│   │   └── counter.test.ts
├── program.json # Program Keypair
└── src # Rust Solana native program
    └── lib.rs

About

Simplify your Solana Native Program development with this easy-to-use template. Ideal for developers seeking a simple, efficient development process without the need for frameworks like Anchor.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published