Last active
February 2, 2024 16:38
-
-
Save benhenryhunter/3bcff37e9fda7e73313cda4ce2aa2809 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