Commit 0cb95366 authored by vipwzw's avatar vipwzw Committed by 33cn

update chain33

parent 0c5d333f
......@@ -116,6 +116,7 @@ func TestBlockChain(t *testing.T) {
testProcDelParaChainBlockMsg(t, mock33, blockchain)
testProcAddParaChainBlockMsg(t, mock33, blockchain)
testProcGetBlockBySeqMsg(t, mock33, blockchain)
testProcBlockChainFork(t, blockchain)
testDelBlock(t, blockchain, curBlock)
......@@ -895,6 +896,28 @@ func testProcAddParaChainBlockMsg(t *testing.T, mock33 *testnode.Chain33Mock, bl
chainlog.Info("testProcAddParaChainBlockMsg end --------------------")
}
func testProcGetBlockBySeqMsg(t *testing.T, mock33 *testnode.Chain33Mock, blockchain *blockchain.BlockChain) {
chainlog.Info("testProcGetBlockBySeqMsg begin --------------------")
seq, err := blockchain.GetStore().LoadBlockLastSequence()
assert.Nil(t, err)
//block, err := blockchain.GetBlock(curheight)
//require.NoError(t, err)
msgGen := mock33.GetClient().NewMessage("blockchain", types.EventGetBlockBySeq, &types.Int64{Data: seq})
mock33.GetClient().Send(msgGen, true)
msg, err := mock33.GetClient().Wait(msgGen)
if err != nil {
t.Log(err)
//t.Error("testProcAddParaChainBlockMsg only in parachain ")
}
blockseq := msg.Data.(*types.BlockSeq)
assert.Equal(t, seq, blockseq.Num)
chainlog.Info("testProcGetBlockBySeqMsg end --------------------")
}
func testProcBlockChainFork(t *testing.T, blockchain *blockchain.BlockChain) {
chainlog.Info("testProcBlockChainFork begin --------------------")
......
......@@ -73,6 +73,9 @@ func (chain *BlockChain) ProcRecvMsg() {
case types.EventGetBlockByHashes:
go chain.processMsg(msg, reqnum, chain.getBlockByHashes)
case types.EventGetBlockBySeq:
go chain.processMsg(msg, reqnum, chain.getBlockBySeq)
case types.EventDelParaChainBlockDetail:
go chain.processMsg(msg, reqnum, chain.delParaChainBlockDetail)
......@@ -418,6 +421,32 @@ func (chain *BlockChain) getBlockByHashes(msg queue.Message) {
}
}
func (chain *BlockChain) getBlockBySeq(msg queue.Message) {
seq := (msg.Data).(*types.Int64)
req := &types.ReqBlocks{Start: seq.Data, End: seq.Data, IsDetail: false, Pid: []string{}}
sequences, err := chain.GetBlockSequences(req)
if err != nil {
chainlog.Error("getBlockBySeq", "seq err", err.Error())
msg.Reply(chain.client.NewMessage("rpc", types.EventGetBlockBySeq, err))
return
}
reqHashes := &types.ReqHashes{Hashes: [][]byte{sequences.Items[0].Hash}}
blocks, err := chain.GetBlockByHashes(reqHashes.Hashes)
if err != nil {
chainlog.Error("getBlockBySeq", "hash err", err.Error())
msg.Reply(chain.client.NewMessage("rpc", types.EventGetBlockBySeq, err))
return
}
blockSeq := &types.BlockSeq{
Num: seq.Data,
Seq: sequences.Items[0],
Detail: blocks.Items[0],
}
msg.Reply(chain.client.NewMessage("rpc", types.EventGetBlockBySeq, blockSeq))
}
//平行链del block的处理
func (chain *BlockChain) delParaChainBlockDetail(msg queue.Message) {
var parablockDetail *types.ParaChainBlockDetail
......
......@@ -104,6 +104,14 @@ func (m *mockBlockChain) SetQueueClient(q queue.Queue) {
case types.EventGetSeqByHash:
msg.Reply(client.NewMessage(blockchainKey, types.EventReplyQuery, &types.Int64{Data: 1}))
case types.EventGetBlockBySeq:
if req, ok := msg.GetData().(*types.Int64); ok {
// just for cover
if req.Data == 10 {
msg.Reply(client.NewMessage(blockchainKey, types.EventReplyQuery, &types.Reply{IsOk: false, Msg: []byte("not support")}))
}
msg.Reply(client.NewMessage(blockchainKey, types.EventReplyQuery, &types.BlockSeq{Num: 1}))
}
case types.EventIsSync:
msg.Reply(client.NewMessage(blockchainKey, types.EventReplyIsSync, &types.IsCaughtUp{}))
case types.EventIsNtpClockSync:
......
......@@ -200,21 +200,21 @@ func (_m *QueueProtocolAPI) GetBlockByHashes(param *types.ReqHashes) (*types.Blo
return r0, r1
}
// GetBlockHash provides a mock function with given fields: param
func (_m *QueueProtocolAPI) GetBlockHash(param *types.ReqInt) (*types.ReplyHash, error) {
// GetBlockBySeq provides a mock function with given fields: param
func (_m *QueueProtocolAPI) GetBlockBySeq(param *types.Int64) (*types.BlockSeq, error) {
ret := _m.Called(param)
var r0 *types.ReplyHash
if rf, ok := ret.Get(0).(func(*types.ReqInt) *types.ReplyHash); ok {
var r0 *types.BlockSeq
if rf, ok := ret.Get(0).(func(*types.Int64) *types.BlockSeq); ok {
r0 = rf(param)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ReplyHash)
r0 = ret.Get(0).(*types.BlockSeq)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(*types.ReqInt) error); ok {
if rf, ok := ret.Get(1).(func(*types.Int64) error); ok {
r1 = rf(param)
} else {
r1 = ret.Error(1)
......@@ -223,21 +223,21 @@ func (_m *QueueProtocolAPI) GetBlockHash(param *types.ReqInt) (*types.ReplyHash,
return r0, r1
}
// GetBlockOverview provides a mock function with given fields: param
func (_m *QueueProtocolAPI) GetBlockOverview(param *types.ReqHash) (*types.BlockOverview, error) {
// GetBlockHash provides a mock function with given fields: param
func (_m *QueueProtocolAPI) GetBlockHash(param *types.ReqInt) (*types.ReplyHash, error) {
ret := _m.Called(param)
var r0 *types.BlockOverview
if rf, ok := ret.Get(0).(func(*types.ReqHash) *types.BlockOverview); ok {
var r0 *types.ReplyHash
if rf, ok := ret.Get(0).(func(*types.ReqInt) *types.ReplyHash); ok {
r0 = rf(param)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.BlockOverview)
r0 = ret.Get(0).(*types.ReplyHash)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(*types.ReqHash) error); ok {
if rf, ok := ret.Get(1).(func(*types.ReqInt) error); ok {
r1 = rf(param)
} else {
r1 = ret.Error(1)
......@@ -246,21 +246,21 @@ func (_m *QueueProtocolAPI) GetBlockOverview(param *types.ReqHash) (*types.Block
return r0, r1
}
// GetBlockSequences provides a mock function with given fields: param
func (_m *QueueProtocolAPI) GetBlockSequences(param *types.ReqBlocks) (*types.BlockSequences, error) {
// GetBlockOverview provides a mock function with given fields: param
func (_m *QueueProtocolAPI) GetBlockOverview(param *types.ReqHash) (*types.BlockOverview, error) {
ret := _m.Called(param)
var r0 *types.BlockSequences
if rf, ok := ret.Get(0).(func(*types.ReqBlocks) *types.BlockSequences); ok {
var r0 *types.BlockOverview
if rf, ok := ret.Get(0).(func(*types.ReqHash) *types.BlockOverview); ok {
r0 = rf(param)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.BlockSequences)
r0 = ret.Get(0).(*types.BlockOverview)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(*types.ReqBlocks) error); ok {
if rf, ok := ret.Get(1).(func(*types.ReqHash) error); ok {
r1 = rf(param)
} else {
r1 = ret.Error(1)
......
......@@ -950,24 +950,22 @@ func (q *QueueProtocol) GetBlockByHashes(param *types.ReqHashes) (*types.BlockDe
return nil, err
}
// GetBlockSequences block执行序列号
func (q *QueueProtocol) GetBlockSequences(param *types.ReqBlocks) (*types.BlockSequences, error) {
// GetBlockBySeq get block detail and hash by seq
func (q *QueueProtocol) GetBlockBySeq(param *types.Int64) (*types.BlockSeq, error) {
if param == nil {
err := types.ErrInvalidParam
log.Error("GetBlockSequences", "Error", err)
log.Error("GetBlockBySeq", "Error", err)
return nil, err
}
msg, err := q.query(blockchainKey, types.EventGetBlockSequences, param)
msg, err := q.query(blockchainKey, types.EventGetBlockBySeq, param)
if err != nil {
log.Error("GetBlockSequences", "Error", err.Error())
log.Error("GetBlockBySeq", "Error", err.Error())
return nil, err
}
if reply, ok := msg.GetData().(*types.BlockSequences); ok {
if reply, ok := msg.GetData().(*types.BlockSeq); ok {
return reply, nil
}
err = types.ErrTypeAsset
log.Error("GetBlockSequences", "Error", err)
return nil, err
return nil, types.ErrTypeAsset
}
// QueryChain query chain
......
......@@ -807,6 +807,7 @@ func TestGRPC(t *testing.T) {
testGetAddrOverviewGRPC(t, &grpcMock)
testGetBlockHashGRPC(t, &grpcMock)
testGetSequenceByHashGRPC(t, &grpcMock)
testGetBlockBySeqGRPC(t, &grpcMock)
testGenSeedGRPC(t, &grpcMock)
testGetSeedGRPC(t, &grpcMock)
testSaveSeedGRPC(t, &grpcMock)
......@@ -818,6 +819,7 @@ func TestGRPC(t *testing.T) {
testIsSyncGRPC(t, &grpcMock)
testIsNtpClockSyncGRPC(t, &grpcMock)
testNetInfoGRPC(t, &grpcMock)
}
func testNetInfoGRPC(t *testing.T, rpc *mockGRPCSystem) {
......@@ -1140,3 +1142,21 @@ func testGetSequenceByHashGRPC(t *testing.T, rpc *mockGRPCSystem) {
t.Error("Call GetSequenceByHash Failed.", err)
}
}
func testGetBlockBySeqGRPC(t *testing.T, rpc *mockGRPCSystem) {
var res types.BlockSeq
//just for coverage
err := rpc.newRpcCtx("GetBlockBySeq", &types.Int64{Data: 1}, &res)
assert.Nil(t, err)
err = rpc.newRpcCtx("GetBlockBySeq", &types.Int64{Data: 10}, &res)
assert.NotNil(t, err)
}
func TestGetBlockBySeq(t *testing.T) {
q := client.QueueProtocol{}
_, err := q.GetBlockBySeq(nil)
assert.NotNil(t, err)
}
......@@ -107,10 +107,11 @@ type QueueProtocolAPI interface {
//types.EventGetLastBlockSequence:
GetLastBlockSequence() (*types.Int64, error)
//types.EventGetBlockSequences:
GetBlockSequences(param *types.ReqBlocks) (*types.BlockSequences, error)
//types.EventGetBlockByHashes:
GetBlockByHashes(param *types.ReqHashes) (*types.BlockDetails, error)
//types.EventGetBlockBySeq:
GetBlockBySeq(param *types.Int64) (*types.BlockSeq, error)
//types.EventGetSequenceByHash:
GetSequenceByHash(param *types.ReqHash) (*types.Int64, error)
......
......@@ -321,6 +321,12 @@ func (c *GrpcCtx) Run() (err error) {
*c.Res.(*types.Int64) = *reply
}
errRet = err
case "GetBlockBySeq":
reply, err := rpc.GetBlockBySeq(context.Background(), c.Params.(*types.Int64))
if err == nil {
*c.Res.(*types.BlockSeq) = *reply
}
errRet = err
default:
errRet = errors.New(fmt.Sprintf("Unsupport method %v", c.Method))
}
......
......@@ -344,11 +344,6 @@ func (g *Grpc) GetLastBlockSequence(ctx context.Context, in *pb.ReqNil) (*pb.Int
return g.cli.GetLastBlockSequence()
}
// GetBlockSequences get block sequeces
func (g *Grpc) GetBlockSequences(ctx context.Context, in *pb.ReqBlocks) (*pb.BlockSequences, error) {
return g.cli.GetBlockSequences(in)
}
// GetBlockByHashes get block by hashes
func (g *Grpc) GetBlockByHashes(ctx context.Context, in *pb.ReqHashes) (*pb.BlockDetails, error) {
return g.cli.GetBlockByHashes(in)
......@@ -359,6 +354,11 @@ func (g *Grpc) GetSequenceByHash(ctx context.Context, in *pb.ReqHash) (*pb.Int64
return g.cli.GetSequenceByHash(in)
}
// GetBlockBySeq get block with hash by seq
func (g *Grpc) GetBlockBySeq(ctx context.Context, in *pb.Int64) (*pb.BlockSeq, error) {
return g.cli.GetBlockBySeq(in)
}
// SignRawTx signature rawtransaction
func (g *Grpc) SignRawTx(ctx context.Context, in *pb.ReqSignRawTx) (*pb.ReplySignRawTx, error) {
return g.cli.SignRawTx(in)
......@@ -372,3 +372,8 @@ func (g *Grpc) QueryRandNum(ctx context.Context, in *pb.ReqRandHash) (*pb.ReplyH
}
return reply.(*pb.ReplyHash), nil
}
// GetFork get fork height by fork key
func (g *Grpc) GetFork(ctx context.Context, in *pb.ReqKey) (*pb.Int64, error) {
return &pb.Int64{Data: pb.GetFork(string(in.Key))}, nil
}
......@@ -1051,22 +1051,6 @@ func (c *Chain33) GetLastBlockSequence(in *types.ReqNil, result *interface{}) er
return nil
}
// GetBlockSequences get the block loading sequence number information for the specified interval
func (c *Chain33) GetBlockSequences(in rpctypes.BlockParam, result *interface{}) error {
resp, err := c.cli.GetBlockSequences(&types.ReqBlocks{Start: in.Start, End: in.End, IsDetail: in.Isdetail, Pid: []string{""}})
if err != nil {
return err
}
var BlkSeqs rpctypes.ReplyBlkSeqs
items := resp.GetItems()
for _, item := range items {
BlkSeqs.BlkSeqInfos = append(BlkSeqs.BlkSeqInfos, &rpctypes.ReplyBlkSeq{Hash: common.ToHex(item.GetHash()),
Type: item.GetType()})
}
*result = &BlkSeqs
return nil
}
// GetBlockByHashes get block information by hashes
func (c *Chain33) GetBlockByHashes(in rpctypes.ReqHashes, result *interface{}) error {
log.Warn("GetBlockByHashes", "hashes", in)
......
......@@ -1214,26 +1214,6 @@ func TestChain33_GetLastBlockSequence(t *testing.T) {
assert.Equal(t, int64(1), result2)
}
func TestChain33_GetBlockSequences(t *testing.T) {
api := new(mocks.QueueProtocolAPI)
client := newTestChain33(api)
var result interface{}
api.On("GetBlockSequences", mock.Anything).Return(nil, types.ErrInvalidParam)
err := client.GetBlockSequences(rpctypes.BlockParam{}, &result)
assert.NotNil(t, err)
api = new(mocks.QueueProtocolAPI)
client = newTestChain33(api)
var result2 interface{}
blocks := types.BlockSequences{}
blocks.Items = make([]*types.BlockSequence, 0)
blocks.Items = append(blocks.Items, &types.BlockSequence{Hash: []byte("h1"), Type: 1})
api.On("GetBlockSequences", mock.Anything).Return(&blocks, nil)
err = client.GetBlockSequences(rpctypes.BlockParam{}, &result2)
assert.Nil(t, err)
assert.Equal(t, 1, len(result2.(*rpctypes.ReplyBlkSeqs).BlkSeqInfos))
}
func TestChain33_GetBlockByHashes(t *testing.T) {
api := new(mocks.QueueProtocolAPI)
client := newTestChain33(api)
......
......@@ -175,6 +175,15 @@ func TestGrpc_Call(t *testing.T) {
assert.Equal(t, ret.IsOk, result.IsOk)
assert.Equal(t, ret.Msg, result.Msg)
rst, err := client.GetFork(ctx, &types.ReqKey{Key: []byte("ForkBlockHash")})
assert.Nil(t, err)
assert.Equal(t, int64(1), rst.Data)
api.On("GetBlockBySeq", mock.Anything).Return(&types.BlockSeq{}, nil)
blockSeq, err := client.GetBlockBySeq(ctx, &types.Int64{Data: 1})
assert.Nil(t, err)
assert.Equal(t, &types.BlockSeq{}, blockSeq)
server.Close()
mock.AssertExpectationsForObjects(t, api)
}
......@@ -138,6 +138,7 @@ const (
EventStoreListReply = 131
EventListBlockSeqCB = 132
EventGetSeqCBLastNum = 133
EventGetBlockBySeq = 134
//exec
EventBlockChainQuery = 212
......@@ -276,4 +277,6 @@ var eventName = map[int]string{
// Token
EventBlockChainQuery: "EventBlockChainQuery",
EventConsensusQuery: "EventConsensusQuery",
EventGetBlockBySeq: "EventGetBlockBySeq",
}
......@@ -402,6 +402,36 @@ func (_m *Chain33Client) GetBlockByHashes(ctx context.Context, in *types.ReqHash
return r0, r1
}
// GetBlockBySeq provides a mock function with given fields: ctx, in, opts
func (_m *Chain33Client) GetBlockBySeq(ctx context.Context, in *types.Int64, opts ...grpc.CallOption) (*types.BlockSeq, error) {
_va := make([]interface{}, len(opts))
for _i := range opts {
_va[_i] = opts[_i]
}
var _ca []interface{}
_ca = append(_ca, ctx, in)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 *types.BlockSeq
if rf, ok := ret.Get(0).(func(context.Context, *types.Int64, ...grpc.CallOption) *types.BlockSeq); ok {
r0 = rf(ctx, in, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.BlockSeq)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *types.Int64, ...grpc.CallOption) error); ok {
r1 = rf(ctx, in, opts...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetBlockHash provides a mock function with given fields: ctx, in, opts
func (_m *Chain33Client) GetBlockHash(ctx context.Context, in *types.ReqInt, opts ...grpc.CallOption) (*types.ReplyHash, error) {
_va := make([]interface{}, len(opts))
......@@ -462,8 +492,8 @@ func (_m *Chain33Client) GetBlockOverview(ctx context.Context, in *types.ReqHash
return r0, r1
}
// GetBlockSequences provides a mock function with given fields: ctx, in, opts
func (_m *Chain33Client) GetBlockSequences(ctx context.Context, in *types.ReqBlocks, opts ...grpc.CallOption) (*types.BlockSequences, error) {
// GetBlocks provides a mock function with given fields: ctx, in, opts
func (_m *Chain33Client) GetBlocks(ctx context.Context, in *types.ReqBlocks, opts ...grpc.CallOption) (*types.Reply, error) {
_va := make([]interface{}, len(opts))
for _i := range opts {
_va[_i] = opts[_i]
......@@ -473,12 +503,12 @@ func (_m *Chain33Client) GetBlockSequences(ctx context.Context, in *types.ReqBlo
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 *types.BlockSequences
if rf, ok := ret.Get(0).(func(context.Context, *types.ReqBlocks, ...grpc.CallOption) *types.BlockSequences); ok {
var r0 *types.Reply
if rf, ok := ret.Get(0).(func(context.Context, *types.ReqBlocks, ...grpc.CallOption) *types.Reply); ok {
r0 = rf(ctx, in, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.BlockSequences)
r0 = ret.Get(0).(*types.Reply)
}
}
......@@ -492,8 +522,8 @@ func (_m *Chain33Client) GetBlockSequences(ctx context.Context, in *types.ReqBlo
return r0, r1
}
// GetBlocks provides a mock function with given fields: ctx, in, opts
func (_m *Chain33Client) GetBlocks(ctx context.Context, in *types.ReqBlocks, opts ...grpc.CallOption) (*types.Reply, error) {
// GetFatalFailure provides a mock function with given fields: ctx, in, opts
func (_m *Chain33Client) GetFatalFailure(ctx context.Context, in *types.ReqNil, opts ...grpc.CallOption) (*types.Int32, error) {
_va := make([]interface{}, len(opts))
for _i := range opts {
_va[_i] = opts[_i]
......@@ -503,17 +533,17 @@ func (_m *Chain33Client) GetBlocks(ctx context.Context, in *types.ReqBlocks, opt
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 *types.Reply
if rf, ok := ret.Get(0).(func(context.Context, *types.ReqBlocks, ...grpc.CallOption) *types.Reply); ok {
var r0 *types.Int32
if rf, ok := ret.Get(0).(func(context.Context, *types.ReqNil, ...grpc.CallOption) *types.Int32); ok {
r0 = rf(ctx, in, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.Reply)
r0 = ret.Get(0).(*types.Int32)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *types.ReqBlocks, ...grpc.CallOption) error); ok {
if rf, ok := ret.Get(1).(func(context.Context, *types.ReqNil, ...grpc.CallOption) error); ok {
r1 = rf(ctx, in, opts...)
} else {
r1 = ret.Error(1)
......@@ -522,8 +552,8 @@ func (_m *Chain33Client) GetBlocks(ctx context.Context, in *types.ReqBlocks, opt
return r0, r1
}
// GetFatalFailure provides a mock function with given fields: ctx, in, opts
func (_m *Chain33Client) GetFatalFailure(ctx context.Context, in *types.ReqNil, opts ...grpc.CallOption) (*types.Int32, error) {
// GetFork provides a mock function with given fields: ctx, in, opts
func (_m *Chain33Client) GetFork(ctx context.Context, in *types.ReqKey, opts ...grpc.CallOption) (*types.Int64, error) {
_va := make([]interface{}, len(opts))
for _i := range opts {
_va[_i] = opts[_i]
......@@ -533,17 +563,17 @@ func (_m *Chain33Client) GetFatalFailure(ctx context.Context, in *types.ReqNil,
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 *types.Int32
if rf, ok := ret.Get(0).(func(context.Context, *types.ReqNil, ...grpc.CallOption) *types.Int32); ok {
var r0 *types.Int64
if rf, ok := ret.Get(0).(func(context.Context, *types.ReqKey, ...grpc.CallOption) *types.Int64); ok {
r0 = rf(ctx, in, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.Int32)
r0 = ret.Get(0).(*types.Int64)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *types.ReqNil, ...grpc.CallOption) error); ok {
if rf, ok := ret.Get(1).(func(context.Context, *types.ReqKey, ...grpc.CallOption) error); ok {
r1 = rf(ctx, in, opts...)
} else {
r1 = ret.Error(1)
......
......@@ -80,4 +80,4 @@ message VersionInfo {
string app = 2;
string chain33 = 3;
string localDb = 4;
}
\ No newline at end of file
}
......@@ -122,14 +122,15 @@ service chain33 {
rpc GetFatalFailure(types.ReqNil) returns (Int32) {}
rpc GetLastBlockSequence(ReqNil) returns (Int64) {}
//获取指定区间的block加载序列号信息
rpc GetBlockSequences(ReqBlocks) returns (BlockSequences) {}
// get add block's sequence by hash
rpc GetSequenceByHash(ReqHash) returns (Int64) {}
//通过block hash 获取对应的blocks信息
rpc GetBlockByHashes(ReqHashes) returns (BlockDetails) {}
//通过block seq 获取对应的blocks hash 信息
rpc GetBlockBySeq(Int64) returns (BlockSeq) {}
//关闭chain33
rpc CloseQueue(ReqNil) returns (Reply) {}
......@@ -142,4 +143,7 @@ service chain33 {
// 获取随机HASH
rpc QueryRandNum(ReqRandHash) returns (ReplyHash) {}
// 获取是否达到fork高度
rpc GetFork(ReqKey) returns (Int64) {}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment