CAUTION: By default, each searcher enforces a limit of 5 requests per second. If you need to have a higher limit, you can send a request to hello@sova.network.
Create a SovaClient Instance for Testnet
package main
import (
sova_sdk_go "github.com/sova-network/sova-sdk-go"
)
func main() {
// Create a new client instance for the testnet
var client = sova_sdk_go.NewTestnetClient()
}
Authenticate the Client
If you need authenticated access, you can sign the challenge provided by the Sova Engine using your ED25519 private key. Replace the dummy private key with your actual 32-byte ED25519 key. If you choose to skip authentication, simply do not call this method.
package main
import (
"encoding/base64"
"fmt"
"time"
"context"
sova_sdk_go "github.com/sova-network/sova-sdk-go"
)
func main() {
client := sova_sdk_go.NewTestnetClient()
// Replace with your actual 32-byte private key.
privKeyB64 := "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
privateKey, err := base64.StdEncoding.DecodeString(privKeyB64)
if err != nil {
panic(err)
}
ctx := context.Background()
// Authenticate and obtain an access token.
token, err := client.Authenticate(ctx, privateKey)
if err != nil {
fmt.Println(err)
}
searcher, err := client.Searcher(ctx)
if err != nil {
panic(err)
}
searcher.SetAccessToken(token)
// Subscription
// searcher.SubscribeByWorkchainShard(...)
// Keep the application running to receive messages
for {
time.Sleep(1 * time.Second)
}
}
Subscribe for Messages
Regardless of authentication, you can use the searcher service to subscribe to Mempool messages.