Configuration
Last updated
Last updated
To use Godot Solana SDK properly, you need to get yourself familiar with SolanaService autoload scene. You can find it in addons -> SolanaSDK -> Autoloads -> SolanaService.tscn
This is a UI layer scene, consisting of a couple very important scripts. First of all, in the root of SolanaService, you can adjust which RPCCluster your game will use, between Mainnet and Devnet. If you're not familiar with these terms, read here
You are also able to add your own custom Mainnet and Devnet RPC links for faster transactions and better overall quality. If you leave these empty, default Solana RPCs will be used.
Helius offers a generous free tier for both mainnet and devnet links. Register and set them up here
In the same SolanaService scene, there is a WalletService node, which is responsible for user wallet authentication and interaction within the game. By clicking Use Generated you will be authenticated with a newly-generated wallet (same one each time you play, as the seed is your computer's ID)
You can also decide to use your own custom wallet by providing a path to the json file, where you wallet's private key is written down in byte array format
Another autoload is the Asset Manager, which you can use to load up all NFTs and tokens of the user, and also some utility functions to make displaying tokens easier. There's some configuration to it as well, like setting whether NFTs should load right when a user logs in and whether load all their textures as well
If you plan on minting NFTs in-game or do anything that needs offchain metadata or images, we have this nifty tool to put your assets to ShdwDrive decentralized storage. You can import your wallet keypair and create storages and upload files to them through the editor.
Only works with mainnet RPC set in Project Settings -> SolanaSDK -> Client
You also need to have some $SHDW and SOL in your wallet to successfully use it!