Skip to content

reclaimprotocol/reclaim-solana-sdk

Repository files navigation

Deployments

Chain Name Deployed Address Explorer Link
Solana Mainnet rEcLDWaVLaymz82eGr6cutosPxE6SEzw6q4pbtLuyqf https://explorer.solana.com/address/rEcLDWaVLaymz82eGr6cutosPxE6SEzw6q4pbtLuyqf
Solana Testnet rEcLDWaVLaymz82eGr6cutosPxE6SEzw6q4pbtLuyqf https://explorer.solana.com/address/rEcLDWaVLaymz82eGr6cutosPxE6SEzw6q4pbtLuyqf?cluster=testnet
Solana Devnet rEcLDWaVLaymz82eGr6cutosPxE6SEzw6q4pbtLuyqf https://explorer.solana.com/address/rEcLDWaVLaymz82eGr6cutosPxE6SEzw6q4pbtLuyqf?cluster=devnet

Environment

Prerequisites

  1. Rust - Install via here
  2. Solana Tool Suite - Install via here
  3. Node JS - Install via here
  4. yarn package manager - npm install -g yarn
  5. Anchor - Install via here

Installation

To get started, clone the repository and install the dependencies:

git clone https://github.com/reclaimprotocol/reclaim-solana-sdk.git
cd reclaim-solana-sdk
yarn install

Setup

The setup process involves generating a new program keypair and updating the configuration files to use the newly generated program ID.

To start the setup:

yarn setup

The setup script will:

  • Generate a new program keypair.
  • Update the Anchor.toml, .solitarc.js, and lib.rs files with the new program ID.
  • Modify the program's utilities and configurations.

Build

To build the SDK, use the following command:

yarn build

This will compile the SDK and generate the required build artifacts.

Deploying the Contract

Deploying the contract requires building the Anchor project and deploying it to the specified Solana network.

  1. Build the Anchor project:
anchor build
  1. Deploy the contract using the generated program keypair:
anchor deploy --program-name reclaim --program-keypair program-keypairs/reclaim-program-keypair.json
  1. Take note of the Program ID shown in the output.

Configuring the Program

After deploying the program, backfill the epochs to initialize the epochConfig account.

  1. Run the backfill command:
yarn backfill
  1. Take note of the Epoch config address displayed in the output

Adding an Epoch

To add an epoch, use the add-epoch command, passing the epochConfig address as an argument.

yarn add-epoch <Epoch config address>

Replace <Epoch config address> with the actual address from the backfill step.

Specifying the Network

By default the SDK will be interacting with Solana devnet Network if you want to change the Network you can set the network (cluster) for various commands by using the SOLANA_CLUSTER environment variable. The options are:

  • devnet (default)
  • testnet
  • mainnet

Example: Specifying the Network for Scripts

To backfill epochs on testnet, run:

SOLANA_CLUSTER=testnet yarn backfill

To add an epoch on testnet, run:

SOLANA_CLUSTER=testnet yarn add-epoch <Epoch config address>

Example: Deploying the Contract on Different Networks

To deploy the contract on testnet:

  1. First replace the lines in Anchor.toml:

    [programs.devnet]
    cluster = "devnet"

    with:

    [programs.testnet]
    cluster = "testnet"
  2. Run the anchor deploy command with the --provider.cluster option.

    anchor deploy --provider.cluster testnet --program-name reclaim --program-keypair program-keypairs/reclaim-program-keypair.json

By following these steps, you can easily configure the SDK and deploy the Reclaim program on any Solana network.

Repository directory

  • programs/reclaim - The anchor smart contract code for reclaim program
  • sdk - The auto generated SDK folder using solita
  • scripts - Automated scripts to speed up certain initializing processes
  • program-keypairs - The keypairs that are stored for vanity addresses
  • tests - The test suites that are ran during anchor test

Contributing to Our Project

We're excited that you're interested in contributing to our project! Before you get started, please take a moment to review the following guidelines.

Code of Conduct

Please read and follow our Code of Conduct to ensure a positive and inclusive environment for all contributors.

Security

If you discover any security-related issues, please refer to our Security Policy for information on how to responsibly disclose vulnerabilities.

Contributor License Agreement

Before contributing to this project, please read and sign our Contributor License Agreement (CLA).

Indie Hackers

For Indie Hackers: Check out our guidelines and potential grant opportunities

License

This project is licensed under a custom license. By contributing to this project, you agree that your contributions will be licensed under its terms.

Thank you for your contributions!

About

No description, website, or topics provided.

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published