func (g *Grpc) GetBlocks(ctx context.Context, in *pb.ReqBlocks) (*pb.Reply, error) {
	reply, err := g.cli.GetBlocks(&pb.ReqBlocks{
		Start:    in.Start,
		End:      in.End,
		IsDetail: in.IsDetail,
	})
	if err != nil {
		return nil, err
	}
	return &pb.Reply{
			IsOk: true,
			Msg:  pb.Encode(reply)},
		nil
}
GetBlocks get blocks by grpc
package rpc
import (
	"time"
	"strings"
	"github.com/33cn/chain33/common"
	pb "github.com/33cn/chain33/types"
	"golang.org/x/net/context"
)
func (g *Grpc) SendTransactionSync(ctx context.Context, in *pb.Transaction) (*pb.Reply, error) {
	reply, err := g.cli.SendTx(in)
	if err != nil {
		return reply, err
	}
	hash := in.Hash()
	for i := 0; i < 100; i++ {
		detail, err := g.cli.QueryTx(&pb.ReqHash{Hash: hash})
		if err == pb.ErrInvalidParam || err == pb.ErrTypeAsset {
			return nil, err
		}
		if detail != nil {
			return &pb.Reply{IsOk: true, Msg: hash}, nil
		}
		time.Sleep(time.Second / 3)
	}
	return nil, pb.ErrTimeout
}
func (g *Grpc) SendTransaction(ctx context.Context, in *pb.Transaction) (*pb.Reply, error) {
	return g.cli.SendTx(in)
}
func (g *Grpc) SendTransactions(ctx context.Context, in *pb.Transactions) (*pb.Replies, error) {
	if len(in.GetTxs()) == 0 {
		return nil, nil
	}
	reps := &pb.Replies{ReplyList: make([]*pb.Reply, 0, len(in.GetTxs()))}
	for _, tx := range in.GetTxs() {
		reply, err := g.cli.SendTx(tx)
		if err != nil {
			reply = &pb.Reply{Msg: []byte(err.Error())}
		}
		reps.ReplyList = append(reps.ReplyList, reply)
	}
	return reps, nil
}
func (g *Grpc) CreateNoBalanceTxs(ctx context.Context, in *pb.NoBalanceTxs) (*pb.ReplySignRawTx, error) {
	reply, err := g.cli.CreateNoBalanceTxs(in)
	if err != nil {
		return nil, err
	}
	tx := pb.Encode(reply)
	return &pb.ReplySignRawTx{TxHex: common.ToHex(tx)}, nil
}
func (g *Grpc) CreateNoBalanceTransaction(ctx context.Context, in *pb.NoBalanceTx) (*pb.ReplySignRawTx, error) {
	params := &pb.NoBalanceTxs{
		TxHexs:  []string{in.GetTxHex()},
		PayAddr: in.GetPayAddr(),
		Privkey: in.GetPrivkey(),
		Expire:  in.GetExpire(),
	}
	reply, err := g.cli.CreateNoBalanceTxs(params)
	if err != nil {
		return nil, err
	}
	tx := pb.Encode(reply)
	return &pb.ReplySignRawTx{TxHex: common.ToHex(tx)}, nil
}
func (g *Grpc) CreateRawTransaction(ctx context.Context, in *pb.CreateTx) (*pb.UnsignTx, error) {
	reply, err := g.cli.CreateRawTransaction(in)
	if err != nil {
		return nil, err
	}
	return &pb.UnsignTx{Data: reply}, nil
}
func (g *Grpc) ReWriteRawTx(ctx context.Context, in *pb.ReWriteRawTx) (*pb.UnsignTx, error) {
	reply, err := g.cli.ReWriteRawTx(in)
	if err != nil {
		return nil, err
	}
	return &pb.UnsignTx{Data: reply}, nil
}
func (g *Grpc) CreateTransaction(ctx context.Context, in *pb.CreateTxIn) (*pb.UnsignTx, error) {
	pb.AssertConfig(g.cli)
	cfg := g.cli.GetConfig()
	execer := cfg.ExecName(string(in.Execer))
	exec := pb.LoadExecutorType(execer)
	if exec == nil {
		log.Error("callExecNewTx", "Error", "exec not found")
		return nil, pb.ErrNotSupport
	}
	msg, err := exec.GetAction(in.ActionName)
	if err != nil {
		return nil, err
	}
	err = pb.Decode(in.Payload, msg)
	if err != nil {
		return nil, err
	}
	reply, err := pb.CallCreateTx(cfg, execer, in.ActionName, msg)
	if err != nil {
		return nil, err
	}
	return &pb.UnsignTx{Data: reply}, nil
}
func (g *Grpc) CreateRawTxGroup(ctx context.Context, in *pb.CreateTransactionGroup) (*pb.UnsignTx, error) {
	reply, err := g.cli.CreateRawTxGroup(in)
	if err != nil {
		return nil, err
	}
	return &pb.UnsignTx{Data: reply}, nil
}
func (g *Grpc) QueryTransaction(ctx context.Context, in *pb.ReqHash) (*pb.TransactionDetail, error) {
	return g.cli.QueryTx(in)
}