Commit c8eaee6f authored by vipwzw's avatar vipwzw Committed by 33cn

update 04/03

parent 7c5ce435
......@@ -171,7 +171,7 @@ proto:protobuf
protobuf: ## Generate protbuf file of types package
@cd types/proto && ./create_protobuf.sh && cd ../..
@find ./system/dapp -maxdepth 2 -type d -name proto -exec make -C {} \;
@find ./system/dapp ./system/store/mavl -maxdepth 2 -type d -name proto -exec make -C {} \;
depends: ## Generate depends file of types package
@find ./system/dapp -maxdepth 2 -type d -name cmd -exec make -C {} OUT="$(MKDIR)build/ci" FLAG= \;
......
......@@ -1092,6 +1092,31 @@ func (bs *BlockStore) SetUpgradeMeta(meta *types.UpgradeMeta) error {
return bs.db.SetSync(version.LocalDBMeta, verByte)
}
//GetStoreUpgradeMeta 获取存在blockchain中的Store的数据库版本号
func (bs *BlockStore) GetStoreUpgradeMeta() (*types.UpgradeMeta, error) {
ver := types.UpgradeMeta{}
version, err := bs.db.Get(version.StoreDBMeta)
if err != nil && err != dbm.ErrNotFoundInDb {
return nil, err
}
if len(version) == 0 {
return &types.UpgradeMeta{Version: "0.0.0"}, nil
}
err = types.Decode(version, &ver)
if err != nil {
return nil, err
}
storeLog.Info("GetStoreUpgradeMeta", "blockchain db version", ver)
return &ver, nil
}
//SetStoreUpgradeMeta 设置blockchain中的Store的数据库版本号
func (bs *BlockStore) SetStoreUpgradeMeta(meta *types.UpgradeMeta) error {
verByte := types.Encode(meta)
storeLog.Info("SetStoreUpgradeMeta", "meta", meta)
return bs.db.SetSync(version.StoreDBMeta, verByte)
}
//isRecordBlockSequence配置的合法性检测
func (bs *BlockStore) isRecordBlockSequenceValid(chain *BlockChain) {
lastHeight := bs.Height()
......
package blockchain_test
import (
"testing"
"io/ioutil"
"os"
"github.com/33cn/chain33/blockchain"
dbm "github.com/33cn/chain33/common/db"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestGetStoreUpgradeMeta(t *testing.T) {
dir, err := ioutil.TempDir("", "example")
assert.Nil(t, err)
defer os.RemoveAll(dir) // clean up
os.RemoveAll(dir) //删除已存在目录
blockStoreDB := dbm.NewDB("blockchain", "leveldb", dir, 100)
blockStore := blockchain.NewBlockStore(nil, blockStoreDB, nil)
require.NotNil(t, blockStore)
meta, err := blockStore.GetStoreUpgradeMeta()
require.NoError(t, err)
require.Equal(t, meta.Version, "0.0.0")
meta.Version = "1.0.0"
err = blockStore.SetStoreUpgradeMeta(meta)
require.NoError(t, err)
meta, err = blockStore.GetStoreUpgradeMeta()
require.NoError(t, err)
require.Equal(t, meta.Version, "1.0.0")
}
......@@ -128,7 +128,7 @@ func TestBlockChain(t *testing.T) {
testWriteBlockToDbTemp(t, blockchain)
testReadBlockToExec(t, blockchain)
testReExecBlock(t, blockchain)
testReExecBlockMsg(t, mock33, blockchain)
testUpgradeStore(t, blockchain)
}
func testProcAddBlockMsg(t *testing.T, mock33 *testnode.Chain33Mock, blockchain *blockchain.BlockChain) {
......@@ -1115,17 +1115,12 @@ func testWriteBlockToDbTemp(t *testing.T, chain *blockchain.BlockChain) {
func testReExecBlock(t *testing.T, chain *blockchain.BlockChain) {
chainlog.Info("ReExecBlock begin ---------------------")
curheight := chain.GetBlockHeight()
chain.ProcessReExecBlock(0, curheight)
chain.ReExecBlock(0, curheight)
chainlog.Info("ReExecBlock end ---------------------")
}
func testReExecBlockMsg(t *testing.T, mock33 *testnode.Chain33Mock, chain *blockchain.BlockChain) {
var err error
client := mock33.GetClient()
msg1 := client.NewMessage("blockchain", types.EventReExecBlock, &types.ReqInt{Height: 8})
err = client.Send(msg1, true)
require.NoError(t, err)
_, err = client.Wait(msg1)
require.NoError(t, err)
time.Sleep(time.Millisecond * 20)
func testUpgradeStore(t *testing.T, chain *blockchain.BlockChain) {
chainlog.Info("UpgradeStore begin ---------------------")
chain.UpgradeStore()
chainlog.Info("UpgradeStore end ---------------------")
}
......@@ -90,8 +90,6 @@ func (chain *BlockChain) ProcRecvMsg() {
case types.EventGetSeqCBLastNum:
go chain.processMsg(msg, reqnum, chain.getSeqCBLastNum)
case types.EventReExecBlock:
go chain.processMsg(msg, reqnum, chain.reExecBlock)
default:
go chain.processMsg(msg, reqnum, chain.unknowMsg)
}
......@@ -135,17 +133,6 @@ func (chain *BlockChain) getSeqCBLastNum(msg *queue.Message) {
msg.Reply(chain.client.NewMessage("rpc", types.EventGetSeqCBLastNum, lastNum))
}
func (chain *BlockChain) reExecBlock(msg *queue.Message) {
data := (msg.Data).(*types.ReqInt)
curHeight := chain.GetBlockHeight()
if curHeight < data.Height {
msg.Reply(chain.client.NewMessage("store", types.EventReExecBlock, &types.ReplyString{Data: "none"}))
return
}
msg.Reply(chain.client.NewMessage("store", types.EventReExecBlock, &types.ReplyString{Data: "need"}))
chain.ProcessReExecBlock(data.Height, curHeight)
}
func (chain *BlockChain) queryTx(msg *queue.Message) {
txhash := (msg.Data).(*types.ReqHash)
TransactionDetail, err := chain.ProcQueryTxMsg(txhash.Hash)
......
......@@ -10,8 +10,6 @@ import (
"math/big"
"sync/atomic"
"fmt"
"github.com/33cn/chain33/client/api"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common/difficulty"
......@@ -601,40 +599,6 @@ func (b *BlockChain) ProcessDelParaChainBlock(broadcast bool, blockdetail *types
return nil, true, false, nil
}
// ProcessReExecBlock 从对应高度本地重新执行区块
func (b *BlockChain) ProcessReExecBlock(startHeight, curHeight int64) {
var prevStateHash []byte
if startHeight > 0 {
blockdetail, err := b.GetBlock(startHeight - 1)
if err != nil {
panic(fmt.Sprintf("get height=%d err, this not allow fail", startHeight-1))
}
prevStateHash = blockdetail.Block.StateHash
}
for i := startHeight; i <= curHeight; i++ {
blockdetail, err := b.GetBlock(i)
if err != nil {
panic(fmt.Sprintf("get height=%d err, this not allow fail", i))
}
block := blockdetail.Block
err = execBlockUpgrade(b.client, prevStateHash, block, false)
if err != nil {
panic(fmt.Sprintf("execBlockEx height=%d err=%s, this not allow fail", i, err.Error()))
}
prevStateHash = block.StateHash
}
// 通知执行结束
msg := b.client.NewMessage("store", types.EventReExecBlock, &types.ReplyString{Data: "over"})
err := b.client.Send(msg, true)
if err != nil {
return
}
_, err = b.client.Wait(msg)
if err != nil {
return
}
}
// IsRecordFaultErr 检测此错误是否要记录到故障错误中
func IsRecordFaultErr(err error) bool {
return err != types.ErrFutureBlock && !api.IsGrpcError(err) && !api.IsQueueError(err)
......
......@@ -29,7 +29,7 @@ func (chain *BlockChain) UpgradeChain() {
}
if chain.needReIndex(meta) {
//如果没有开始重建index,那么先del all keys
if !meta.Indexing {
if !meta.Starting {
chainlog.Info("begin del all keys")
chain.blockStore.delAllKeys()
chainlog.Info("end del all keys")
......@@ -38,7 +38,7 @@ func (chain *BlockChain) UpgradeChain() {
//reindex 的过程中,会每个高度都去更新meta
chain.reIndex(start, curheight)
meta := &types.UpgradeMeta{
Indexing: false,
Starting: false,
Version: version.GetLocalDBVersion(),
Height: 0,
}
......@@ -59,7 +59,7 @@ func (chain *BlockChain) reIndex(start, end int64) {
}
func (chain *BlockChain) needReIndex(meta *types.UpgradeMeta) bool {
if meta.Indexing { //正在index
if meta.Starting { //正在index
return true
}
v1 := meta.Version
......@@ -89,7 +89,7 @@ func (chain *BlockChain) reIndexOne(height int64) error {
panic(err)
}
meta := &types.UpgradeMeta{
Indexing: true,
Starting: true,
Version: version.GetLocalDBVersion(),
Height: height + 1,
}
......
// Copyright Fuzamei Corp. 2018 All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package blockchain
import (
"strings"
"fmt"
"github.com/33cn/chain33/common/version"
"github.com/33cn/chain33/types"
)
// Upgrade 升级localDB和storeDB
func (chain *BlockChain) Upgrade() {
chain.UpgradeChain()
chain.UpgradeStore()
}
//UpgradeStore 升级storedb
func (chain *BlockChain) UpgradeStore() {
meta, err := chain.blockStore.GetStoreUpgradeMeta()
if err != nil {
panic(err)
}
curheight := chain.GetBlockHeight()
if curheight == -1 {
meta = &types.UpgradeMeta{
Version: version.GetStoreDBVersion(),
}
err = chain.blockStore.SetStoreUpgradeMeta(meta)
if err != nil {
panic(err)
}
}
if chain.needReExec(meta) {
start := meta.Height
//reExecBlock 的过程中,会每个高度都去更新meta
chain.ReExecBlock(start, curheight)
meta := &types.UpgradeMeta{
Starting: false,
Version: version.GetStoreDBVersion(),
Height: 0,
}
err = chain.blockStore.SetStoreUpgradeMeta(meta)
if err != nil {
panic(err)
}
}
}
// ReExecBlock 从对应高度本地重新执行区块
func (chain *BlockChain) ReExecBlock(startHeight, curHeight int64) {
var prevStateHash []byte
if startHeight > 0 {
blockdetail, err := chain.GetBlock(startHeight - 1)
if err != nil {
panic(fmt.Sprintf("get height=%d err, this not allow fail", startHeight-1))
}
prevStateHash = blockdetail.Block.StateHash
}
for i := startHeight; i <= curHeight; i++ {
blockdetail, err := chain.GetBlock(i)
if err != nil {
panic(fmt.Sprintf("get height=%d err, this not allow fail", i))
}
block := blockdetail.Block
err = execBlockUpgrade(chain.client, prevStateHash, block, false)
if err != nil {
panic(fmt.Sprintf("execBlockEx height=%d err=%s, this not allow fail", i, err.Error()))
}
prevStateHash = block.StateHash
//更新高度
err = chain.upgradeMeta(startHeight)
if err != nil {
panic(err)
}
}
}
func (chain *BlockChain) needReExec(meta *types.UpgradeMeta) bool {
if meta.Starting { //正在
return true
}
v1 := meta.Version
v2 := version.GetStoreDBVersion()
v1arr := strings.Split(v1, ".")
v2arr := strings.Split(v2, ".")
if len(v1arr) != 3 || len(v2arr) != 3 {
panic("upgrade store meta version error")
}
return v1arr[0] != v2arr[0]
}
func (chain *BlockChain) upgradeMeta(height int64) error {
meta := &types.UpgradeMeta{
Starting: true,
Version: version.GetStoreDBVersion(),
Height: height + 1,
}
return chain.blockStore.SetStoreUpgradeMeta(meta)
}
......@@ -200,8 +200,10 @@ driver="leveldb"
dbPath="datadir/mavltree"
# Cache大小
dbCache=128
# 数据库版本
# local数据库版本
localdbVersion="1.0.0"
# store数据库版本
storedbVersion="1.0.0"
[store.sub.mavl]
# 是否使能mavl加前缀
......
......@@ -12,8 +12,10 @@ var (
WalletVerKey = []byte("WalletVerKey")
BlockChainVerKey = []byte("BlockChainVerKey")
LocalDBMeta = []byte("LocalDBMeta")
StoreDBMeta = []byte("StoreDBMeta")
MavlTreeVerKey = []byte("MavlTreeVerKey")
localversion = "1.0.0"
storeversion = "1.0.0"
appversion = "1.0.0"
GitCommit string
)
......@@ -49,6 +51,22 @@ func SetLocalDBVersion(version string) {
}
}
//GetStoreDBVersion 数据库版本解析
/*
格式: v1.v2.v3
如果: v1 升级了, 那么意味着storedb 需要升级
*/
func GetStoreDBVersion() string {
return storeversion
}
//SetStoreDBVersion 通过设置版本号,强制重建数据库
func SetStoreDBVersion(version string) {
if version != "" {
storeversion = version
}
}
//GetAppVersion 获取应用 app 的版本
func GetAppVersion() string {
return appversion
......
......@@ -12,7 +12,6 @@ func init() {
type feePlugin struct {
pluginBase
fee types.TotalFee
}
func (p *feePlugin) CheckEnable(executor *executor, enable bool) (kvs []*types.KeyValue, ok bool, err error) {
......@@ -20,13 +19,13 @@ func (p *feePlugin) CheckEnable(executor *executor, enable bool) (kvs []*types.K
}
func (p *feePlugin) ExecLocal(executor *executor, data *types.BlockDetail) ([]*types.KeyValue, error) {
p.fee = types.TotalFee{}
fee := &types.TotalFee{}
for i := 0; i < len(data.Block.Txs); i++ {
tx := data.Block.Txs[i]
p.fee.Fee += tx.Fee
p.fee.TxCount++
fee.Fee += tx.Fee
fee.TxCount++
}
kv, err := saveFee(executor, &p.fee, data.Block.ParentHash, data.Block.Hash())
kv, err := saveFee(executor, fee, data.Block.ParentHash, data.Block.Hash())
if err != nil {
return nil, err
}
......
......@@ -284,7 +284,7 @@ func (d *DownloadJob) syncDownloadBlock(peer *Peer, inv *pb.Inventory, bchan cha
RECV:
for _, item := range invdatas.Items {
bchan <- &pb.BlockPid{Pid: peer.GetPeerName(), Block: item.GetBlock()} //下载完成后插入bchan
log.Debug("download", "frompeer", peer.Addr(), "blockheight", inv.GetHeight(), "Blocksize", item.GetBlock().XXX_Size())
log.Debug("download", "frompeer", peer.Addr(), "blockheight", inv.GetHeight(), "Blocksize", item.GetBlock().Size())
}
}
}
......@@ -86,9 +86,6 @@ func (store *BaseStore) SetQueueClient(c queue.Client) {
}
store.done <- struct{}{}
}()
if store.child != nil {
store.child.ProcEvent(nil)
}
}
//Wait wait for basestore ready
......
#!/bin/sh
protoc --go_out=plugins=grpc:../ticket ./*.proto --proto_path=. --proto_path="$GOPATH/src/github.com/33cn/chain33/types/proto/"
syntax = "proto3";
package ticket;
message Ticket {
string ticketId = 1;
// 0 -> 未成熟 1 -> 可挖矿 2 -> 已挖成功 3-> 已关闭
int32 status = 2;
// genesis 创建的私钥比较特殊
bool isGenesis = 3;
//创建时间
int64 createTime = 4;
//挖矿时间
int64 minerTime = 5;
//挖到的币的数目
int64 minerValue = 8;
string minerAddress = 6;
// return wallet
string returnAddress = 7;
}
\ No newline at end of file
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package types
package ticket
var (
// TicketPrefix ticket prefix
......
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: ticket.proto
package ticket
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type Ticket struct {
TicketId string `protobuf:"bytes,1,opt,name=ticketId,proto3" json:"ticketId,omitempty"`
// 0 -> 未成熟 1 -> 可挖矿 2 -> 已挖成功 3-> 已关闭
Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
// genesis 创建的私钥比较特殊
IsGenesis bool `protobuf:"varint,3,opt,name=isGenesis,proto3" json:"isGenesis,omitempty"`
//创建时间
CreateTime int64 `protobuf:"varint,4,opt,name=createTime,proto3" json:"createTime,omitempty"`
//挖矿时间
MinerTime int64 `protobuf:"varint,5,opt,name=minerTime,proto3" json:"minerTime,omitempty"`
//挖到的币的数目
MinerValue int64 `protobuf:"varint,8,opt,name=minerValue,proto3" json:"minerValue,omitempty"`
MinerAddress string `protobuf:"bytes,6,opt,name=minerAddress,proto3" json:"minerAddress,omitempty"`
// return wallet
ReturnAddress string `protobuf:"bytes,7,opt,name=returnAddress,proto3" json:"returnAddress,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Ticket) Reset() { *m = Ticket{} }
func (m *Ticket) String() string { return proto.CompactTextString(m) }
func (*Ticket) ProtoMessage() {}
func (*Ticket) Descriptor() ([]byte, []int) {
return fileDescriptor_98a6c21780e82d22, []int{0}
}
func (m *Ticket) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Ticket.Unmarshal(m, b)
}
func (m *Ticket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Ticket.Marshal(b, m, deterministic)
}
func (m *Ticket) XXX_Merge(src proto.Message) {
xxx_messageInfo_Ticket.Merge(m, src)
}
func (m *Ticket) XXX_Size() int {
return xxx_messageInfo_Ticket.Size(m)
}
func (m *Ticket) XXX_DiscardUnknown() {
xxx_messageInfo_Ticket.DiscardUnknown(m)
}
var xxx_messageInfo_Ticket proto.InternalMessageInfo
func (m *Ticket) GetTicketId() string {
if m != nil {
return m.TicketId
}
return ""
}
func (m *Ticket) GetStatus() int32 {
if m != nil {
return m.Status
}
return 0
}
func (m *Ticket) GetIsGenesis() bool {
if m != nil {
return m.IsGenesis
}
return false
}
func (m *Ticket) GetCreateTime() int64 {
if m != nil {
return m.CreateTime
}
return 0
}
func (m *Ticket) GetMinerTime() int64 {
if m != nil {
return m.MinerTime
}
return 0
}
func (m *Ticket) GetMinerValue() int64 {
if m != nil {
return m.MinerValue
}
return 0
}
func (m *Ticket) GetMinerAddress() string {
if m != nil {
return m.MinerAddress
}
return ""
}
func (m *Ticket) GetReturnAddress() string {
if m != nil {
return m.ReturnAddress
}
return ""
}
func init() {
proto.RegisterType((*Ticket)(nil), "ticket.Ticket")
}
func init() { proto.RegisterFile("ticket.proto", fileDescriptor_98a6c21780e82d22) }
var fileDescriptor_98a6c21780e82d22 = []byte{
// 196 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xb1, 0xae, 0x82, 0x30,
0x14, 0x86, 0x53, 0xb8, 0xf4, 0xc2, 0x09, 0x77, 0xe9, 0x70, 0xd3, 0x18, 0x63, 0x1a, 0xe2, 0xd0,
0xc9, 0xc5, 0x27, 0x70, 0x32, 0xae, 0x0d, 0x71, 0x47, 0x38, 0x43, 0xa3, 0x80, 0x69, 0xcb, 0x0b,
0xf8, 0xe4, 0x86, 0x83, 0x8a, 0x6c, 0xfd, 0xbe, 0xff, 0xff, 0x93, 0xe6, 0x40, 0x1e, 0x6c, 0x7d,
0xc5, 0xb0, 0xbb, 0xbb, 0x3e, 0xf4, 0x82, 0x4f, 0x54, 0x3c, 0x22, 0xe0, 0x25, 0x3d, 0xc5, 0x0a,
0xd2, 0x49, 0x9e, 0x1a, 0xc9, 0x14, 0xd3, 0x99, 0xf9, 0xb0, 0xf8, 0x07, 0xee, 0x43, 0x15, 0x06,
0x2f, 0x23, 0xc5, 0x74, 0x62, 0x5e, 0x24, 0xd6, 0x90, 0x59, 0x7f, 0xc4, 0x0e, 0xbd, 0xf5, 0x32,
0x56, 0x4c, 0xa7, 0x66, 0x16, 0x62, 0x03, 0x50, 0x3b, 0xac, 0x02, 0x96, 0xb6, 0x45, 0xf9, 0xa3,
0x98, 0x8e, 0xcd, 0x97, 0x19, 0xd7, 0xad, 0xed, 0xd0, 0x51, 0x9c, 0x50, 0x3c, 0x8b, 0x71, 0x4d,
0x70, 0xae, 0x6e, 0x03, 0xca, 0x74, 0x5a, 0xcf, 0x46, 0x14, 0x90, 0x13, 0x1d, 0x9a, 0xc6, 0xa1,
0xf7, 0x92, 0xd3, 0x9f, 0x17, 0x4e, 0x6c, 0xe1, 0xcf, 0x61, 0x18, 0x5c, 0xf7, 0x2e, 0xfd, 0x52,
0x69, 0x29, 0x2f, 0x9c, 0x6e, 0xb2, 0x7f, 0x06, 0x00, 0x00, 0xff, 0xff, 0x90, 0x22, 0xb8, 0x7d,
0x23, 0x01, 0x00, 0x00,
}
......@@ -14,7 +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/system/store/mavl/db/ticket"
"github.com/33cn/chain33/types"
farm "github.com/dgryski/go-farm"
"github.com/golang/protobuf/proto"
......@@ -570,10 +570,10 @@ 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状态下不做存储
if bytes.HasPrefix(node.key, ticket.TicketPrefix) {
tk := &ticket.Ticket{}
err := proto.Unmarshal(node.value, tk)
if err == nil && tk.Status == ticket.StatusCloseTicket { //ticket为close状态下不做存储
return
}
}
......@@ -602,10 +602,10 @@ 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状态下不做存储
if bytes.HasPrefix(node.key, ticket.TicketPrefix) {
tk := &ticket.Ticket{}
err := proto.Unmarshal(node.value, tk)
if err == nil && tk.Status == ticket.StatusCloseTicket { //ticket为close状态下不做存储
return
}
}
......
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: ticket.proto
package types
import (
context "context"
fmt "fmt"
math "math"
types "github.com/33cn/chain33/types"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type Ticket struct {
TicketId string `protobuf:"bytes,1,opt,name=ticketId,proto3" json:"ticketId,omitempty"`
// 0 -> 未成熟 1 -> 可挖矿 2 -> 已挖成功 3-> 已关闭
Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
// genesis 创建的私钥比较特殊
IsGenesis bool `protobuf:"varint,3,opt,name=isGenesis,proto3" json:"isGenesis,omitempty"`
//创建时间
CreateTime int64 `protobuf:"varint,4,opt,name=createTime,proto3" json:"createTime,omitempty"`
//挖矿时间
MinerTime int64 `protobuf:"varint,5,opt,name=minerTime,proto3" json:"minerTime,omitempty"`
//挖到的币的数目
MinerValue int64 `protobuf:"varint,8,opt,name=minerValue,proto3" json:"minerValue,omitempty"`
MinerAddress string `protobuf:"bytes,6,opt,name=minerAddress,proto3" json:"minerAddress,omitempty"`
// return wallet
ReturnAddress string `protobuf:"bytes,7,opt,name=returnAddress,proto3" json:"returnAddress,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Ticket) Reset() { *m = Ticket{} }
func (m *Ticket) String() string { return proto.CompactTextString(m) }
func (*Ticket) ProtoMessage() {}
func (*Ticket) Descriptor() ([]byte, []int) {
return fileDescriptor_98a6c21780e82d22, []int{0}
}
func (m *Ticket) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Ticket.Unmarshal(m, b)
}
func (m *Ticket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Ticket.Marshal(b, m, deterministic)
}
func (m *Ticket) XXX_Merge(src proto.Message) {
xxx_messageInfo_Ticket.Merge(m, src)
}
func (m *Ticket) XXX_Size() int {
return xxx_messageInfo_Ticket.Size(m)
}
func (m *Ticket) XXX_DiscardUnknown() {
xxx_messageInfo_Ticket.DiscardUnknown(m)
}
var xxx_messageInfo_Ticket proto.InternalMessageInfo
func (m *Ticket) GetTicketId() string {
if m != nil {
return m.TicketId
}
return ""
}
func (m *Ticket) GetStatus() int32 {
if m != nil {
return m.Status
}
return 0
}
func (m *Ticket) GetIsGenesis() bool {
if m != nil {
return m.IsGenesis
}
return false
}
func (m *Ticket) GetCreateTime() int64 {
if m != nil {
return m.CreateTime
}
return 0
}
func (m *Ticket) GetMinerTime() int64 {
if m != nil {
return m.MinerTime
}
return 0
}
func (m *Ticket) GetMinerValue() int64 {
if m != nil {
return m.MinerValue
}
return 0
}
func (m *Ticket) GetMinerAddress() string {
if m != nil {
return m.MinerAddress
}
return ""
}
func (m *Ticket) GetReturnAddress() string {
if m != nil {
return m.ReturnAddress
}
return ""
}
// message for execs.ticket
type TicketAction struct {
// Types that are valid to be assigned to Value:
// *TicketAction_Tbind
// *TicketAction_Topen
// *TicketAction_Genesis
// *TicketAction_Tclose
// *TicketAction_Miner
Value isTicketAction_Value `protobuf_oneof:"value"`
Ty int32 `protobuf:"varint,10,opt,name=ty,proto3" json:"ty,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TicketAction) Reset() { *m = TicketAction{} }
func (m *TicketAction) String() string { return proto.CompactTextString(m) }
func (*TicketAction) ProtoMessage() {}
func (*TicketAction) Descriptor() ([]byte, []int) {
return fileDescriptor_98a6c21780e82d22, []int{1}
}
func (m *TicketAction) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TicketAction.Unmarshal(m, b)
}
func (m *TicketAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TicketAction.Marshal(b, m, deterministic)
}
func (m *TicketAction) XXX_Merge(src proto.Message) {
xxx_messageInfo_TicketAction.Merge(m, src)
}
func (m *TicketAction) XXX_Size() int {
return xxx_messageInfo_TicketAction.Size(m)
}
func (m *TicketAction) XXX_DiscardUnknown() {
xxx_messageInfo_TicketAction.DiscardUnknown(m)
}
var xxx_messageInfo_TicketAction proto.InternalMessageInfo
type isTicketAction_Value interface {
isTicketAction_Value()
}
type TicketAction_Tbind struct {
Tbind *TicketBind `protobuf:"bytes,5,opt,name=tbind,proto3,oneof"`
}
type TicketAction_Topen struct {
Topen *TicketOpen `protobuf:"bytes,1,opt,name=topen,proto3,oneof"`
}
type TicketAction_Genesis struct {
Genesis *TicketGenesis `protobuf:"bytes,2,opt,name=genesis,proto3,oneof"`
}
type TicketAction_Tclose struct {
Tclose *TicketClose `protobuf:"bytes,3,opt,name=tclose,proto3,oneof"`
}
type TicketAction_Miner struct {
Miner *TicketMiner `protobuf:"bytes,4,opt,name=miner,proto3,oneof"`
}
func (*TicketAction_Tbind) isTicketAction_Value() {}
func (*TicketAction_Topen) isTicketAction_Value() {}
func (*TicketAction_Genesis) isTicketAction_Value() {}
func (*TicketAction_Tclose) isTicketAction_Value() {}
func (*TicketAction_Miner) isTicketAction_Value() {}
func (m *TicketAction) GetValue() isTicketAction_Value {
if m != nil {
return m.Value
}
return nil
}
func (m *TicketAction) GetTbind() *TicketBind {
if x, ok := m.GetValue().(*TicketAction_Tbind); ok {
return x.Tbind
}
return nil
}
func (m *TicketAction) GetTopen() *TicketOpen {
if x, ok := m.GetValue().(*TicketAction_Topen); ok {
return x.Topen
}
return nil
}
func (m *TicketAction) GetGenesis() *TicketGenesis {
if x, ok := m.GetValue().(*TicketAction_Genesis); ok {
return x.Genesis
}
return nil
}
func (m *TicketAction) GetTclose() *TicketClose {
if x, ok := m.GetValue().(*TicketAction_Tclose); ok {
return x.Tclose
}
return nil
}
func (m *TicketAction) GetMiner() *TicketMiner {
if x, ok := m.GetValue().(*TicketAction_Miner); ok {
return x.Miner
}
return nil
}
func (m *TicketAction) GetTy() int32 {
if m != nil {
return m.Ty
}
return 0
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*TicketAction) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _TicketAction_OneofMarshaler, _TicketAction_OneofUnmarshaler, _TicketAction_OneofSizer, []interface{}{
(*TicketAction_Tbind)(nil),
(*TicketAction_Topen)(nil),
(*TicketAction_Genesis)(nil),
(*TicketAction_Tclose)(nil),
(*TicketAction_Miner)(nil),
}
}
func _TicketAction_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*TicketAction)
// value
switch x := m.Value.(type) {
case *TicketAction_Tbind:
b.EncodeVarint(5<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Tbind); err != nil {
return err
}
case *TicketAction_Topen:
b.EncodeVarint(1<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Topen); err != nil {
return err
}
case *TicketAction_Genesis:
b.EncodeVarint(2<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Genesis); err != nil {
return err
}
case *TicketAction_Tclose:
b.EncodeVarint(3<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Tclose); err != nil {
return err
}
case *TicketAction_Miner:
b.EncodeVarint(4<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Miner); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("TicketAction.Value has unexpected type %T", x)
}
return nil
}
func _TicketAction_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*TicketAction)
switch tag {
case 5: // value.tbind
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(TicketBind)
err := b.DecodeMessage(msg)
m.Value = &TicketAction_Tbind{msg}
return true, err
case 1: // value.topen
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(TicketOpen)
err := b.DecodeMessage(msg)
m.Value = &TicketAction_Topen{msg}
return true, err
case 2: // value.genesis
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(TicketGenesis)
err := b.DecodeMessage(msg)
m.Value = &TicketAction_Genesis{msg}
return true, err
case 3: // value.tclose
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(TicketClose)
err := b.DecodeMessage(msg)
m.Value = &TicketAction_Tclose{msg}
return true, err
case 4: // value.miner
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(TicketMiner)
err := b.DecodeMessage(msg)
m.Value = &TicketAction_Miner{msg}
return true, err
default:
return false, nil
}
}
func _TicketAction_OneofSizer(msg proto.Message) (n int) {
m := msg.(*TicketAction)
// value
switch x := m.Value.(type) {
case *TicketAction_Tbind:
s := proto.Size(x.Tbind)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *TicketAction_Topen:
s := proto.Size(x.Topen)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *TicketAction_Genesis:
s := proto.Size(x.Genesis)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *TicketAction_Tclose:
s := proto.Size(x.Tclose)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *TicketAction_Miner:
s := proto.Size(x.Miner)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
type TicketMiner struct {
Bits uint32 `protobuf:"varint,1,opt,name=bits,proto3" json:"bits,omitempty"`
Reward int64 `protobuf:"varint,2,opt,name=reward,proto3" json:"reward,omitempty"`
TicketId string `protobuf:"bytes,3,opt,name=ticketId,proto3" json:"ticketId,omitempty"`
Modify []byte `protobuf:"bytes,4,opt,name=modify,proto3" json:"modify,omitempty"`
//挖到区块时公开
PrivHash []byte `protobuf:"bytes,5,opt,name=privHash,proto3" json:"privHash,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TicketMiner) Reset() { *m = TicketMiner{} }
func (m *TicketMiner) String() string { return proto.CompactTextString(m) }
func (*TicketMiner) ProtoMessage() {}
func (*TicketMiner) Descriptor() ([]byte, []int) {
return fileDescriptor_98a6c21780e82d22, []int{2}
}
func (m *TicketMiner) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TicketMiner.Unmarshal(m, b)
}
func (m *TicketMiner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TicketMiner.Marshal(b, m, deterministic)
}
func (m *TicketMiner) XXX_Merge(src proto.Message) {
xxx_messageInfo_TicketMiner.Merge(m, src)
}
func (m *TicketMiner) XXX_Size() int {
return xxx_messageInfo_TicketMiner.Size(m)
}
func (m *TicketMiner) XXX_DiscardUnknown() {
xxx_messageInfo_TicketMiner.DiscardUnknown(m)
}
var xxx_messageInfo_TicketMiner proto.InternalMessageInfo
func (m *TicketMiner) GetBits() uint32 {
if m != nil {
return m.Bits
}
return 0
}
func (m *TicketMiner) GetReward() int64 {
if m != nil {
return m.Reward
}
return 0
}
func (m *TicketMiner) GetTicketId() string {
if m != nil {
return m.TicketId
}
return ""
}
func (m *TicketMiner) GetModify() []byte {
if m != nil {
return m.Modify
}
return nil
}
func (m *TicketMiner) GetPrivHash() []byte {
if m != nil {
return m.PrivHash
}
return nil
}
type TicketMinerOld struct {
Bits uint32 `protobuf:"varint,1,opt,name=bits,proto3" json:"bits,omitempty"`
Reward int64 `protobuf:"varint,2,opt,name=reward,proto3" json:"reward,omitempty"`
TicketId string `protobuf:"bytes,3,opt,name=ticketId,proto3" json:"ticketId,omitempty"`
Modify []byte `protobuf:"bytes,4,opt,name=modify,proto3" json:"modify,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TicketMinerOld) Reset() { *m = TicketMinerOld{} }
func (m *TicketMinerOld) String() string { return proto.CompactTextString(m) }
func (*TicketMinerOld) ProtoMessage() {}
func (*TicketMinerOld) Descriptor() ([]byte, []int) {
return fileDescriptor_98a6c21780e82d22, []int{3}
}
func (m *TicketMinerOld) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TicketMinerOld.Unmarshal(m, b)
}
func (m *TicketMinerOld) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TicketMinerOld.Marshal(b, m, deterministic)
}
func (m *TicketMinerOld) XXX_Merge(src proto.Message) {
xxx_messageInfo_TicketMinerOld.Merge(m, src)
}
func (m *TicketMinerOld) XXX_Size() int {
return xxx_messageInfo_TicketMinerOld.Size(m)
}
func (m *TicketMinerOld) XXX_DiscardUnknown() {
xxx_messageInfo_TicketMinerOld.DiscardUnknown(m)
}
var xxx_messageInfo_TicketMinerOld proto.InternalMessageInfo
func (m *TicketMinerOld) GetBits() uint32 {
if m != nil {
return m.Bits
}
return 0
}
func (m *TicketMinerOld) GetReward() int64 {
if m != nil {
return m.Reward
}
return 0
}
func (m *TicketMinerOld) GetTicketId() string {
if m != nil {
return m.TicketId
}
return ""
}
func (m *TicketMinerOld) GetModify() []byte {
if m != nil {
return m.Modify
}
return nil
}
type MinerFlag struct {
Flag int32 `protobuf:"varint,1,opt,name=flag,proto3" json:"flag,omitempty"`
Reserve int64 `protobuf:"varint,2,opt,name=reserve,proto3" json:"reserve,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *MinerFlag) Reset() { *m = MinerFlag{} }
func (m *MinerFlag) String() string { return proto.CompactTextString(m) }
func (*MinerFlag) ProtoMessage() {}
func (*MinerFlag) Descriptor() ([]byte, []int) {
return fileDescriptor_98a6c21780e82d22, []int{4}
}
func (m *MinerFlag) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_MinerFlag.Unmarshal(m, b)
}
func (m *MinerFlag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_MinerFlag.Marshal(b, m, deterministic)
}
func (m *MinerFlag) XXX_Merge(src proto.Message) {
xxx_messageInfo_MinerFlag.Merge(m, src)
}
func (m *MinerFlag) XXX_Size() int {
return xxx_messageInfo_MinerFlag.Size(m)
}
func (m *MinerFlag) XXX_DiscardUnknown() {
xxx_messageInfo_MinerFlag.DiscardUnknown(m)
}
var xxx_messageInfo_MinerFlag proto.InternalMessageInfo
func (m *MinerFlag) GetFlag() int32 {
if m != nil {
return m.Flag
}
return 0
}
func (m *MinerFlag) GetReserve() int64 {
if m != nil {
return m.Reserve
}
return 0
}
type TicketBind struct {
MinerAddress string `protobuf:"bytes,1,opt,name=minerAddress,proto3" json:"minerAddress,omitempty"`
ReturnAddress string `protobuf:"bytes,2,opt,name=returnAddress,proto3" json:"returnAddress,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TicketBind) Reset() { *m = TicketBind{} }
func (m *TicketBind) String() string { return proto.CompactTextString(m) }
func (*TicketBind) ProtoMessage() {}
func (*TicketBind) Descriptor() ([]byte, []int) {
return fileDescriptor_98a6c21780e82d22, []int{5}
}
func (m *TicketBind) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TicketBind.Unmarshal(m, b)
}
func (m *TicketBind) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TicketBind.Marshal(b, m, deterministic)
}
func (m *TicketBind) XXX_Merge(src proto.Message) {
xxx_messageInfo_TicketBind.Merge(m, src)
}
func (m *TicketBind) XXX_Size() int {
return xxx_messageInfo_TicketBind.Size(m)
}
func (m *TicketBind) XXX_DiscardUnknown() {
xxx_messageInfo_TicketBind.DiscardUnknown(m)
}
var xxx_messageInfo_TicketBind proto.InternalMessageInfo
func (m *TicketBind) GetMinerAddress() string {
if m != nil {
return m.MinerAddress
}
return ""
}
func (m *TicketBind) GetReturnAddress() string {
if m != nil {
return m.ReturnAddress
}
return ""
}
type TicketOpen struct {
//用户挖矿的ticket 地址
MinerAddress string `protobuf:"bytes,1,opt,name=minerAddress,proto3" json:"minerAddress,omitempty"`
//购买ticket的数目
Count int32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
//币实际存储的地址
ReturnAddress string `protobuf:"bytes,3,opt,name=returnAddress,proto3" json:"returnAddress,omitempty"`
//随机种子
RandSeed int64 `protobuf:"varint,4,opt,name=randSeed,proto3" json:"randSeed,omitempty"`
//购买ticket时公开
PubHashes [][]byte `protobuf:"bytes,5,rep,name=pubHashes,proto3" json:"pubHashes,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TicketOpen) Reset() { *m = TicketOpen{} }
func (m *TicketOpen) String() string { return proto.CompactTextString(m) }
func (*TicketOpen) ProtoMessage() {}
func (*TicketOpen) Descriptor() ([]byte, []int) {
return fileDescriptor_98a6c21780e82d22, []int{6}
}
func (m *TicketOpen) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TicketOpen.Unmarshal(m, b)
}
func (m *TicketOpen) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TicketOpen.Marshal(b, m, deterministic)
}
func (m *TicketOpen) XXX_Merge(src proto.Message) {
xxx_messageInfo_TicketOpen.Merge(m, src)
}
func (m *TicketOpen) XXX_Size() int {
return xxx_messageInfo_TicketOpen.Size(m)
}
func (m *TicketOpen) XXX_DiscardUnknown() {
xxx_messageInfo_TicketOpen.DiscardUnknown(m)
}
var xxx_messageInfo_TicketOpen proto.InternalMessageInfo
func (m *TicketOpen) GetMinerAddress() string {
if m != nil {
return m.MinerAddress
}
return ""
}
func (m *TicketOpen) GetCount() int32 {
if m != nil {
return m.Count
}
return 0
}
func (m *TicketOpen) GetReturnAddress() string {
if m != nil {
return m.ReturnAddress
}
return ""
}
func (m *TicketOpen) GetRandSeed() int64 {
if m != nil {
return m.RandSeed
}
return 0
}
func (m *TicketOpen) GetPubHashes() [][]byte {
if m != nil {
return m.PubHashes
}
return nil
}
type TicketGenesis struct {
MinerAddress string `protobuf:"bytes,1,opt,name=minerAddress,proto3" json:"minerAddress,omitempty"`
ReturnAddress string `protobuf:"bytes,2,opt,name=returnAddress,proto3" json:"returnAddress,omitempty"`
Count int32 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TicketGenesis) Reset() { *m = TicketGenesis{} }
func (m *TicketGenesis) String() string { return proto.CompactTextString(m) }
func (*TicketGenesis) ProtoMessage() {}
func (*TicketGenesis) Descriptor() ([]byte, []int) {
return fileDescriptor_98a6c21780e82d22, []int{7}
}
func (m *TicketGenesis) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TicketGenesis.Unmarshal(m, b)
}
func (m *TicketGenesis) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TicketGenesis.Marshal(b, m, deterministic)
}
func (m *TicketGenesis) XXX_Merge(src proto.Message) {
xxx_messageInfo_TicketGenesis.Merge(m, src)
}
func (m *TicketGenesis) XXX_Size() int {
return xxx_messageInfo_TicketGenesis.Size(m)
}
func (m *TicketGenesis) XXX_DiscardUnknown() {
xxx_messageInfo_TicketGenesis.DiscardUnknown(m)
}
var xxx_messageInfo_TicketGenesis proto.InternalMessageInfo
func (m *TicketGenesis) GetMinerAddress() string {
if m != nil {
return m.MinerAddress
}
return ""
}
func (m *TicketGenesis) GetReturnAddress() string {
if m != nil {
return m.ReturnAddress
}
return ""
}
func (m *TicketGenesis) GetCount() int32 {
if m != nil {
return m.Count
}
return 0
}
type TicketClose struct {
TicketId []string `protobuf:"bytes,1,rep,name=ticketId,proto3" json:"ticketId,omitempty"`
MinerAddress string `protobuf:"bytes,2,opt,name=minerAddress,proto3" json:"minerAddress,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TicketClose) Reset() { *m = TicketClose{} }
func (m *TicketClose) String() string { return proto.CompactTextString(m) }
func (*TicketClose) ProtoMessage() {}
func (*TicketClose) Descriptor() ([]byte, []int) {
return fileDescriptor_98a6c21780e82d22, []int{8}
}
func (m *TicketClose) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TicketClose.Unmarshal(m, b)
}
func (m *TicketClose) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TicketClose.Marshal(b, m, deterministic)
}
func (m *TicketClose) XXX_Merge(src proto.Message) {
xxx_messageInfo_TicketClose.Merge(m, src)
}
func (m *TicketClose) XXX_Size() int {
return xxx_messageInfo_TicketClose.Size(m)
}
func (m *TicketClose) XXX_DiscardUnknown() {
xxx_messageInfo_TicketClose.DiscardUnknown(m)
}
var xxx_messageInfo_TicketClose proto.InternalMessageInfo
func (m *TicketClose) GetTicketId() []string {
if m != nil {
return m.TicketId
}
return nil
}
func (m *TicketClose) GetMinerAddress() string {
if m != nil {
return m.MinerAddress
}
return ""
}
type TicketList struct {
Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"`
Status int32 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TicketList) Reset() { *m = TicketList{} }
func (m *TicketList) String() string { return proto.CompactTextString(m) }
func (*TicketList) ProtoMessage() {}
func (*TicketList) Descriptor() ([]byte, []int) {
return fileDescriptor_98a6c21780e82d22, []int{9}
}
func (m *TicketList) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TicketList.Unmarshal(m, b)
}
func (m *TicketList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TicketList.Marshal(b, m, deterministic)
}
func (m *TicketList) XXX_Merge(src proto.Message) {
xxx_messageInfo_TicketList.Merge(m, src)
}
func (m *TicketList) XXX_Size() int {
return xxx_messageInfo_TicketList.Size(m)
}
func (m *TicketList) XXX_DiscardUnknown() {
xxx_messageInfo_TicketList.DiscardUnknown(m)
}
var xxx_messageInfo_TicketList proto.InternalMessageInfo
func (m *TicketList) GetAddr() string {
if m != nil {
return m.Addr
}
return ""
}
func (m *TicketList) GetStatus() int32 {
if m != nil {
return m.Status
}
return 0
}
type TicketInfos struct {
TicketIds []string `protobuf:"bytes,1,rep,name=ticketIds,proto3" json:"ticketIds,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TicketInfos) Reset() { *m = TicketInfos{} }
func (m *TicketInfos) String() string { return proto.CompactTextString(m) }
func (*TicketInfos) ProtoMessage() {}
func (*TicketInfos) Descriptor() ([]byte, []int) {
return fileDescriptor_98a6c21780e82d22, []int{10}
}
func (m *TicketInfos) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TicketInfos.Unmarshal(m, b)
}
func (m *TicketInfos) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TicketInfos.Marshal(b, m, deterministic)
}
func (m *TicketInfos) XXX_Merge(src proto.Message) {
xxx_messageInfo_TicketInfos.Merge(m, src)
}
func (m *TicketInfos) XXX_Size() int {
return xxx_messageInfo_TicketInfos.Size(m)
}
func (m *TicketInfos) XXX_DiscardUnknown() {
xxx_messageInfo_TicketInfos.DiscardUnknown(m)
}
var xxx_messageInfo_TicketInfos proto.InternalMessageInfo
func (m *TicketInfos) GetTicketIds() []string {
if m != nil {
return m.TicketIds
}
return nil
}
type ReplyTicketList struct {
Tickets []*Ticket `protobuf:"bytes,1,rep,name=tickets,proto3" json:"tickets,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ReplyTicketList) Reset() { *m = ReplyTicketList{} }
func (m *ReplyTicketList) String() string { return proto.CompactTextString(m) }
func (*ReplyTicketList) ProtoMessage() {}
func (*ReplyTicketList) Descriptor() ([]byte, []int) {
return fileDescriptor_98a6c21780e82d22, []int{11}
}
func (m *ReplyTicketList) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReplyTicketList.Unmarshal(m, b)
}
func (m *ReplyTicketList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReplyTicketList.Marshal(b, m, deterministic)
}
func (m *ReplyTicketList) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReplyTicketList.Merge(m, src)
}
func (m *ReplyTicketList) XXX_Size() int {
return xxx_messageInfo_ReplyTicketList.Size(m)
}
func (m *ReplyTicketList) XXX_DiscardUnknown() {
xxx_messageInfo_ReplyTicketList.DiscardUnknown(m)
}
var xxx_messageInfo_ReplyTicketList proto.InternalMessageInfo
func (m *ReplyTicketList) GetTickets() []*Ticket {
if m != nil {
return m.Tickets
}
return nil
}
type ReplyWalletTickets struct {
Tickets []*Ticket `protobuf:"bytes,1,rep,name=tickets,proto3" json:"tickets,omitempty"`
Privkeys [][]byte `protobuf:"bytes,2,rep,name=privkeys,proto3" json:"privkeys,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ReplyWalletTickets) Reset() { *m = ReplyWalletTickets{} }
func (m *ReplyWalletTickets) String() string { return proto.CompactTextString(m) }
func (*ReplyWalletTickets) ProtoMessage() {}
func (*ReplyWalletTickets) Descriptor() ([]byte, []int) {
return fileDescriptor_98a6c21780e82d22, []int{12}
}
func (m *ReplyWalletTickets) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReplyWalletTickets.Unmarshal(m, b)
}
func (m *ReplyWalletTickets) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReplyWalletTickets.Marshal(b, m, deterministic)
}
func (m *ReplyWalletTickets) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReplyWalletTickets.Merge(m, src)
}
func (m *ReplyWalletTickets) XXX_Size() int {
return xxx_messageInfo_ReplyWalletTickets.Size(m)
}
func (m *ReplyWalletTickets) XXX_DiscardUnknown() {
xxx_messageInfo_ReplyWalletTickets.DiscardUnknown(m)
}
var xxx_messageInfo_ReplyWalletTickets proto.InternalMessageInfo
func (m *ReplyWalletTickets) GetTickets() []*Ticket {
if m != nil {
return m.Tickets
}
return nil
}
func (m *ReplyWalletTickets) GetPrivkeys() [][]byte {
if m != nil {
return m.Privkeys
}
return nil
}
type ReceiptTicket struct {
TicketId string `protobuf:"bytes,1,opt,name=ticketId,proto3" json:"ticketId,omitempty"`
Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
PrevStatus int32 `protobuf:"varint,3,opt,name=prevStatus,proto3" json:"prevStatus,omitempty"`
Addr string `protobuf:"bytes,4,opt,name=addr,proto3" json:"addr,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ReceiptTicket) Reset() { *m = ReceiptTicket{} }
func (m *ReceiptTicket) String() string { return proto.CompactTextString(m) }
func (*ReceiptTicket) ProtoMessage() {}
func (*ReceiptTicket) Descriptor() ([]byte, []int) {
return fileDescriptor_98a6c21780e82d22, []int{13}
}
func (m *ReceiptTicket) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReceiptTicket.Unmarshal(m, b)
}
func (m *ReceiptTicket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReceiptTicket.Marshal(b, m, deterministic)
}
func (m *ReceiptTicket) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReceiptTicket.Merge(m, src)
}
func (m *ReceiptTicket) XXX_Size() int {
return xxx_messageInfo_ReceiptTicket.Size(m)
}
func (m *ReceiptTicket) XXX_DiscardUnknown() {
xxx_messageInfo_ReceiptTicket.DiscardUnknown(m)
}
var xxx_messageInfo_ReceiptTicket proto.InternalMessageInfo
func (m *ReceiptTicket) GetTicketId() string {
if m != nil {
return m.TicketId
}
return ""
}
func (m *ReceiptTicket) GetStatus() int32 {
if m != nil {
return m.Status
}
return 0
}
func (m *ReceiptTicket) GetPrevStatus() int32 {
if m != nil {
return m.PrevStatus
}
return 0
}
func (m *ReceiptTicket) GetAddr() string {
if m != nil {
return m.Addr
}
return ""
}
type ReceiptTicketBind struct {
OldMinerAddress string `protobuf:"bytes,1,opt,name=oldMinerAddress,proto3" json:"oldMinerAddress,omitempty"`
NewMinerAddress string `protobuf:"bytes,2,opt,name=newMinerAddress,proto3" json:"newMinerAddress,omitempty"`
ReturnAddress string `protobuf:"bytes,3,opt,name=returnAddress,proto3" json:"returnAddress,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ReceiptTicketBind) Reset() { *m = ReceiptTicketBind{} }
func (m *ReceiptTicketBind) String() string { return proto.CompactTextString(m) }
func (*ReceiptTicketBind) ProtoMessage() {}
func (*ReceiptTicketBind) Descriptor() ([]byte, []int) {
return fileDescriptor_98a6c21780e82d22, []int{14}
}
func (m *ReceiptTicketBind) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReceiptTicketBind.Unmarshal(m, b)
}
func (m *ReceiptTicketBind) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReceiptTicketBind.Marshal(b, m, deterministic)
}
func (m *ReceiptTicketBind) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReceiptTicketBind.Merge(m, src)
}
func (m *ReceiptTicketBind) XXX_Size() int {
return xxx_messageInfo_ReceiptTicketBind.Size(m)
}
func (m *ReceiptTicketBind) XXX_DiscardUnknown() {
xxx_messageInfo_ReceiptTicketBind.DiscardUnknown(m)
}
var xxx_messageInfo_ReceiptTicketBind proto.InternalMessageInfo
func (m *ReceiptTicketBind) GetOldMinerAddress() string {
if m != nil {
return m.OldMinerAddress
}
return ""
}
func (m *ReceiptTicketBind) GetNewMinerAddress() string {
if m != nil {
return m.NewMinerAddress
}
return ""
}
func (m *ReceiptTicketBind) GetReturnAddress() string {
if m != nil {
return m.ReturnAddress
}
return ""
}
type ReqBindMiner struct {
BindAddr string `protobuf:"bytes,1,opt,name=bindAddr,proto3" json:"bindAddr,omitempty"`
OriginAddr string `protobuf:"bytes,2,opt,name=originAddr,proto3" json:"originAddr,omitempty"`
Amount int64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"`
CheckBalance bool `protobuf:"varint,4,opt,name=checkBalance,proto3" json:"checkBalance,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ReqBindMiner) Reset() { *m = ReqBindMiner{} }
func (m *ReqBindMiner) String() string { return proto.CompactTextString(m) }
func (*ReqBindMiner) ProtoMessage() {}
func (*ReqBindMiner) Descriptor() ([]byte, []int) {
return fileDescriptor_98a6c21780e82d22, []int{15}
}
func (m *ReqBindMiner) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReqBindMiner.Unmarshal(m, b)
}
func (m *ReqBindMiner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReqBindMiner.Marshal(b, m, deterministic)
}
func (m *ReqBindMiner) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReqBindMiner.Merge(m, src)
}
func (m *ReqBindMiner) XXX_Size() int {
return xxx_messageInfo_ReqBindMiner.Size(m)
}
func (m *ReqBindMiner) XXX_DiscardUnknown() {
xxx_messageInfo_ReqBindMiner.DiscardUnknown(m)
}
var xxx_messageInfo_ReqBindMiner proto.InternalMessageInfo
func (m *ReqBindMiner) GetBindAddr() string {
if m != nil {
return m.BindAddr
}
return ""
}
func (m *ReqBindMiner) GetOriginAddr() string {
if m != nil {
return m.OriginAddr
}
return ""
}
func (m *ReqBindMiner) GetAmount() int64 {
if m != nil {
return m.Amount
}
return 0
}
func (m *ReqBindMiner) GetCheckBalance() bool {
if m != nil {
return m.CheckBalance
}
return false
}
type ReplyBindMiner struct {
TxHex string `protobuf:"bytes,1,opt,name=txHex,proto3" json:"txHex,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ReplyBindMiner) Reset() { *m = ReplyBindMiner{} }
func (m *ReplyBindMiner) String() string { return proto.CompactTextString(m) }
func (*ReplyBindMiner) ProtoMessage() {}
func (*ReplyBindMiner) Descriptor() ([]byte, []int) {
return fileDescriptor_98a6c21780e82d22, []int{16}
}
func (m *ReplyBindMiner) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReplyBindMiner.Unmarshal(m, b)
}
func (m *ReplyBindMiner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReplyBindMiner.Marshal(b, m, deterministic)
}
func (m *ReplyBindMiner) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReplyBindMiner.Merge(m, src)
}
func (m *ReplyBindMiner) XXX_Size() int {
return xxx_messageInfo_ReplyBindMiner.Size(m)
}
func (m *ReplyBindMiner) XXX_DiscardUnknown() {
xxx_messageInfo_ReplyBindMiner.DiscardUnknown(m)
}
var xxx_messageInfo_ReplyBindMiner proto.InternalMessageInfo
func (m *ReplyBindMiner) GetTxHex() string {
if m != nil {
return m.TxHex
}
return ""
}
func init() {
proto.RegisterType((*Ticket)(nil), "types.Ticket")
proto.RegisterType((*TicketAction)(nil), "types.TicketAction")
proto.RegisterType((*TicketMiner)(nil), "types.TicketMiner")
proto.RegisterType((*TicketMinerOld)(nil), "types.TicketMinerOld")
proto.RegisterType((*MinerFlag)(nil), "types.MinerFlag")
proto.RegisterType((*TicketBind)(nil), "types.TicketBind")
proto.RegisterType((*TicketOpen)(nil), "types.TicketOpen")
proto.RegisterType((*TicketGenesis)(nil), "types.TicketGenesis")
proto.RegisterType((*TicketClose)(nil), "types.TicketClose")
proto.RegisterType((*TicketList)(nil), "types.TicketList")
proto.RegisterType((*TicketInfos)(nil), "types.TicketInfos")
proto.RegisterType((*ReplyTicketList)(nil), "types.ReplyTicketList")
proto.RegisterType((*ReplyWalletTickets)(nil), "types.ReplyWalletTickets")
proto.RegisterType((*ReceiptTicket)(nil), "types.ReceiptTicket")
proto.RegisterType((*ReceiptTicketBind)(nil), "types.ReceiptTicketBind")
proto.RegisterType((*ReqBindMiner)(nil), "types.ReqBindMiner")
proto.RegisterType((*ReplyBindMiner)(nil), "types.ReplyBindMiner")
}
func init() { proto.RegisterFile("ticket.proto", fileDescriptor_98a6c21780e82d22) }
var fileDescriptor_98a6c21780e82d22 = []byte{
// 839 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcf, 0x6f, 0xe3, 0x44,
0x14, 0x8e, 0xe3, 0x3a, 0x49, 0x5f, 0x9d, 0x96, 0x1d, 0x0a, 0xb2, 0x22, 0xb4, 0x8a, 0x46, 0x08,
0xc2, 0x0f, 0x15, 0x28, 0x08, 0x01, 0x17, 0xd4, 0x56, 0x62, 0x53, 0x89, 0xb0, 0xd2, 0x74, 0xb5,
0x88, 0xa3, 0x6b, 0xbf, 0x66, 0x47, 0x75, 0xc6, 0xc6, 0x9e, 0xb4, 0x9b, 0x2b, 0x07, 0xa4, 0x3d,
0xf0, 0x6f, 0x70, 0xe3, 0x7f, 0x44, 0xf3, 0x3c, 0xfe, 0x95, 0xf4, 0x50, 0x09, 0xf6, 0xe6, 0xf7,
0xe6, 0x7b, 0x7e, 0xdf, 0x7c, 0xf3, 0xb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x0d, 0x00, 0x00, 0xff, 0xff, 0xd7,
0x1e, 0x82, 0xa2, 0x9e, 0x08, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// TicketClient is the client API for Ticket service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type TicketClient interface {
//创建绑定挖矿
CreateBindMiner(ctx context.Context, in *ReqBindMiner, opts ...grpc.CallOption) (*ReplyBindMiner, error)
//查询钱包票数
GetTicketCount(ctx context.Context, in *types.ReqNil, opts ...grpc.CallOption) (*types.Int64, error)
// Miner
//设置自动挖矿
SetAutoMining(ctx context.Context, in *MinerFlag, opts ...grpc.CallOption) (*types.Reply, error)
}
type ticketClient struct {
cc *grpc.ClientConn
}
func NewTicketClient(cc *grpc.ClientConn) TicketClient {
return &ticketClient{cc}
}
func (c *ticketClient) CreateBindMiner(ctx context.Context, in *ReqBindMiner, opts ...grpc.CallOption) (*ReplyBindMiner, error) {
out := new(ReplyBindMiner)
err := c.cc.Invoke(ctx, "/types.ticket/CreateBindMiner", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *ticketClient) GetTicketCount(ctx context.Context, in *types.ReqNil, opts ...grpc.CallOption) (*types.Int64, error) {
out := new(types.Int64)
err := c.cc.Invoke(ctx, "/types.ticket/GetTicketCount", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *ticketClient) SetAutoMining(ctx context.Context, in *MinerFlag, opts ...grpc.CallOption) (*types.Reply, error) {
out := new(types.Reply)
err := c.cc.Invoke(ctx, "/types.ticket/SetAutoMining", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// TicketServer is the server API for Ticket service.
type TicketServer interface {
//创建绑定挖矿
CreateBindMiner(context.Context, *ReqBindMiner) (*ReplyBindMiner, error)
//查询钱包票数
GetTicketCount(context.Context, *types.ReqNil) (*types.Int64, error)
// Miner
//设置自动挖矿
SetAutoMining(context.Context, *MinerFlag) (*types.Reply, error)
}
func RegisterTicketServer(s *grpc.Server, srv TicketServer) {
s.RegisterService(&_Ticket_serviceDesc, srv)
}
func _Ticket_CreateBindMiner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReqBindMiner)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TicketServer).CreateBindMiner(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/types.ticket/CreateBindMiner",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TicketServer).CreateBindMiner(ctx, req.(*ReqBindMiner))
}
return interceptor(ctx, in, info, handler)
}
func _Ticket_GetTicketCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(types.ReqNil)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TicketServer).GetTicketCount(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/types.ticket/GetTicketCount",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TicketServer).GetTicketCount(ctx, req.(*types.ReqNil))
}
return interceptor(ctx, in, info, handler)
}
func _Ticket_SetAutoMining_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MinerFlag)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TicketServer).SetAutoMining(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/types.ticket/SetAutoMining",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TicketServer).SetAutoMining(ctx, req.(*MinerFlag))
}
return interceptor(ctx, in, info, handler)
}
var _Ticket_serviceDesc = grpc.ServiceDesc{
ServiceName: "types.ticket",
HandlerType: (*TicketServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateBindMiner",
Handler: _Ticket_CreateBindMiner_Handler,
},
{
MethodName: "GetTicketCount",
Handler: _Ticket_GetTicketCount_Handler,
},
{
MethodName: "SetAutoMining",
Handler: _Ticket_SetAutoMining_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "ticket.proto",
}
......@@ -111,6 +111,8 @@ type Store struct {
DbCache int32 `protobuf:"varint,4,opt,name=dbCache" json:"dbCache,omitempty"`
// 数据库版本
LocalDBVersion string `protobuf:"bytes,5,opt,name=localdbVersion" json:"localdbVersion,omitempty"`
// 数据库版本
StoreDBVersion string `protobuf:"bytes,5,opt,name=storedbVersion" json:"storedbVersion,omitempty"`
}
// BlockChain 配置
......
......@@ -237,7 +237,7 @@ message UserWrite {
}
message UpgradeMeta {
bool indexing = 1;
bool starting = 1;
string version = 2;
int64 height = 3;
}
\ No newline at end of file
......@@ -1954,7 +1954,7 @@ func (m *UserWrite) GetContent() string {
}
type UpgradeMeta struct {
Indexing bool `protobuf:"varint,1,opt,name=indexing,proto3" json:"indexing,omitempty"`
Starting bool `protobuf:"varint,1,opt,name=starting,proto3" json:"starting,omitempty"`
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
......@@ -1987,9 +1987,9 @@ func (m *UpgradeMeta) XXX_DiscardUnknown() {
var xxx_messageInfo_UpgradeMeta proto.InternalMessageInfo
func (m *UpgradeMeta) GetIndexing() bool {
func (m *UpgradeMeta) GetStarting() bool {
if m != nil {
return m.Indexing
return m.Starting
}
return false
}
......@@ -2049,7 +2049,7 @@ func init() {
func init() { proto.RegisterFile("transaction.proto", fileDescriptor_2cc4e03d2c28c490) }
var fileDescriptor_2cc4e03d2c28c490 = []byte{
// 1319 bytes of a gzipped FileDescriptorProto
// 1320 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcf, 0x6e, 0x1b, 0xb7,
0x13, 0x86, 0xb4, 0x5a, 0x59, 0x1a, 0x29, 0xf9, 0xc5, 0x8b, 0x20, 0x11, 0x82, 0x5f, 0x13, 0x97,
0x48, 0x81, 0x20, 0x08, 0x64, 0xc0, 0xce, 0xad, 0x05, 0xda, 0x24, 0x6e, 0x93, 0xc0, 0x49, 0x9a,
......@@ -2128,9 +2128,9 @@ var fileDescriptor_2cc4e03d2c28c490 = []byte{
0xa9, 0x1c, 0xd3, 0x4b, 0x2c, 0x78, 0x7b, 0x6c, 0x7c, 0xed, 0xb0, 0x2f, 0xa1, 0xfb, 0xba, 0x40,
0x45, 0x4f, 0x37, 0x32, 0x91, 0x8b, 0x2c, 0xad, 0x4c, 0x0c, 0x30, 0x5f, 0x97, 0x54, 0xe6, 0x1a,
0xdd, 0x5c, 0xe8, 0x72, 0x0f, 0xd9, 0x4f, 0xd0, 0x7b, 0xbd, 0x98, 0x28, 0x31, 0xc6, 0xe7, 0xa8,
0x85, 0x29, 0x21, 0x75, 0x20, 0xcb, 0x27, 0xe4, 0xa1, 0xc3, 0x2b, 0x6c, 0x9c, 0x9c, 0xa2, 0x2a,
0xfc, 0x30, 0xef, 0x72, 0x0f, 0x2f, 0x1a, 0xe5, 0x0f, 0x6f, 0xfd, 0xf8, 0xd9, 0x24, 0xd3, 0xd3,
0xe5, 0xd1, 0x30, 0x95, 0xf3, 0xdd, 0xfd, 0xfd, 0x34, 0xdf, 0x4d, 0xa7, 0x22, 0xcb, 0xf7, 0xf7,
0x77, 0xa9, 0x48, 0x47, 0x6d, 0xfa, 0x17, 0xb6, 0xff, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x72,
0xdc, 0x53, 0x0e, 0xaf, 0x0d, 0x00, 0x00,
0x85, 0x29, 0x61, 0xa1, 0x85, 0xd2, 0x59, 0x3e, 0x21, 0x0f, 0x1d, 0x5e, 0x61, 0xe3, 0xe4, 0x14,
0x55, 0xe1, 0x87, 0x79, 0x97, 0x7b, 0x78, 0xd1, 0x28, 0x7f, 0x78, 0xeb, 0xc7, 0xcf, 0x26, 0x99,
0x9e, 0x2e, 0x8f, 0x86, 0xa9, 0x9c, 0xef, 0xee, 0xef, 0xa7, 0xf9, 0x6e, 0x3a, 0x15, 0x59, 0xbe,
0xbf, 0xbf, 0x4b, 0x45, 0x3a, 0x6a, 0xd3, 0xbf, 0xb0, 0xfd, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff,
0xba, 0x68, 0x0f, 0x9b, 0xaf, 0x0d, 0x00, 0x00,
}
......@@ -134,6 +134,7 @@ func RunChain33(name string) {
//开始区块链模块加载
//channel, rabitmq 等
version.SetLocalDBVersion(cfg.Store.LocalDBVersion)
version.SetStoreDBVersion(cfg.Store.StoreDBVersion)
version.SetAppVersion(cfg.Version)
log.Info(cfg.Title + "-app:" + version.GetAppVersion() + " chain33:" + version.GetVersion() + " localdb:" + version.GetLocalDBVersion())
log.Info("loading queue")
......@@ -155,12 +156,13 @@ func RunChain33(name string) {
log.Info("loading blockchain module")
chain := blockchain.New(cfg.BlockChain)
chain.SetQueueClient(q.Client())
chain.UpgradeChain()
log.Info("loading store module")
s := store.New(cfg.Store, sub.Store)
s.SetQueueClient(q.Client())
chain.Upgrade()
log.Info("loading consensus module")
cs := consensus.New(cfg.Consensus, sub.Consensus)
cs.SetQueueClient(q.Client())
......
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