This repository is an example of how to stake from any Solana wallet in minutes. This codebase uses the CDP Golang SDK.
Please check out our docs to learn more! Also check out our demo video of this repository for more details!
NOTE: This example is for demonstration purposes only. Make sure to persist your private keys in a secure fashion.
Secure your wallet using best practices. In production, you should IP whitelist your API key for increased security.
If there is specific functionality you'd like to see in the CDP Staking API that is missing, we would love your feedback!
The best way to contact us is in the CDP Staking Discord Channel.
-
Clone this repository:
git clone https://github.com/ProfMoo/coinbase-staking-demo
-
Provision a CDP API Key.
-
Set the following environment variables via an
export
shell command:export CDP_API_KEY_PATH="<path_to_my_cdp_key>" export SOLANA_PRIVATE_KEY_PATH="<path_to_my_solana_private_key>" export SOLANA_ADDRESS="<my_solana_wallet>"
-
Run the example application:
go mod tidy && go run main.go