Nav apraksta

Claire Fan 1c98596eec Merge pull request #72 from bidhan-a/fix/add-missing-opcodes 2 dienas atpakaļ
.github 59ff4eebe2 ci: run all tests in workspace 1 nedēļu atpakaļ
crates 1c98596eec Merge pull request #72 from bidhan-a/fix/add-missing-opcodes 2 dienas atpakaļ
dist 26c0123319 version bump 1 mēnesi atpakaļ
examples b7ac3d80da fix:tests 1 nedēļu atpakaļ
src 44fe385ba0 fix disassembler output 1 nedēļu atpakaļ
tests 4df3a91d8d Add CI workflow 1 mēnesi atpakaļ
.gitignore 3810c78a7c gitignore 1 mēnesi atpakaļ
.npmignore 892eb02ea0 Add crates.io metadata for publishing 1 mēnesi atpakaļ
CONTRIBUTING.md ad486f2706 chore: fix clippy lints, apply cargo fmt, add licenses 1 mēnesi atpakaļ
Cargo.toml ef2d13172b remove extra line 3 nedēļas atpakaļ
LICENSE-APACHE ad486f2706 chore: fix clippy lints, apply cargo fmt, add licenses 1 mēnesi atpakaļ
LICENSE-MIT ad486f2706 chore: fix clippy lints, apply cargo fmt, add licenses 1 mēnesi atpakaļ
Makefile d9ee242c82 update test-examples target to use local sbpf 3 dienas atpakaļ
README.md ad486f2706 chore: fix clippy lints, apply cargo fmt, add licenses 1 mēnesi atpakaļ
package.json c157c96604 cleanup wasm 1 mēnesi atpakaļ
rustfmt.toml 4df3a91d8d Add CI workflow 1 mēnesi atpakaļ

README.md

Table of Contents

sbpf

A simple scaffold to bootstrap sBPF Assembly programs.

Installation

cargo install --git https://github.com/blueshift-gg/sbpf.git

Usage

To view all the commands you can run, type sbpf help. Here are the available commands:

  • init: Create a new project scaffold.
  • build: Compile into a Solana program executable.
  • deploy: Build and deploy the program.
  • test: Test the deployed program.
  • e2e: Build, deploy, and test a program.
  • clean: Clean up build and deploy artifacts.
  • help: Print this message or the help of the given subcommand(s).

    Usage: sbpf <COMMAND>
    
    Commands:
    init    Create a new project scaffold
    build   Compile into a Solana program executable
    deploy  Build and deploy the program
    test    Test deployed program
    e2e     Build, deploy and test a program
    clean   Clean up build and deploy artifacts
    help    Print this message or the help of the given subcommand(s)
    
    Options:
    -h, --help     Print help
    -V, --version  Print version
    

Command Details

Initialize a Project

To create a new project, use the sbpf init command. By default, it initializes a project with Rust tests using Mollusk. You can also initialize a project with TypeScript tests using the --ts-tests option.

sbpf init --help
Create a new project scaffold

Usage: sbpf init [OPTIONS] [NAME]

Arguments:
  [NAME]  The name of the project to create

Options:
  -t, --ts-tests  Initialize with TypeScript tests instead of Mollusk Rust tests
  -h, --help      Print help information
  -V, --version   Print version information
Examples
Create a new project with Rust tests (default)
sbpf init my-project
Create a new project with TypeScript tests
sbpf init my-project --ts-tests

After initializing the project, you can navigate into the project directory and use other commands to build, deploy, and test your program.

Advanced Usage

You can override the default linker with a custom linker file by including it in the src directory with the same name as your program. For example:

src/example/example.s
src/example/example.ld

License

Licensed under either of

at your option.

Contributing

PRs welcome!