Created
February 2, 2024 16:38
-
-
Save benhenryhunter/1b720bdad2da1e8006f55282cff6c31c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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