mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 06:42:16 +00:00
* de-mystify tests & run them in parallel (#1031) * test optimization for jenkins (#1093) * makefile cleanup * tests: split fast and slow go tests, closes #1055 * pr comments * restore circle conditions * fix need_abci * ... * docker run: no :Z for circle? * Remove cmd breaking comment
37 lines
676 B
Go
Executable File
37 lines
676 B
Go
Executable File
package main
|
|
|
|
import (
|
|
"encoding/hex"
|
|
"fmt"
|
|
"os"
|
|
|
|
"context"
|
|
|
|
"github.com/tendermint/go-wire"
|
|
"github.com/tendermint/tendermint/rpc/grpc"
|
|
)
|
|
|
|
var grpcAddr = "tcp://localhost:36656"
|
|
|
|
func main() {
|
|
args := os.Args
|
|
if len(args) == 1 {
|
|
fmt.Println("Must enter a transaction to send (hex)")
|
|
os.Exit(1)
|
|
}
|
|
tx := args[1]
|
|
txBytes, err := hex.DecodeString(tx)
|
|
if err != nil {
|
|
fmt.Println("Invalid hex", err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
clientGRPC := core_grpc.StartGRPCClient(grpcAddr)
|
|
res, err := clientGRPC.BroadcastTx(context.Background(), &core_grpc.RequestBroadcastTx{txBytes})
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
os.Exit(1)
|
|
}
|
|
fmt.Println(string(wire.JSONBytes(res)))
|
|
}
|