Skip to content

Instantly share code, notes, and snippets.

@benhenryhunter
Created February 2, 2024 16:38
Show Gist options
  • Save benhenryhunter/1b720bdad2da1e8006f55282cff6c31c to your computer and use it in GitHub Desktop.
Save benhenryhunter/1b720bdad2da1e8006f55282cff6c31c to your computer and use it in GitHub Desktop.
package main
import (
"context"
"fmt"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/metadata"
relaygrpc "github.com/bloXroute-Labs/relay-grpc"
)
func main() {
dialOptions := []grpc.DialOption{
grpc.WithTransportCredentials(insecure.NewCredentials()),
}
relayConnection, err := grpc.Dial("grpc.max-profit.blxrbdn.com:5010", dialOptions...)
if err != nil {
return
}
relayClient := relaygrpc.NewRelayClient(relayConnection)
outgoingCtx := metadata.AppendToOutgoingContext(context.Background(), "authorization", "<your auth header>")
res, err := relayClient.SubmitBlock(outgoingCtx, &relaygrpc.SubmitBlockRequest{})
fmt.Println(res, err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment