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 |
- Rust - Install via here
- Solana Tool Suite - Install via here
- Node JS - Install via here
- yarn package manager -
npm install -g yarn
- Anchor - Install via here
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
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.
To build the SDK, use the following command:
yarn build
This will compile the SDK and generate the required build artifacts.
Deploying the contract requires building the Anchor project and deploying it to the specified Solana network.
- Build the Anchor project:
anchor build
- Deploy the contract using the generated program keypair:
anchor deploy --program-name reclaim --program-keypair program-keypairs/reclaim-program-keypair.json
- Take note of the Program ID shown in the output.
After deploying the program, backfill the epochs to initialize the epochConfig account.
- Run the backfill command:
yarn backfill
- Take note of the Epoch config address displayed in the output
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.
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:
-
First replace the lines in
Anchor.toml
:[programs.devnet] cluster = "devnet"
with:
[programs.testnet] cluster = "testnet"
-
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.
- 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
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.
Please read and follow our Code of Conduct to ensure a positive and inclusive environment for all contributors.
If you discover any security-related issues, please refer to our Security Policy for information on how to responsibly disclose vulnerabilities.
Before contributing to this project, please read and sign our Contributor License Agreement (CLA).
For Indie Hackers: Check out our guidelines and potential grant opportunities
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!