Notes on `create-solana-program`

Notes taken on using create-solana-program generator.

Getting started

I used pnpm - get it here pnpm.io/installation

pnpm create solana-program

Running the above command will generate a series of commands for you to fill in about your program.

An example of this is.

 Program name: … solana-program
 Organization name: … jimii
 Program crate name: … jimii-solana-program
 Program framework: › Anchor
 Generated clients: › JavaScript Client, Rust Client
 JavaScript client package name: … @jimii/solana-program
 Rust client crate name: … jimii-solana-program-client

After ‘filling in’ the prompts,

cd into created directory.

cd solana-program

Install the dependencies.

pnpm install

Generate the clients

pnpm generate

Change directory in the js directory that houses the JavaScript client and tests and install dependencies

cd clients/js

pnpm install

What I loved

  1. Codama integration. I don’t have to configure codama to generate clients and the test are also setup.
  2. Comes with the setup for Solana web3.js V2. The new web3.js lib comes with a variety of new features and optimizations that devs will love. README.md
  3. You have the option of using an already existing anchor program. readme docs

What I disliked.

  1. Probably overkill for simple programs that don’t want to publish any of their packages because of the bloat from the clients.
  2. Comes with the setup for Solana web3.js V2. Not many devs are familiar with the new API for web3.js V2.

All in all, as with everything in software, it depends on what your use case is. For program developers that want to move quick and be able to publish the program client side code, this is the perfect tool. That is why it is used for the official SPL programs

More features that the CLI supports github.com/solana-program/create-solana-program

/solana/ /create-solana-program/