We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I used BlockSubscribe, but found that there was no data output.But with the same endpoint, LogsSubscribe is running normally. `package main
import ( "context" "fmt" "math" "sync"
bin "github.com/gagliardetto/binary" "github.com/gagliardetto/solana-go" "github.com/gagliardetto/solana-go/programs/serum" "github.com/gagliardetto/solana-go/rpc" "github.com/gagliardetto/solana-go/programs/token" "github.com/gagliardetto/solana-go/rpc/ws"
)
func main() { client, err := ws.Connect(context.Background(), rpc.MainNetBeta_WS)
if err != nil { panic(err) } filter := ws.NewBlockSubscribeFilterAll() opts := &ws.BlockSubscribeOpts{ Commitment: rpc.CommitmentConfirmed, } sub, err := client.BlockSubscribe(filter, opts) if err != nil { panic(err) } defer sub.Unsubscribe() for { res, err := sub.Recv() if err != nil { fmt.Println("BlockSubscribe error:", err) panic(err) } fmt.Println("Received block:", res.Value.Block) for _, transaction := range res.Value.Block.Transactions { fmt.Println("Transaction:", transaction) } }
}`
The text was updated successfully, but these errors were encountered:
https://solana.com/docs/rpc/websocket/blocksubscribe
Sorry, something went wrong.
No branches or pull requests
I used BlockSubscribe, but found that there was no data output.But with the same endpoint, LogsSubscribe is running normally.
`package main
import (
"context"
"fmt"
"math"
"sync"
)
func main() {
client, err := ws.Connect(context.Background(), rpc.MainNetBeta_WS)
}`
The text was updated successfully, but these errors were encountered: