Git Product home page Git Product logo

captain's Introduction

captain ๐Ÿง‘โ€โœˆ๏ธ

Crates.io License Build Status Contributors

Version control and key management for Solana programs.

  • Automatic versioning of program binaries based on Cargo
  • Separation of deployer and authority keys
  • Per-cluster configuration
  • Reusable and custom program addresses
  • (optional) Integration with Anchor IDLs

Setup

Install via Cargo like so:

cargo install --git https://github.com/saber-hq/captain --force --locked

Then, in your directory containing your root Cargo.toml, run the following command:

captain init

Usage

A Captain workflow works like so:

  1. Build your latest programs via captain build
  2. Deploy any new programs with captain deploy
  3. Upgrade any new programs with captain upgrade

Build

First, build your programs using the command:

captain build

This runs anchor build -v if you have Anchor installed, and cargo build-bpf if you don't have Anchor installed.

Deploy

Once your new program is ready to be deployed to the blockchain, run:

captain deploy --program <program> --network <network>

where:

  • <network> is one of mainnet, devnet, testnet, localnet, or debug
  • <program> is the name of your program in the target/deploy/ directory. You can view a list of all available programs using the command captain programs.

This does several things for you:

  • Deploys the program
  • Sets the deployer of the program to the upgrade_authority of <network> in your Captain.toml file
  • If Anchor is installed, uploads the IDLs and sets the authority to the upgrade_authority

Upgrading

If you need to make changes to your program, you can run:

captain upgrade --program <program> --network <network>

This performs the following actions:

  • Writes a new program buffer
  • Replaces the existing program buffer with this new buffer using the upgrade authority
  • (WIP) If Anchor is installed, uploads the new IDL

Support

For support, join the Saber Discord at chat.saber.so!

License

Apache-2.0

captain's People

Contributors

macalinao avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.