Без опису

Loris Leiva 64b8a7f3ba Add changeset 1 рік тому
.changeset 64b8a7f3ba Add changeset 1 рік тому
.github d0e02ef6d5 Update main.yml 1 рік тому
locales 6be68cf913 Detect Solana version 1 рік тому
projects 2c21fb01b3 Update snapshot 1 рік тому
scripts 032e0f57cc Add lint test for JS clients 1 рік тому
template 8c4a41c7d0 Update Kinobi 1 рік тому
utils a7e46b7d06 Prefix dot files with _. in templates 1 рік тому
.gitignore fbef45ab27 Add counter-shank submodule 1 рік тому
.gitmodules fbef45ab27 Add counter-shank submodule 1 рік тому
.prettierignore 1c6c1449f1 Update .prettierignore 1 рік тому
.prettierrc bea8ea6e38 Format code 1 рік тому
CHANGELOG.md eefe85e505 Publish a new release (#25) 1 рік тому
CONTRIBUTING.md 56b0d2cf01 Add main workflow 1 рік тому
README.md 28e9d8f39b Add README and CONTRIBUTING guides 1 рік тому
index.ts 20dc4c87f5 Patch Solana dependencies when needed 1 рік тому
package.json eefe85e505 Publish a new release (#25) 1 рік тому
pnpm-lock.yaml bea8ea6e38 Format code 1 рік тому
tsconfig.json 868052ec07 Add Solana version to arg inputs 1 рік тому

README.md

create-solana-program npm package node compatibility

The fastest way to get started with Solana program development.

Solana Program banner

Usage

pnpm create solana-program

Note that, when using npm, the @latest tag name must be provided, otherwise npm may resolve to a cached and outdated version of the package.

npm create solana-program@latest

CLI arguments

Whilst you don't need to provide any CLI arguments, you can use them to customize the generated program repository. Any missing information will either be inferred from the provided input or prompted to the user.

The first CLI argument allows you to specify the program name and the directory of the new program repository.

# The generated directory is "counter" and the program name is "counter".
pnpm create solana-program counter

When a second CLI argument is provided, it allows you to specify a program name that differs from the directory name.

# The generated directory is "my-projects/counter-program" and the program name is "counter".
pnpm create solana-program my-projects/counter-program counter

CLI options

Various CLI options are also available to customize the generated program repository further and even skip user input altogether.

# Specify the organization name for the program.
pnpm create solana-program --org acme

# Select a program framework.
pnpm create solana-program --anchor
pnpm create solana-program --shank

# Select the clients to generate for your program (default to all clients).
pnpm create solana-program --client js --client rust

# Opt out of generating any clients for your program.
pnpm create solana-program --no-clients

# Do not prompt use input and use all default values (alias: -d).
pnpm create solana-program --default

# The --default flag can be combined with other flags.
pnpm create solana-program counter --org acme --default

# Skip generating a new program keypair and use the provided address instead.
pnpm create solana-program --address "MyProgram11111111111111111"

# Use a specific Solana version instead of detecting the one installed on the system.
pnpm create solana-program --solana 1.18

# Force the creation of the program repository even if the directory is not empty.
pnpm create solana-program --force

Contributing

If you're interested in contributing to this project, please make sure to read our contributing guide.