Solana Client

An asset by Virus-Axel
The page banner background of a mountain and forest
Solana Client hero image

Quick Information

0 ratings
Solana Client icon image
Virus-Axel
Solana Client

This custom node type enables full Solana RPC API connectivity from your godot games.

Supported Engine Version
4.0
Version String
0.1
License Version
MIT
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

Godot Solana Client

Connect your games to the Solana blockchain. Access the Solana JSON RPC API from your Godot game. The plugin is written for Godot version 4 and up. It is currently not in the godot asset library.

Installation

Download the latest release and place the addons folder in the res:// root. The plugin will load when your project is reloaded. The plugin must be enabled in your project settings under the plugins tab.

Usage

Add a node of type SolanaClient.

You can set the client behavior such as cluster URL, commitment level and minimum context slot. You can also set if your calls will be synchronous or asynchronous.

Synchronous calls

The default value is to use synchronous calls. The methods should then be called with the await keyword as follows

var result = await $solana_client_node.get_latest_blockhash()

Asynchronous calls

If you prefer to use asynchronous calls you can get the request responce through signals. A basic example could be

var blockhash_request_id = 0

func basic_get_blockhash_example():
    blockhash_request_id = $solana_client_node.unique_id
    $solana_client_node.rpc_response.connect(Callable(self, "handle_response"))
    $solana_client_node.get_latest_blockhash()

func handle_response(id, value):
    if id == blockhash_request_id:
        print("Latest blockhash is:", value)

Signals

There are two signals in the SolanaClient node apart from the inherited signals.

There is an error signal and a rpc_response signal. The rpc_response signal would only be used when dealing with asynchronous calls as shown in the example. It will pass the request ID that was passed with the request. The unique ID class property will increment by one by each request and can be used to keep track the requests and responses.

Error Handling

The error signal can be used to get error information. The signal passes an error Identifier and a short description of the error. A list of possible errors can be found here: GRPC status codes.

When using synchronous calls the return values can also indicate errors. When an error occurred, the methods will return null. For asynchronous calls the return values will always be null.

This custom node type enables full Solana RPC API connectivity from your godot games.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Solana Client icon image
Virus-Axel
Solana Client

This custom node type enables full Solana RPC API connectivity from your godot games.

Supported Engine Version
4.0
Version String
0.1
License Version
MIT
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers