Sem descrição

Fernando Otero da8d9bd364 p-token: Add `spl-token` test fixtures (#39) há 6 meses atrás
.github da8d9bd364 p-token: Add `spl-token` test fixtures (#39) há 6 meses atrás
clients 7433164b2a Publish JS client v0.5.1 há 7 meses atrás
interface 90152b12d0 p-token: Add `withdraw_excess_lamports` instruction (#36) há 7 meses atrás
p-token 90152b12d0 p-token: Add `withdraw_excess_lamports` instruction (#36) há 7 meses atrás
program da8d9bd364 p-token: Add `spl-token` test fixtures (#39) há 6 meses atrás
scripts da8d9bd364 p-token: Add `spl-token` test fixtures (#39) há 6 meses atrás
.gitattributes 8fa926bde8 Initial commit há 1 ano atrás
.gitignore 8fa926bde8 Initial commit há 1 ano atrás
.prettierrc a7ca79e32f Update repo from latest `create-solana-program` (#5) há 1 ano atrás
Cargo.lock 90152b12d0 p-token: Add `withdraw_excess_lamports` instruction (#36) há 7 meses atrás
Cargo.toml 5adaa0e687 p-token: Add interface and p-token to workspace (#24) há 7 meses atrás
LICENSE f476906122 Update License há 1 ano atrás
README.md f89ab407b2 Update README.md (#33) há 7 meses atrás
package.json da8d9bd364 p-token: Add `spl-token` test fixtures (#39) há 6 meses atrás
pnpm-lock.yaml 06677863f6 Bump Codama to 1.2.8 and use @solana/kit (#29) há 7 meses atrás
rust-toolchain.toml 2f189b15e7 CI: Add automated publish job (#34) há 7 meses atrás
rustfmt.toml f8bbbb7a5f CI: Add program and all extra steps (#13) há 9 meses atrás

README.md

SPL Token

This template should help get you started developing Solana programs. Let's walk through this generated program repository and see what's included.

Project setup

The first thing you'll want to do is install NPM dependencies which will allow you to access all the scripts and tools provided by this template.

pnpm install

Managing programs

You'll notice a program folder in the root of this repository. This is where your generated Solana program is located.

Whilst only one program gets generated, note that you can have as many programs as you like in this repository. Whenever you add a new program folder to this repository, remember to add it to the members array of your root Cargo.toml file. That way, your programs will be recognized by the following scripts that allow you to build, test, format and lint your programs respectively.

pnpm programs:build
pnpm programs:test
pnpm programs:format
pnpm programs:lint

Generating IDLs

You may use the following command to generate the IDLs for your programs.

pnpm generate:idls

Depending on your program's framework, this will either use Shank or Anchor to generate the IDLs. Note that, to ensure IDLs are generated using the correct framework version, the specific version used by the program will be downloaded and used locally.

Generating clients

Once your programs' IDLs have been generated, you can generate clients for them using the following command.

pnpm generate:clients

Alternatively, you can use the generate script to generate both the IDLs and the clients at once.

pnpm generate

Managing clients

The following clients are available for your programs. You may use the following links to learn more about each client.

Starting and stopping the local validator

The following script is available to start your local validator.

pnpm validator:start

By default, if a local validator is already running, the script will be skipped. You may use the validator:restart script instead to force the validator to restart.

pnpm validator:restart

Finally, you may stop the local validator using the following command.

pnpm validator:stop

Using external programs in your validator

If your program requires any external programs to be running, you'll want to add them to your local validator.

You can do this by adding their program addresses to the program-dependencies array in the Cargo.toml of your program.

program-dependencies = [
  "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s",
  "noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV",
]

Next time you build your program and run your validator, these external programs will automatically be fetched from mainnet and used in your local validator.

pnpm programs:build
pnpm validator:restart