Commit ebc21f9e authored by liuyuhang's avatar liuyuhang

modify kvmvccmavl update mod

parent 1a1f36c2
......@@ -135,6 +135,8 @@ name="kvmvccmavl"
driver="leveldb"
dbPath="datadir/mavltree"
dbCache=128
# store数据库版本
storedbVersion="1.0.0"
[store.sub.mavl]
enableMavlPrefix=false
......@@ -155,8 +157,6 @@ pruneHeight=10000
enableMemTree=true
# 是否使能mavl叶子节点数据载入内存
enableMemVal=true
# 是否使能升级kvmvcc(在mavl数据上)
enableUpdateKvmvcc=false
[wallet]
minFee=100000
......
......@@ -117,9 +117,9 @@ type RoundState struct {
// RoundStateMessage ...
func (rs *RoundState) RoundStateMessage() *tmtypes.NewRoundStepMsg {
return &tmtypes.NewRoundStepMsg{
Height: rs.Height,
Round: int32(rs.Round),
Step: int32(rs.Step),
Height: rs.Height,
Round: int32(rs.Round),
Step: int32(rs.Step),
SecondsSinceStartTime: int32(time.Since(rs.StartTime).Seconds()),
LastCommitRound: int32(rs.LastCommit.Round()),
}
......
......@@ -73,9 +73,9 @@ func ParseX509CertificateToSm2(x509Cert *x509.Certificate) *sm2.Certificate {
UnknownExtKeyUsage: x509Cert.UnknownExtKeyUsage,
BasicConstraintsValid: x509Cert.BasicConstraintsValid,
IsCA: x509Cert.IsCA,
MaxPathLen: x509Cert.MaxPathLen,
MaxPathLenZero: x509Cert.MaxPathLenZero,
IsCA: x509Cert.IsCA,
MaxPathLen: x509Cert.MaxPathLen,
MaxPathLenZero: x509Cert.MaxPathLenZero,
SubjectKeyId: x509Cert.SubjectKeyId,
AuthorityKeyId: x509Cert.AuthorityKeyId,
......@@ -136,9 +136,9 @@ func ParseSm2CertificateToX509(sm2Cert *sm2.Certificate) *x509.Certificate {
UnknownExtKeyUsage: sm2Cert.UnknownExtKeyUsage,
BasicConstraintsValid: sm2Cert.BasicConstraintsValid,
IsCA: sm2Cert.IsCA,
MaxPathLen: sm2Cert.MaxPathLen,
MaxPathLenZero: sm2Cert.MaxPathLenZero,
IsCA: sm2Cert.IsCA,
MaxPathLen: sm2Cert.MaxPathLen,
MaxPathLenZero: sm2Cert.MaxPathLenZero,
SubjectKeyId: sm2Cert.SubjectKeyId,
AuthorityKeyId: sm2Cert.AuthorityKeyId,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: norm.proto
/*
Package types is a generated protocol buffer package.
It is generated from these files:
norm.proto
It has these top-level messages:
Norm
NormAction
NormPut
NormGetKey
*/
package types
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
)
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
......@@ -22,39 +31,16 @@ var _ = math.Inf
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type Norm struct {
NormId []byte `protobuf:"bytes,1,opt,name=normId,proto3" json:"normId,omitempty"`
CreateTime int64 `protobuf:"varint,2,opt,name=createTime,proto3" json:"createTime,omitempty"`
Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Norm) Reset() { *m = Norm{} }
func (m *Norm) String() string { return proto.CompactTextString(m) }
func (*Norm) ProtoMessage() {}
func (*Norm) Descriptor() ([]byte, []int) {
return fileDescriptor_4c505000707f0293, []int{0}
}
func (m *Norm) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Norm.Unmarshal(m, b)
}
func (m *Norm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Norm.Marshal(b, m, deterministic)
}
func (m *Norm) XXX_Merge(src proto.Message) {
xxx_messageInfo_Norm.Merge(m, src)
}
func (m *Norm) XXX_Size() int {
return xxx_messageInfo_Norm.Size(m)
}
func (m *Norm) XXX_DiscardUnknown() {
xxx_messageInfo_Norm.DiscardUnknown(m)
NormId []byte `protobuf:"bytes,1,opt,name=normId,proto3" json:"normId,omitempty"`
CreateTime int64 `protobuf:"varint,2,opt,name=createTime" json:"createTime,omitempty"`
Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"`
}
var xxx_messageInfo_Norm proto.InternalMessageInfo
func (m *Norm) Reset() { *m = Norm{} }
func (m *Norm) String() string { return proto.CompactTextString(m) }
func (*Norm) ProtoMessage() {}
func (*Norm) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *Norm) GetNormId() []byte {
if m != nil {
......@@ -87,44 +73,21 @@ func (m *Norm) GetValue() []byte {
type NormAction struct {
// Types that are valid to be assigned to Value:
// *NormAction_Nput
Value isNormAction_Value `protobuf_oneof:"value"`
Ty int32 `protobuf:"varint,5,opt,name=ty,proto3" json:"ty,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *NormAction) Reset() { *m = NormAction{} }
func (m *NormAction) String() string { return proto.CompactTextString(m) }
func (*NormAction) ProtoMessage() {}
func (*NormAction) Descriptor() ([]byte, []int) {
return fileDescriptor_4c505000707f0293, []int{1}
}
func (m *NormAction) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_NormAction.Unmarshal(m, b)
}
func (m *NormAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_NormAction.Marshal(b, m, deterministic)
}
func (m *NormAction) XXX_Merge(src proto.Message) {
xxx_messageInfo_NormAction.Merge(m, src)
}
func (m *NormAction) XXX_Size() int {
return xxx_messageInfo_NormAction.Size(m)
}
func (m *NormAction) XXX_DiscardUnknown() {
xxx_messageInfo_NormAction.DiscardUnknown(m)
Value isNormAction_Value `protobuf_oneof:"value"`
Ty int32 `protobuf:"varint,5,opt,name=ty" json:"ty,omitempty"`
}
var xxx_messageInfo_NormAction proto.InternalMessageInfo
func (m *NormAction) Reset() { *m = NormAction{} }
func (m *NormAction) String() string { return proto.CompactTextString(m) }
func (*NormAction) ProtoMessage() {}
func (*NormAction) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
type isNormAction_Value interface {
isNormAction_Value()
}
type NormAction_Nput struct {
Nput *NormPut `protobuf:"bytes,1,opt,name=nput,proto3,oneof"`
Nput *NormPut `protobuf:"bytes,1,opt,name=nput,oneof"`
}
func (*NormAction_Nput) isNormAction_Value() {}
......@@ -195,7 +158,7 @@ func _NormAction_OneofSizer(msg proto.Message) (n int) {
switch x := m.Value.(type) {
case *NormAction_Nput:
s := proto.Size(x.Nput)
n += 1 // tag and wire
n += proto.SizeVarint(1<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case nil:
......@@ -206,37 +169,14 @@ func _NormAction_OneofSizer(msg proto.Message) (n int) {
}
type NormPut struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}
func (m *NormPut) Reset() { *m = NormPut{} }
func (m *NormPut) String() string { return proto.CompactTextString(m) }
func (*NormPut) ProtoMessage() {}
func (*NormPut) Descriptor() ([]byte, []int) {
return fileDescriptor_4c505000707f0293, []int{2}
}
func (m *NormPut) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_NormPut.Unmarshal(m, b)
}
func (m *NormPut) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_NormPut.Marshal(b, m, deterministic)
}
func (m *NormPut) XXX_Merge(src proto.Message) {
xxx_messageInfo_NormPut.Merge(m, src)
}
func (m *NormPut) XXX_Size() int {
return xxx_messageInfo_NormPut.Size(m)
}
func (m *NormPut) XXX_DiscardUnknown() {
xxx_messageInfo_NormPut.DiscardUnknown(m)
}
var xxx_messageInfo_NormPut proto.InternalMessageInfo
func (m *NormPut) Reset() { *m = NormPut{} }
func (m *NormPut) String() string { return proto.CompactTextString(m) }
func (*NormPut) ProtoMessage() {}
func (*NormPut) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
func (m *NormPut) GetKey() []byte {
if m != nil {
......@@ -253,36 +193,13 @@ func (m *NormPut) GetValue() []byte {
}
type NormGetKey struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *NormGetKey) Reset() { *m = NormGetKey{} }
func (m *NormGetKey) String() string { return proto.CompactTextString(m) }
func (*NormGetKey) ProtoMessage() {}
func (*NormGetKey) Descriptor() ([]byte, []int) {
return fileDescriptor_4c505000707f0293, []int{3}
}
func (m *NormGetKey) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_NormGetKey.Unmarshal(m, b)
}
func (m *NormGetKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_NormGetKey.Marshal(b, m, deterministic)
}
func (m *NormGetKey) XXX_Merge(src proto.Message) {
xxx_messageInfo_NormGetKey.Merge(m, src)
}
func (m *NormGetKey) XXX_Size() int {
return xxx_messageInfo_NormGetKey.Size(m)
}
func (m *NormGetKey) XXX_DiscardUnknown() {
xxx_messageInfo_NormGetKey.DiscardUnknown(m)
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
}
var xxx_messageInfo_NormGetKey proto.InternalMessageInfo
func (m *NormGetKey) Reset() { *m = NormGetKey{} }
func (m *NormGetKey) String() string { return proto.CompactTextString(m) }
func (*NormGetKey) ProtoMessage() {}
func (*NormGetKey) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
func (m *NormGetKey) GetKey() []byte {
if m != nil {
......@@ -298,9 +215,9 @@ func init() {
proto.RegisterType((*NormGetKey)(nil), "types.NormGetKey")
}
func init() { proto.RegisterFile("norm.proto", fileDescriptor_4c505000707f0293) }
func init() { proto.RegisterFile("norm.proto", fileDescriptor0) }
var fileDescriptor_4c505000707f0293 = []byte{
var fileDescriptor0 = []byte{
// 209 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xca, 0xcb, 0x2f, 0xca,
0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2d, 0xa9, 0x2c, 0x48, 0x2d, 0x56, 0x4a, 0xe3,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -33,11 +33,6 @@ var (
delMavlDataState int32
wg sync.WaitGroup
quit bool
// 用来阻塞查看当前是否需要升级数据库
done chan struct{}
// 使能mavl在当前区块基础上升级kvmvcc
enableUpdateKvmvcc bool
)
const (
......@@ -59,7 +54,6 @@ func DisableLog() {
func init() {
drivers.Reg("kvmvccmavl", New)
done = make(chan struct{}, 1)
}
// KVmMavlStore provide kvmvcc and mavl store interface implementation
......@@ -96,8 +90,7 @@ type subConfig struct {
// 是否使能内存树
EnableMemTree bool `json:"enableMemTree"`
// 是否使能内存树中叶子节点
EnableMemVal bool `json:"enableMemVal"`
EnableUpdateKvmvcc bool `json:"enableUpdateKvmvcc"`
EnableMemVal bool `json:"enableMemVal"`
}
// New construct KVMVCCStore module
......@@ -120,10 +113,6 @@ func New(cfg *types.Store, sub []byte) queue.Module {
subMavlcfg.EnableMemVal = subcfg.EnableMemVal
}
if subcfg.EnableUpdateKvmvcc {
enableUpdateKvmvcc = true
}
bs := drivers.NewBaseStore(cfg)
cache, err := lru.New(cacheSize)
if err != nil {
......@@ -261,41 +250,10 @@ func (kvmMavls *KVmMavlStore) IterateRangeByStateHash(statehash []byte, start []
// ProcEvent handles supported events
func (kvmMavls *KVmMavlStore) ProcEvent(msg *queue.Message) {
//msg.ReplyErr("KVmMavlStore", types.ErrActionNotSupport)
client := kvmMavls.GetQueueClient()
if msg != nil && msg.Ty == types.EventReExecBlock {
reData := msg.GetData().(*types.ReplyString)
if reData.Data == "over" {
kmlog.Info("ProcEvent update store over")
msg.ReplyErr("KVmMavlStore", nil)
done <- struct{}{}
return
}
} else if msg == nil {
if !enableUpdateKvmvcc {
return
}
height, err := kvmMavls.KVMVCCStore.GetMaxVersion()
if err != nil {
height = 0
} else {
height++
}
msg1 := client.NewMessage("blockchain", types.EventReExecBlock, &types.ReqInt{Height: height})
err = client.Send(msg1, true)
if err != nil {
return
}
resp, err := client.Wait(msg1)
if err != nil {
return
}
data := resp.GetData().(*types.ReplyString)
if data.Data == "need" {
//进程阻塞
<-done
}
if msg == nil {
return
}
msg.ReplyErr("KVmMavlStore", types.ErrActionNotSupport)
}
// MemSetUpgrade set kvs to the mem of KVmMavlStore module not cache the tree and return the StateHash
......
......@@ -19,11 +19,9 @@ import (
"github.com/33cn/chain33/common"
dbm "github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/queue"
qmocks "github.com/33cn/chain33/queue/mocks"
drivers "github.com/33cn/chain33/system/store"
"github.com/33cn/chain33/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
)
......@@ -539,10 +537,6 @@ func TestIterateRangeByStateHash(t *testing.T) {
assert.Equal(t, int64(0), resp.Amount)
}
type testClient struct {
qmocks.Client
}
func TestProcEvent(t *testing.T) {
dir, err := ioutil.TempDir("", "example")
assert.Nil(t, err)
......@@ -552,19 +546,6 @@ func TestProcEvent(t *testing.T) {
store := New(storeCfg, sub).(*KVmMavlStore)
assert.NotNil(t, store)
client := &qmocks.Client{}
client.On("Send", mock.Anything, mock.Anything).Return(nil)
client.On("Sub", mock.Anything, mock.Anything).Return(nil)
client.On("Recv", mock.Anything, mock.Anything).Return(nil)
client.On("NewMessage", mock.Anything, mock.Anything, mock.Anything).Return(nil).Once()
client.On("Wait", mock.Anything).Return(&queue.Message{Data: &types.ReplyString{Data: "other"}}, nil).Once()
store.SetQueueClient(client)
store.ProcEvent(nil)
enableUpdateKvmvcc = true
defer func() {
enableUpdateKvmvcc = false
}()
store.ProcEvent(nil)
store.ProcEvent(&queue.Message{})
}
......
......@@ -1092,7 +1092,7 @@ func (bs *BlockStore) SetUpgradeMeta(meta *types.UpgradeMeta) error {
return bs.db.SetSync(version.LocalDBMeta, verByte)
}
//SetStoreUpgradeMeta 获取存在blockchain中的Store的数据库版本号
//GetStoreUpgradeMeta 获取存在blockchain中的Store的数据库版本号
func (bs *BlockStore) GetStoreUpgradeMeta() (*types.UpgradeMeta, error) {
ver := types.UpgradeMeta{}
version, err := bs.db.Get(version.StoreDBMeta)
......
......@@ -128,6 +128,7 @@ func TestBlockChain(t *testing.T) {
testWriteBlockToDbTemp(t, blockchain)
testReadBlockToExec(t, blockchain)
testReExecBlock(t, blockchain)
testUpgradeStore(t, blockchain)
}
func testProcAddBlockMsg(t *testing.T, mock33 *testnode.Chain33Mock, blockchain *blockchain.BlockChain) {
......@@ -1117,3 +1118,9 @@ func testReExecBlock(t *testing.T, chain *blockchain.BlockChain) {
chain.ReExecBlock(0, curheight)
chainlog.Info("ReExecBlock end ---------------------")
}
func testUpgradeStore(t *testing.T, chain *blockchain.BlockChain) {
chainlog.Info("UpgradeStore begin ---------------------")
chain.UpgradeStore()
chainlog.Info("UpgradeStore end ---------------------")
}
......@@ -200,9 +200,9 @@ driver="leveldb"
dbPath="datadir/mavltree"
# Cache大小
dbCache=128
# 数据库版本
# local数据库版本
localdbVersion="1.0.0"
# 状态数据库版本
# store数据库版本
storedbVersion="1.0.0"
[store.sub.mavl]
......
......@@ -54,16 +54,16 @@ func SetLocalDBVersion(version string) {
//GetStoreDBVersion 数据库版本解析
/*
格式: v1.v2.v3
如果: v1 升级了, 那么意味着localdb 需要 重新 reindex
如果: v1 升级了, 那么意味着storedb 需要升级
*/
func GetStoreDBVersion() string {
return localversion
return storeversion
}
//SetStoreDBVersion 通过设置版本号,强制重建数据库
func SetStoreDBVersion(version string) {
if version != "" {
localversion = version
storeversion = version
}
}
......
......@@ -160,6 +160,26 @@ func decodeTx(hexstr string) (*types.Transaction, error) {
return &tx, nil
}
// SendRawTransaction send rawtransaction by p2p
func (c *channelClient) SendRawTransaction(param *types.SignedTx) (*types.Reply, error) {
if param == nil {
err := types.ErrInvalidParam
log.Error("SendRawTransaction", "Error", err)
return nil, err
}
var tx types.Transaction
err := types.Decode(param.GetUnsign(), &tx)
if err == nil {
tx.Signature = &types.Signature{
Ty: param.GetTy(),
Pubkey: param.GetPubkey(),
Signature: param.GetSign(),
}
return c.SendTx(&tx)
}
return nil, err
}
// GetAddrOverview get overview of address
func (c *channelClient) GetAddrOverview(parm *types.ReqAddr) (*types.AddrOverview, error) {
err := address.CheckAddress(parm.Addr)
......
......@@ -80,6 +80,11 @@ func (g *Grpc) CreateRawTxGroup(ctx context.Context, in *pb.CreateTransactionGro
return &pb.UnsignTx{Data: reply}, nil
}
// SendRawTransaction send rawtransaction
func (g *Grpc) SendRawTransaction(ctx context.Context, in *pb.SignedTx) (*pb.Reply, error) {
return g.cli.SendRawTransaction(in)
}
// QueryTransaction query transaction by grpc
func (g *Grpc) QueryTransaction(ctx context.Context, in *pb.ReqHash) (*pb.TransactionDetail, error) {
return g.cli.QueryTx(in)
......
......@@ -8,6 +8,7 @@ import (
"context"
"encoding/hex"
"encoding/json"
"fmt"
"time"
"github.com/33cn/chain33/common"
......@@ -82,6 +83,36 @@ func (c *Chain33) CreateNoBalanceTransaction(in *types.NoBalanceTx, result *stri
return nil
}
// SendRawTransaction send rawtransacion
func (c *Chain33) SendRawTransaction(in rpctypes.SignedTx, result *interface{}) error {
var stx types.SignedTx
var err error
stx.Pubkey, err = hex.DecodeString(in.Pubkey)
if err != nil {
return err
}
stx.Sign, err = hex.DecodeString(in.Sign)
if err != nil {
return err
}
stx.Unsign, err = hex.DecodeString(in.Unsign)
if err != nil {
return err
}
stx.Ty = in.Ty
reply, err := c.cli.SendRawTransaction(&stx)
if err != nil {
return err
}
if reply.IsOk {
*result = "0x" + hex.EncodeToString(reply.Msg)
return nil
}
return fmt.Errorf(string(reply.Msg))
}
// SendTransaction send transaction
func (c *Chain33) SendTransaction(in rpctypes.RawParm, result *interface{}) error {
var parm types.Transaction
......
......@@ -14,6 +14,7 @@ import (
"github.com/33cn/chain33/common"
dbm "github.com/33cn/chain33/common/db"
log "github.com/33cn/chain33/common/log/log15"
ty "github.com/33cn/chain33/system/store/mavl/db/types"
"github.com/33cn/chain33/types"
farm "github.com/dgryski/go-farm"
"github.com/golang/protobuf/proto"
......@@ -569,6 +570,13 @@ func updateGlobalMemTree(node *Node) {
Size: node.size,
}
if node.height == 0 {
if bytes.HasPrefix(node.key, ty.TicketPrefix) {
ticket := &ty.Ticket{}
err := proto.Unmarshal(node.value, ticket)
if err == nil && ticket.Status == ty.StatusCloseTicket { //ticket为close状态下不做存储
return
}
}
memN.data = make([][]byte, 4)
memN.data[3] = node.value
} else {
......@@ -594,6 +602,13 @@ func updateLocalMemTree(t *Tree, node *Node) {
Size: node.size,
}
if node.height == 0 {
if bytes.HasPrefix(node.key, ty.TicketPrefix) {
ticket := &ty.Ticket{}
err := proto.Unmarshal(node.value, ticket)
if err == nil && ticket.Status == ty.StatusCloseTicket { //ticket为close状态下不做存储
return
}
}
memN.data = make([][]byte, 4)
memN.data[3] = node.value
} else {
......
......@@ -81,8 +81,6 @@ type Consensus struct {
Genesis string `protobuf:"bytes,4,opt,name=genesis" json:"genesis,omitempty"`
HotkeyAddr string `protobuf:"bytes,5,opt,name=hotkeyAddr" json:"hotkeyAddr,omitempty"`
ForceMining bool `protobuf:"varint,6,opt,name=forceMining" json:"forceMining,omitempty"`
// 配置挖矿的合约名单
MinerExecs []string `protobuf:"bytes,7,rep,name=minerExecs" json:"minerExecs,omitempty"`
}
// Wallet 配置
......
......@@ -20,6 +20,8 @@ service chain33 {
//交易接口
rpc CreateRawTransaction(CreateTx) returns (UnsignTx) {}
rpc CreateRawTxGroup(CreateTransactionGroup) returns (UnsignTx) {}
//发送签名后交易
rpc SendRawTransaction(SignedTx) returns (Reply) {}
// 根据哈希查询交易
rpc QueryTransaction(ReqHash) returns (TransactionDetail) {}
// 发送交易
......
......@@ -76,6 +76,13 @@ message NoBalanceTx {
string expire = 4;
}
message SignedTx {
bytes unsign = 1;
bytes sign = 2;
bytes pubkey = 3;
int32 ty = 4;
}
message Transaction {
bytes execer = 1;
bytes payload = 2;
......
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