broadcast_tx via grpc

This commit is contained in:
Ethan Buchman
2016-12-02 00:29:25 -05:00
parent 538a50c9e8
commit db437e7a45
13 changed files with 573 additions and 4 deletions
+18
View File
@@ -0,0 +1,18 @@
package core_grpc
import (
core "github.com/tendermint/tendermint/rpc/core"
context "golang.org/x/net/context"
)
type broadcastAPI struct {
}
func (bapi *broadcastAPI) BroadcastTx(ctx context.Context, req *RequestBroadcastTx) (*ResponseBroadcastTx, error) {
res, err := core.BroadcastTxCommit(req.Tx)
if res == nil {
return nil, err
}
return &ResponseBroadcastTx{uint64(res.Code), res.Data, res.Log}, err
}