diff --git a/boxd/eventbus/topics.go b/boxd/eventbus/topics.go index 663feb18..0bfc7416 100644 --- a/boxd/eventbus/topics.go +++ b/boxd/eventbus/topics.go @@ -13,6 +13,9 @@ const ( TopicGetNetworkID = "rpc:getnetworkid" // TopicGetAddressBook is topic for listing p2p peer status TopicGetAddressBook = "rpc:getaddressbook" + + ////////////////////////////// p2p ///////////////////////////// + //TopicP2PPeerAddr is a event topic for new peer addr found or peer addr updated TopicP2PPeerAddr = "p2p:peeraddr" //TopicP2PAddPeer is a event topic for adding peer addr to peer store @@ -20,11 +23,30 @@ const ( // TopicConnEvent is a event topic of events for score updated TopicConnEvent = "p2p:connevent" + ////////////////////////////// dpos ///////////////////////////// + + // TopicMiner is topic for miner + TopicMiner = "dpos:miner" + // TopicMiners is topic for replying current miners + TopicMiners = "dpos:miners" + // TopicAddrs is topic for replying current addrs + TopicAddrs = "dpos:addrs" + // TopicValidateMiner is topic for replying wheather it is a miner now + TopicValidateMiner = "dpos:validateminer" + // TopicMinerPubkey is topic for miner pubkey + TopicMinerPubkey = "dpos:minerpubkey" + // TopicSignature is topic for sign a []byte + TopicSignature = "dpos:signature" + ////////////////////////////// chain ///////////////////////////// // TopicChainUpdate is topic for notifying that the chain is updated, // either chain reorg, or chain extended. TopicChainUpdate = "chain:update" + // TopicBlacklistBlockConfirmResult is topic for confirmed result + TopicBlacklistBlockConfirmResult = "chain:blacklistblockresult" + // TopicBlacklistTxConfirmResult is topic for confirmed result + TopicBlacklistTxConfirmResult = "chain:blacklisttxresult" // TopicUtxoUpdate is topic for notifying that chain utxo is changed TopicUtxoUpdate = "chain:utxoupdate" @@ -37,4 +59,9 @@ const ( TopicGetDatabaseValue = "rpc:database:get" // TopicRPCSendNewBlock is topic for sending new block to explorer TopicRPCSendNewBlock = "rpc:newblock:send" + + ////////////////////////////// tx ///////////////////////////// + + // TopicGenerateTx is topic to generate tx + TopicGenerateTx = "tx:generate" ) diff --git a/boxd/server.go b/boxd/server.go index 00f4425d..dfb388cf 100644 --- a/boxd/server.go +++ b/boxd/server.go @@ -15,14 +15,14 @@ import ( "sync" "time" - "github.com/BOXFoundation/boxd/wallet/walletserver" - "github.com/BOXFoundation/boxd/blocksync" "github.com/BOXFoundation/boxd/boxd/eventbus" "github.com/BOXFoundation/boxd/boxd/service" config "github.com/BOXFoundation/boxd/config" "github.com/BOXFoundation/boxd/consensus/dpos" "github.com/BOXFoundation/boxd/core/chain" + ctl "github.com/BOXFoundation/boxd/core/controller" + "github.com/BOXFoundation/boxd/core/txgenerator" "github.com/BOXFoundation/boxd/core/txpool" "github.com/BOXFoundation/boxd/log" "github.com/BOXFoundation/boxd/metrics" @@ -31,6 +31,7 @@ import ( storage "github.com/BOXFoundation/boxd/storage" _ "github.com/BOXFoundation/boxd/storage/memdb" // init memdb _ "github.com/BOXFoundation/boxd/storage/rocksdb" // init rocksdb + "github.com/BOXFoundation/boxd/wallet/walletserver" "github.com/jbenet/goprocess" ) @@ -162,7 +163,7 @@ func (server *Server) Prepare() { // prepare grpc server. if cfg.RPC.Enabled { - server.grpcsvr = grpcserver.NewServer(txPool.Proc(), &cfg.RPC, blockChain, txPool, server.wallet, server.bus) + server.grpcsvr = grpcserver.NewServer(txPool.Proc(), &cfg.RPC, blockChain, txPool, server.wallet, server.bus, ctl.Default()) } // prepare sync manager. @@ -170,6 +171,9 @@ func (server *Server) Prepare() { server.syncManager = syncManager server.blockChain.Setup(consensus, syncManager) + if _, err := txgenerator.New(database, blockChain, txPool, peer); err != nil { + logger.Fatalf("Failed to new txgenerator. Err: %v", err) + } } var _ service.Server = (*Server)(nil) @@ -220,9 +224,10 @@ func (server *Server) Run() error { if cfg.RPC.Enabled { server.grpcsvr = grpcserver.NewServer(server.txPool.Proc(), &cfg.RPC, server.blockChain, - server.txPool, server.wallet, server.bus) + server.txPool, server.wallet, server.bus, ctl.Default()) server.grpcsvr.Run() } + txgenerator.Default().Run() // goprocesses dependencies // root diff --git a/commands/box/ctl/root.go b/commands/box/ctl/root.go index bed2b7fa..37a43f91 100644 --- a/commands/box/ctl/root.go +++ b/commands/box/ctl/root.go @@ -113,6 +113,11 @@ to quickly create a Cobra application.`, fmt.Println("getnetworkinfo called") }, }, + &cobra.Command{ + Use: "getblacklist", + Short: "Get the blacklist of the main chain", + Run: getBlacklistCmdFunc, + }, &cobra.Command{ Use: "getrawtx [txhash]", Short: "Get the raw transaction for a txid", @@ -288,6 +293,17 @@ func getBlockHeaderCmdFunc(cmd *cobra.Command, args []string) { } } +func getBlacklistCmdFunc(cmd *cobra.Command, args []string) { + fmt.Println("getblacklist called") + conn := client.NewConnectionWithViper(viper.GetViper()) + defer conn.Close() + blacklist, err := client.GetBlacklist(conn) + if err != nil { + fmt.Println(err) + } + fmt.Println("Current Blacklist: ", blacklist) +} + func getRawTxCmdFunc(cmd *cobra.Command, args []string) { fmt.Println("getrawtx called") if len(args) < 1 { diff --git a/consensus/dpos/dpos.go b/consensus/dpos/dpos.go index d0a06a2d..beaa3960 100644 --- a/consensus/dpos/dpos.go +++ b/consensus/dpos/dpos.go @@ -11,11 +11,11 @@ import ( "sync/atomic" "time" - "github.com/hashicorp/golang-lru" - + "github.com/BOXFoundation/boxd/boxd/eventbus" "github.com/BOXFoundation/boxd/boxd/service" "github.com/BOXFoundation/boxd/core" "github.com/BOXFoundation/boxd/core/chain" + ctl "github.com/BOXFoundation/boxd/core/controller" "github.com/BOXFoundation/boxd/core/txpool" "github.com/BOXFoundation/boxd/core/types" "github.com/BOXFoundation/boxd/crypto" @@ -24,6 +24,7 @@ import ( "github.com/BOXFoundation/boxd/storage" "github.com/BOXFoundation/boxd/util" "github.com/BOXFoundation/boxd/wallet" + "github.com/hashicorp/golang-lru" "github.com/jbenet/goprocess" ) @@ -118,6 +119,7 @@ func (dpos *Dpos) Run() error { return err } dpos.bftservice = bftService + dpos.subscribeBlacklist() bftService.Start() dpos.proc.Go(dpos.loop) @@ -441,9 +443,8 @@ func (dpos *Dpos) BroadcastEternalMsgToMiners(block *types.Block) error { eternalBlockMsg.hash = *hash eternalBlockMsg.signature = signature eternalBlockMsg.timestamp = block.Header.TimeStamp - miners := dpos.context.periodContext.periodPeers - return dpos.net.BroadcastToMiners(p2p.EternalBlockMsg, eternalBlockMsg, miners) + return dpos.net.BroadcastToMiners(p2p.EternalBlockMsg, eternalBlockMsg) } // StorePeriodContext store period context @@ -674,3 +675,45 @@ func (dpos *Dpos) TryToUpdateEternalBlock(src *types.Block) { } dpos.bftservice.updateEternal(block) } + +func (dpos *Dpos) subscribeBlacklist() { + + ctl.SetPeriodSize(PeriodSize) + + dpos.chain.Bus().Reply(eventbus.TopicMiners, func(out chan<- []string) { + out <- dpos.context.periodContext.periodPeers + }, false) + + dpos.chain.Bus().Reply(eventbus.TopicMiner, func(out chan<- *wallet.Account) { + out <- dpos.miner + }, false) + + dpos.chain.Bus().Reply(eventbus.TopicAddrs, func(out chan<- []types.AddressHash) { + out <- dpos.context.periodContext.periodAddrs + }, false) + + dpos.chain.Bus().Reply(eventbus.TopicMinerPubkey, func(out chan<- []byte) { + out <- dpos.miner.PubKeyHash() + }, false) + + dpos.chain.Bus().Reply(eventbus.TopicValidateMiner, func(pid string, addr types.AddressHash, out chan<- bool) { + if util.InArray(pid, dpos.bftservice.consensus.context.periodContext.periodPeers) { + for _, v := range dpos.bftservice.consensus.context.periodContext.period { + if addr == v.addr && pid == v.peerID { + out <- true + } + } + } + out <- false + }, false) + + dpos.chain.Bus().Reply(eventbus.TopicSignature, func(digest []byte, out chan<- []byte) { + signature, err := crypto.SignCompact(dpos.miner.PrivateKey(), digest[:]) + if err == nil { + out <- signature + } else { + logger.Warnf("SignCompact err: %v", err) + out <- nil + } + }, false) +} diff --git a/core/chain/blockchain.go b/core/chain/blockchain.go index a74a7059..10fc7b29 100644 --- a/core/chain/blockchain.go +++ b/core/chain/blockchain.go @@ -16,6 +16,7 @@ import ( "github.com/BOXFoundation/boxd/boxd/eventbus" "github.com/BOXFoundation/boxd/boxd/service" "github.com/BOXFoundation/boxd/core" + ctl "github.com/BOXFoundation/boxd/core/controller" "github.com/BOXFoundation/boxd/core/metrics" "github.com/BOXFoundation/boxd/core/pb" "github.com/BOXFoundation/boxd/core/types" @@ -146,8 +147,9 @@ var _ service.Server = (*BlockChain)(nil) // Run launch blockchain. func (chain *BlockChain) Run() error { chain.subscribeMessageNotifiee() + chain.subscribeBlacklistMsg() chain.proc.Go(chain.loop) - + ctl.NewBlacklistWrap(chain.notifiee, chain.bus, chain.db, chain.proc) return nil } @@ -180,6 +182,13 @@ func (chain *BlockChain) subscribeMessageNotifiee() { chain.notifiee.Subscribe(p2p.NewNotifiee(p2p.NewBlockMsg, chain.newblockMsgCh)) } +func (chain *BlockChain) subscribeBlacklistMsg() { + chain.bus.Reply(eventbus.TopicBlacklistBlockConfirmResult, func(block *types.Block, messageFrom peer.ID, resultCh chan error) { + err := chain.ProcessBlock(block, core.DefaultMode, false, messageFrom) + resultCh <- err + }, false) +} + func (chain *BlockChain) loop(p goprocess.Process) { logger.Info("Waitting for new block message...") metricsTicker := time.NewTicker(metricsLoopInterval) @@ -223,14 +232,33 @@ func (chain *BlockChain) processBlockMsg(msg p2p.Message) error { } // process block - if err := chain.ProcessBlock(block, core.RelayMode, true, msg.From()); err != nil && util.InArray(err, core.EvilBehavior) { - chain.Bus().Publish(eventbus.TopicConnEvent, msg.From(), eventbus.BadBlockEvent) + if err := chain.ProcessBlock(block, core.RelayMode, true, msg.From()); err != nil { + chain.checkEvilBehavior(msg.From(), block, err) return err } + + // TODO: test + go func() { + if pubkey, ok := crypto.RecoverCompact(block.BlockHash()[:], block.Signature); ok { + ctl.Default().SceneCh <- &ctl.Evidence{PubKey: pubkey.Serialize(), Block: block, Type: ctl.BlockEvidence, Err: core.ErrBlockExists.Error(), Ts: time.Now().Unix()} + } + }() + chain.Bus().Publish(eventbus.TopicConnEvent, msg.From(), eventbus.NewBlockEvent) return nil } +func (chain *BlockChain) checkEvilBehavior(pid peer.ID, block *types.Block, err error) { + if util.InArray(err, core.EvilBehavior) { + chain.Bus().Publish(eventbus.TopicConnEvent, pid, eventbus.BadBlockEvent) + go func() { + if pubkey, ok := crypto.RecoverCompact(block.BlockHash()[:], block.Signature); ok { + ctl.Default().SceneCh <- &ctl.Evidence{PubKey: pubkey.Serialize(), Block: block, Type: ctl.BlockEvidence, Err: err.Error(), Ts: time.Now().Unix()} + } + }() + } +} + // ProcessBlock is used to handle new blocks. func (chain *BlockChain) ProcessBlock(block *types.Block, transferMode core.TransferMode, fastConfirm bool, messageFrom peer.ID) error { @@ -657,6 +685,11 @@ func (chain *BlockChain) applyBlock(block *types.Block, utxoSet *UtxoSet, batch return err } + // save candidate context + if err := ctl.Default().StoreContext(block, batch); err != nil { + return err + } + // save tx index if err := chain.WriteTxIndex(block, batch); err != nil { return err diff --git a/core/chain/validate.go b/core/chain/validate.go index 138aa4da..85dcfa95 100644 --- a/core/chain/validate.go +++ b/core/chain/validate.go @@ -159,6 +159,7 @@ func validateBlockScripts(utxoSet *UtxoSet, block *types.Block) error { // Coinbase tx will not reach here func ValidateTxScripts(utxoSet *UtxoSet, tx *types.Transaction) error { txHash, _ := tx.TxHash() + var checkBlackList bool for txInIdx, txIn := range tx.Vin { // Ensure the referenced input transaction exists and is not spent. utxo := utxoSet.FindUtxo(txIn.PrevOutPoint) @@ -177,6 +178,16 @@ func ValidateTxScripts(utxoSet *UtxoSet, tx *types.Transaction) error { if err := script.Validate(scriptSig, prevScriptPubKey, tx, txInIdx); err != nil { return err } + + // Ensure public key not in black list + if !checkBlackList { + // if checksum, ok := prevScriptPubKey.GetPubKeyChecksum(); ok { + // if _, ok := bl.Default().Details.Load(checksum); ok { + // return core.ErrPubKeyInBlackList + // } + // } + // checkBlackList = true + } } return nil diff --git a/core/controller/blacklistwrap.go b/core/controller/blacklistwrap.go new file mode 100644 index 00000000..25df6ce2 --- /dev/null +++ b/core/controller/blacklistwrap.go @@ -0,0 +1,447 @@ +// Copyright (c) 2018 ContentBox Authors. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package controller + +import ( + "bytes" + "fmt" + "hash/crc32" + "sync" + "time" + + "github.com/BOXFoundation/boxd/boxd/eventbus" + "github.com/BOXFoundation/boxd/core" + corepb "github.com/BOXFoundation/boxd/core/pb" + "github.com/BOXFoundation/boxd/core/types" + "github.com/BOXFoundation/boxd/crypto" + "github.com/BOXFoundation/boxd/log" + "github.com/BOXFoundation/boxd/p2p" + "github.com/BOXFoundation/boxd/script" + "github.com/BOXFoundation/boxd/storage" + "github.com/BOXFoundation/boxd/storage/key" + "github.com/BOXFoundation/boxd/util" + lru "github.com/hashicorp/golang-lru" + "github.com/jbenet/goprocess" + peer "github.com/libp2p/go-libp2p-peer" +) + +var logger = log.NewLogger("blacklist") // logger + +// TODO: add into core config +const ( + TxEvidence uint32 = iota + BlockEvidence + + // evidence useful life + blackListPeriod = 3 * time.Second + blackListThreshold = 100 + + txEvidenceChMaxSize = 100 + blockEvidenceChMaxSize = 3 + BlMsgChBufferSize = 5 + MaxConfirmMsgCacheTime = 5 +) + +var ( + blacklistBase = key.NewKey("/bl") + + blackListWrap *BlackListWrap + + // periodSize is a clone of consensus.periodSize + periodSize int +) + +// BlackListWrap represents the black list of public keys +type BlackListWrap struct { + // Main part of blacklist. + // checksumIEEE(pubKey) -> int64(expire time) + Details *sync.Map + + // Collecting evidence from various sources. + // All scene named variables in blacklist logic represent + // the invalid transaction or block that caused the evidence. + SceneCh chan *Evidence + + // Each entry contains two chs now, first is for txs and second for blocks. + // When one of them reach a certain len, the blacklist judgment logic will start. + // checksumIEEE(pubKey) -> []ch + evidenceNote *lru.Cache + + // Save the signatures of each blacklist msg hash received from all pbs. + // checkousum(hash) -> [][]byte([]signature) + confirmMsgNote *lru.Cache + + // Preserve recent signed blacklist msg. + // checkousum(hash) -> struct{}{} + existConfirmedKey *lru.Cache + + db storage.Table + bus eventbus.Bus + notifiee p2p.Net + msgCh chan p2p.Message + proc goprocess.Process + mutex *sync.Mutex +} + +// Evidence can help bp to restore error scene +type Evidence struct { + PubKey []byte + Tx *types.Transaction + Block *types.Block + Type uint32 + Err string + Ts int64 +} + +// Default returns the default BlackListWrap. +func Default() *BlackListWrap { + return blackListWrap +} + +// SetPeriodSize get a clone from consensus +func SetPeriodSize(size int) { + periodSize = size +} + +// NewBlacklistWrap return a singleton wrap +func NewBlacklistWrap(notifiee p2p.Net, bus eventbus.Bus, db storage.Table, parent goprocess.Process) *BlackListWrap { + + if blackListWrap != nil { + return blackListWrap + } + + blackListWrap = &BlackListWrap{ + Details: new(sync.Map), + SceneCh: make(chan *Evidence, 4096), + msgCh: make(chan p2p.Message, BlMsgChBufferSize), + mutex: &sync.Mutex{}, + } + blackListWrap.evidenceNote, _ = lru.New(4096) + blackListWrap.confirmMsgNote, _ = lru.New(1024) + blackListWrap.existConfirmedKey, _ = lru.New(1024) + + blackListWrap.bus = bus + blackListWrap.notifiee = notifiee + blackListWrap.db = db + + blackListWrap.loadBlacklistFromDb() + blackListWrap.subscribeMessageNotifiee() + + blackListWrap.proc = parent.Go(func(p goprocess.Process) { + logger.Info("Start blacklist loop") + for { + select { + case msg := <-blackListWrap.msgCh: + switch msg.Code() { + case p2p.BlacklistMsg: + if err := blackListWrap.onBlacklistMsg(msg); err != nil { + logger.Errorf("Process blacklist msg fail. %v", err) + } + case p2p.BlacklistConfirmMsg: + if err := blackListWrap.onBlacklistConfirmMsg(msg); err != nil { + logger.Errorf("Process blacklist confirm msg fail. %v", err) + } + } + case evidence := <-blackListWrap.SceneCh: + if err := blackListWrap.processEvidence(evidence); err != nil { + logger.Errorf("Process evidence fail. %v", err) + } + case <-parent.Closing(): + logger.Info("Stopped black list loop.") + return + } + } + }) + return blackListWrap +} + +func (bl *BlackListWrap) processEvidence(evidence *Evidence) error { + + key := crc32.ChecksumIEEE(evidence.PubKey) + // get personal note + personalNote, ok := bl.evidenceNote.Get(key) + if !ok { + newNote := make([]chan *Evidence, 2) + // store invalid txs + newNote[0] = make(chan *Evidence, txEvidenceChMaxSize+1) + // store invalid blocks + newNote[1] = make(chan *Evidence, blockEvidenceChMaxSize+1) + bl.evidenceNote.Add(key, newNote) + personalNote, _ = bl.evidenceNote.Get(key) + } + + // get pioneer + var first *Evidence + var evidenceCh chan *Evidence + switch evidence.Type { + case TxEvidence: + evidenceCh = personalNote.([]chan *Evidence)[0] + if len(evidenceCh) >= txEvidenceChMaxSize { + first = <-evidenceCh + } else { + evidenceCh <- evidence + return nil + } + case BlockEvidence: + evidenceCh = personalNote.([]chan *Evidence)[1] + if len(evidenceCh) >= blockEvidenceChMaxSize { + first = <-evidenceCh + } else { + evidenceCh <- evidence + return nil + } + default: + logger.Errorf("invalid evidence type: %v", evidence.Type) + return nil + } + evidenceCh <- evidence + if first == nil || time.Unix(int64(first.Ts), 0).Add(blackListPeriod).Before(time.Unix(int64(evidence.Ts), 0)) { + return nil + } + eviPackege := bl.packageEvidences(first, evidenceCh) + blm := &BlacklistMsg{evidences: eviPackege} + hash, err := blm.calcHash() + if err != nil { + return err + } + blm.hash = hash + bl.notifiee.BroadcastToMiners(p2p.BlacklistMsg, blm) + return nil +} + +func (bl *BlackListWrap) packageEvidences(first *Evidence, evidenceCh chan *Evidence) []*Evidence { + evidences := []*Evidence{first} + for len(evidenceCh) != 0 { + evidences = append(evidences, <-evidenceCh) + } + return evidences +} + +func (bl *BlackListWrap) subscribeMessageNotifiee() { + bl.notifiee.Subscribe(p2p.NewNotifiee(p2p.BlacklistMsg, bl.msgCh)) + bl.notifiee.Subscribe(p2p.NewNotifiee(p2p.BlacklistConfirmMsg, bl.msgCh)) +} + +// StoreContext save new blacklist item +func (bl *BlackListWrap) StoreContext(block *types.Block, batch storage.Batch) error { + for _, tx := range block.Txs { + if err := bl.processBlacklistTx(tx, batch); err != nil { + return err + } + } + return nil +} + +func (bl *BlackListWrap) processBlacklistTx(tx *types.Transaction, batch storage.Batch) error { + + if tx.Data == nil || tx.Data.Type != types.BlacklistTx { + return nil + } + + blacklistContent := new(BlacklistTxData) + if err := blacklistContent.Unmarshal(tx.Data.Content); err != nil { + return err + } + expire := time.Now().Add(24 * time.Hour).Unix() + bl.Details.Store(crc32.ChecksumIEEE(blacklistContent.pubkey), expire) + batch.Put(BlacklistKey(blacklistContent.pubkey), util.FromInt64(expire)) + + return nil +} + +func (bl *BlackListWrap) loadBlacklistFromDb() { + keys := bl.db.KeysWithPrefix(blacklistBase.Bytes()) + for _, k := range keys { + slice := key.NewKeyFromBytes(k).List() + if len(slice) == 2 { + val, err := bl.db.Get(k) + if err != nil { + logger.Errorf("db get fail. Err: %v", err) + continue + } + expire := util.Int64(val) + if expire <= time.Now().Unix() { + continue + } + pubkey := slice[1] + bl.Details.Store(crc32.ChecksumIEEE([]byte(pubkey)), expire) + logger.Errorf("blacklist form db: %v = %v", crc32.ChecksumIEEE([]byte(pubkey)), expire) + } + } +} + +func (bl *BlackListWrap) onBlacklistMsg(msg p2p.Message) error { + blMsg := new(BlacklistMsg) + if err := blMsg.Unmarshal(msg.Body()); err != nil { + return err + } + if err := blMsg.validateHash(); err != nil { + return err + } + + pubkey, err := bl.validateEvidences(blMsg) + if err != nil { + return err + } + + signCh := make(chan []byte) + bl.bus.Send(eventbus.TopicSignature, blMsg.hash, signCh) + signature := <-signCh + if signature == nil { + return core.ErrSign + } + + confirmMsg := &BlacklistConfirmMsg{ + pubkey: pubkey, + hash: blMsg.hash, + signature: signature, + timestamp: time.Now().Unix(), + } + + bl.notifiee.SendMessageToPeer(p2p.BlacklistConfirmMsg, confirmMsg, msg.From()) + return nil +} + +func (bl *BlackListWrap) validateEvidences(blMsg *BlacklistMsg) ([]byte, error) { + var pubkey []byte + resultCh := make(chan error) + for _, evidence := range blMsg.evidences { + switch evidence.Type { + case BlockEvidence: + // Param peer.ID in processBlock is used for light sync. + // So we neednt to provide it. + bl.bus.Send(eventbus.TopicBlacklistBlockConfirmResult, evidence.Block, peer.ID(""), resultCh) + case TxEvidence: + bl.bus.Send(eventbus.TopicBlacklistTxConfirmResult, evidence.Tx, resultCh) + default: + return nil, core.ErrInvalidEvidenceType + } + if result := <-resultCh; result == nil || result.Error() != evidence.Err { + logger.Errorf("result err = %v, except = %v", result, evidence.Err) + return nil, core.ErrEvidenceErrNotMatch + } + + if pubkey == nil || len(pubkey) == 0 { + pubkey = make([]byte, len(evidence.PubKey)) + copy(pubkey[:], evidence.PubKey) + } else if !bytes.Equal(pubkey, evidence.PubKey) { + return nil, core.ErrSeparateSourceEvidences + } + + // Guarantee that all evidence is of the same origin. + switch evidence.Type { + case BlockEvidence: + if scenePubkey, ok := crypto.RecoverCompact(evidence.Block.BlockHash()[:], evidence.Block.Signature); !ok || !bytes.Equal(pubkey, scenePubkey.Serialize()) { + return nil, core.ErrSeparateSourceEvidences + } + case TxEvidence: + if scenePubkey, ok := script.NewScriptFromBytes(evidence.Tx.Vout[0].ScriptPubKey).GetPubKey(); !ok || !bytes.Equal(pubkey, scenePubkey) { + return nil, core.ErrSeparateSourceEvidences + } + } + } + return pubkey, nil +} + +func (bl *BlackListWrap) onBlacklistConfirmMsg(msg p2p.Message) error { + + confirmMsg := new(BlacklistConfirmMsg) + if err := confirmMsg.Unmarshal(msg.Body()); err != nil { + return err + } + + if bl.existConfirmedKey.Contains(crc32.ChecksumIEEE(confirmMsg.hash)) { + logger.Debugf("Enough confirmMsgs had been received.") + return nil + } + + now := time.Now().Unix() + if confirmMsg.timestamp > now || now-confirmMsg.timestamp > MaxConfirmMsgCacheTime { + return core.ErrIllegalMsg + } + + pubkey, ok := crypto.RecoverCompact(confirmMsg.hash[:], confirmMsg.signature) + if !ok { + return core.ErrSign + } + addrPubKeyHash, err := types.NewAddressFromPubKey(pubkey) + if err != nil { + return err + } + addr := *addrPubKeyHash.Hash160() + + minersValidateCh := make(chan bool) + bl.bus.Send(eventbus.TopicValidateMiner, msg.From().Pretty(), addr, minersValidateCh) + if !<-minersValidateCh { + return core.ErrIllegalMsg + } + + hashChecksum := crc32.ChecksumIEEE(confirmMsg.hash) + bl.mutex.Lock() + if sigs, ok := bl.confirmMsgNote.Get(hashChecksum); ok { + sigSlice := sigs.([][]byte) + if util.InArray(confirmMsg.signature, sigSlice) { + return nil + } + sigSlice = append(sigSlice, confirmMsg.signature) + if len(sigSlice) > 2*periodSize/3 { + bl.existConfirmedKey.Add(hashChecksum, struct{}{}) + go func() { + bl.doBlacklistTx(confirmMsg.pubkey, confirmMsg.hash, sigSlice) + bl.confirmMsgNote.Remove(hashChecksum) + }() + } else { + bl.confirmMsgNote.Add(hashChecksum, sigSlice) + } + } else { + bl.confirmMsgNote.Add(hashChecksum, [][]byte{confirmMsg.signature}) + } + bl.mutex.Unlock() + return nil +} + +func (bl *BlackListWrap) doBlacklistTx(pubkey, hash []byte, signs [][]byte) error { + tx, err := CreateBlacklistTx(&BlacklistTxData{ + pubkey: pubkey, + hash: hash, + signatures: signs, + }) + if err != nil { + return err + } + + resultCh := make(chan error) + bl.bus.Send(eventbus.TopicBlacklistTxConfirmResult, tx, resultCh) + if err = <-resultCh; err != nil { + logger.Errorf("tx send fail %v", err) + return err + } + logger.Errorf("tx send success %v", tx) + return nil +} + +// CreateBlacklistTx creates blacklist type tx +func CreateBlacklistTx(txData *BlacklistTxData) (*types.Transaction, error) { + + data, err := txData.Marshal() + if err != nil { + return nil, err + } + txpbData := &corepb.Data{ + Type: types.BlacklistTx, + Content: data, + } + + txCh := make(chan *types.Transaction) + eventbus.Default().Send(eventbus.TopicGenerateTx, txpbData, txCh) + tx := <-txCh + + return tx, nil +} + +// BlacklistKey returns the db key to store blacklist pubkey +func BlacklistKey(pubkey []byte) []byte { + return blacklistBase.ChildString(fmt.Sprintf("%x", pubkey)).Bytes() +} diff --git a/core/controller/pb/Makefile b/core/controller/pb/Makefile new file mode 100644 index 00000000..8e4c8cf4 --- /dev/null +++ b/core/controller/pb/Makefile @@ -0,0 +1,35 @@ +# Copyright (c) 2018 ContentBox Authors. +# Use of this source code is governed by a MIT-style +# license that can be found in the LICENSE file. + +PB = $(wildcard *.proto) +GO = $(PB:.proto=.pb.go) + +ifndef ${GOPATH} + GOPATH := $(shell go env GOPATH) +endif + +.PHONY: all +all: dependencies clean build + +.PHONY: dependencies +dependencies: + @echo "Installing gRPC tools..." # TODO work around build error on GO111MODULE=on... + #@-GO111MODULE=off go get -u github.com/gogo/protobuf/protoc-gen-gogofaster &>/dev/null + #@-GO111MODULE=off go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway &>/dev/null + #@-GO111MODULE=off go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger &>/dev/null + +.PHONY: build +build: $(GO) + +.PHONY: %.pb.go +%.pb.go: %.proto + protoc -I. -I$(GOPATH)/src \ + -I$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \ + --gogofaster_out=plugins=grpc:. \ + --grpc-gateway_out=logtostderr=true:. \ + $< + +.PHONY: clean +clean: + @rm -f *.pb.go *.pb.gw.go \ No newline at end of file diff --git a/core/controller/pb/blacklist.pb.go b/core/controller/pb/blacklist.pb.go new file mode 100644 index 00000000..7b3567af --- /dev/null +++ b/core/controller/pb/blacklist.pb.go @@ -0,0 +1,1350 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: blacklist.proto + +package pb + +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" +import pb "github.com/BOXFoundation/boxd/core/pb" + +import io "io" + +// 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.GoGoProtoPackageIsVersion2 // please upgrade the proto package + +type Evidence struct { + PubKey []byte `protobuf:"bytes,1,opt,name=PubKey,proto3" json:"PubKey,omitempty"` + Tx *pb.Transaction `protobuf:"bytes,2,opt,name=Tx,proto3" json:"Tx,omitempty"` + Block *pb.Block `protobuf:"bytes,3,opt,name=Block,proto3" json:"Block,omitempty"` + Type uint32 `protobuf:"varint,4,opt,name=Type,proto3" json:"Type,omitempty"` + Err string `protobuf:"bytes,5,opt,name=Err,proto3" json:"Err,omitempty"` + Ts int64 `protobuf:"varint,6,opt,name=Ts,proto3" json:"Ts,omitempty"` +} + +func (m *Evidence) Reset() { *m = Evidence{} } +func (m *Evidence) String() string { return proto.CompactTextString(m) } +func (*Evidence) ProtoMessage() {} +func (*Evidence) Descriptor() ([]byte, []int) { + return fileDescriptor_blacklist_9c5bbb1e7e0b6c45, []int{0} +} +func (m *Evidence) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Evidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Evidence.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *Evidence) XXX_Merge(src proto.Message) { + xxx_messageInfo_Evidence.Merge(dst, src) +} +func (m *Evidence) XXX_Size() int { + return m.Size() +} +func (m *Evidence) XXX_DiscardUnknown() { + xxx_messageInfo_Evidence.DiscardUnknown(m) +} + +var xxx_messageInfo_Evidence proto.InternalMessageInfo + +func (m *Evidence) GetPubKey() []byte { + if m != nil { + return m.PubKey + } + return nil +} + +func (m *Evidence) GetTx() *pb.Transaction { + if m != nil { + return m.Tx + } + return nil +} + +func (m *Evidence) GetBlock() *pb.Block { + if m != nil { + return m.Block + } + return nil +} + +func (m *Evidence) GetType() uint32 { + if m != nil { + return m.Type + } + return 0 +} + +func (m *Evidence) GetErr() string { + if m != nil { + return m.Err + } + return "" +} + +func (m *Evidence) GetTs() int64 { + if m != nil { + return m.Ts + } + return 0 +} + +type BlacklistMsg struct { + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Evidences []*Evidence `protobuf:"bytes,2,rep,name=evidences,proto3" json:"evidences,omitempty"` +} + +func (m *BlacklistMsg) Reset() { *m = BlacklistMsg{} } +func (m *BlacklistMsg) String() string { return proto.CompactTextString(m) } +func (*BlacklistMsg) ProtoMessage() {} +func (*BlacklistMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_blacklist_9c5bbb1e7e0b6c45, []int{1} +} +func (m *BlacklistMsg) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlacklistMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlacklistMsg.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *BlacklistMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlacklistMsg.Merge(dst, src) +} +func (m *BlacklistMsg) XXX_Size() int { + return m.Size() +} +func (m *BlacklistMsg) XXX_DiscardUnknown() { + xxx_messageInfo_BlacklistMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_BlacklistMsg proto.InternalMessageInfo + +func (m *BlacklistMsg) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + +func (m *BlacklistMsg) GetEvidences() []*Evidence { + if m != nil { + return m.Evidences + } + return nil +} + +type BlacklistConfirmMsg struct { + Pubkey []byte `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty"` + Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` + Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` + Timestamp int64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (m *BlacklistConfirmMsg) Reset() { *m = BlacklistConfirmMsg{} } +func (m *BlacklistConfirmMsg) String() string { return proto.CompactTextString(m) } +func (*BlacklistConfirmMsg) ProtoMessage() {} +func (*BlacklistConfirmMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_blacklist_9c5bbb1e7e0b6c45, []int{2} +} +func (m *BlacklistConfirmMsg) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlacklistConfirmMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlacklistConfirmMsg.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *BlacklistConfirmMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlacklistConfirmMsg.Merge(dst, src) +} +func (m *BlacklistConfirmMsg) XXX_Size() int { + return m.Size() +} +func (m *BlacklistConfirmMsg) XXX_DiscardUnknown() { + xxx_messageInfo_BlacklistConfirmMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_BlacklistConfirmMsg proto.InternalMessageInfo + +func (m *BlacklistConfirmMsg) GetPubkey() []byte { + if m != nil { + return m.Pubkey + } + return nil +} + +func (m *BlacklistConfirmMsg) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + +func (m *BlacklistConfirmMsg) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +func (m *BlacklistConfirmMsg) GetTimestamp() int64 { + if m != nil { + return m.Timestamp + } + return 0 +} + +type BlacklistTxData struct { + Pubkey []byte `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty"` + Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` + Signatures [][]byte `protobuf:"bytes,3,rep,name=signatures,proto3" json:"signatures,omitempty"` +} + +func (m *BlacklistTxData) Reset() { *m = BlacklistTxData{} } +func (m *BlacklistTxData) String() string { return proto.CompactTextString(m) } +func (*BlacklistTxData) ProtoMessage() {} +func (*BlacklistTxData) Descriptor() ([]byte, []int) { + return fileDescriptor_blacklist_9c5bbb1e7e0b6c45, []int{3} +} +func (m *BlacklistTxData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlacklistTxData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlacklistTxData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *BlacklistTxData) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlacklistTxData.Merge(dst, src) +} +func (m *BlacklistTxData) XXX_Size() int { + return m.Size() +} +func (m *BlacklistTxData) XXX_DiscardUnknown() { + xxx_messageInfo_BlacklistTxData.DiscardUnknown(m) +} + +var xxx_messageInfo_BlacklistTxData proto.InternalMessageInfo + +func (m *BlacklistTxData) GetPubkey() []byte { + if m != nil { + return m.Pubkey + } + return nil +} + +func (m *BlacklistTxData) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + +func (m *BlacklistTxData) GetSignatures() [][]byte { + if m != nil { + return m.Signatures + } + return nil +} + +func init() { + proto.RegisterType((*Evidence)(nil), "pb.Evidence") + proto.RegisterType((*BlacklistMsg)(nil), "pb.BlacklistMsg") + proto.RegisterType((*BlacklistConfirmMsg)(nil), "pb.BlacklistConfirmMsg") + proto.RegisterType((*BlacklistTxData)(nil), "pb.BlacklistTxData") +} +func (m *Evidence) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Evidence) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.PubKey) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintBlacklist(dAtA, i, uint64(len(m.PubKey))) + i += copy(dAtA[i:], m.PubKey) + } + if m.Tx != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintBlacklist(dAtA, i, uint64(m.Tx.Size())) + n1, err := m.Tx.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n1 + } + if m.Block != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintBlacklist(dAtA, i, uint64(m.Block.Size())) + n2, err := m.Block.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n2 + } + if m.Type != 0 { + dAtA[i] = 0x20 + i++ + i = encodeVarintBlacklist(dAtA, i, uint64(m.Type)) + } + if len(m.Err) > 0 { + dAtA[i] = 0x2a + i++ + i = encodeVarintBlacklist(dAtA, i, uint64(len(m.Err))) + i += copy(dAtA[i:], m.Err) + } + if m.Ts != 0 { + dAtA[i] = 0x30 + i++ + i = encodeVarintBlacklist(dAtA, i, uint64(m.Ts)) + } + return i, nil +} + +func (m *BlacklistMsg) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlacklistMsg) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Hash) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintBlacklist(dAtA, i, uint64(len(m.Hash))) + i += copy(dAtA[i:], m.Hash) + } + if len(m.Evidences) > 0 { + for _, msg := range m.Evidences { + dAtA[i] = 0x12 + i++ + i = encodeVarintBlacklist(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + return i, nil +} + +func (m *BlacklistConfirmMsg) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlacklistConfirmMsg) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Pubkey) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintBlacklist(dAtA, i, uint64(len(m.Pubkey))) + i += copy(dAtA[i:], m.Pubkey) + } + if len(m.Hash) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintBlacklist(dAtA, i, uint64(len(m.Hash))) + i += copy(dAtA[i:], m.Hash) + } + if len(m.Signature) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintBlacklist(dAtA, i, uint64(len(m.Signature))) + i += copy(dAtA[i:], m.Signature) + } + if m.Timestamp != 0 { + dAtA[i] = 0x20 + i++ + i = encodeVarintBlacklist(dAtA, i, uint64(m.Timestamp)) + } + return i, nil +} + +func (m *BlacklistTxData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlacklistTxData) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Pubkey) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintBlacklist(dAtA, i, uint64(len(m.Pubkey))) + i += copy(dAtA[i:], m.Pubkey) + } + if len(m.Hash) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintBlacklist(dAtA, i, uint64(len(m.Hash))) + i += copy(dAtA[i:], m.Hash) + } + if len(m.Signatures) > 0 { + for _, b := range m.Signatures { + dAtA[i] = 0x1a + i++ + i = encodeVarintBlacklist(dAtA, i, uint64(len(b))) + i += copy(dAtA[i:], b) + } + } + return i, nil +} + +func encodeVarintBlacklist(dAtA []byte, offset int, v uint64) int { + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return offset + 1 +} +func (m *Evidence) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PubKey) + if l > 0 { + n += 1 + l + sovBlacklist(uint64(l)) + } + if m.Tx != nil { + l = m.Tx.Size() + n += 1 + l + sovBlacklist(uint64(l)) + } + if m.Block != nil { + l = m.Block.Size() + n += 1 + l + sovBlacklist(uint64(l)) + } + if m.Type != 0 { + n += 1 + sovBlacklist(uint64(m.Type)) + } + l = len(m.Err) + if l > 0 { + n += 1 + l + sovBlacklist(uint64(l)) + } + if m.Ts != 0 { + n += 1 + sovBlacklist(uint64(m.Ts)) + } + return n +} + +func (m *BlacklistMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovBlacklist(uint64(l)) + } + if len(m.Evidences) > 0 { + for _, e := range m.Evidences { + l = e.Size() + n += 1 + l + sovBlacklist(uint64(l)) + } + } + return n +} + +func (m *BlacklistConfirmMsg) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Pubkey) + if l > 0 { + n += 1 + l + sovBlacklist(uint64(l)) + } + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovBlacklist(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovBlacklist(uint64(l)) + } + if m.Timestamp != 0 { + n += 1 + sovBlacklist(uint64(m.Timestamp)) + } + return n +} + +func (m *BlacklistTxData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Pubkey) + if l > 0 { + n += 1 + l + sovBlacklist(uint64(l)) + } + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovBlacklist(uint64(l)) + } + if len(m.Signatures) > 0 { + for _, b := range m.Signatures { + l = len(b) + n += 1 + l + sovBlacklist(uint64(l)) + } + } + return n +} + +func sovBlacklist(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozBlacklist(x uint64) (n int) { + return sovBlacklist(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Evidence) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlacklist + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Evidence: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Evidence: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlacklist + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthBlacklist + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PubKey = append(m.PubKey[:0], dAtA[iNdEx:postIndex]...) + if m.PubKey == nil { + m.PubKey = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tx", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlacklist + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBlacklist + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Tx == nil { + m.Tx = &pb.Transaction{} + } + if err := m.Tx.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlacklist + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBlacklist + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Block == nil { + m.Block = &pb.Block{} + } + if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlacklist + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Err", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlacklist + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthBlacklist + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Err = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Ts", wireType) + } + m.Ts = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlacklist + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Ts |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipBlacklist(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthBlacklist + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlacklistMsg) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlacklist + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlacklistMsg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlacklistMsg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlacklist + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthBlacklist + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Evidences", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlacklist + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBlacklist + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Evidences = append(m.Evidences, &Evidence{}) + if err := m.Evidences[len(m.Evidences)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBlacklist(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthBlacklist + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlacklistConfirmMsg) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlacklist + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlacklistConfirmMsg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlacklistConfirmMsg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pubkey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlacklist + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthBlacklist + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Pubkey = append(m.Pubkey[:0], dAtA[iNdEx:postIndex]...) + if m.Pubkey == nil { + m.Pubkey = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlacklist + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthBlacklist + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlacklist + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthBlacklist + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + m.Timestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlacklist + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timestamp |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipBlacklist(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthBlacklist + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlacklistTxData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlacklist + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlacklistTxData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlacklistTxData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pubkey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlacklist + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthBlacklist + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Pubkey = append(m.Pubkey[:0], dAtA[iNdEx:postIndex]...) + if m.Pubkey == nil { + m.Pubkey = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlacklist + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthBlacklist + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlacklist + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthBlacklist + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signatures = append(m.Signatures, make([]byte, postIndex-iNdEx)) + copy(m.Signatures[len(m.Signatures)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBlacklist(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthBlacklist + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipBlacklist(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBlacklist + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBlacklist + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBlacklist + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + iNdEx += length + if length < 0 { + return 0, ErrInvalidLengthBlacklist + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBlacklist + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipBlacklist(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthBlacklist = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowBlacklist = fmt.Errorf("proto: integer overflow") +) + +func init() { proto.RegisterFile("blacklist.proto", fileDescriptor_blacklist_9c5bbb1e7e0b6c45) } + +var fileDescriptor_blacklist_9c5bbb1e7e0b6c45 = []byte{ + // 384 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0xcd, 0x8e, 0xd3, 0x30, + 0x14, 0x85, 0x6b, 0x67, 0x26, 0xa2, 0x77, 0x32, 0x0c, 0xf2, 0x48, 0x23, 0x0b, 0xa1, 0x28, 0xca, + 0x6c, 0x22, 0x16, 0x89, 0x28, 0x6f, 0x10, 0x28, 0x1b, 0xc4, 0x8f, 0xac, 0x2c, 0xd8, 0xb0, 0xb0, + 0x53, 0xd3, 0x46, 0x6d, 0x62, 0x2b, 0x76, 0x50, 0xba, 0xe0, 0x1d, 0x78, 0x06, 0x9e, 0x86, 0x65, + 0x97, 0x2c, 0x51, 0xfb, 0x22, 0x28, 0x69, 0x9b, 0x74, 0xcb, 0xee, 0xde, 0x73, 0x6e, 0xce, 0xc9, + 0x27, 0xc3, 0x9d, 0xd8, 0xf0, 0x7c, 0xbd, 0x29, 0x8c, 0x8d, 0x75, 0xad, 0xac, 0x22, 0x58, 0x8b, + 0xe7, 0xaf, 0x96, 0x85, 0x5d, 0x35, 0x22, 0xce, 0x55, 0x99, 0xa4, 0x9f, 0xbe, 0xbc, 0x53, 0x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ee, 0x05, 0x4c, 0x4d, 0xb1, 0xac, 0xb8, 0x6d, 0x6a, 0xd9, + 0x13, 0x7b, 0x6c, 0x14, 0x3a, 0xd7, 0x16, 0xa5, 0x34, 0x96, 0x97, 0xba, 0x67, 0x75, 0xd8, 0x28, + 0x84, 0x5f, 0xe1, 0x6e, 0xa8, 0xcf, 0xda, 0xb7, 0xdc, 0xf2, 0xff, 0xaa, 0xf6, 0x01, 0x86, 0x26, + 0x43, 0x9d, 0xc0, 0x89, 0x3c, 0x76, 0xa1, 0xa4, 0xf4, 0xf7, 0xde, 0x47, 0xbb, 0xbd, 0x8f, 0xfe, + 0xee, 0x7d, 0xf4, 0xf3, 0xe0, 0x4f, 0x76, 0x07, 0x7f, 0xf2, 0xe7, 0xe0, 0x4f, 0x84, 0xdb, 0xbf, + 0xf9, 0xeb, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x81, 0xf9, 0x12, 0xbe, 0x3d, 0x02, 0x00, 0x00, +} diff --git a/core/controller/pb/blacklist.proto b/core/controller/pb/blacklist.proto new file mode 100644 index 00000000..fef5ab13 --- /dev/null +++ b/core/controller/pb/blacklist.proto @@ -0,0 +1,37 @@ +// Copyright (c) 2018 ContentBox Authors. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +syntax = "proto3"; + +package pb; + +import "github.com/BOXFoundation/boxd/core/pb/block.proto"; + + +message Evidence { + bytes PubKey = 1; + corepb.Transaction Tx = 2; + corepb.Block Block = 3; + uint32 Type = 4; + string Err = 5; + int64 Ts = 6; +} + +message BlacklistMsg { + bytes hash = 1; + repeated Evidence evidences = 2; +} + +message BlacklistConfirmMsg { + bytes pubkey = 1; + bytes hash = 2; + bytes signature = 3; + int64 timestamp = 4; +} + +message BlacklistTxData { + bytes pubkey = 1; + bytes hash = 2; + repeated bytes signatures = 3; +} \ No newline at end of file diff --git a/core/controller/types.go b/core/controller/types.go new file mode 100644 index 00000000..8b4a33a1 --- /dev/null +++ b/core/controller/types.go @@ -0,0 +1,430 @@ +// Copyright (c) 2018 ContentBox Authors. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package controller + +import ( + "bytes" + "errors" + "fmt" + + "github.com/BOXFoundation/boxd/core" + ctlpb "github.com/BOXFoundation/boxd/core/controller/pb" + corepb "github.com/BOXFoundation/boxd/core/pb" + coreTypes "github.com/BOXFoundation/boxd/core/types" + "github.com/BOXFoundation/boxd/crypto" + conv "github.com/BOXFoundation/boxd/p2p/convert" + "github.com/gogo/protobuf/proto" +) + +var ( + _ conv.Convertible = (*Evidence)(nil) + _ conv.Serializable = (*Evidence)(nil) + _ conv.Convertible = (*BlacklistMsg)(nil) + _ conv.Serializable = (*BlacklistMsg)(nil) + _ conv.Convertible = (*BlacklistConfirmMsg)(nil) + _ conv.Serializable = (*BlacklistConfirmMsg)(nil) + _ conv.Convertible = (*BlacklistTxData)(nil) + _ conv.Serializable = (*BlacklistTxData)(nil) + + errInvalidProtoMessage = errors.New("Invalid proto message") +) + +// BlacklistMsg contains evidences for bad node +type BlacklistMsg struct { + hash []byte + evidences []*Evidence +} + +// BlacklistConfirmMsg contains evidences for bad node +type BlacklistConfirmMsg struct { + pubkey []byte + hash []byte + signature []byte + timestamp int64 +} + +// BlacklistTxData will put into tx on chain +type BlacklistTxData struct { + pubkey []byte + hash []byte + signatures [][]byte +} + +func newBlacklistMsg(evis ...*Evidence) *BlacklistMsg { + if evis == nil { + evis = make([]*Evidence, 0) + } + blm := &BlacklistMsg{evidences: evis} + hash, _ := blm.calcHash() + blm.hash = hash + return blm +} + +// calcHash calculates the identifier hash for the msg. +func (blm *BlacklistMsg) calcHash() ([]byte, error) { + if blm.evidences == nil || len(blm.evidences) == 0 { + return nil, core.ErrEmptyEvidence + } + + msgBuf := make([][]byte, len(blm.evidences)) + + for _, evidence := range blm.evidences { + eviBuf, err := evidence.Marshal() + if err != nil { + return nil, err + } + msgBuf = append(msgBuf, eviBuf) + } + hash := crypto.Sha256Multi(msgBuf...) + return hash, nil +} + +func (blm *BlacklistMsg) validateHash() error { + eviHash, err := blm.calcHash() + if err != nil { + return err + } + if !bytes.Equal(blm.hash, eviHash) { + return core.ErrInsufficientEvidence + } + return nil +} + +// Hash return hash +func (btd *BlacklistTxData) Hash() []byte { + return btd.hash +} + +// Signatures return signatures +func (btd *BlacklistTxData) Signatures() [][]byte { + return btd.signatures +} + +//////////////////////////////////////////////////////////////////// + +// ToProtoMessage converts Evidence to proto message. +func (evi *Evidence) ToProtoMessage() (proto.Message, error) { + + var err error + var tx *corepb.Transaction + var block *corepb.Block + + switch evi.Type { + case TxEvidence: + tx, err = ConvTxToPbTx(evi.Tx) + block = &corepb.Block{} + + case BlockEvidence: + tx = &corepb.Transaction{} + block, err = ConvBlockToPbBlock(evi.Block) + + } + if err != nil { + return nil, err + } + + return &ctlpb.Evidence{ + PubKey: evi.PubKey, + Tx: tx, + Block: block, + Type: evi.Type, + Err: evi.Err, + Ts: evi.Ts, + }, nil +} + +// FromProtoMessage converts proto message to Evidence. +func (evi *Evidence) FromProtoMessage(message proto.Message) error { + if evi == nil { + evi = &Evidence{} + } + var err error + if message, ok := message.(*ctlpb.Evidence); ok { + if message != nil { + evi.PubKey = make([]byte, len(message.PubKey)) + copy(evi.PubKey[:], message.PubKey[:]) + evi.Tx, err = ConvPbTxToTx(message.Tx) + if err != nil { + return err + } + evi.Block, err = ConvPbBlockToBlock(message.Block) + if err != nil { + return err + } + evi.Type = message.Type + evi.Err = message.Err + evi.Ts = message.Ts + return nil + } + return core.ErrEmptyProtoMessage + } + + return errInvalidProtoMessage +} + +// Marshal method marshal Evidence object to binary +func (evi *Evidence) Marshal() (data []byte, err error) { + return conv.MarshalConvertible(evi) +} + +// Unmarshal method unmarshal binary data to Evidence object +func (evi *Evidence) Unmarshal(data []byte) error { + msg := &ctlpb.Evidence{} + if err := proto.Unmarshal(data, msg); err != nil { + return err + } + return evi.FromProtoMessage(msg) +} + +// ToProtoMessage converts BlacklistMsg to proto message. +func (blm *BlacklistMsg) ToProtoMessage() (proto.Message, error) { + if blm == nil { + blm = newBlacklistMsg() + } + evis, err := ConvEvidencesToPbEvidences(blm.evidences) + if err != nil { + return nil, err + } + + hash := make([]byte, len(blm.hash)) + copy(hash[:], blm.hash[:]) + + return &ctlpb.BlacklistMsg{ + Evidences: evis, + Hash: hash, + }, nil +} + +// FromProtoMessage converts proto message to BlacklistMsg. +func (blm *BlacklistMsg) FromProtoMessage(message proto.Message) error { + if blm == nil { + blm = newBlacklistMsg() + } + if msg, ok := message.(*ctlpb.BlacklistMsg); ok { + if msg != nil { + var err error + blm.evidences, err = ConvPbEvidencesToEvidences(msg.Evidences) + if err != nil { + logger.Error(err.Error()) + return errInvalidProtoMessage + } + blm.hash = make([]byte, len(msg.Hash)) + copy(blm.hash[:], msg.Hash[:]) + return nil + } + return core.ErrEmptyProtoMessage + } + return errInvalidProtoMessage +} + +// Marshal method marshal BlacklistMsg object to binary +func (blm *BlacklistMsg) Marshal() (data []byte, err error) { + return conv.MarshalConvertible(blm) +} + +// Unmarshal method unmarshal binary data to BlacklistMsg object +func (blm *BlacklistMsg) Unmarshal(data []byte) error { + msg := &ctlpb.BlacklistMsg{} + if err := proto.Unmarshal(data, msg); err != nil { + return err + } + return blm.FromProtoMessage(msg) +} + +// ToProtoMessage converts BlacklistConfirmMsg to proto message. +func (bcm *BlacklistConfirmMsg) ToProtoMessage() (proto.Message, error) { + if bcm == nil { + return nil, core.ErrEmptyProtoSource + } + + hash := make([]byte, len(bcm.hash)) + copy(hash[:], bcm.hash[:]) + + signature := make([]byte, len(bcm.signature)) + copy(signature[:], bcm.signature[:]) + + pubkey := make([]byte, len(bcm.pubkey)) + copy(pubkey[:], bcm.pubkey[:]) + + return &ctlpb.BlacklistConfirmMsg{ + Pubkey: pubkey, + Hash: hash, + Signature: signature, + Timestamp: bcm.timestamp, + }, nil +} + +// FromProtoMessage converts proto message to BlacklistConfirmMsg. +func (bcm *BlacklistConfirmMsg) FromProtoMessage(message proto.Message) error { + if bcm == nil { + return core.ErrEmptyProtoMessage + } + if msg, ok := message.(*ctlpb.BlacklistConfirmMsg); ok { + if msg != nil { + bcm.pubkey = make([]byte, len(msg.Pubkey)) + copy(bcm.pubkey[:], msg.Pubkey[:]) + bcm.hash = make([]byte, len(msg.Hash)) + copy(bcm.hash[:], msg.Hash[:]) + bcm.signature = make([]byte, len(msg.Signature)) + copy(bcm.signature[:], msg.Signature[:]) + bcm.timestamp = msg.Timestamp + return nil + } + return core.ErrEmptyProtoMessage + } + return errInvalidProtoMessage +} + +// Marshal method marshal BlacklistConfirmMsg object to binary +func (bcm *BlacklistConfirmMsg) Marshal() (data []byte, err error) { + return conv.MarshalConvertible(bcm) +} + +// Unmarshal method unmarshal binary data to BlacklistConfirmMsg object +func (bcm *BlacklistConfirmMsg) Unmarshal(data []byte) error { + msg := &ctlpb.BlacklistConfirmMsg{} + if err := proto.Unmarshal(data, msg); err != nil { + return err + } + return bcm.FromProtoMessage(msg) +} + +// ToProtoMessage converts BlacklistConfirmMsg to proto message. +func (btd *BlacklistTxData) ToProtoMessage() (proto.Message, error) { + if btd == nil { + return nil, core.ErrEmptyProtoSource + } + + hash := make([]byte, len(btd.hash)) + copy(hash[:], btd.hash[:]) + pubkey := make([]byte, len(btd.pubkey)) + copy(pubkey[:], btd.pubkey[:]) + + signs := [][]byte{} + for _, v := range btd.signatures { + sign := make([]byte, len(v)) + copy(sign[:], v[:]) + signs = append(signs, sign) + } + + return &ctlpb.BlacklistTxData{ + Pubkey: pubkey, + Hash: hash, + Signatures: signs, + }, nil +} + +// FromProtoMessage converts proto message to BlacklistConfirmMsg. +func (btd *BlacklistTxData) FromProtoMessage(message proto.Message) error { + if btd == nil { + btd = &BlacklistTxData{} + } + if msg, ok := message.(*ctlpb.BlacklistTxData); ok { + if msg != nil { + btd.pubkey = make([]byte, len(msg.Pubkey)) + copy(btd.pubkey[:], msg.Pubkey[:]) + btd.hash = make([]byte, len(msg.Hash)) + copy(btd.hash[:], msg.Hash[:]) + + btd.signatures = make([][]byte, len(btd.signatures)) + for _, v := range msg.Signatures { + sign := make([]byte, len(v)) + copy(sign[:], v[:]) + btd.signatures = append(btd.signatures, sign) + } + return nil + } + return core.ErrEmptyProtoMessage + } + return errInvalidProtoMessage +} + +// Marshal method marshal BlacklistConfirmMsg object to binary +func (btd *BlacklistTxData) Marshal() (data []byte, err error) { + return conv.MarshalConvertible(btd) +} + +// Unmarshal method unmarshal binary data to BlacklistConfirmMsg object +func (btd *BlacklistTxData) Unmarshal(data []byte) error { + msg := &ctlpb.BlacklistTxData{} + if err := proto.Unmarshal(data, msg); err != nil { + return err + } + return btd.FromProtoMessage(msg) +} + +/////////////////////////////////////////////////////////////////////// + +// ConvBlockToPbBlock convert *coreTypes.Block to *corepb.Block +func ConvBlockToPbBlock(block *coreTypes.Block) (*corepb.Block, error) { + msg, err := block.ToProtoMessage() + if err != nil { + return nil, err + } + if hmsg, ok := msg.(*corepb.Block); ok { + return hmsg, nil + } + return nil, fmt.Errorf("asserted failed for proto.Message to *corepb.Block") +} + +// ConvPbBlockToBlock convert *corepb.Block to *coreTypes.Block +func ConvPbBlockToBlock(pbBlock *corepb.Block) (*coreTypes.Block, error) { + block := new(coreTypes.Block) + if err := block.FromProtoMessage(pbBlock); err != nil { + return nil, err + } + return block, nil +} + +// ConvTxToPbTx convert *coreTypes.Transaction to *corepb.Transaction +func ConvTxToPbTx(v *coreTypes.Transaction) (*corepb.Transaction, error) { + tx, err := v.ToProtoMessage() + if err != nil { + return nil, err + } + if tx, ok := tx.(*corepb.Transaction); ok { + return tx, nil + } + return nil, fmt.Errorf("asserted failed for proto.Message to *corepb.Transaction") +} + +// ConvPbTxToTx convert *corepb.Transaction to *coreTypes.Transaction +func ConvPbTxToTx(pbTx *corepb.Transaction) (*coreTypes.Transaction, error) { + tx := new(coreTypes.Transaction) + if err := tx.FromProtoMessage(pbTx); err != nil { + return nil, err + } + return tx, nil +} + +// ConvEvidencesToPbEvidences convert []*coreTypes.Block to []*corepb.Block +func ConvEvidencesToPbEvidences(evidences []*Evidence) ([]*ctlpb.Evidence, error) { + pbEvis := make([]*ctlpb.Evidence, 0, len(evidences)) + for _, v := range evidences { + msg, err := v.ToProtoMessage() + if err != nil { + return nil, err + } + evi, ok := msg.(*ctlpb.Evidence) + if !ok { + return nil, fmt.Errorf("asserted failed for proto.Message to *ctlpb.Evidence") + } + pbEvis = append(pbEvis, evi) + } + return pbEvis, nil +} + +// ConvPbEvidencesToEvidences convert []*corepb.Block to []*coreTypes.Block +func ConvPbEvidencesToEvidences(pbEvis []*ctlpb.Evidence) ([]*Evidence, error) { + evidences := make([]*Evidence, 0, len(pbEvis)) + for _, v := range pbEvis { + evidence := new(Evidence) + if err := evidence.FromProtoMessage(v); err != nil { + return nil, err + } + evidences = append(evidences, evidence) + } + return evidences, nil +} diff --git a/core/controller/types_test.go b/core/controller/types_test.go new file mode 100644 index 00000000..9e68616f --- /dev/null +++ b/core/controller/types_test.go @@ -0,0 +1,58 @@ +// Copyright (c) 2018 ContentBox Authors. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package controller + +import ( + "testing" + "time" + + "github.com/facebookgo/ensure" +) + +func TestBlacklistTxDataMarshal(t *testing.T) { + data := &BlacklistTxData{ + pubkey: []byte{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, + 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, + 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f}, + hash: []byte{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, + 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, + 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f}, + signatures: [][]byte{ + {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, + 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, + 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f}, + {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, + 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, + 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x10, 0x0a}, + }, + } + biData, err := data.Marshal() + ensure.DeepEqual(t, err, nil) + + newData := &BlacklistTxData{} + err = newData.Unmarshal(biData) + ensure.DeepEqual(t, err, nil) +} + +func TestBlacklistConfirmMsgMarshal(t *testing.T) { + data := &BlacklistConfirmMsg{ + pubkey: []byte{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, + 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, + 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f}, + hash: []byte{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, + 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, + 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f}, + signature: []byte{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, + 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, + 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f}, + timestamp: time.Now().Unix(), + } + biData, err := data.Marshal() + ensure.DeepEqual(t, err, nil) + + newData := &BlacklistConfirmMsg{} + err = newData.Unmarshal(biData) + ensure.DeepEqual(t, err, nil) +} diff --git a/core/error.go b/core/error.go index 8a5993f0..5f4c6687 100644 --- a/core/error.go +++ b/core/error.go @@ -78,6 +78,7 @@ var ( ErrMissingTxOut = errors.New("Referenced utxo does not exist") ErrImmatureSpend = errors.New("Attempting to spend an immature coinbase") ErrSpendTooHigh = errors.New("Transaction is attempting to spend more value than the sum of all of its inputs") + ErrPubKeyInBlackList = errors.New("Public key is in black list") //utxoset.go ErrTxOutIndexOob = errors.New("Transaction output index out of bound") @@ -88,5 +89,17 @@ var ( ErrInvalidFilterHeight = errors.New("Filter can only be added in chain sequence") ErrLoadBlockFilters = errors.New("Fail to load block filters") - EvilBehavior = []interface{}{ErrInvalidTime, ErrNoTransactions, ErrBlockTooBig, ErrFirstTxNotCoinbase, ErrMultipleCoinbases, ErrBadMerkleRoot, ErrDuplicateTx, ErrTooManySigOps, ErrBadFees, ErrBadCoinbaseValue, ErrUnfinalizedTx, ErrWrongBlockHeight, ErrDuplicateTxInPool, ErrDuplicateTxInOrphanPool, ErrCoinbaseTx, ErrNonStandardTransaction, ErrOutPutAlreadySpent, ErrOrphanTransaction, ErrDoubleSpendTx} + // blacklist.go + ErrInvalidEvidenceType = errors.New("Invalid evidence type") + ErrInsufficientEvidence = errors.New("Insufficient evidence") + ErrEmptyEvidence = errors.New("No evidences") + ErrSeparateSourceEvidences = errors.New("Separate source evidences") + ErrSign = errors.New("Sign error") + ErrEmptyProtoSource = errors.New("Empty proto source") + ErrNotMintPeer = errors.New("Invalid mint peer") + ErrIllegalMsg = errors.New("Illegal message") + ErrEvidenceErrNotMatch = errors.New("Evidence not match error") + ErrInvalidBlacklistTx = errors.New("Invalid blacklist tx") + + EvilBehavior = []interface{}{ErrInvalidTime, ErrNoTransactions, ErrBlockTooBig, ErrFirstTxNotCoinbase, ErrMultipleCoinbases, ErrBadMerkleRoot, ErrDuplicateTx, ErrTooManySigOps, ErrBadFees, ErrBadCoinbaseValue, ErrUnfinalizedTx, ErrWrongBlockHeight, ErrDuplicateTxInPool, ErrDuplicateTxInOrphanPool, ErrCoinbaseTx, ErrNonStandardTransaction, ErrOutPutAlreadySpent, ErrDoubleSpendTx} ) diff --git a/core/txgenerator/tx_generator.go b/core/txgenerator/tx_generator.go new file mode 100644 index 00000000..3ff37222 --- /dev/null +++ b/core/txgenerator/tx_generator.go @@ -0,0 +1,280 @@ +// Copyright (c) 2018 ContentBox Authors. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package txgenerator + +import ( + "fmt" + "math" + + "github.com/BOXFoundation/boxd/boxd/eventbus" + "github.com/BOXFoundation/boxd/core/chain" + "github.com/BOXFoundation/boxd/core/pb" + "github.com/BOXFoundation/boxd/core/txpool" + "github.com/BOXFoundation/boxd/core/types" + "github.com/BOXFoundation/boxd/crypto" + "github.com/BOXFoundation/boxd/log" + "github.com/BOXFoundation/boxd/p2p" + "github.com/BOXFoundation/boxd/script" + "github.com/BOXFoundation/boxd/storage" + "github.com/BOXFoundation/boxd/util" + "github.com/BOXFoundation/boxd/wallet" + "github.com/BOXFoundation/boxd/wallet/utxo" +) + +var logger = log.NewLogger("tx_generator") + +var ( + txGenerator *TxGenerator + zeroHash = crypto.HashType{} +) + +// TxGenerator can generate tx automatically +type TxGenerator struct { + db storage.Table + chain *chain.BlockChain + peer *p2p.BoxPeer + txpool *txpool.TransactionPool +} + +// Default return the default TxGenerator +func Default() *TxGenerator { + return txGenerator +} + +// New return a new TxGenerator +func New(s storage.Storage, blockchain *chain.BlockChain, txpool *txpool.TransactionPool, peer *p2p.BoxPeer) (*TxGenerator, error) { + if txGenerator == nil { + txGenerator = &TxGenerator{} + } + table, err := s.Table(chain.WalletTableName) + if err != nil { + return nil, err + } + txGenerator.db = table + txGenerator.chain = blockchain + txGenerator.txpool = txpool + txGenerator.peer = peer + return txGenerator, nil +} + +// Run tx generator +func (tg *TxGenerator) Run() { + eventbus.Default().Reply(eventbus.TopicGenerateTx, func(data *corepb.Data, out chan<- *types.Transaction) { + logger.Errorf("newTx start!!!!") + tx, err := tg.NewTx(data) + if err != nil { + logger.Errorf("new tx failed: %v", err) + out <- nil + return + } + logger.Errorf("new tx success: %v", tx) + out <- tx + }, false) +} + +// FundTransaction asdf +func (tg *TxGenerator) FundTransaction(minerAddr string, requiredAmount uint64) (map[types.OutPoint]*types.UtxoWrap, error) { + + addr, err := types.NewAddress(minerAddr) + payToPubKeyHashScript := *script.PayToPubKeyHashScript(addr.Hash()) + if err != nil { + return nil, nil + } + wallet := utxo.NewWalletUtxoWithAddress(payToPubKeyHashScript, tg.db) + utxos, err := wallet.Utxos(addr) + if err != nil { + return nil, err + } + + nextHeight := tg.chain.GetBlockHeight() + 1 + + // apply mempool txs as if they were mined into a block with 0 confirmation + utxoSet := chain.NewUtxoSetFromMap(utxos) + memPoolTxs, _ := tg.txpool.GetTransactionsInPool() + // Note: we add utxo first and spend them later to maintain tx topological order within mempool. Since memPoolTxs may not + // be topologically ordered, if tx1 spends tx2 but tx1 comes after tx2, tx1's output is mistakenly marked as unspent + // Add utxos first + for _, tx := range memPoolTxs { + for txOutIdx, txOut := range tx.Vout { + // utxo for this address + if util.IsPrefixed(txOut.ScriptPubKey, payToPubKeyHashScript) { + if err := utxoSet.AddUtxo(tx, uint32(txOutIdx), nextHeight); err != nil { + return nil, nil + } + } + } + } + // Then spend + for _, tx := range memPoolTxs { + for _, txIn := range tx.Vin { + utxoSet.SpendUtxo(txIn.PrevOutPoint) + } + } + utxos = utxoSet.GetUtxos() + + var current uint64 + tokenAmount := make(map[types.OutPoint]uint64) + choosenUtxos := make(map[types.OutPoint]*types.UtxoWrap) + for out, utxo := range utxos { + token, amount, isToken := tg.getTokenInfo(out, utxo) + if isToken { + if val, ok := tokenAmount[token]; ok && val > 0 { + if val > amount { + tokenAmount[token] = val - amount + } else { + delete(tokenAmount, token) + } + current += utxo.Value() + choosenUtxos[out] = utxo + } else { + // Do not include token utxos not needed + continue + } + } else if current < requiredAmount { + choosenUtxos[out] = utxo + current += utxo.Value() + } + if current >= requiredAmount && len(tokenAmount) == 0 { + break + } + } + if current < requiredAmount || len(tokenAmount) > 0 { + errMsg := "Not enough balance" + return nil, fmt.Errorf(errMsg) + } + return choosenUtxos, nil +} + +func (tg *TxGenerator) getTokenInfo(outpoint types.OutPoint, wrap *types.UtxoWrap) (types.OutPoint, uint64, bool) { + s := script.NewScriptFromBytes(wrap.Output.ScriptPubKey) + if s.IsTokenIssue() { + if issueParam, err := s.GetIssueParams(); err == nil { + return outpoint, issueParam.TotalSupply * uint64(math.Pow10(int(issueParam.Decimals))), true + } + } + if s.IsTokenTransfer() { + if transferParam, err := s.GetTransferParams(); err == nil { + return transferParam.OutPoint, transferParam.Amount, true + } + } + return types.OutPoint{}, 0, false +} + +// NewTx new a tx +func (tg *TxGenerator) NewTx(data *corepb.Data) (*types.Transaction, error) { + + // 获取发送方地址 + accCh := make(chan *wallet.Account) + eventbus.Default().Send(eventbus.TopicMiner, accCh) + acc := <-accCh + + amount := uint64(1) + // 获取utxo + utxos, err := tg.FundTransaction(acc.Addr(), amount) + if err != nil { + return nil, err + } + + tx, err := tg.NewTxWithUtxo(acc, utxos, []string{zeroHash.String()}, []uint64{amount}, 0, data) + if err != nil { + return nil, err + } + + return tx, nil +} + +// NewTxWithUtxo new a transaction +func (tg *TxGenerator) NewTxWithUtxo(fromAcc *wallet.Account, utxos map[types.OutPoint]*types.UtxoWrap, toAddrs []string, + amounts []uint64, changeAmt uint64, data *corepb.Data) (*types.Transaction, error) { + + logger.Errorf("fromAcc = %v, utxos = %v, toAddrs = %v, amounts = %v, changeAmt = %v", fromAcc.Addr(), utxos, toAddrs, amounts, changeAmt) + + utxoValue := uint64(0) + for _, u := range utxos { + utxoValue += u.Output.Value + } + amount := uint64(0) + for _, a := range amounts { + amount += a + } + if utxoValue < amount+changeAmt { + return nil, fmt.Errorf("input %d is less than output %d", utxoValue, amount+changeAmt) + } + + // vin + vins := make([]*types.TxIn, 0) + for outpoint, utxo := range utxos { + vins = append(vins, makeVin(outpoint, utxo, 0)) + } + + // vout for toAddrs + vouts := make([]*corepb.TxOut, 0, len(toAddrs)) + for i, toAddr := range toAddrs { + vouts = append(vouts, makeVout(toAddr, amounts[i])) + } + + // vout for change of fromAddress + fromAddrOut := makeVout(fromAcc.Addr(), changeAmt) + + // construct transaction + tx := new(types.Transaction) + tx.Vin = append(tx.Vin, vins...) + tx.Vout = append(tx.Vout, vouts...) + tx.Vout = append(tx.Vout, fromAddrOut) + tx.Data = data + + // sign vin + if err := tg.signTx(tx, utxos, fromAcc); err != nil { + return nil, err + } + + // create change utxo + tx.TxHash() + + return tx, nil +} + +func makeVin(outpoint types.OutPoint, utxo *types.UtxoWrap, seq uint32) *types.TxIn { + var hash crypto.HashType + copy(hash[:], outpoint.Hash[:]) + return &types.TxIn{ + PrevOutPoint: types.OutPoint{ + Hash: hash, + Index: outpoint.Index, + }, + ScriptSig: []byte{}, + Sequence: seq, + } +} + +func makeVout(acc string, amount uint64) *corepb.TxOut { + address, _ := types.NewAddress(acc) + addrPkh, _ := types.NewAddressPubKeyHash(address.Hash()) + addrScript := *script.PayToPubKeyHashScript(addrPkh.Hash()) + return &corepb.TxOut{ + Value: amount, + ScriptPubKey: addrScript, + } +} + +func (tg *TxGenerator) signTx(tx *types.Transaction, utxos map[types.OutPoint]*types.UtxoWrap, acc *wallet.Account) error { + i := 0 + for _, utxo := range utxos { + scriptPkBytes := utxo.Output.ScriptPubKey + sigHash, err := script.CalcTxHashForSig(scriptPkBytes, tx, i) + if err != nil { + return err + } + + sig, err := crypto.Sign(acc.PrivateKey(), sigHash) + if err != nil { + return err + } + scriptSig := script.SignatureScript(sig, acc.PublicKey()) + tx.Vin[i].ScriptSig = *scriptSig + i++ + } + return nil +} diff --git a/core/txpool/transaction_pool.go b/core/txpool/transaction_pool.go index bc8e0134..b4a3740b 100644 --- a/core/txpool/transaction_pool.go +++ b/core/txpool/transaction_pool.go @@ -5,6 +5,7 @@ package txpool import ( + "bytes" "errors" "sync" "time" @@ -13,6 +14,7 @@ import ( "github.com/BOXFoundation/boxd/boxd/service" "github.com/BOXFoundation/boxd/core" "github.com/BOXFoundation/boxd/core/chain" + ctl "github.com/BOXFoundation/boxd/core/controller" "github.com/BOXFoundation/boxd/core/metrics" "github.com/BOXFoundation/boxd/core/types" "github.com/BOXFoundation/boxd/crypto" @@ -21,6 +23,7 @@ import ( "github.com/BOXFoundation/boxd/script" "github.com/BOXFoundation/boxd/util" "github.com/jbenet/goprocess" + peer "github.com/libp2p/go-libp2p-peer" ) // const defines constants @@ -82,9 +85,9 @@ func (tx_pool *TransactionPool) Run() error { // p2p tx msg tx_pool.txNotifee = p2p.NewNotifiee(p2p.TransactionMsg, tx_pool.newTxMsgCh) tx_pool.notifiee.Subscribe(tx_pool.txNotifee) - // chain update msg tx_pool.bus.Subscribe(eventbus.TopicChainUpdate, tx_pool.receiveChainUpdateMsg) + tx_pool.subscribeBlacklistMsg() tx_pool.proc.Go(tx_pool.loop) return nil @@ -184,14 +187,28 @@ func (tx_pool *TransactionPool) processTxMsg(msg p2p.Message) error { return err } - if err := tx_pool.ProcessTx(tx, core.RelayMode); err != nil && util.InArray(err, core.EvilBehavior) { - tx_pool.chain.Bus().Publish(eventbus.TopicConnEvent, msg.From(), eventbus.BadTxEvent) + if err := tx_pool.ProcessTx(tx, core.RelayMode); err != nil { + tx_pool.checkEvilBehavior(msg.From(), tx, err) return err } tx_pool.chain.Bus().Publish(eventbus.TopicConnEvent, msg.From(), eventbus.NewTxEvent) return nil } +func (tx_pool *TransactionPool) checkEvilBehavior(pid peer.ID, tx *types.Transaction, err error) { + if util.InArray(err, core.EvilBehavior) { + tx_pool.chain.Bus().Publish(eventbus.TopicConnEvent, pid, eventbus.BadTxEvent) + + go func() { + // TODO: need to process script and valid sig = true + pubkey, ok := script.NewScriptFromBytes(tx.Vout[0].ScriptPubKey).GetPubKey() + if ok { + ctl.Default().SceneCh <- &ctl.Evidence{PubKey: pubkey, Tx: tx, Type: ctl.TxEvidence, Err: err.Error(), Ts: time.Now().Unix()} + } + }() + } +} + // ProcessTx is used to handle new transactions. // utxoSet: utxos associated with the tx func (tx_pool *TransactionPool) ProcessTx(tx *types.Transaction, transferMode core.TransferMode) error { @@ -236,8 +253,8 @@ func (tx_pool *TransactionPool) maybeAcceptTx(tx *types.Transaction, transferMod return core.ErrNonStandardTransaction } - if err := tx_pool.checkRegisterOrVoteTx(tx); err != nil { - logger.Errorf("Tx %v is a invalid Register or Vote tx. Err: %v", txHash.String(), err) + if err := tx_pool.checkSpecialTx(tx); err != nil { + logger.Errorf("Tx %v is a invalid special tx. Err: %v", txHash.String(), err) return err } @@ -306,6 +323,13 @@ func (tx_pool *TransactionPool) maybeAcceptTx(tx *types.Transaction, transferMod return nil } +func (tx_pool *TransactionPool) subscribeBlacklistMsg() { + tx_pool.bus.Reply(eventbus.TopicBlacklistTxConfirmResult, func(tx *types.Transaction, resultCh chan error) { + err := tx_pool.ProcessTx(tx, core.DefaultMode) + resultCh <- err + }, false) +} + func (tx_pool *TransactionPool) isTransactionInPool(txHash *crypto.HashType) bool { _, exists := tx_pool.hashToTx.Load(*txHash) return exists @@ -328,7 +352,7 @@ func (tx_pool *TransactionPool) checkTransactionStandard(tx *types.Transaction) return nil } -func (tx_pool *TransactionPool) checkRegisterOrVoteTx(tx *types.Transaction) error { +func (tx_pool *TransactionPool) checkSpecialTx(tx *types.Transaction) error { if tx.Data == nil { return nil } @@ -356,8 +380,46 @@ func (tx_pool *TransactionPool) checkRegisterOrVoteTx(tx *types.Transaction) err if !tx_pool.checkRegisterCandidateOrVoteTx(tx) { return core.ErrInvalidRegisterCandidateOrVoteTx } + case types.BlacklistTx: + if err := tx_pool.checkBlacklistData(tx); err != nil { + return err + } + } + return nil +} + +func (tx_pool *TransactionPool) checkBlacklistData(tx *types.Transaction) error { + blacklistContent := new(ctl.BlacklistTxData) + if err := blacklistContent.Unmarshal(tx.Data.Content); err != nil { + return err } + logger.Errorf("blacklistContent = %v", blacklistContent) + + minerAddrsCh := make(chan []types.AddressHash) + tx_pool.bus.Send(eventbus.TopicAddrs, minerAddrsCh) + minerAddrs := <-minerAddrsCh + for _, sigStr := range blacklistContent.Signatures() { + pubkey, ok := crypto.RecoverCompact(blacklistContent.Hash()[:], sigStr) + if ok { + addr, err := types.NewAddressFromPubKey(pubkey) + if err != nil { + return err + } + var match bool + for _, minerAddr := range minerAddrs { + if bytes.Equal(minerAddr[:], addr.Hash()) { + match = true + break + } + } + if !match { + return core.ErrSign + } + } else { + return core.ErrSign + } + } return nil } diff --git a/core/types/transaction.go b/core/types/transaction.go index 27171590..66f974c0 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -17,6 +17,7 @@ const ( GeneralTx = iota RegisterCandidateTx VoteTx + BlacklistTx ) // Transaction defines a transaction. diff --git a/p2p/dummypeer.go b/p2p/dummypeer.go index c740f2c3..7ad1b5ac 100644 --- a/p2p/dummypeer.go +++ b/p2p/dummypeer.go @@ -47,7 +47,7 @@ func (d *DummyPeer) UnSubscribe(*Notifiee) {} func (d *DummyPeer) Notify(Message) {} // BroadcastToMiners broadcast to miners -func (d *DummyPeer) BroadcastToMiners(code uint32, msg conv.Convertible, miners []string) error { +func (d *DummyPeer) BroadcastToMiners(code uint32, msg conv.Convertible) error { return nil } diff --git a/p2p/interface.go b/p2p/interface.go index 4dad8891..b8c12522 100644 --- a/p2p/interface.go +++ b/p2p/interface.go @@ -25,6 +25,6 @@ type Net interface { UnSubscribe(*Notifiee) Notify(Message) PickOnePeer(peersExclusive ...peer.ID) peer.ID - BroadcastToMiners(uint32, conv.Convertible, []string) error + BroadcastToMiners(uint32, conv.Convertible) error PeerSynced(peers peer.ID) (bool, bool) } diff --git a/p2p/message.go b/p2p/message.go index ec1ca61c..0f7735bf 100644 --- a/p2p/message.go +++ b/p2p/message.go @@ -51,6 +51,9 @@ const ( LightSyncRequest = 0x17 LightSyncReponse = 0x18 + BlacklistMsg = 0x19 + BlacklistConfirmMsg = 0x20 + MaxMessageDataLength = 1024 * 1024 * 1024 // 1GB ) diff --git a/p2p/metrics.go b/p2p/metrics.go index cf4f2c29..156a7615 100644 --- a/p2p/metrics.go +++ b/p2p/metrics.go @@ -10,6 +10,10 @@ import ( var ( metricsRevieveChSizeGauge = metrics.NewGauge("box.p2p.recieveCh.size") + metricsPQTopChSizeGauge = metrics.NewGauge("box.p2p.pq.top.size") + metricsPQHighChSizeGauge = metrics.NewGauge("box.p2p.pq.high.size") + metricsPQMidChSizeGauge = metrics.NewGauge("box.p2p.pq.mid.size") + metricsPQLowChSizeGauge = metrics.NewGauge("box.p2p.pq.low.size") metricsReadMeter = metrics.NewMeter("box.p2p.read.request") metricsWriteMeter = metrics.NewMeter("box.p2p.write.request") diff --git a/p2p/peer.go b/p2p/peer.go index 38f6aa0a..955dd71a 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -234,12 +234,17 @@ func (p *BoxPeer) Broadcast(code uint32, msg conv.Convertible) error { } // BroadcastToMiners business message to miners. -func (p *BoxPeer) BroadcastToMiners(code uint32, msg conv.Convertible, miners []string) error { +func (p *BoxPeer) BroadcastToMiners(code uint32, msg conv.Convertible) error { body, err := conv.MarshalConvertible(msg) if err != nil { return err } + + minersCh := make(chan []string) + p.bus.Send(eventbus.TopicMiners, minersCh) + miners := <-minersCh + for _, v := range miners { if p.id.Pretty() == v { continue @@ -334,6 +339,11 @@ func (p *BoxPeer) PeerSynced(peerID peer.ID) (bool, bool) { return val.(*Conn).isSynced, ok } +// NetworkIdentity get networkIdentity +func (p *BoxPeer) NetworkIdentity() crypto.PrivKey { + return p.networkIdentity +} + // UpdateSynced update peers' isSynced func UpdateSynced(synced bool) { isSynced = synced diff --git a/rpc/client/control.go b/rpc/client/control.go index 6c219928..e6970fd8 100644 --- a/rpc/client/control.go +++ b/rpc/client/control.go @@ -115,3 +115,18 @@ func GetBlock(conn *grpc.ClientConn, hash string) (*types.Block, error) { err = block.FromProtoMessage(r.Block) return block, err } + +// GetBlacklist return blacklist +func GetBlacklist(conn *grpc.ClientConn) (map[string]string, error) { + c := pb.NewContorlCommandClient(conn) + + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + logger.Info("Querying blacklist") + r, err := c.GetBlacklist(ctx, &pb.GetBlacklistRequest{}) + if err != nil { + return nil, err + } + return r.Details, nil +} diff --git a/rpc/pb/common.pb.go b/rpc/pb/common.pb.go index 403db1fd..d5d87879 100644 --- a/rpc/pb/common.pb.go +++ b/rpc/pb/common.pb.go @@ -3,12 +3,13 @@ package rpcpb -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import pb "github.com/BOXFoundation/boxd/core/pb" - -import io "io" +import ( + fmt "fmt" + pb "github.com/BOXFoundation/boxd/core/pb" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -33,7 +34,7 @@ func (m *Utxo) Reset() { *m = Utxo{} } func (m *Utxo) String() string { return proto.CompactTextString(m) } func (*Utxo) ProtoMessage() {} func (*Utxo) Descriptor() ([]byte, []int) { - return fileDescriptor_common_a5e71acf58e73035, []int{0} + return fileDescriptor_555bd8c177793206, []int{0} } func (m *Utxo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -50,8 +51,8 @@ func (m *Utxo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (dst *Utxo) XXX_Merge(src proto.Message) { - xxx_messageInfo_Utxo.Merge(dst, src) +func (m *Utxo) XXX_Merge(src proto.Message) { + xxx_messageInfo_Utxo.Merge(m, src) } func (m *Utxo) XXX_Size() int { return m.Size() @@ -106,7 +107,7 @@ func (m *BaseResponse) Reset() { *m = BaseResponse{} } func (m *BaseResponse) String() string { return proto.CompactTextString(m) } func (*BaseResponse) ProtoMessage() {} func (*BaseResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_common_a5e71acf58e73035, []int{1} + return fileDescriptor_555bd8c177793206, []int{1} } func (m *BaseResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -123,8 +124,8 @@ func (m *BaseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (dst *BaseResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_BaseResponse.Merge(dst, src) +func (m *BaseResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_BaseResponse.Merge(m, src) } func (m *BaseResponse) XXX_Size() int { return m.Size() @@ -153,6 +154,32 @@ func init() { proto.RegisterType((*Utxo)(nil), "rpcpb.Utxo") proto.RegisterType((*BaseResponse)(nil), "rpcpb.BaseResponse") } + +func init() { proto.RegisterFile("common.proto", fileDescriptor_555bd8c177793206) } + +var fileDescriptor_555bd8c177793206 = []byte{ + // 302 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x34, 0x90, 0xcf, 0x4a, 0x03, 0x31, + 0x18, 0xc4, 0x1b, 0xed, 0xf6, 0x4f, 0xda, 0x82, 0xe4, 0x14, 0x3d, 0xac, 0xb5, 0x78, 0xe8, 0xc5, + 0x5d, 0xd4, 0xab, 0xa7, 0x0a, 0xe2, 0xad, 0x12, 0x15, 0xbc, 0x2d, 0x9b, 0x34, 0xb4, 0x41, 0x37, + 0x5f, 0x68, 0xbe, 0xc0, 0x3e, 0x86, 0xcf, 0xe3, 0x13, 0x78, 0xec, 0xd1, 0xa3, 0xb4, 0x2f, 0x22, + 0x1b, 0xdb, 0x53, 0x66, 0x7e, 0x99, 0x21, 0x43, 0xe8, 0x50, 0x41, 0x55, 0x81, 0xcd, 0xdc, 0x1a, + 0x10, 0x58, 0xb2, 0x76, 0xca, 0xc9, 0xb3, 0xeb, 0xa5, 0xc1, 0x55, 0x90, 0x99, 0x82, 0x2a, 0x9f, + 0xcd, 0xdf, 0x1e, 0x20, 0xd8, 0x45, 0x89, 0x06, 0x6c, 0x2e, 0x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9, + 0xfd, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xe5, 0x14, 0x0d, 0x92, 0x65, 0x01, 0x00, 0x00, +} + func (m *Utxo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -686,28 +713,3 @@ var ( ErrInvalidLengthCommon = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowCommon = fmt.Errorf("proto: integer overflow") ) - -func init() { proto.RegisterFile("common.proto", fileDescriptor_common_a5e71acf58e73035) } - -var fileDescriptor_common_a5e71acf58e73035 = []byte{ - // 302 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x34, 0x90, 0xcf, 0x4a, 0x03, 0x31, - 0x18, 0xc4, 0x1b, 0xed, 0xf6, 0x4f, 0xda, 0x82, 0xe4, 0x14, 0x3d, 0xac, 0xb5, 0x78, 0xe8, 0xc5, - 0x5d, 0xd4, 0xab, 0xa7, 0x0a, 0xe2, 0xad, 0x12, 0x15, 0xbc, 0x2d, 0x9b, 0x34, 0xb4, 0x41, 0x37, - 0x5f, 0x68, 0xbe, 0xc0, 0x3e, 0x86, 0xcf, 0xe3, 0x13, 0x78, 0xec, 0xd1, 0xa3, 0xb4, 0x2f, 0x22, - 0x1b, 0xdb, 0x53, 0x66, 0x7e, 0x99, 0x21, 0x43, 0xe8, 0x50, 0x41, 0x55, 0x81, 0xcd, 0xdc, 0x1a, - 0x10, 0x58, 0xb2, 0x76, 0xca, 0xc9, 0xb3, 0xeb, 0xa5, 0xc1, 0x55, 0x90, 0x99, 0x82, 0x2a, 0x9f, - 0xcd, 0xdf, 0x1e, 0x20, 0xd8, 0x45, 0x89, 0x06, 0x6c, 0x2e, 0xa1, 0x5e, 0xe4, 0x0a, 0xd6, 0x3a, - 0x77, 0x32, 0x97, 0x1f, 0xa0, 0xde, 0xff, 0x9b, 0x93, 0x2f, 0x42, 0xdb, 0xaf, 0x58, 0x03, 0xbb, - 0xa2, 0x7d, 0x08, 0x58, 0x38, 0x30, 0x16, 0x39, 0x19, 0x93, 0xe9, 0xe0, 0xe6, 0x24, 0x6b, 0x1a, - 0x4e, 0x66, 0xf3, 0x80, 0x4f, 0x0d, 0x17, 0x3d, 0xd8, 0x2b, 0x76, 0x49, 0x3b, 0x58, 0x17, 0x10, - 0x90, 0x1f, 0xc5, 0xec, 0xe8, 0x90, 0x7d, 0xa9, 0xe7, 0x01, 0x45, 0x82, 0xcd, 0xc1, 0x2e, 0xe8, - 0x30, 0x3e, 0x56, 0xac, 0xb4, 0x59, 0xae, 0x90, 0x1f, 0x8f, 0xc9, 0x74, 0x24, 0x06, 0x91, 0x3d, - 0x46, 0xc4, 0xce, 0xe9, 0xc0, 0xf8, 0x42, 0x81, 0xb1, 0xb2, 0xf4, 0x9a, 0xb7, 0xc7, 0x64, 0xda, - 0x13, 0xd4, 0xf8, 0xfb, 0x3d, 0x61, 0xa7, 0xb4, 0x67, 0x7c, 0xe1, 0x9d, 0xb6, 0xc8, 0x93, 0x78, - 0xdb, 0x35, 0xfe, 0xb9, 0xb1, 0x93, 0x3b, 0x3a, 0x9c, 0x95, 0x5e, 0x0b, 0xed, 0x1d, 0x58, 0xaf, - 0x19, 0xa3, 0x6d, 0x05, 0x0b, 0x1d, 0xe7, 0x27, 0x22, 0x6a, 0xc6, 0x69, 0xb7, 0xd2, 0xde, 0x97, - 0x4b, 0x1d, 0x97, 0xf6, 0xc5, 0xc1, 0xce, 0xf8, 0xf7, 0x36, 0x25, 0x9b, 0x6d, 0x4a, 0x7e, 0xb7, - 0x29, 0xf9, 0xdc, 0xa5, 0xad, 0xcd, 0x2e, 0x6d, 0xfd, 0xec, 0xd2, 0x96, 0xec, 0xc4, 0xbf, 0xb9, - 0xfd, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xe5, 0x14, 0x0d, 0x92, 0x65, 0x01, 0x00, 0x00, -} diff --git a/rpc/pb/control.pb.go b/rpc/pb/control.pb.go index 775b7f94..d85d610d 100644 --- a/rpc/pb/control.pb.go +++ b/rpc/pb/control.pb.go @@ -3,19 +3,17 @@ package rpcpb -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import pb "github.com/BOXFoundation/boxd/core/pb" -import _ "google.golang.org/genproto/googleapis/api/annotations" - import ( - context "golang.org/x/net/context" + context "context" + fmt "fmt" + pb "github.com/BOXFoundation/boxd/core/pb" + proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" + io "io" + math "math" ) -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -36,7 +34,7 @@ func (m *DebugLevelRequest) Reset() { *m = DebugLevelRequest{} } func (m *DebugLevelRequest) String() string { return proto.CompactTextString(m) } func (*DebugLevelRequest) ProtoMessage() {} func (*DebugLevelRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_control_ab15ce0ab718732b, []int{0} + return fileDescriptor_0c5120591600887d, []int{0} } func (m *DebugLevelRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -53,8 +51,8 @@ func (m *DebugLevelRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (dst *DebugLevelRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DebugLevelRequest.Merge(dst, src) +func (m *DebugLevelRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DebugLevelRequest.Merge(m, src) } func (m *DebugLevelRequest) XXX_Size() int { return m.Size() @@ -80,7 +78,7 @@ func (m *UpdateNetworkIDRequest) Reset() { *m = UpdateNetworkIDRequest{} func (m *UpdateNetworkIDRequest) String() string { return proto.CompactTextString(m) } func (*UpdateNetworkIDRequest) ProtoMessage() {} func (*UpdateNetworkIDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_control_ab15ce0ab718732b, []int{1} + return fileDescriptor_0c5120591600887d, []int{1} } func (m *UpdateNetworkIDRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -97,8 +95,8 @@ func (m *UpdateNetworkIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (dst *UpdateNetworkIDRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateNetworkIDRequest.Merge(dst, src) +func (m *UpdateNetworkIDRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateNetworkIDRequest.Merge(m, src) } func (m *UpdateNetworkIDRequest) XXX_Size() int { return m.Size() @@ -123,7 +121,7 @@ func (m *GetNetworkIDRequest) Reset() { *m = GetNetworkIDRequest{} } func (m *GetNetworkIDRequest) String() string { return proto.CompactTextString(m) } func (*GetNetworkIDRequest) ProtoMessage() {} func (*GetNetworkIDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_control_ab15ce0ab718732b, []int{2} + return fileDescriptor_0c5120591600887d, []int{2} } func (m *GetNetworkIDRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -140,8 +138,8 @@ func (m *GetNetworkIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (dst *GetNetworkIDRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetNetworkIDRequest.Merge(dst, src) +func (m *GetNetworkIDRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetNetworkIDRequest.Merge(m, src) } func (m *GetNetworkIDRequest) XXX_Size() int { return m.Size() @@ -161,7 +159,7 @@ func (m *GetNetworkIDResponse) Reset() { *m = GetNetworkIDResponse{} } func (m *GetNetworkIDResponse) String() string { return proto.CompactTextString(m) } func (*GetNetworkIDResponse) ProtoMessage() {} func (*GetNetworkIDResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_control_ab15ce0ab718732b, []int{3} + return fileDescriptor_0c5120591600887d, []int{3} } func (m *GetNetworkIDResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -178,8 +176,8 @@ func (m *GetNetworkIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (dst *GetNetworkIDResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetNetworkIDResponse.Merge(dst, src) +func (m *GetNetworkIDResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetNetworkIDResponse.Merge(m, src) } func (m *GetNetworkIDResponse) XXX_Size() int { return m.Size() @@ -212,7 +210,7 @@ func (m *AddNodeRequest) Reset() { *m = AddNodeRequest{} } func (m *AddNodeRequest) String() string { return proto.CompactTextString(m) } func (*AddNodeRequest) ProtoMessage() {} func (*AddNodeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_control_ab15ce0ab718732b, []int{4} + return fileDescriptor_0c5120591600887d, []int{4} } func (m *AddNodeRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -229,8 +227,8 @@ func (m *AddNodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (dst *AddNodeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddNodeRequest.Merge(dst, src) +func (m *AddNodeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddNodeRequest.Merge(m, src) } func (m *AddNodeRequest) XXX_Size() int { return m.Size() @@ -255,7 +253,7 @@ func (m *GetBlockHeightRequest) Reset() { *m = GetBlockHeightRequest{} } func (m *GetBlockHeightRequest) String() string { return proto.CompactTextString(m) } func (*GetBlockHeightRequest) ProtoMessage() {} func (*GetBlockHeightRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_control_ab15ce0ab718732b, []int{5} + return fileDescriptor_0c5120591600887d, []int{5} } func (m *GetBlockHeightRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -272,8 +270,8 @@ func (m *GetBlockHeightRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } -func (dst *GetBlockHeightRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetBlockHeightRequest.Merge(dst, src) +func (m *GetBlockHeightRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBlockHeightRequest.Merge(m, src) } func (m *GetBlockHeightRequest) XXX_Size() int { return m.Size() @@ -294,7 +292,7 @@ func (m *GetBlockHeightResponse) Reset() { *m = GetBlockHeightResponse{} func (m *GetBlockHeightResponse) String() string { return proto.CompactTextString(m) } func (*GetBlockHeightResponse) ProtoMessage() {} func (*GetBlockHeightResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_control_ab15ce0ab718732b, []int{6} + return fileDescriptor_0c5120591600887d, []int{6} } func (m *GetBlockHeightResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -311,8 +309,8 @@ func (m *GetBlockHeightResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (dst *GetBlockHeightResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetBlockHeightResponse.Merge(dst, src) +func (m *GetBlockHeightResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBlockHeightResponse.Merge(m, src) } func (m *GetBlockHeightResponse) XXX_Size() int { return m.Size() @@ -352,7 +350,7 @@ func (m *GetBlockHashRequest) Reset() { *m = GetBlockHashRequest{} } func (m *GetBlockHashRequest) String() string { return proto.CompactTextString(m) } func (*GetBlockHashRequest) ProtoMessage() {} func (*GetBlockHashRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_control_ab15ce0ab718732b, []int{7} + return fileDescriptor_0c5120591600887d, []int{7} } func (m *GetBlockHashRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -369,8 +367,8 @@ func (m *GetBlockHashRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (dst *GetBlockHashRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetBlockHashRequest.Merge(dst, src) +func (m *GetBlockHashRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBlockHashRequest.Merge(m, src) } func (m *GetBlockHashRequest) XXX_Size() int { return m.Size() @@ -398,7 +396,7 @@ func (m *GetBlockHashResponse) Reset() { *m = GetBlockHashResponse{} } func (m *GetBlockHashResponse) String() string { return proto.CompactTextString(m) } func (*GetBlockHashResponse) ProtoMessage() {} func (*GetBlockHashResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_control_ab15ce0ab718732b, []int{8} + return fileDescriptor_0c5120591600887d, []int{8} } func (m *GetBlockHashResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -415,8 +413,8 @@ func (m *GetBlockHashResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (dst *GetBlockHashResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetBlockHashResponse.Merge(dst, src) +func (m *GetBlockHashResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBlockHashResponse.Merge(m, src) } func (m *GetBlockHashResponse) XXX_Size() int { return m.Size() @@ -456,7 +454,7 @@ func (m *GetBlockRequest) Reset() { *m = GetBlockRequest{} } func (m *GetBlockRequest) String() string { return proto.CompactTextString(m) } func (*GetBlockRequest) ProtoMessage() {} func (*GetBlockRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_control_ab15ce0ab718732b, []int{9} + return fileDescriptor_0c5120591600887d, []int{9} } func (m *GetBlockRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -473,8 +471,8 @@ func (m *GetBlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } -func (dst *GetBlockRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetBlockRequest.Merge(dst, src) +func (m *GetBlockRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBlockRequest.Merge(m, src) } func (m *GetBlockRequest) XXX_Size() int { return m.Size() @@ -502,7 +500,7 @@ func (m *GetBlockHeaderResponse) Reset() { *m = GetBlockHeaderResponse{} func (m *GetBlockHeaderResponse) String() string { return proto.CompactTextString(m) } func (*GetBlockHeaderResponse) ProtoMessage() {} func (*GetBlockHeaderResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_control_ab15ce0ab718732b, []int{10} + return fileDescriptor_0c5120591600887d, []int{10} } func (m *GetBlockHeaderResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -519,8 +517,8 @@ func (m *GetBlockHeaderResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (dst *GetBlockHeaderResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetBlockHeaderResponse.Merge(dst, src) +func (m *GetBlockHeaderResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBlockHeaderResponse.Merge(m, src) } func (m *GetBlockHeaderResponse) XXX_Size() int { return m.Size() @@ -562,7 +560,7 @@ func (m *GetBlockResponse) Reset() { *m = GetBlockResponse{} } func (m *GetBlockResponse) String() string { return proto.CompactTextString(m) } func (*GetBlockResponse) ProtoMessage() {} func (*GetBlockResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_control_ab15ce0ab718732b, []int{11} + return fileDescriptor_0c5120591600887d, []int{11} } func (m *GetBlockResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -579,8 +577,8 @@ func (m *GetBlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (dst *GetBlockResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetBlockResponse.Merge(dst, src) +func (m *GetBlockResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBlockResponse.Merge(m, src) } func (m *GetBlockResponse) XXX_Size() int { return m.Size() @@ -622,7 +620,7 @@ func (m *Node) Reset() { *m = Node{} } func (m *Node) String() string { return proto.CompactTextString(m) } func (*Node) ProtoMessage() {} func (*Node) Descriptor() ([]byte, []int) { - return fileDescriptor_control_ab15ce0ab718732b, []int{12} + return fileDescriptor_0c5120591600887d, []int{12} } func (m *Node) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -639,8 +637,8 @@ func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (dst *Node) XXX_Merge(src proto.Message) { - xxx_messageInfo_Node.Merge(dst, src) +func (m *Node) XXX_Merge(src proto.Message) { + xxx_messageInfo_Node.Merge(m, src) } func (m *Node) XXX_Size() int { return m.Size() @@ -679,7 +677,7 @@ func (m *GetNodeInfoRequest) Reset() { *m = GetNodeInfoRequest{} } func (m *GetNodeInfoRequest) String() string { return proto.CompactTextString(m) } func (*GetNodeInfoRequest) ProtoMessage() {} func (*GetNodeInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_control_ab15ce0ab718732b, []int{13} + return fileDescriptor_0c5120591600887d, []int{13} } func (m *GetNodeInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -696,8 +694,8 @@ func (m *GetNodeInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (dst *GetNodeInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetNodeInfoRequest.Merge(dst, src) +func (m *GetNodeInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetNodeInfoRequest.Merge(m, src) } func (m *GetNodeInfoRequest) XXX_Size() int { return m.Size() @@ -716,7 +714,7 @@ func (m *GetNodeInfoResponse) Reset() { *m = GetNodeInfoResponse{} } func (m *GetNodeInfoResponse) String() string { return proto.CompactTextString(m) } func (*GetNodeInfoResponse) ProtoMessage() {} func (*GetNodeInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_control_ab15ce0ab718732b, []int{14} + return fileDescriptor_0c5120591600887d, []int{14} } func (m *GetNodeInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -733,8 +731,8 @@ func (m *GetNodeInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (dst *GetNodeInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetNodeInfoResponse.Merge(dst, src) +func (m *GetNodeInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetNodeInfoResponse.Merge(m, src) } func (m *GetNodeInfoResponse) XXX_Size() int { return m.Size() @@ -752,6 +750,102 @@ func (m *GetNodeInfoResponse) GetNodes() []*Node { return nil } +type GetBlacklistRequest struct { +} + +func (m *GetBlacklistRequest) Reset() { *m = GetBlacklistRequest{} } +func (m *GetBlacklistRequest) String() string { return proto.CompactTextString(m) } +func (*GetBlacklistRequest) ProtoMessage() {} +func (*GetBlacklistRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0c5120591600887d, []int{15} +} +func (m *GetBlacklistRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetBlacklistRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetBlacklistRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetBlacklistRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBlacklistRequest.Merge(m, src) +} +func (m *GetBlacklistRequest) XXX_Size() int { + return m.Size() +} +func (m *GetBlacklistRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetBlacklistRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetBlacklistRequest proto.InternalMessageInfo + +type GetBlacklistResponse struct { + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + Details map[string]string `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *GetBlacklistResponse) Reset() { *m = GetBlacklistResponse{} } +func (m *GetBlacklistResponse) String() string { return proto.CompactTextString(m) } +func (*GetBlacklistResponse) ProtoMessage() {} +func (*GetBlacklistResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0c5120591600887d, []int{16} +} +func (m *GetBlacklistResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetBlacklistResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetBlacklistResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetBlacklistResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBlacklistResponse.Merge(m, src) +} +func (m *GetBlacklistResponse) XXX_Size() int { + return m.Size() +} +func (m *GetBlacklistResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetBlacklistResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetBlacklistResponse proto.InternalMessageInfo + +func (m *GetBlacklistResponse) GetCode() int32 { + if m != nil { + return m.Code + } + return 0 +} + +func (m *GetBlacklistResponse) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func (m *GetBlacklistResponse) GetDetails() map[string]string { + if m != nil { + return m.Details + } + return nil +} + func init() { proto.RegisterType((*DebugLevelRequest)(nil), "rpcpb.DebugLevelRequest") proto.RegisterType((*UpdateNetworkIDRequest)(nil), "rpcpb.UpdateNetworkIDRequest") @@ -768,6 +862,71 @@ func init() { proto.RegisterType((*Node)(nil), "rpcpb.Node") proto.RegisterType((*GetNodeInfoRequest)(nil), "rpcpb.GetNodeInfoRequest") proto.RegisterType((*GetNodeInfoResponse)(nil), "rpcpb.GetNodeInfoResponse") + proto.RegisterType((*GetBlacklistRequest)(nil), "rpcpb.GetBlacklistRequest") + proto.RegisterType((*GetBlacklistResponse)(nil), "rpcpb.GetBlacklistResponse") + proto.RegisterMapType((map[string]string)(nil), "rpcpb.GetBlacklistResponse.DetailsEntry") +} + +func init() { proto.RegisterFile("control.proto", fileDescriptor_0c5120591600887d) } + +var fileDescriptor_0c5120591600887d = []byte{ + // 887 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0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xcb, 0xaa, 0xbb, + 0xa3, 0xbd, 0xac, 0x19, 0x2b, 0xc4, 0x6f, 0x29, 0xac, 0xc7, 0xb8, 0x3d, 0x83, 0x45, 0x8a, 0x48, + 0x22, 0xfd, 0x60, 0xcf, 0x26, 0x4d, 0x05, 0x75, 0x6a, 0xfd, 0x16, 0x4f, 0x65, 0xdb, 0xdc, 0xff, + 0x4d, 0x25, 0xf3, 0x24, 0xd6, 0x25, 0x3c, 0x34, 0xc5, 0x0b, 0x51, 0x0e, 0x66, 0xbe, 0xeb, 0xfe, + 0x87, 0xaa, 0xff, 0x3e, 0xde, 0xad, 0xf7, 0x97, 0x9d, 0x29, 0x6c, 0x58, 0x5e, 0x82, 0x1e, 0x5b, + 0xfa, 0xa9, 0xba, 0x8e, 0xe7, 0xcd, 0x0b, 0x69, 0x88, 0xae, 0x82, 0x70, 0xf1, 0x9e, 0xad, 0x2c, + 0x4e, 0x59, 0x9c, 0x5e, 0x71, 0xfb, 0x55, 0xb4, 0x07, 0x54, 0x5f, 0xa5, 0x6a, 0x46, 0xd5, 0x57, + 0xa9, 0x99, 0xc6, 0x82, 0x57, 0xd1, 0x59, 0xe7, 0xce, 0xd3, 0xbe, 0xfb, 0xe7, 0x5d, 0xd7, 0xb9, + 0xbd, 0xeb, 0x3a, 0xff, 0xdc, 0x75, 0x9d, 0xdf, 0xee, 0xbb, 0x2b, 0xb7, 0xf7, 0xdd, 0x95, 0xbf, + 0xef, 0xbb, 0x2b, 0xc1, 0x03, 0xf5, 0xb7, 0xe3, 0xc3, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x54, + 0xd9, 0xc7, 0xbe, 0xed, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -792,6 +951,7 @@ type ContorlCommandClient interface { GetBlockHeader(ctx context.Context, in *GetBlockRequest, opts ...grpc.CallOption) (*GetBlockHeaderResponse, error) GetBlock(ctx context.Context, in *GetBlockRequest, opts ...grpc.CallOption) (*GetBlockResponse, error) GetNodeInfo(ctx context.Context, in *GetNodeInfoRequest, opts ...grpc.CallOption) (*GetNodeInfoResponse, error) + GetBlacklist(ctx context.Context, in *GetBlacklistRequest, opts ...grpc.CallOption) (*GetBlacklistResponse, error) } type contorlCommandClient struct { @@ -883,6 +1043,15 @@ func (c *contorlCommandClient) GetNodeInfo(ctx context.Context, in *GetNodeInfoR return out, nil } +func (c *contorlCommandClient) GetBlacklist(ctx context.Context, in *GetBlacklistRequest, opts ...grpc.CallOption) (*GetBlacklistResponse, error) { + out := new(GetBlacklistResponse) + err := c.cc.Invoke(ctx, "/rpcpb.ContorlCommand/GetBlacklist", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ContorlCommandServer is the server API for ContorlCommand service. type ContorlCommandServer interface { // set boxd debug level @@ -895,6 +1064,7 @@ type ContorlCommandServer interface { GetBlockHeader(context.Context, *GetBlockRequest) (*GetBlockHeaderResponse, error) GetBlock(context.Context, *GetBlockRequest) (*GetBlockResponse, error) GetNodeInfo(context.Context, *GetNodeInfoRequest) (*GetNodeInfoResponse, error) + GetBlacklist(context.Context, *GetBlacklistRequest) (*GetBlacklistResponse, error) } func RegisterContorlCommandServer(s *grpc.Server, srv ContorlCommandServer) { @@ -1063,6 +1233,24 @@ func _ContorlCommand_GetNodeInfo_Handler(srv interface{}, ctx context.Context, d return interceptor(ctx, in, info, handler) } +func _ContorlCommand_GetBlacklist_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBlacklistRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContorlCommandServer).GetBlacklist(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/rpcpb.ContorlCommand/GetBlacklist", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContorlCommandServer).GetBlacklist(ctx, req.(*GetBlacklistRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _ContorlCommand_serviceDesc = grpc.ServiceDesc{ ServiceName: "rpcpb.ContorlCommand", HandlerType: (*ContorlCommandServer)(nil), @@ -1103,6 +1291,10 @@ var _ContorlCommand_serviceDesc = grpc.ServiceDesc{ MethodName: "GetNodeInfo", Handler: _ContorlCommand_GetNodeInfo_Handler, }, + { + MethodName: "GetBlacklist", + Handler: _ContorlCommand_GetBlacklist_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "control.proto", @@ -1531,6 +1723,70 @@ func (m *GetNodeInfoResponse) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *GetBlacklistRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetBlacklistRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + return i, nil +} + +func (m *GetBlacklistResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetBlacklistResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Code != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintControl(dAtA, i, uint64(m.Code)) + } + if len(m.Message) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintControl(dAtA, i, uint64(len(m.Message))) + i += copy(dAtA[i:], m.Message) + } + if len(m.Details) > 0 { + for k, _ := range m.Details { + dAtA[i] = 0x1a + i++ + v := m.Details[k] + mapSize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) + i = encodeVarintControl(dAtA, i, uint64(mapSize)) + dAtA[i] = 0xa + i++ + i = encodeVarintControl(dAtA, i, uint64(len(k))) + i += copy(dAtA[i:], k) + dAtA[i] = 0x12 + i++ + i = encodeVarintControl(dAtA, i, uint64(len(v))) + i += copy(dAtA[i:], v) + } + } + return i, nil +} + func encodeVarintControl(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) @@ -1763,6 +2019,39 @@ func (m *GetNodeInfoResponse) Size() (n int) { return n } +func (m *GetBlacklistRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *GetBlacklistResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Code != 0 { + n += 1 + sovControl(uint64(m.Code)) + } + l = len(m.Message) + if l > 0 { + n += 1 + l + sovControl(uint64(l)) + } + if len(m.Details) > 0 { + for k, v := range m.Details { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovControl(uint64(len(k))) + 1 + len(v) + sovControl(uint64(len(v))) + n += mapEntrySize + 1 + sovControl(uint64(mapEntrySize)) + } + } + return n +} + func sovControl(x uint64) (n int) { for { n++ @@ -3123,6 +3412,272 @@ func (m *GetNodeInfoResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *GetBlacklistRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetBlacklistRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetBlacklistRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipControl(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthControl + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetBlacklistResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetBlacklistResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetBlacklistResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + } + m.Code = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Code |= (int32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthControl + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthControl + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Details == nil { + m.Details = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthControl + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthControl + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipControl(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthControl + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Details[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipControl(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthControl + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipControl(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 @@ -3227,59 +3782,3 @@ var ( ErrInvalidLengthControl = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowControl = fmt.Errorf("proto: integer overflow") ) - -func init() { proto.RegisterFile("control.proto", fileDescriptor_control_ab15ce0ab718732b) } - -var fileDescriptor_control_ab15ce0ab718732b = []byte{ - // 796 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xcd, 0x52, 0xdb, 0x48, - 0x10, 0x46, 0xfe, 0x81, 0x75, 0x1b, 0x1b, 0x18, 0xff, 0x20, 0x04, 0xf6, 0xc2, 0xec, 0x1e, 0x58, - 0xb6, 0xd6, 0x5a, 0xd8, 0xcb, 0x16, 0x87, 0xad, 0x8d, 0xa1, 0x42, 0xa8, 0x4a, 0x91, 0x8a, 0x53, - 0xa9, 0xe2, 0x92, 0xa4, 0x24, 0xcd, 0x60, 0x29, 0xc8, 0x1a, 0x45, 0x1a, 0x93, 0x9c, 0xf3, 0x04, - 0xa9, 0xca, 0x21, 0xaf, 0x94, 0x23, 0x55, 0xb9, 0xe4, 0x98, 0x82, 0x3c, 0x48, 0x6a, 0x46, 0x23, - 0x2c, 0xff, 0xe5, 0xc0, 0x6d, 0x5a, 0x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 0x50, 0x08, 0x18, 0xa1, - 0x4a, 0xa9, 0x7c, 0xe3, 0x75, 0x68, 0x9c, 0x50, 0xde, 0x15, 0x1d, 0x79, 0x44, 0xbd, 0xbe, 0xcb, - 0x53, 0x01, 0x2f, 0xa1, 0x39, 0xe9, 0x50, 0x12, 0x10, 0x14, 0x9c, 0x14, 0xa6, 0xd8, 0x93, 0x6f, - 0x21, 0x63, 0x40, 0xe3, 0xd8, 0xea, 0xd3, 0x54, 0x86, 0x32, 0x51, 0x13, 0x16, 0x5d, 0x99, 0xaf, - 0xe7, 0xa5, 0x68, 0x65, 0xe1, 0xbf, 0x64, 0xdd, 0x09, 0xbe, 0x15, 0xbb, 0xa9, 0xc6, 0x51, 0xb8, - 0x36, 0x16, 0x7e, 0x2e, 0xfb, 0x91, 0x09, 0xbf, 0x97, 0x18, 0x04, 0x05, 0xd7, 0x8a, 0x5d, 0x29, - 0xa5, 0xd4, 0x93, 0x6f, 0xfc, 0x37, 0xac, 0xa4, 0xc8, 0xa9, 0x88, 0x16, 0x80, 0x9c, 0x91, 0x57, - 0x32, 0x38, 0x69, 0x57, 0xc9, 0x4e, 0xb9, 0x71, 0x9c, 0x6d, 0x8d, 0x45, 0x68, 0x74, 0x4f, 0x35, - 0x7f, 0x8a, 0x5a, 0x45, 0xbe, 0xd4, 0x53, 0x3e, 0xa8, 0x75, 0xc4, 0x84, 0x86, 0x76, 0x27, 0x0b, - 0xad, 0x42, 0x30, 0x85, 0xd5, 0x91, 0xcc, 0x7b, 0xd1, 0xfd, 0x06, 0x45, 0x59, 0x83, 0x62, 0xab, - 0x8c, 0xb1, 0xf5, 0x12, 0x1f, 0xfe, 0x0f, 0x0a, 0x62, 0x64, 0x32, 0x73, 0x56, 0x92, 0x73, 0x56, - 0x87, 0xa2, 0x45, 0x48, 0x14, 0xeb, 0xb9, 0xed, 0xbc, 0x18, 0x73, 0x69, 0xa0, 0x55, 0xc8, 0x73, - 0xee, 0xab, 0x76, 0x8a, 0x27, 0xae,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 0xcd, 0xf1, 0x2a, - 0xaa, 0x1d, 0x49, 0xb5, 0x89, 0x9b, 0x99, 0x02, 0xe4, 0x28, 0x26, 0x8b, 0x2f, 0x18, 0x5d, 0xd9, - 0xac, 0xbb, 0xdd, 0xcf, 0x36, 0x6b, 0xf2, 0x7e, 0x64, 0x9b, 0x35, 0x75, 0x2c, 0xf0, 0xaf, 0x92, - 0x6b, 0x03, 0xd7, 0xa7, 0xb8, 0xac, 0xd8, 0x15, 0x4c, 0xaf, 0xb3, 0xb5, 0x89, 0xb5, 0x43, 0xcd, - 0x09, 0xbc, 0xf9, 0x55, 0x65, 0x0f, 0xc1, 0xcf, 0xaa, 0x12, 0x71, 0x82, 0xeb, 0x1c, 0x7e, 0x49, - 0x93, 0xe7, 0xb2, 0xac, 0x4f, 0x7d, 0x57, 0xf8, 0x9b, 0x12, 0xbf, 0x81, 0x57, 0x27, 0xf1, 0x05, - 0x32, 0x81, 0x72, 0x66, 0xdb, 0xd0, 0x46, 0x66, 0x7e, 0xc6, 0xf7, 0xd2, 0x30, 0x66, 0xb9, 0x14, - 0x45, 0x5b, 0x52, 0xe8, 0xb8, 0x96, 0x9d, 0x2c, 0x46, 0xa8, 0x17, 0x5c, 0xb0, 0x43, 0x6d, 0xaf, - 0xab, 0x7f, 0xbe, 0x69, 0x6b, 0xd7, 0x37, 0x6d, 0xed, 0xdb, 0x4d, 0x5b, 0xfb, 0x70, 0xdb, 0x5e, - 0xb8, 0xbe, 0x6d, 0x2f, 0x7c, 0xbd, 0x6d, 0x2f, 0xd8, 0x8b, 0xf2, 0xef, 0xf2, 0x9f, 0x1f, 0x01, - 0x00, 0x00, 0xff, 0xff, 0xf4, 0x91, 0x48, 0x35, 0xa5, 0x07, 0x00, 0x00, -} diff --git a/rpc/pb/control.pb.gw.go b/rpc/pb/control.pb.gw.go index 17a9f4d3..1d294d82 100644 --- a/rpc/pb/control.pb.gw.go +++ b/rpc/pb/control.pb.gw.go @@ -145,6 +145,19 @@ func request_ContorlCommand_GetNodeInfo_0(ctx context.Context, marshaler runtime } +func request_ContorlCommand_GetBlacklist_0(ctx context.Context, marshaler runtime.Marshaler, client ContorlCommandClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetBlacklistRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetBlacklist(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + // RegisterContorlCommandHandlerFromEndpoint is same as RegisterContorlCommandHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterContorlCommandHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { @@ -444,6 +457,35 @@ func RegisterContorlCommandHandlerClient(ctx context.Context, mux *runtime.Serve }) + mux.Handle("POST", pattern_ContorlCommand_GetBlacklist_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ContorlCommand_GetBlacklist_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ContorlCommand_GetBlacklist_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -465,6 +507,8 @@ var ( pattern_ContorlCommand_GetBlock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "ctl", "getblock"}, "")) pattern_ContorlCommand_GetNodeInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "ctl", "getnodeinfo"}, "")) + + pattern_ContorlCommand_GetBlacklist_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "ctl", "getblacklist"}, "")) ) var ( @@ -485,4 +529,6 @@ var ( forward_ContorlCommand_GetBlock_0 = runtime.ForwardResponseMessage forward_ContorlCommand_GetNodeInfo_0 = runtime.ForwardResponseMessage + + forward_ContorlCommand_GetBlacklist_0 = runtime.ForwardResponseMessage ) diff --git a/rpc/pb/control.proto b/rpc/pb/control.proto index 64757948..669dbda2 100644 --- a/rpc/pb/control.proto +++ b/rpc/pb/control.proto @@ -74,6 +74,13 @@ service ContorlCommand { body: "*" }; } + + rpc GetBlacklist (GetBlacklistRequest) returns (GetBlacklistResponse) { + option (google.api.http) = { + post: "/v1/ctl/getblacklist" + body: "*" + }; + } } // The request message containing debug level. @@ -146,3 +153,12 @@ message GetNodeInfoResponse { repeated Node nodes = 1; } +message GetBlacklistRequest { + +} + +message GetBlacklistResponse { + int32 code = 1; + string message = 2; + map details = 3; +} diff --git a/rpc/pb/db.pb.go b/rpc/pb/db.pb.go index fc401b4f..bd37a7e3 100644 --- a/rpc/pb/db.pb.go +++ b/rpc/pb/db.pb.go @@ -3,18 +3,16 @@ package rpcpb -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "google.golang.org/genproto/googleapis/api/annotations" - import ( - context "golang.org/x/net/context" + context "context" + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" + io "io" + math "math" ) -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -37,7 +35,7 @@ func (m *GetDatabaseKeysRequest) Reset() { *m = GetDatabaseKeysRequest{} func (m *GetDatabaseKeysRequest) String() string { return proto.CompactTextString(m) } func (*GetDatabaseKeysRequest) ProtoMessage() {} func (*GetDatabaseKeysRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db_242678ef2bd82154, []int{0} + return fileDescriptor_8817812184a13374, []int{0} } func (m *GetDatabaseKeysRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -54,8 +52,8 @@ func (m *GetDatabaseKeysRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (dst *GetDatabaseKeysRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetDatabaseKeysRequest.Merge(dst, src) +func (m *GetDatabaseKeysRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetDatabaseKeysRequest.Merge(m, src) } func (m *GetDatabaseKeysRequest) XXX_Size() int { return m.Size() @@ -105,7 +103,7 @@ func (m *GetDatabaseKeysResponse) Reset() { *m = GetDatabaseKeysResponse func (m *GetDatabaseKeysResponse) String() string { return proto.CompactTextString(m) } func (*GetDatabaseKeysResponse) ProtoMessage() {} func (*GetDatabaseKeysResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db_242678ef2bd82154, []int{1} + return fileDescriptor_8817812184a13374, []int{1} } func (m *GetDatabaseKeysResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -122,8 +120,8 @@ func (m *GetDatabaseKeysResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (dst *GetDatabaseKeysResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetDatabaseKeysResponse.Merge(dst, src) +func (m *GetDatabaseKeysResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetDatabaseKeysResponse.Merge(m, src) } func (m *GetDatabaseKeysResponse) XXX_Size() int { return m.Size() @@ -171,7 +169,7 @@ func (m *GetDatabaseValueRequest) Reset() { *m = GetDatabaseValueRequest func (m *GetDatabaseValueRequest) String() string { return proto.CompactTextString(m) } func (*GetDatabaseValueRequest) ProtoMessage() {} func (*GetDatabaseValueRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db_242678ef2bd82154, []int{2} + return fileDescriptor_8817812184a13374, []int{2} } func (m *GetDatabaseValueRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -188,8 +186,8 @@ func (m *GetDatabaseValueRequest) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (dst *GetDatabaseValueRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetDatabaseValueRequest.Merge(dst, src) +func (m *GetDatabaseValueRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetDatabaseValueRequest.Merge(m, src) } func (m *GetDatabaseValueRequest) XXX_Size() int { return m.Size() @@ -224,7 +222,7 @@ func (m *GetDatabaseValueResponse) Reset() { *m = GetDatabaseValueRespon func (m *GetDatabaseValueResponse) String() string { return proto.CompactTextString(m) } func (*GetDatabaseValueResponse) ProtoMessage() {} func (*GetDatabaseValueResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db_242678ef2bd82154, []int{3} + return fileDescriptor_8817812184a13374, []int{3} } func (m *GetDatabaseValueResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -241,8 +239,8 @@ func (m *GetDatabaseValueResponse) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (dst *GetDatabaseValueResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetDatabaseValueResponse.Merge(dst, src) +func (m *GetDatabaseValueResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetDatabaseValueResponse.Merge(m, src) } func (m *GetDatabaseValueResponse) XXX_Size() int { return m.Size() @@ -281,6 +279,36 @@ func init() { proto.RegisterType((*GetDatabaseValueResponse)(nil), "rpcpb.GetDatabaseValueResponse") } +func init() { proto.RegisterFile("db.proto", fileDescriptor_8817812184a13374) } + +var fileDescriptor_8817812184a13374 = []byte{ + // 371 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xbb, 0x4e, 0xf3, 0x30, + 0x1c, 0xc5, 0xeb, 0x36, 0xe9, 0xf7, 0xd5, 0x20, 0xb5, 0xb2, 0x4a, 0xb1, 0x2a, 0x08, 0x55, 0xa6, + 0xaa, 0x43, 0x23, 0x60, 0xeb, 0xc6, 0x45, 0x62, 0x60, 0xcb, 0xc0, 0x88, 0xe4, 0x34, 0x7f, 0x42, + 0x68, 0x12, 0x9b, 0xda, 0xad, 0xe8, 0xca, 0x13, 0x20, 0xf1, 0x52, 0x8c, 0x95, 0x58, 0x18, 0x51, + 0x8b, 0xc4, 0x6b, 0xa0, 0x38, 0xa9, 0x04, 0xbd, 0x30, 0xb0, 0x9d, 0x63, 0x27, 0xe7, 0xf7, 0xbf, + 0x18, 0xff, 0xf7, 0xbd, 0xae, 0x18, 0x72, 0xc5, 0x89, 0x39, 0x14, 0x7d, 0xe1, 0x35, 0xf7, 0x02, + 0xce, 0x83, 0x08, 0x1c, 0x26, 0x42, 0x87, 0x25, 0x09, 0x57, 0x4c, 0x85, 0x3c, 0x91, 0xd9, 0x47, + 0xb6, 0xc0, 0x8d, 0x0b, 0x50, 0xe7, 0x4c, 0x31, 0x8f, 0x49, 0xb8, 0x84, 0x89, 0x74, 0xe1, 0x7e, + 0x04, 0x52, 0x91, 0x3a, 0x36, 0x15, 0xf3, 0x22, 0xa0, 0xa8, 0x85, 0xda, 0x15, 0x37, 0x33, 0xa4, + 0x81, 0xcb, 0x62, 0x08, 0x37, 0xe1, 0x03, 0x2d, 0xea, 0xe3, 0xdc, 0x11, 0x82, 0x0d, 0x39, 0x08, + 0x05, 0x2d, 0xb5, 0x50, 0xdb, 0x74, 0xb5, 0x4e, 0x13, 0xa2, 0x30, 0x0e, 0x15, 0x35, 0xf4, 0x61, + 0x66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x00, 0x00, 0xff, 0xff, 0x59, 0x55, 0xaa, 0x97, 0xc1, + 0x02, 0x00, 0x00, +} + // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn @@ -1284,33 +1312,3 @@ var ( ErrInvalidLengthDb = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowDb = fmt.Errorf("proto: integer overflow") ) - -func init() { proto.RegisterFile("db.proto", fileDescriptor_db_242678ef2bd82154) } - -var fileDescriptor_db_242678ef2bd82154 = []byte{ - // 371 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xbb, 0x4e, 0xf3, 0x30, - 0x1c, 0xc5, 0xeb, 0x36, 0xe9, 0xf7, 0xd5, 0x20, 0xb5, 0xb2, 0x4a, 0xb1, 0x2a, 0x08, 0x55, 0xa6, - 0xaa, 0x43, 0x23, 0x60, 0xeb, 0xc6, 0x45, 0x62, 0x60, 0xcb, 0xc0, 0x88, 0xe4, 0x34, 0x7f, 0x42, - 0x68, 0x12, 0x9b, 0xda, 0xad, 0xe8, 0xca, 0x13, 0x20, 0xf1, 0x52, 0x8c, 0x95, 0x58, 0x18, 0x51, - 0x8b, 0xc4, 0x6b, 0xa0, 0x38, 0xa9, 0x04, 0xbd, 0x30, 0xb0, 0x9d, 0x63, 0x27, 0xe7, 0xf7, 0xbf, - 0x18, 0xff, 0xf7, 0xbd, 0xae, 0x18, 0x72, 0xc5, 0x89, 0x39, 0x14, 0x7d, 0xe1, 0x35, 0xf7, 0x02, - 0xce, 0x83, 0x08, 0x1c, 0x26, 0x42, 0x87, 0x25, 0x09, 0x57, 0x4c, 0x85, 0x3c, 0x91, 0xd9, 0x47, - 0xb6, 0xc0, 0x8d, 0x0b, 0x50, 0xe7, 0x4c, 0x31, 0x8f, 0x49, 0xb8, 0x84, 0x89, 0x74, 0xe1, 0x7e, - 0x04, 0x52, 0x91, 0x3a, 0x36,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, 0xf7, 0x39, 0x6c, - 0x47, 0xc3, 0xaa, 0x36, 0xce, 0x61, 0x01, 0xa8, 0x1e, 0xea, 0x9c, 0xd2, 0x97, 0x99, 0x85, 0xa6, - 0x33, 0x0b, 0xbd, 0xcf, 0x2c, 0xf4, 0x34, 0xb7, 0x0a, 0xd3, 0xb9, 0x55, 0x78, 0x9b, 0x5b, 0x05, - 0xaf, 0xac, 0x1f, 0xe4, 0xf1, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x59, 0x55, 0xaa, 0x97, 0xc1, - 0x02, 0x00, 0x00, -} diff --git a/rpc/pb/transaction.pb.go b/rpc/pb/transaction.pb.go index 8fd6858e..becce727 100644 --- a/rpc/pb/transaction.pb.go +++ b/rpc/pb/transaction.pb.go @@ -3,19 +3,17 @@ package rpcpb -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import pb "github.com/BOXFoundation/boxd/core/pb" -import _ "google.golang.org/genproto/googleapis/api/annotations" - import ( - context "golang.org/x/net/context" + context "context" + fmt "fmt" + pb "github.com/BOXFoundation/boxd/core/pb" + proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" + io "io" + math "math" ) -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -34,7 +32,7 @@ func (m *ListUtxosRequest) Reset() { *m = ListUtxosRequest{} } func (m *ListUtxosRequest) String() string { return proto.CompactTextString(m) } func (*ListUtxosRequest) ProtoMessage() {} func (*ListUtxosRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_365073e243c7f713, []int{0} + return fileDescriptor_2cc4e03d2c28c490, []int{0} } func (m *ListUtxosRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -51,8 +49,8 @@ func (m *ListUtxosRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (dst *ListUtxosRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListUtxosRequest.Merge(dst, src) +func (m *ListUtxosRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListUtxosRequest.Merge(m, src) } func (m *ListUtxosRequest) XXX_Size() int { return m.Size() @@ -71,7 +69,7 @@ func (m *GetRawTransactionRequest) Reset() { *m = GetRawTransactionReque func (m *GetRawTransactionRequest) String() string { return proto.CompactTextString(m) } func (*GetRawTransactionRequest) ProtoMessage() {} func (*GetRawTransactionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_365073e243c7f713, []int{1} + return fileDescriptor_2cc4e03d2c28c490, []int{1} } func (m *GetRawTransactionRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -88,8 +86,8 @@ func (m *GetRawTransactionRequest) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (dst *GetRawTransactionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetRawTransactionRequest.Merge(dst, src) +func (m *GetRawTransactionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetRawTransactionRequest.Merge(m, src) } func (m *GetRawTransactionRequest) XXX_Size() int { return m.Size() @@ -115,7 +113,7 @@ func (m *GetRawTransactionResponse) Reset() { *m = GetRawTransactionResp func (m *GetRawTransactionResponse) String() string { return proto.CompactTextString(m) } func (*GetRawTransactionResponse) ProtoMessage() {} func (*GetRawTransactionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_365073e243c7f713, []int{2} + return fileDescriptor_2cc4e03d2c28c490, []int{2} } func (m *GetRawTransactionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -132,8 +130,8 @@ func (m *GetRawTransactionResponse) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } -func (dst *GetRawTransactionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetRawTransactionResponse.Merge(dst, src) +func (m *GetRawTransactionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetRawTransactionResponse.Merge(m, src) } func (m *GetRawTransactionResponse) XXX_Size() int { return m.Size() @@ -158,7 +156,7 @@ func (m *GetTransactionPoolRequest) Reset() { *m = GetTransactionPoolReq func (m *GetTransactionPoolRequest) String() string { return proto.CompactTextString(m) } func (*GetTransactionPoolRequest) ProtoMessage() {} func (*GetTransactionPoolRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_365073e243c7f713, []int{3} + return fileDescriptor_2cc4e03d2c28c490, []int{3} } func (m *GetTransactionPoolRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -175,8 +173,8 @@ func (m *GetTransactionPoolRequest) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } -func (dst *GetTransactionPoolRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTransactionPoolRequest.Merge(dst, src) +func (m *GetTransactionPoolRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTransactionPoolRequest.Merge(m, src) } func (m *GetTransactionPoolRequest) XXX_Size() int { return m.Size() @@ -195,7 +193,7 @@ func (m *GetTransactionsResponse) Reset() { *m = GetTransactionsResponse func (m *GetTransactionsResponse) String() string { return proto.CompactTextString(m) } func (*GetTransactionsResponse) ProtoMessage() {} func (*GetTransactionsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_365073e243c7f713, []int{4} + return fileDescriptor_2cc4e03d2c28c490, []int{4} } func (m *GetTransactionsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -212,8 +210,8 @@ func (m *GetTransactionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (dst *GetTransactionsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTransactionsResponse.Merge(dst, src) +func (m *GetTransactionsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTransactionsResponse.Merge(m, src) } func (m *GetTransactionsResponse) XXX_Size() int { return m.Size() @@ -240,7 +238,7 @@ func (m *TokenAmount) Reset() { *m = TokenAmount{} } func (m *TokenAmount) String() string { return proto.CompactTextString(m) } func (*TokenAmount) ProtoMessage() {} func (*TokenAmount) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_365073e243c7f713, []int{5} + return fileDescriptor_2cc4e03d2c28c490, []int{5} } func (m *TokenAmount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -257,8 +255,8 @@ func (m *TokenAmount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (dst *TokenAmount) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenAmount.Merge(dst, src) +func (m *TokenAmount) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenAmount.Merge(m, src) } func (m *TokenAmount) XXX_Size() int { return m.Size() @@ -293,7 +291,7 @@ func (m *FundTransactionRequest) Reset() { *m = FundTransactionRequest{} func (m *FundTransactionRequest) String() string { return proto.CompactTextString(m) } func (*FundTransactionRequest) ProtoMessage() {} func (*FundTransactionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_365073e243c7f713, []int{6} + return fileDescriptor_2cc4e03d2c28c490, []int{6} } func (m *FundTransactionRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -310,8 +308,8 @@ func (m *FundTransactionRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (dst *FundTransactionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_FundTransactionRequest.Merge(dst, src) +func (m *FundTransactionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_FundTransactionRequest.Merge(m, src) } func (m *FundTransactionRequest) XXX_Size() int { return m.Size() @@ -351,7 +349,7 @@ func (m *SendTransactionRequest) Reset() { *m = SendTransactionRequest{} func (m *SendTransactionRequest) String() string { return proto.CompactTextString(m) } func (*SendTransactionRequest) ProtoMessage() {} func (*SendTransactionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_365073e243c7f713, []int{7} + return fileDescriptor_2cc4e03d2c28c490, []int{7} } func (m *SendTransactionRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -368,8 +366,8 @@ func (m *SendTransactionRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (dst *SendTransactionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SendTransactionRequest.Merge(dst, src) +func (m *SendTransactionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SendTransactionRequest.Merge(m, src) } func (m *SendTransactionRequest) XXX_Size() int { return m.Size() @@ -398,7 +396,7 @@ func (m *ListUtxosResponse) Reset() { *m = ListUtxosResponse{} } func (m *ListUtxosResponse) String() string { return proto.CompactTextString(m) } func (*ListUtxosResponse) ProtoMessage() {} func (*ListUtxosResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_365073e243c7f713, []int{8} + return fileDescriptor_2cc4e03d2c28c490, []int{8} } func (m *ListUtxosResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -415,8 +413,8 @@ func (m *ListUtxosResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (dst *ListUtxosResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListUtxosResponse.Merge(dst, src) +func (m *ListUtxosResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListUtxosResponse.Merge(m, src) } func (m *ListUtxosResponse) XXX_Size() int { return m.Size() @@ -463,7 +461,7 @@ func (m *GetBalanceRequest) Reset() { *m = GetBalanceRequest{} } func (m *GetBalanceRequest) String() string { return proto.CompactTextString(m) } func (*GetBalanceRequest) ProtoMessage() {} func (*GetBalanceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_365073e243c7f713, []int{9} + return fileDescriptor_2cc4e03d2c28c490, []int{9} } func (m *GetBalanceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -480,8 +478,8 @@ func (m *GetBalanceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (dst *GetBalanceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetBalanceRequest.Merge(dst, src) +func (m *GetBalanceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBalanceRequest.Merge(m, src) } func (m *GetBalanceRequest) XXX_Size() int { return m.Size() @@ -509,7 +507,7 @@ func (m *GetBalanceResponse) Reset() { *m = GetBalanceResponse{} } func (m *GetBalanceResponse) String() string { return proto.CompactTextString(m) } func (*GetBalanceResponse) ProtoMessage() {} func (*GetBalanceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_365073e243c7f713, []int{10} + return fileDescriptor_2cc4e03d2c28c490, []int{10} } func (m *GetBalanceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -526,8 +524,8 @@ func (m *GetBalanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (dst *GetBalanceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetBalanceResponse.Merge(dst, src) +func (m *GetBalanceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBalanceResponse.Merge(m, src) } func (m *GetBalanceResponse) XXX_Size() int { return m.Size() @@ -568,7 +566,7 @@ func (m *GetTokenBalanceRequest) Reset() { *m = GetTokenBalanceRequest{} func (m *GetTokenBalanceRequest) String() string { return proto.CompactTextString(m) } func (*GetTokenBalanceRequest) ProtoMessage() {} func (*GetTokenBalanceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_365073e243c7f713, []int{11} + return fileDescriptor_2cc4e03d2c28c490, []int{11} } func (m *GetTokenBalanceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -585,8 +583,8 @@ func (m *GetTokenBalanceRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (dst *GetTokenBalanceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTokenBalanceRequest.Merge(dst, src) +func (m *GetTokenBalanceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTokenBalanceRequest.Merge(m, src) } func (m *GetTokenBalanceRequest) XXX_Size() int { return m.Size() @@ -621,7 +619,7 @@ func (m *GetTokenBalanceResponse) Reset() { *m = GetTokenBalanceResponse func (m *GetTokenBalanceResponse) String() string { return proto.CompactTextString(m) } func (*GetTokenBalanceResponse) ProtoMessage() {} func (*GetTokenBalanceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_365073e243c7f713, []int{12} + return fileDescriptor_2cc4e03d2c28c490, []int{12} } func (m *GetTokenBalanceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -638,8 +636,8 @@ func (m *GetTokenBalanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (dst *GetTokenBalanceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTokenBalanceResponse.Merge(dst, src) +func (m *GetTokenBalanceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTokenBalanceResponse.Merge(m, src) } func (m *GetTokenBalanceResponse) XXX_Size() int { return m.Size() @@ -678,7 +676,7 @@ func (m *GetFeePriceRequest) Reset() { *m = GetFeePriceRequest{} } func (m *GetFeePriceRequest) String() string { return proto.CompactTextString(m) } func (*GetFeePriceRequest) ProtoMessage() {} func (*GetFeePriceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_365073e243c7f713, []int{13} + return fileDescriptor_2cc4e03d2c28c490, []int{13} } func (m *GetFeePriceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -695,8 +693,8 @@ func (m *GetFeePriceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (dst *GetFeePriceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetFeePriceRequest.Merge(dst, src) +func (m *GetFeePriceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFeePriceRequest.Merge(m, src) } func (m *GetFeePriceRequest) XXX_Size() int { return m.Size() @@ -715,7 +713,7 @@ func (m *GetFeePriceResponse) Reset() { *m = GetFeePriceResponse{} } func (m *GetFeePriceResponse) String() string { return proto.CompactTextString(m) } func (*GetFeePriceResponse) ProtoMessage() {} func (*GetFeePriceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_365073e243c7f713, []int{14} + return fileDescriptor_2cc4e03d2c28c490, []int{14} } func (m *GetFeePriceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -732,8 +730,8 @@ func (m *GetFeePriceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (dst *GetFeePriceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetFeePriceResponse.Merge(dst, src) +func (m *GetFeePriceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFeePriceResponse.Merge(m, src) } func (m *GetFeePriceResponse) XXX_Size() int { return m.Size() @@ -752,14 +750,14 @@ func (m *GetFeePriceResponse) GetBoxPerByte() uint64 { } type CreateTransactionRequest struct { - TxParams []*TransactionParam `protobuf:"bytes,1,rep,name=tx_params,json=txParams" json:"tx_params,omitempty"` + TxParams []*TransactionParam `protobuf:"bytes,1,rep,name=tx_params,json=txParams,proto3" json:"tx_params,omitempty"` } func (m *CreateTransactionRequest) Reset() { *m = CreateTransactionRequest{} } func (m *CreateTransactionRequest) String() string { return proto.CompactTextString(m) } func (*CreateTransactionRequest) ProtoMessage() {} func (*CreateTransactionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_365073e243c7f713, []int{15} + return fileDescriptor_2cc4e03d2c28c490, []int{15} } func (m *CreateTransactionRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -776,8 +774,8 @@ func (m *CreateTransactionRequest) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (dst *CreateTransactionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateTransactionRequest.Merge(dst, src) +func (m *CreateTransactionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateTransactionRequest.Merge(m, src) } func (m *CreateTransactionRequest) XXX_Size() int { return m.Size() @@ -796,14 +794,14 @@ func (m *CreateTransactionRequest) GetTxParams() []*TransactionParam { } type CreateTransactionResponse struct { - Txs []*pb.Transaction `protobuf:"bytes,1,rep,name=txs" json:"txs,omitempty"` + Txs []*pb.Transaction `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` } func (m *CreateTransactionResponse) Reset() { *m = CreateTransactionResponse{} } func (m *CreateTransactionResponse) String() string { return proto.CompactTextString(m) } func (*CreateTransactionResponse) ProtoMessage() {} func (*CreateTransactionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_365073e243c7f713, []int{16} + return fileDescriptor_2cc4e03d2c28c490, []int{16} } func (m *CreateTransactionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -820,8 +818,8 @@ func (m *CreateTransactionResponse) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } -func (dst *CreateTransactionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateTransactionResponse.Merge(dst, src) +func (m *CreateTransactionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateTransactionResponse.Merge(m, src) } func (m *CreateTransactionResponse) XXX_Size() int { return m.Size() @@ -852,7 +850,7 @@ func (m *TransactionParam) Reset() { *m = TransactionParam{} } func (m *TransactionParam) String() string { return proto.CompactTextString(m) } func (*TransactionParam) ProtoMessage() {} func (*TransactionParam) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_365073e243c7f713, []int{17} + return fileDescriptor_2cc4e03d2c28c490, []int{17} } func (m *TransactionParam) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -869,8 +867,8 @@ func (m *TransactionParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (dst *TransactionParam) XXX_Merge(src proto.Message) { - xxx_messageInfo_TransactionParam.Merge(dst, src) +func (m *TransactionParam) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionParam.Merge(m, src) } func (m *TransactionParam) XXX_Size() int { return m.Size() @@ -888,13 +886,13 @@ type isTransactionParam_Param interface { } type TransactionParam_BoxTarget struct { - BoxTarget *TransferBoxTarget `protobuf:"bytes,2,opt,name=box_target,json=boxTarget,oneof"` + BoxTarget *TransferBoxTarget `protobuf:"bytes,2,opt,name=box_target,json=boxTarget,proto3,oneof"` } type TransactionParam_TokenTarget struct { - TokenTarget *TransferTokenTarget `protobuf:"bytes,3,opt,name=token_target,json=tokenTarget,oneof"` + TokenTarget *TransferTokenTarget `protobuf:"bytes,3,opt,name=token_target,json=tokenTarget,proto3,oneof"` } type TransactionParam_SplitAddr struct { - SplitAddr *SplitAddrInfo `protobuf:"bytes,4,opt,name=split_addr,json=splitAddr,oneof"` + SplitAddr *SplitAddrInfo `protobuf:"bytes,4,opt,name=split_addr,json=splitAddr,proto3,oneof"` } func (*TransactionParam_BoxTarget) isTransactionParam_Param() {} @@ -1037,7 +1035,7 @@ func (m *TransferBoxTarget) Reset() { *m = TransferBoxTarget{} } func (m *TransferBoxTarget) String() string { return proto.CompactTextString(m) } func (*TransferBoxTarget) ProtoMessage() {} func (*TransferBoxTarget) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_365073e243c7f713, []int{18} + return fileDescriptor_2cc4e03d2c28c490, []int{18} } func (m *TransferBoxTarget) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1054,8 +1052,8 @@ func (m *TransferBoxTarget) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (dst *TransferBoxTarget) XXX_Merge(src proto.Message) { - xxx_messageInfo_TransferBoxTarget.Merge(dst, src) +func (m *TransferBoxTarget) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransferBoxTarget.Merge(m, src) } func (m *TransferBoxTarget) XXX_Size() int { return m.Size() @@ -1075,14 +1073,14 @@ func (m *TransferBoxTarget) GetAmount() uint64 { type TransferTokenTarget struct { Amount uint64 `protobuf:"varint,1,opt,name=amount,proto3" json:"amount,omitempty"` - Token *pb.OutPoint `protobuf:"bytes,2,opt,name=token" json:"token,omitempty"` + Token *pb.OutPoint `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` } func (m *TransferTokenTarget) Reset() { *m = TransferTokenTarget{} } func (m *TransferTokenTarget) String() string { return proto.CompactTextString(m) } func (*TransferTokenTarget) ProtoMessage() {} func (*TransferTokenTarget) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_365073e243c7f713, []int{19} + return fileDescriptor_2cc4e03d2c28c490, []int{19} } func (m *TransferTokenTarget) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1099,8 +1097,8 @@ func (m *TransferTokenTarget) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (dst *TransferTokenTarget) XXX_Merge(src proto.Message) { - xxx_messageInfo_TransferTokenTarget.Merge(dst, src) +func (m *TransferTokenTarget) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransferTokenTarget.Merge(m, src) } func (m *TransferTokenTarget) XXX_Size() int { return m.Size() @@ -1126,15 +1124,15 @@ func (m *TransferTokenTarget) GetToken() *pb.OutPoint { } type SplitAddrInfo struct { - Addrs []string `protobuf:"bytes,1,rep,name=addrs" json:"addrs,omitempty"` - Weights []uint64 `protobuf:"varint,2,rep,packed,name=weights" json:"weights,omitempty"` + Addrs []string `protobuf:"bytes,1,rep,name=addrs,proto3" json:"addrs,omitempty"` + Weights []uint64 `protobuf:"varint,2,rep,packed,name=weights,proto3" json:"weights,omitempty"` } func (m *SplitAddrInfo) Reset() { *m = SplitAddrInfo{} } func (m *SplitAddrInfo) String() string { return proto.CompactTextString(m) } func (*SplitAddrInfo) ProtoMessage() {} func (*SplitAddrInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_365073e243c7f713, []int{20} + return fileDescriptor_2cc4e03d2c28c490, []int{20} } func (m *SplitAddrInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1151,8 +1149,8 @@ func (m *SplitAddrInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return b[:n], nil } } -func (dst *SplitAddrInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_SplitAddrInfo.Merge(dst, src) +func (m *SplitAddrInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_SplitAddrInfo.Merge(m, src) } func (m *SplitAddrInfo) XXX_Size() int { return m.Size() @@ -1203,6 +1201,78 @@ func init() { proto.RegisterType((*SplitAddrInfo)(nil), "rpcpb.SplitAddrInfo") } +func init() { proto.RegisterFile("transaction.proto", fileDescriptor_2cc4e03d2c28c490) } + +var fileDescriptor_2cc4e03d2c28c490 = []byte{ + // 1052 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4d, 0x6f, 0x1b, 0xc5, + 0x1b, 0xcf, 0xfa, 0x25, 0x89, 0x9f, 0x24, 0x4a, 0x32, 0xc9, 0xdf, 0xd9, 0x6c, 0x1a, 0xff, 0xdd, + 0xa9, 0x80, 0x50, 0x90, 0x57, 0x2d, 0xef, 0x41, 0xa8, 0xad, 0x23, 0xd2, 0x22, 0x81, 0x1a, 0x6d, + 0x53, 0x84, 0xc4, 0xc1, 0x9a, 0x5d, 0x4f, 0x1c, 0x2b, 0xde, 0x9d, 0x65, 0x67, 0xb6, 0xd9, 0x00, + 0x27, 0x3e, 0x01, 0x12, 0x5f, 0x89, 0x03, 0x27, 0x54, 0x89, 0x0b, 0x47, 0x94, 0x70, 0xe3, 0x03, + 0x70, 0x45, 0x33, 0x3b, 0x6b, 0xaf, 0xed, 0x75, 0x14, 0x2a, 0x71, 0x9b, 0x67, 0x9e, 0x97, 0xdf, + 0xf3, 0x32, 0xf3, 0x9b, 0x81, 0x75, 0x11, 0x91, 0x80, 0x13, 0x4f, 0xf4, 0x59, 0xd0, 0x0a, 0x23, + 0x26, 0x18, 0xaa, 0x46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, + 0xbd, 0xbc, 0x6a, 0xcc, 0xfd, 0x7e, 0xd5, 0x98, 0x73, 0xe7, 0xd5, 0xd7, 0xf5, 0x9d, 0x7f, 0x02, + 0x00, 0x00, 0xff, 0xff, 0x90, 0x51, 0xe1, 0xdf, 0x35, 0x0b, 0x00, 0x00, +} + // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn @@ -4901,75 +4971,3 @@ var ( ErrInvalidLengthTransaction = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTransaction = fmt.Errorf("proto: integer overflow") ) - -func init() { proto.RegisterFile("transaction.proto", fileDescriptor_transaction_365073e243c7f713) } - -var fileDescriptor_transaction_365073e243c7f713 = []byte{ - // 1052 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4d, 0x6f, 0x1b, 0xc5, - 0x1b, 0xcf, 0xfa, 0x25, 0x89, 0x9f, 0x24, 0x4a, 0x32, 0xc9, 0xdf, 0xd9, 0x6c, 0x1a, 0xff, 0xdd, - 0xa9, 0x80, 0x50, 0x90, 0x57, 0x2d, 0xef, 0x41, 0xa8, 0xad, 0x23, 0xd2, 0x22, 0x81, 0x1a, 0x6d, - 0x53, 0x84, 0xc4, 0xc1, 0x9a, 0x5d, 0x4f, 0x1c, 0x2b, 0xde, 0x9d, 0x65, 0x67, 0xb6, 0xd9, 0x00, - 0x27, 0x3e, 0x01, 0x12, 0x5f, 0x89, 0x03, 0x27, 0x54, 0x89, 0x0b, 0x47, 0x94, 0x70, 0xe3, 0x03, - 0x70, 0x45, 0x33, 0x3b, 0x6b, 0xaf, 0xed, 0x75, 0x14, 0x2a, 0x71, 0x9b, 0x67, 0x9e, 0x97, 0xdf, - 0xf3, 0x32, 0xf3, 0x9b, 0x81, 0x75, 0x11, 0x91, 0x80, 0x13, 0x4f, 0xf4, 0x59, 0xd0, 0x0a, 0x23, - 0x26, 0x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, 0x6a, 0xcc, - 0xbd, 0xbc, 0x6a, 0xcc, 0xfd, 0x7e, 0xd5, 0x98, 0x73, 0xe7, 0xd5, 0xd7, 0xf5, 0x9d, 0x7f, 0x02, - 0x00, 0x00, 0xff, 0xff, 0x90, 0x51, 0xe1, 0xdf, 0x35, 0x0b, 0x00, 0x00, -} diff --git a/rpc/pb/wallet.pb.go b/rpc/pb/wallet.pb.go index 1bfcec85..f4b6aa16 100644 --- a/rpc/pb/wallet.pb.go +++ b/rpc/pb/wallet.pb.go @@ -3,19 +3,17 @@ package rpcpb -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import pb "github.com/BOXFoundation/boxd/core/pb" -import _ "google.golang.org/genproto/googleapis/api/annotations" - import ( - context "golang.org/x/net/context" + context "context" + fmt "fmt" + pb "github.com/BOXFoundation/boxd/core/pb" + proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" + io "io" + math "math" ) -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -37,7 +35,7 @@ func (m *ListTransactionsRequest) Reset() { *m = ListTransactionsRequest func (m *ListTransactionsRequest) String() string { return proto.CompactTextString(m) } func (*ListTransactionsRequest) ProtoMessage() {} func (*ListTransactionsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_wallet_925d89b13bb40012, []int{0} + return fileDescriptor_b88fd140af4deb6f, []int{0} } func (m *ListTransactionsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -54,8 +52,8 @@ func (m *ListTransactionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (dst *ListTransactionsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListTransactionsRequest.Merge(dst, src) +func (m *ListTransactionsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListTransactionsRequest.Merge(m, src) } func (m *ListTransactionsRequest) XXX_Size() int { return m.Size() @@ -98,7 +96,7 @@ func (m *ListTransactionsResponse) Reset() { *m = ListTransactionsRespon func (m *ListTransactionsResponse) String() string { return proto.CompactTextString(m) } func (*ListTransactionsResponse) ProtoMessage() {} func (*ListTransactionsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_wallet_925d89b13bb40012, []int{1} + return fileDescriptor_b88fd140af4deb6f, []int{1} } func (m *ListTransactionsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -115,8 +113,8 @@ func (m *ListTransactionsResponse) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (dst *ListTransactionsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListTransactionsResponse.Merge(dst, src) +func (m *ListTransactionsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListTransactionsResponse.Merge(m, src) } func (m *ListTransactionsResponse) XXX_Size() int { return m.Size() @@ -164,7 +162,7 @@ func (m *Transaction) Reset() { *m = Transaction{} } func (m *Transaction) String() string { return proto.CompactTextString(m) } func (*Transaction) ProtoMessage() {} func (*Transaction) Descriptor() ([]byte, []int) { - return fileDescriptor_wallet_925d89b13bb40012, []int{2} + return fileDescriptor_b88fd140af4deb6f, []int{2} } func (m *Transaction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -181,8 +179,8 @@ func (m *Transaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (dst *Transaction) XXX_Merge(src proto.Message) { - xxx_messageInfo_Transaction.Merge(dst, src) +func (m *Transaction) XXX_Merge(src proto.Message) { + xxx_messageInfo_Transaction.Merge(m, src) } func (m *Transaction) XXX_Size() int { return m.Size() @@ -215,7 +213,7 @@ func (m *GetTransactionCountRequest) Reset() { *m = GetTransactionCountR func (m *GetTransactionCountRequest) String() string { return proto.CompactTextString(m) } func (*GetTransactionCountRequest) ProtoMessage() {} func (*GetTransactionCountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_wallet_925d89b13bb40012, []int{3} + return fileDescriptor_b88fd140af4deb6f, []int{3} } func (m *GetTransactionCountRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -232,8 +230,8 @@ func (m *GetTransactionCountRequest) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (dst *GetTransactionCountRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTransactionCountRequest.Merge(dst, src) +func (m *GetTransactionCountRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTransactionCountRequest.Merge(m, src) } func (m *GetTransactionCountRequest) XXX_Size() int { return m.Size() @@ -261,7 +259,7 @@ func (m *GetTransactionCountResponse) Reset() { *m = GetTransactionCount func (m *GetTransactionCountResponse) String() string { return proto.CompactTextString(m) } func (*GetTransactionCountResponse) ProtoMessage() {} func (*GetTransactionCountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_wallet_925d89b13bb40012, []int{4} + return fileDescriptor_b88fd140af4deb6f, []int{4} } func (m *GetTransactionCountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -278,8 +276,8 @@ func (m *GetTransactionCountResponse) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (dst *GetTransactionCountResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTransactionCountResponse.Merge(dst, src) +func (m *GetTransactionCountResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTransactionCountResponse.Merge(m, src) } func (m *GetTransactionCountResponse) XXX_Size() int { return m.Size() @@ -319,6 +317,41 @@ func init() { proto.RegisterType((*GetTransactionCountResponse)(nil), "rpcpb.GetTransactionCountResponse") } +func init() { proto.RegisterFile("wallet.proto", fileDescriptor_b88fd140af4deb6f) } + +var fileDescriptor_b88fd140af4deb6f = []byte{ + // 463 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0x41, 0x6b, 0x13, 0x41, + 0x14, 0xce, 0xa4, 0x4d, 0x6a, 0x5e, 0x53, 0x90, 0xa9, 0xd8, 0x65, 0xa3, 0x6b, 0x1c, 0x41, 0x42, + 0x0f, 0x3b, 0xb6, 0x1e, 0x84, 0x1e, 0x13, 0x50, 0x0f, 0x82, 0xb0, 0x08, 0x0a, 0x1e, 0xca, 0xec, + 0xee, 0x74, 0xb3, 0xb8, 0x3b, 0x6f, 0xdd, 0x99, 0x98, 0x78, 0x15, 0x7f, 0x40, 0xc1, 0x83, 0x7f, + 0xc9, 0x63, 0xc1, 0x8b, 0x47, 0x49, 0xfc, 0x21, 0xb2, 0x93, 0x54, 0x56, 0x6d, 0x72, 0xea, 0x6d, + 0xbe, 0xfd, 0xde, 0x7c, 0xef, 0x7b, 0xdf, 0xbc, 0x85, 0xee, 0x54, 0x64, 0x99, 0x34, 0x7e, 0x51, + 0xa2, 0x41, 0xda, 0x2a, 0x8b, 0xa8, 0x08, 0xdd, 0xa3, 0x24, 0x35, 0xe3, 0x49, 0xe8, 0x47, 0x98, + 0xf3, 0xe1, 0xcb, 0x37, 0x4f, 0x71, 0xa2, 0x62, 0x61, 0x52, 0x54, 0x3c, 0xc4, 0x59, 0xcc, 0x23, + 0x2c, 0x25, 0x2f, 0x42, 0x1e, 0x66, 0x18, 0xbd, 0x5b, 0xde, 0x74, 0xef, 0x24, 0x88, 0x49, 0x26, + 0xb9, 0x28, 0x52, 0x2e, 0x94, 0x42, 0x63, 0xeb, 0xf5, 0x92, 0x65, 0x6f, 0xe1, 0xe0, 0x45, 0xaa, + 0xcd, 0xab, 0x52, 0x28, 0x2d, 0x22, 0xcb, 0x04, 0xf2, 0xfd, 0x44, 0x6a, 0x43, 0x29, 0x6c, 0x8b, + 0x38, 0x2e, 0x1d, 0xd2, 0x27, 0x83, 0x4e, 0x60, 0xcf, 0xf4, 0x36, 0xb4, 0xf1, 0xec, 0x4c, 0x4b, + 0xe3, 0x34, 0xfb, 0x64, 0xb0, 0x17, 0xac, 0x10, 0xbd, 0x05, 0x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a, 0xc4, 0x27, 0xe4, 0x90, 0x7e, 0x26, 0xb0, 0x7f, 0xc5, 0xbc, 0xf4, 0xfe, 0x4a, 0x7d, 0x7d, + 0x7a, 0x2e, 0xdb, 0x54, 0xb2, 0xf2, 0xf0, 0xd0, 0x7a, 0xe8, 0xb3, 0xde, 0xa5, 0x87, 0x44, 0xd6, + 0x2d, 0xd8, 0x3c, 0x4e, 0xc8, 0xe1, 0xd0, 0xf9, 0x36, 0xf7, 0xc8, 0xc5, 0xdc, 0x23, 0x3f, 0xe7, + 0x1e, 0x39, 0x5f, 0x78, 0x8d, 0x8b, 0x85, 0xd7, 0xf8, 0xb1, 0xf0, 0x1a, 0x61, 0xdb, 0xfe, 0x04, + 0x8f, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x0e, 0x55, 0x16, 0x67, 0x6c, 0x03, 0x00, 0x00, +} + // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn @@ -1382,38 +1415,3 @@ var ( ErrInvalidLengthWallet = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowWallet = fmt.Errorf("proto: integer overflow") ) - -func init() { proto.RegisterFile("wallet.proto", fileDescriptor_wallet_925d89b13bb40012) } - -var fileDescriptor_wallet_925d89b13bb40012 = []byte{ - // 463 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0x41, 0x6b, 0x13, 0x41, - 0x14, 0xce, 0xa4, 0x4d, 0x6a, 0x5e, 0x53, 0x90, 0xa9, 0xd8, 0x65, 0xa3, 0x6b, 0x1c, 0x41, 0x42, - 0x0f, 0x3b, 0xb6, 0x1e, 0x84, 0x1e, 0x13, 0x50, 0x0f, 0x82, 0xb0, 0x08, 0x0a, 0x1e, 0xca, 0xec, - 0xee, 0x74, 0xb3, 0xb8, 0x3b, 0x6f, 0xdd, 0x99, 0x98, 0x78, 0x15, 0x7f, 0x40, 0xc1, 0x83, 0x7f, - 0xc9, 0x63, 0xc1, 0x8b, 0x47, 0x49, 0xfc, 0x21, 0xb2, 0x93, 0x54, 0x56, 0x6d, 0x72, 0xea, 0x6d, - 0xbe, 0xfd, 0xde, 0x7c, 0xef, 0x7b, 0xdf, 0xbc, 0x85, 0xee, 0x54, 0x64, 0x99, 0x34, 0x7e, 0x51, - 0xa2, 0x41, 0xda, 0x2a, 0x8b, 0xa8, 0x08, 0xdd, 0xa3, 0x24, 0x35, 0xe3, 0x49, 0xe8, 0x47, 0x98, - 0xf3, 0xe1, 0xcb, 0x37, 0x4f, 0x71, 0xa2, 0x62, 0x61, 0x52, 0x54, 0x3c, 0xc4, 0x59, 0xcc, 0x23, - 0x2c, 0x25, 0x2f, 0x42, 0x1e, 0x66, 0x18, 0xbd, 0x5b, 0xde, 0x74, 0xef, 0x24, 0x88, 0x49, 0x26, - 0xb9, 0x28, 0x52, 0x2e, 0x94, 0x42, 0x63, 0xeb, 0xf5, 0x92, 0x65, 0x6f, 0xe1, 0xe0, 0x45, 0xaa, - 0xcd, 0xab, 0x52, 0x28, 0x2d, 0x22, 0xcb, 0x04, 0xf2, 0xfd, 0x44, 0x6a, 0x43, 0x29, 0x6c, 0x8b, - 0x38, 0x2e, 0x1d, 0xd2, 0x27, 0x83, 0x4e, 0x60, 0xcf, 0xf4, 0x36, 0xb4, 0xf1, 0xec, 0x4c, 0x4b, - 0xe3, 0x34, 0xfb, 0x64, 0xb0, 0x17, 0xac, 0x10, 0xbd, 0x05, 0xad, 0x2c, 0xcd, 0x53, 0xe3, 0x6c, - 0xd9, 0xcf, 0x4b, 0xc0, 0xbe, 0x12, 0x70, 0xfe, 0x57, 0xd7, 0x05, 0x2a, 0x2d, 0x2b, 0xf9, 0x08, - 0x63, 0x69, 0xe5, 0x5b, 0x81, 0x3d, 0x53, 0x07, 0x76, 0x72, 0xa9, 0xb5, 0x48, 0xa4, 0xd5, 0xef, - 0x04, 0x97, 0xb0, 0x6a, 0x10, 0xe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0xc8, 0xc5, 0xdc, 0x23, 0x3f, 0xe7, - 0x1e, 0x39, 0x5f, 0x78, 0x8d, 0x8b, 0x85, 0xd7, 0xf8, 0xb1, 0xf0, 0x1a, 0x61, 0xdb, 0xfe, 0x04, - 0x8f, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x0e, 0x55, 0x16, 0x67, 0x6c, 0x03, 0x00, 0x00, -} diff --git a/rpc/pb/web.pb.go b/rpc/pb/web.pb.go index 3d69eb03..0d09a69f 100644 --- a/rpc/pb/web.pb.go +++ b/rpc/pb/web.pb.go @@ -3,19 +3,17 @@ package rpcpb -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import pb "github.com/BOXFoundation/boxd/core/pb" -import _ "google.golang.org/genproto/googleapis/api/annotations" - import ( - context "golang.org/x/net/context" + context "context" + fmt "fmt" + pb "github.com/BOXFoundation/boxd/core/pb" + proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" + io "io" + math "math" ) -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -36,7 +34,7 @@ func (m *GetTransactionsInfoResponse) Reset() { *m = GetTransactionsInfo func (m *GetTransactionsInfoResponse) String() string { return proto.CompactTextString(m) } func (*GetTransactionsInfoResponse) ProtoMessage() {} func (*GetTransactionsInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{0} + return fileDescriptor_461bb3ac99194e85, []int{0} } func (m *GetTransactionsInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -53,8 +51,8 @@ func (m *GetTransactionsInfoResponse) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (dst *GetTransactionsInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTransactionsInfoResponse.Merge(dst, src) +func (m *GetTransactionsInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTransactionsInfoResponse.Merge(m, src) } func (m *GetTransactionsInfoResponse) XXX_Size() int { return m.Size() @@ -89,7 +87,7 @@ func (m *GetTransactionHistoryRequest) Reset() { *m = GetTransactionHist func (m *GetTransactionHistoryRequest) String() string { return proto.CompactTextString(m) } func (*GetTransactionHistoryRequest) ProtoMessage() {} func (*GetTransactionHistoryRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{1} + return fileDescriptor_461bb3ac99194e85, []int{1} } func (m *GetTransactionHistoryRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -106,8 +104,8 @@ func (m *GetTransactionHistoryRequest) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (dst *GetTransactionHistoryRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTransactionHistoryRequest.Merge(dst, src) +func (m *GetTransactionHistoryRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTransactionHistoryRequest.Merge(m, src) } func (m *GetTransactionHistoryRequest) XXX_Size() int { return m.Size() @@ -148,7 +146,7 @@ func (m *GetPendingTransactionRequest) Reset() { *m = GetPendingTransact func (m *GetPendingTransactionRequest) String() string { return proto.CompactTextString(m) } func (*GetPendingTransactionRequest) ProtoMessage() {} func (*GetPendingTransactionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{2} + return fileDescriptor_461bb3ac99194e85, []int{2} } func (m *GetPendingTransactionRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -165,8 +163,8 @@ func (m *GetPendingTransactionRequest) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (dst *GetPendingTransactionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetPendingTransactionRequest.Merge(dst, src) +func (m *GetPendingTransactionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetPendingTransactionRequest.Merge(m, src) } func (m *GetPendingTransactionRequest) XXX_Size() int { return m.Size() @@ -199,7 +197,7 @@ func (m *GetBlockInfoRequest) Reset() { *m = GetBlockInfoRequest{} } func (m *GetBlockInfoRequest) String() string { return proto.CompactTextString(m) } func (*GetBlockInfoRequest) ProtoMessage() {} func (*GetBlockInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{3} + return fileDescriptor_461bb3ac99194e85, []int{3} } func (m *GetBlockInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -216,8 +214,8 @@ func (m *GetBlockInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (dst *GetBlockInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetBlockInfoRequest.Merge(dst, src) +func (m *GetBlockInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBlockInfoRequest.Merge(m, src) } func (m *GetBlockInfoRequest) XXX_Size() int { return m.Size() @@ -243,7 +241,7 @@ func (m *GetTransactionInfoRequest) Reset() { *m = GetTransactionInfoReq func (m *GetTransactionInfoRequest) String() string { return proto.CompactTextString(m) } func (*GetTransactionInfoRequest) ProtoMessage() {} func (*GetTransactionInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{4} + return fileDescriptor_461bb3ac99194e85, []int{4} } func (m *GetTransactionInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -260,8 +258,8 @@ func (m *GetTransactionInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } -func (dst *GetTransactionInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTransactionInfoRequest.Merge(dst, src) +func (m *GetTransactionInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTransactionInfoRequest.Merge(m, src) } func (m *GetTransactionInfoRequest) XXX_Size() int { return m.Size() @@ -288,7 +286,7 @@ func (m *GetTopHoldersRequest) Reset() { *m = GetTopHoldersRequest{} } func (m *GetTopHoldersRequest) String() string { return proto.CompactTextString(m) } func (*GetTopHoldersRequest) ProtoMessage() {} func (*GetTopHoldersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{5} + return fileDescriptor_461bb3ac99194e85, []int{5} } func (m *GetTopHoldersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -305,8 +303,8 @@ func (m *GetTopHoldersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (dst *GetTopHoldersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTopHoldersRequest.Merge(dst, src) +func (m *GetTopHoldersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTopHoldersRequest.Merge(m, src) } func (m *GetTopHoldersRequest) XXX_Size() int { return m.Size() @@ -340,7 +338,7 @@ func (m *GetTopHoldersResponse) Reset() { *m = GetTopHoldersResponse{} } func (m *GetTopHoldersResponse) String() string { return proto.CompactTextString(m) } func (*GetTopHoldersResponse) ProtoMessage() {} func (*GetTopHoldersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{6} + return fileDescriptor_461bb3ac99194e85, []int{6} } func (m *GetTopHoldersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -357,8 +355,8 @@ func (m *GetTopHoldersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } -func (dst *GetTopHoldersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTopHoldersResponse.Merge(dst, src) +func (m *GetTopHoldersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTopHoldersResponse.Merge(m, src) } func (m *GetTopHoldersResponse) XXX_Size() int { return m.Size() @@ -392,7 +390,7 @@ func (m *AddressAmount) Reset() { *m = AddressAmount{} } func (m *AddressAmount) String() string { return proto.CompactTextString(m) } func (*AddressAmount) ProtoMessage() {} func (*AddressAmount) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{7} + return fileDescriptor_461bb3ac99194e85, []int{7} } func (m *AddressAmount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -409,8 +407,8 @@ func (m *AddressAmount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return b[:n], nil } } -func (dst *AddressAmount) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddressAmount.Merge(dst, src) +func (m *AddressAmount) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressAmount.Merge(m, src) } func (m *AddressAmount) XXX_Size() int { return m.Size() @@ -442,7 +440,7 @@ func (m *GetHolderCountRequest) Reset() { *m = GetHolderCountRequest{} } func (m *GetHolderCountRequest) String() string { return proto.CompactTextString(m) } func (*GetHolderCountRequest) ProtoMessage() {} func (*GetHolderCountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{8} + return fileDescriptor_461bb3ac99194e85, []int{8} } func (m *GetHolderCountRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -459,8 +457,8 @@ func (m *GetHolderCountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } -func (dst *GetHolderCountRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetHolderCountRequest.Merge(dst, src) +func (m *GetHolderCountRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetHolderCountRequest.Merge(m, src) } func (m *GetHolderCountRequest) XXX_Size() int { return m.Size() @@ -479,7 +477,7 @@ func (m *GetHolderCountResponse) Reset() { *m = GetHolderCountResponse{} func (m *GetHolderCountResponse) String() string { return proto.CompactTextString(m) } func (*GetHolderCountResponse) ProtoMessage() {} func (*GetHolderCountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{9} + return fileDescriptor_461bb3ac99194e85, []int{9} } func (m *GetHolderCountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -496,8 +494,8 @@ func (m *GetHolderCountResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (dst *GetHolderCountResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetHolderCountResponse.Merge(dst, src) +func (m *GetHolderCountResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetHolderCountResponse.Merge(m, src) } func (m *GetHolderCountResponse) XXX_Size() int { return m.Size() @@ -529,7 +527,7 @@ func (m *HeaderInfo) Reset() { *m = HeaderInfo{} } func (m *HeaderInfo) String() string { return proto.CompactTextString(m) } func (*HeaderInfo) ProtoMessage() {} func (*HeaderInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{10} + return fileDescriptor_461bb3ac99194e85, []int{10} } func (m *HeaderInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -546,8 +544,8 @@ func (m *HeaderInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (dst *HeaderInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_HeaderInfo.Merge(dst, src) +func (m *HeaderInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_HeaderInfo.Merge(m, src) } func (m *HeaderInfo) XXX_Size() int { return m.Size() @@ -624,7 +622,7 @@ func (m *TransactionInfo) Reset() { *m = TransactionInfo{} } func (m *TransactionInfo) String() string { return proto.CompactTextString(m) } func (*TransactionInfo) ProtoMessage() {} func (*TransactionInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{11} + return fileDescriptor_461bb3ac99194e85, []int{11} } func (m *TransactionInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -641,8 +639,8 @@ func (m *TransactionInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } -func (dst *TransactionInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_TransactionInfo.Merge(dst, src) +func (m *TransactionInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionInfo.Merge(m, src) } func (m *TransactionInfo) XXX_Size() int { return m.Size() @@ -732,7 +730,7 @@ func (m *TransactionExtraInfo) Reset() { *m = TransactionExtraInfo{} } func (m *TransactionExtraInfo) String() string { return proto.CompactTextString(m) } func (*TransactionExtraInfo) ProtoMessage() {} func (*TransactionExtraInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{12} + return fileDescriptor_461bb3ac99194e85, []int{12} } func (m *TransactionExtraInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -749,8 +747,8 @@ func (m *TransactionExtraInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (dst *TransactionExtraInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_TransactionExtraInfo.Merge(dst, src) +func (m *TransactionExtraInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionExtraInfo.Merge(m, src) } func (m *TransactionExtraInfo) XXX_Size() int { return m.Size() @@ -784,7 +782,7 @@ func (m *GetTransactionInfoResponse) Reset() { *m = GetTransactionInfoRe func (m *GetTransactionInfoResponse) String() string { return proto.CompactTextString(m) } func (*GetTransactionInfoResponse) ProtoMessage() {} func (*GetTransactionInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{13} + return fileDescriptor_461bb3ac99194e85, []int{13} } func (m *GetTransactionInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -801,8 +799,8 @@ func (m *GetTransactionInfoResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (dst *GetTransactionInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTransactionInfoResponse.Merge(dst, src) +func (m *GetTransactionInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTransactionInfoResponse.Merge(m, src) } func (m *GetTransactionInfoResponse) XXX_Size() int { return m.Size() @@ -836,7 +834,7 @@ func (m *TokenTransferInfo) Reset() { *m = TokenTransferInfo{} } func (m *TokenTransferInfo) String() string { return proto.CompactTextString(m) } func (*TokenTransferInfo) ProtoMessage() {} func (*TokenTransferInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{14} + return fileDescriptor_461bb3ac99194e85, []int{14} } func (m *TokenTransferInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -853,8 +851,8 @@ func (m *TokenTransferInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (dst *TokenTransferInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenTransferInfo.Merge(dst, src) +func (m *TokenTransferInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenTransferInfo.Merge(m, src) } func (m *TokenTransferInfo) XXX_Size() int { return m.Size() @@ -891,7 +889,7 @@ func (m *TokenIssueInfo) Reset() { *m = TokenIssueInfo{} } func (m *TokenIssueInfo) String() string { return proto.CompactTextString(m) } func (*TokenIssueInfo) ProtoMessage() {} func (*TokenIssueInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{15} + return fileDescriptor_461bb3ac99194e85, []int{15} } func (m *TokenIssueInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -908,8 +906,8 @@ func (m *TokenIssueInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (dst *TokenIssueInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenIssueInfo.Merge(dst, src) +func (m *TokenIssueInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenIssueInfo.Merge(m, src) } func (m *TokenIssueInfo) XXX_Size() int { return m.Size() @@ -968,7 +966,7 @@ func (m *TxOutInfo) Reset() { *m = TxOutInfo{} } func (m *TxOutInfo) String() string { return proto.CompactTextString(m) } func (*TxOutInfo) ProtoMessage() {} func (*TxOutInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{16} + return fileDescriptor_461bb3ac99194e85, []int{16} } func (m *TxOutInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -985,8 +983,8 @@ func (m *TxOutInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (dst *TxOutInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxOutInfo.Merge(dst, src) +func (m *TxOutInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_TxOutInfo.Merge(m, src) } func (m *TxOutInfo) XXX_Size() int { return m.Size() @@ -1048,7 +1046,7 @@ func (m *OutPointInfo) Reset() { *m = OutPointInfo{} } func (m *OutPointInfo) String() string { return proto.CompactTextString(m) } func (*OutPointInfo) ProtoMessage() {} func (*OutPointInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{17} + return fileDescriptor_461bb3ac99194e85, []int{17} } func (m *OutPointInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1065,8 +1063,8 @@ func (m *OutPointInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (dst *OutPointInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_OutPointInfo.Merge(dst, src) +func (m *OutPointInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_OutPointInfo.Merge(m, src) } func (m *OutPointInfo) XXX_Size() int { return m.Size() @@ -1103,7 +1101,7 @@ func (m *TxInInfo) Reset() { *m = TxInInfo{} } func (m *TxInInfo) String() string { return proto.CompactTextString(m) } func (*TxInInfo) ProtoMessage() {} func (*TxInInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{18} + return fileDescriptor_461bb3ac99194e85, []int{18} } func (m *TxInInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1120,8 +1118,8 @@ func (m *TxInInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (dst *TxInInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxInInfo.Merge(dst, src) +func (m *TxInInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_TxInInfo.Merge(m, src) } func (m *TxInInfo) XXX_Size() int { return m.Size() @@ -1182,7 +1180,7 @@ func (m *BlockInfo) Reset() { *m = BlockInfo{} } func (m *BlockInfo) String() string { return proto.CompactTextString(m) } func (*BlockInfo) ProtoMessage() {} func (*BlockInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{19} + return fileDescriptor_461bb3ac99194e85, []int{19} } func (m *BlockInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1199,8 +1197,8 @@ func (m *BlockInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (dst *BlockInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockInfo.Merge(dst, src) +func (m *BlockInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockInfo.Merge(m, src) } func (m *BlockInfo) XXX_Size() int { return m.Size() @@ -1276,7 +1274,7 @@ func (m *Token) Reset() { *m = Token{} } func (m *Token) String() string { return proto.CompactTextString(m) } func (*Token) ProtoMessage() {} func (*Token) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{20} + return fileDescriptor_461bb3ac99194e85, []int{20} } func (m *Token) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1293,8 +1291,8 @@ func (m *Token) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (dst *Token) XXX_Merge(src proto.Message) { - xxx_messageInfo_Token.Merge(dst, src) +func (m *Token) XXX_Merge(src proto.Message) { + xxx_messageInfo_Token.Merge(m, src) } func (m *Token) XXX_Size() int { return m.Size() @@ -1328,7 +1326,7 @@ func (m *ListTokensRequest) Reset() { *m = ListTokensRequest{} } func (m *ListTokensRequest) String() string { return proto.CompactTextString(m) } func (*ListTokensRequest) ProtoMessage() {} func (*ListTokensRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{21} + return fileDescriptor_461bb3ac99194e85, []int{21} } func (m *ListTokensRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1345,8 +1343,8 @@ func (m *ListTokensRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (dst *ListTokensRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListTokensRequest.Merge(dst, src) +func (m *ListTokensRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListTokensRequest.Merge(m, src) } func (m *ListTokensRequest) XXX_Size() int { return m.Size() @@ -1381,7 +1379,7 @@ func (m *GetTokenHoldersRequest) Reset() { *m = GetTokenHoldersRequest{} func (m *GetTokenHoldersRequest) String() string { return proto.CompactTextString(m) } func (*GetTokenHoldersRequest) ProtoMessage() {} func (*GetTokenHoldersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{22} + return fileDescriptor_461bb3ac99194e85, []int{22} } func (m *GetTokenHoldersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1398,8 +1396,8 @@ func (m *GetTokenHoldersRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (dst *GetTokenHoldersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTokenHoldersRequest.Merge(dst, src) +func (m *GetTokenHoldersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTokenHoldersRequest.Merge(m, src) } func (m *GetTokenHoldersRequest) XXX_Size() int { return m.Size() @@ -1441,7 +1439,7 @@ func (m *GetTokenTransactionsRequest) Reset() { *m = GetTokenTransaction func (m *GetTokenTransactionsRequest) String() string { return proto.CompactTextString(m) } func (*GetTokenTransactionsRequest) ProtoMessage() {} func (*GetTokenTransactionsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{23} + return fileDescriptor_461bb3ac99194e85, []int{23} } func (m *GetTokenTransactionsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1458,8 +1456,8 @@ func (m *GetTokenTransactionsRequest) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (dst *GetTokenTransactionsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTokenTransactionsRequest.Merge(dst, src) +func (m *GetTokenTransactionsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTokenTransactionsRequest.Merge(m, src) } func (m *GetTokenTransactionsRequest) XXX_Size() int { return m.Size() @@ -1499,7 +1497,7 @@ func (m *GetTokenInfoRequest) Reset() { *m = GetTokenInfoRequest{} } func (m *GetTokenInfoRequest) String() string { return proto.CompactTextString(m) } func (*GetTokenInfoRequest) ProtoMessage() {} func (*GetTokenInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{24} + return fileDescriptor_461bb3ac99194e85, []int{24} } func (m *GetTokenInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1516,8 +1514,8 @@ func (m *GetTokenInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (dst *GetTokenInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTokenInfoRequest.Merge(dst, src) +func (m *GetTokenInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTokenInfoRequest.Merge(m, src) } func (m *GetTokenInfoRequest) XXX_Size() int { return m.Size() @@ -1543,7 +1541,7 @@ func (m *GetTokenInfoResponse) Reset() { *m = GetTokenInfoResponse{} } func (m *GetTokenInfoResponse) String() string { return proto.CompactTextString(m) } func (*GetTokenInfoResponse) ProtoMessage() {} func (*GetTokenInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{25} + return fileDescriptor_461bb3ac99194e85, []int{25} } func (m *GetTokenInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1560,8 +1558,8 @@ func (m *GetTokenInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (dst *GetTokenInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTokenInfoResponse.Merge(dst, src) +func (m *GetTokenInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTokenInfoResponse.Merge(m, src) } func (m *GetTokenInfoResponse) XXX_Size() int { return m.Size() @@ -1595,7 +1593,7 @@ func (m *TokenBasicInfo) Reset() { *m = TokenBasicInfo{} } func (m *TokenBasicInfo) String() string { return proto.CompactTextString(m) } func (*TokenBasicInfo) ProtoMessage() {} func (*TokenBasicInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{26} + return fileDescriptor_461bb3ac99194e85, []int{26} } func (m *TokenBasicInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1612,8 +1610,8 @@ func (m *TokenBasicInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (dst *TokenBasicInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenBasicInfo.Merge(dst, src) +func (m *TokenBasicInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenBasicInfo.Merge(m, src) } func (m *TokenBasicInfo) XXX_Size() int { return m.Size() @@ -1689,7 +1687,7 @@ func (m *ListTokensResponse) Reset() { *m = ListTokensResponse{} } func (m *ListTokensResponse) String() string { return proto.CompactTextString(m) } func (*ListTokensResponse) ProtoMessage() {} func (*ListTokensResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{27} + return fileDescriptor_461bb3ac99194e85, []int{27} } func (m *ListTokensResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1706,8 +1704,8 @@ func (m *ListTokensResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (dst *ListTokensResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListTokensResponse.Merge(dst, src) +func (m *ListTokensResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListTokensResponse.Merge(m, src) } func (m *ListTokensResponse) XXX_Size() int { return m.Size() @@ -1742,7 +1740,7 @@ func (m *GetTokenHoldersResponse) Reset() { *m = GetTokenHoldersResponse func (m *GetTokenHoldersResponse) String() string { return proto.CompactTextString(m) } func (*GetTokenHoldersResponse) ProtoMessage() {} func (*GetTokenHoldersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{28} + return fileDescriptor_461bb3ac99194e85, []int{28} } func (m *GetTokenHoldersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1759,8 +1757,8 @@ func (m *GetTokenHoldersResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (dst *GetTokenHoldersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTokenHoldersResponse.Merge(dst, src) +func (m *GetTokenHoldersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTokenHoldersResponse.Merge(m, src) } func (m *GetTokenHoldersResponse) XXX_Size() int { return m.Size() @@ -1799,7 +1797,7 @@ func (m *ListenBlockRequest) Reset() { *m = ListenBlockRequest{} } func (m *ListenBlockRequest) String() string { return proto.CompactTextString(m) } func (*ListenBlockRequest) ProtoMessage() {} func (*ListenBlockRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_web_d5fe91820a4f981b, []int{29} + return fileDescriptor_461bb3ac99194e85, []int{29} } func (m *ListenBlockRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1816,8 +1814,8 @@ func (m *ListenBlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (dst *ListenBlockRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListenBlockRequest.Merge(dst, src) +func (m *ListenBlockRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListenBlockRequest.Merge(m, src) } func (m *ListenBlockRequest) XXX_Size() int { return m.Size() @@ -1861,6 +1859,118 @@ func init() { proto.RegisterType((*ListenBlockRequest)(nil), "rpcpb.ListenBlockRequest") } +func init() { proto.RegisterFile("web.proto", fileDescriptor_461bb3ac99194e85) } + +var fileDescriptor_461bb3ac99194e85 = []byte{ + // 1682 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcd, 0x6f, 0x5b, 0x4b, + 0x15, 0xef, 0x8d, 0x3f, 0x62, 0x1f, 0xdb, 0xc9, 0xeb, 0x34, 0x49, 0x1d, 0x27, 0xf1, 0x4b, 0xa6, + 0x05, 0x52, 0x24, 0x62, 0x1a, 0x58, 0xf0, 0x78, 0x42, 0x28, 0x79, 0x85, 0x97, 0x8a, 0x27, 0x5a, + 0xdd, 0x56, 0x7a, 0x05, 0x09, 0x99, 0xfb, 0x31, 0xb1, 0x47, 0xb1, 0xef, 0x5c, 0xee, 0x8c, 0x13, + 0x07, 0x56, 0x20, 0x10, 0x4b, 0x90, 0xf8, 0x0b, 0xd8, 0xf2, 0x97, 0xb0, 0x7c, 0x12, 0x1b, 0x56, + 0x08, 0xb5, 0x2c, 0xf8, 0x07, 0x58, 0xb0, 0x43, 0x73, 0x66, 0xee, 0x87, 0x1d, 0x3b, 0x6d, 0xd1, + 0xdb, 0xdd, 0x39, 0x73, 0xe6, 0x77, 0x3e, 0xe7, 0x9c, 0x33, 0x17, 0xea, 0x57, 0xcc, 0x3f, 0x8a, + 0x13, 0xa1, 0x04, 0xa9, 0x24, 0x71, 0x10, 0xfb, 0x9d, 0xc7, 0x03, 0xae, 0x86, 0x13, 0xff, 0x28, + 0x10, 0xe3, 0xde, 0xe9, 0xb3, 0x57, 0x3f, 0x14, 0x93, 0x28, 0xf4, 0x14, 0x17, 0x51, 0xcf, 0x17, + 0xd3, 0xb0, 0x17, 0x88, 0x84, 0xf5, 0x62, 0xbf, 0xe7, 0x8f, 0x44, 0x70, 0x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 0xb3, 0x35, + 0xab, 0xa6, 0x09, 0xa7, 0x9e, 0xc4, 0x8a, 0x14, 0x88, 0xe8, 0x9c, 0x27, 0x63, 0x16, 0x62, 0xf5, + 0xaa, 0xb9, 0x39, 0x81, 0x3e, 0x86, 0x0a, 0x66, 0xc6, 0x7b, 0xc4, 0xf6, 0x04, 0xee, 0x7e, 0xc6, + 0xa5, 0xc2, 0x63, 0xd9, 0x08, 0x90, 0x37, 0x7b, 0xa7, 0xd8, 0xec, 0x17, 0x8f, 0x42, 0xf4, 0xa7, + 0xd8, 0x53, 0x11, 0x61, 0x6e, 0x94, 0x58, 0x52, 0x28, 0x16, 0x0d, 0x12, 0x39, 0x76, 0xa9, 0x88, + 0xdd, 0x37, 0xf3, 0x60, 0x96, 0xee, 0x76, 0x28, 0xfc, 0xf2, 0x04, 0x98, 0x09, 0xcb, 0x5c, 0xc4, + 0xd9, 0x81, 0x69, 0x1e, 0x98, 0x9e, 0xd8, 0x81, 0x29, 0x63, 0xb5, 0xe5, 0xf8, 0x11, 0x94, 0x79, + 0x5e, 0x8c, 0x67, 0xee, 0xf6, 0xa9, 0x27, 0x79, 0x60, 0xfa, 0x9b, 0x66, 0xd1, 0xc9, 0xb9, 0x36, + 0xbb, 0x41, 0xa8, 0x9e, 0x93, 0x2e, 0x58, 0x64, 0x8f, 0x37, 0x8b, 0xc7, 0x5d, 0xb3, 0x95, 0x55, + 0xcc, 0x95, 0x5b, 0x2a, 0x66, 0xe9, 0x66, 0xc5, 0x3c, 0x80, 0x66, 0x90, 0x30, 0x4f, 0x89, 0xa4, + 0x8f, 0xc6, 0x94, 0xf1, 0x78, 0xc3, 0xd2, 0xf4, 0x74, 0x55, 0x64, 0xc1, 0x6e, 0x55, 0x31, 0x28, + 0x96, 0x86, 0xfd, 0xaa, 0x58, 0x5f, 0xab, 0x73, 0xf5, 0x35, 0xaf, 0xc9, 0xab, 0x33, 0x35, 0x39, + 0x75, 0x5f, 0xad, 0xe0, 0xbe, 0x9f, 0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xfc, 0x31, 0xbb, 0x32, 0x05, 0xa2, 0x18, 0xbb, 0xd9, 0x7a, 0xd6, 0x69, 0xa5, 0xaf, 0x2f, 0xa4, + 0x7e, 0xd3, 0x39, 0x6d, 0xff, 0xf5, 0x75, 0xd7, 0xf9, 0xe2, 0x75, 0xd7, 0xf9, 0xe7, 0xeb, 0xae, + 0xf3, 0xc7, 0x37, 0xdd, 0x3b, 0x5f, 0xbc, 0xe9, 0xde, 0xf9, 0xfb, 0x9b, 0xee, 0x1d, 0xbf, 0x8a, + 0x3f, 0x6f, 0xbe, 0xf5, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x08, 0x7e, 0x6e, 0x3f, 0x21, 0x12, + 0x00, 0x00, +} + // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn @@ -7875,115 +7985,3 @@ var ( ErrInvalidLengthWeb = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowWeb = fmt.Errorf("proto: integer overflow") ) - -func init() { proto.RegisterFile("web.proto", fileDescriptor_web_d5fe91820a4f981b) } - -var fileDescriptor_web_d5fe91820a4f981b = []byte{ - // 1682 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcd, 0x6f, 0x5b, 0x4b, - 0x15, 0xef, 0x8d, 0x3f, 0x62, 0x1f, 0xdb, 0xc9, 0xeb, 0x34, 0x49, 0x1d, 0x27, 0xf1, 0x4b, 0xa6, - 0x05, 0x52, 0x24, 0x62, 0x1a, 0x58, 0xf0, 0x78, 0x42, 0x28, 0x79, 0x85, 0x97, 0x8a, 0x27, 0x5a, - 0xdd, 0x56, 0x7a, 0x05, 0x09, 0x99, 0xfb, 0x31, 0xb1, 0x47, 0xb1, 0xef, 0x5c, 0xee, 0x8c, 0x13, - 0x07, 0x56, 0x20, 0x10, 0x4b, 0x90, 0xf8, 0x0b, 0xd8, 0xf2, 0x97, 0xb0, 0x7c, 0x12, 0x1b, 0x56, - 0x08, 0xb5, 0x2c, 0xf8, 0x07, 0x58, 0xb0, 0x43, 0x73, 0x66, 0xee, 0x87, 0x1d, 0x3b, 0x6d, 0xd1, - 0xdb, 0xdd, 0x39, 0x73, 0xe6, 0x77, 0x3e, 0xe7, 0x9c, 0x33, 0x17, 0xea, 0x57, 0xcc, 0x3f, 0x8a, - 0x13, 0xa1, 0x04, 0xa9, 0x24, 0x71, 0x10, 0xfb, 0x9d, 0xc7, 0x03, 0xae, 0x86, 0x13, 0xff, 0x28, - 0x10, 0xe3, 0xde, 0xe9, 0xb3, 0x57, 0x3f, 0x14, 0x93, 0x28, 0xf4, 0x14, 0x17, 0x51, 0xcf, 0x17, - 0xd3, 0xb0, 0x17, 0x88, 0x84, 0xf5, 0x62, 0xbf, 0xe7, 0x8f, 0x44, 0x70, 0x61, 0x4e, 0x76, 0x76, - 0x07, 0x42, 0x0c, 0x46, 0xac, 0xe7, 0xc5, 0xbc, 0xe7, 0x45, 0x91, 0x50, 0xc8, 0x2f, 0xcd, 0x2e, - 0xfd, 0x19, 0xec, 0x7c, 0xca, 0xd4, 0xcb, 0xc4, 0x8b, 0xa4, 0x17, 0xe0, 0xc6, 0xd3, 0xe8, 0x5c, - 0xb8, 0x4c, 0xc6, 0x22, 0x92, 0x8c, 0x6c, 0x40, 0x45, 0x09, 0xe5, 0x8d, 0xda, 0xce, 0xbe, 0x73, - 0xd8, 0x72, 0xcd, 0x82, 0x1c, 0x42, 0x49, 0x4d, 0x65, 0x7b, 0x65, 0xbf, 0x74, 0xd8, 0x38, 0xde, - 0x3a, 0x42, 0xd5, 0x8e, 0x0a, 0x18, 0x08, 0xa1, 0x59, 0xe8, 0xcf, 0x61, 0x77, 0x16, 0xfe, 0x8c, - 0x4b, 0x25, 0x92, 0x6b, 0x97, 0xfd, 0x62, 0xc2, 0xa4, 0x22, 0x04, 0xca, 0x5e, 0x18, 0x26, 0x08, - 0x5f, 0x77, 0xf1, 0x5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0x75, 0x99, 0x8e, 0x02, - 0x66, 0x9b, 0x6a, 0xb6, 0xce, 0xc3, 0x54, 0x2e, 0x86, 0x69, 0x51, 0x78, 0xff, 0xeb, 0x40, 0x3d, - 0x6b, 0x98, 0xe4, 0x11, 0x54, 0x87, 0x58, 0xb1, 0xad, 0x96, 0x77, 0xad, 0x96, 0x79, 0x19, 0x77, - 0x2d, 0xc3, 0xbb, 0x4f, 0x11, 0x3a, 0x13, 0xed, 0xdd, 0xb5, 0xbd, 0xdf, 0xac, 0x74, 0xb9, 0x90, - 0x7c, 0x10, 0x79, 0x6a, 0x92, 0x18, 0x45, 0xb5, 0x79, 0x29, 0x21, 0xf3, 0x77, 0xa5, 0xe0, 0xef, - 0xb4, 0xe8, 0x54, 0x0b, 0x45, 0x67, 0x07, 0xea, 0x81, 0xe0, 0x51, 0xdf, 0xf7, 0x24, 0xb3, 0x35, - 0xab, 0xa6, 0x09, 0xa7, 0x9e, 0xc4, 0x8a, 0x14, 0x88, 0xe8, 0x9c, 0x27, 0x63, 0x16, 0x62, 0xf5, - 0xaa, 0xb9, 0x39, 0x81, 0x3e, 0x86, 0x0a, 0x66, 0xc6, 0x7b, 0xc4, 0xf6, 0x04, 0xee, 0x7e, 0xc6, - 0xa5, 0xc2, 0x63, 0xd9, 0x08, 0x90, 0x37, 0x7b, 0xa7, 0xd8, 0xec, 0x17, 0x8f, 0x42, 0xf4, 0xa7, - 0xd8, 0x53, 0x11, 0x61, 0x6e, 0x94, 0x58, 0x52, 0x28, 0x16, 0x0d, 0x12, 0x39, 0x76, 0xa9, 0x88, - 0xdd, 0x37, 0xf3, 0x60, 0x96, 0xee, 0x76, 0x28, 0xfc, 0xf2, 0x04, 0x98, 0x09, 0xcb, 0x5c, 0xc4, - 0xd9, 0x81, 0x69, 0x1e, 0x98, 0x9e, 0xd8, 0x81, 0x29, 0x63, 0xb5, 0xe5, 0xf8, 0x11, 0x94, 0x79, - 0x5e, 0x8c, 0x67, 0xee, 0xf6, 0xa9,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x9a, 0xc5, 0xa2, 0x5a, 0xcc, 0xd8, 0xf9, 0xa2, 0xdc, 0xd9, 0x59, 0xb8, 0x67, 0x45, 0x2d, - 0x49, 0x5e, 0x94, 0xa4, 0x05, 0x5d, 0xc1, 0xfa, 0x5c, 0x8d, 0x20, 0x7b, 0x73, 0x78, 0x73, 0x09, - 0xdc, 0x5d, 0xb6, 0x6d, 0x25, 0x7e, 0x05, 0x25, 0x7e, 0x48, 0x3b, 0x0b, 0x24, 0x16, 0xf2, 0xf8, - 0xd7, 0x4e, 0xde, 0x37, 0x8a, 0xf1, 0x20, 0x74, 0x0e, 0x7f, 0x41, 0x83, 0x7b, 0xa7, 0x58, 0x2e, - 0xca, 0xec, 0x54, 0x0f, 0x9b, 0x51, 0x9f, 0xc0, 0xa6, 0xa9, 0x58, 0x27, 0x51, 0xe8, 0x32, 0x2f, - 0xfc, 0x31, 0xbb, 0x32, 0x05, 0xa2, 0x18, 0xbb, 0xd9, 0x7a, 0xd6, 0x69, 0xa5, 0xaf, 0x2f, 0xa4, - 0x7e, 0xd3, 0x39, 0x6d, 0xff, 0xf5, 0x75, 0xd7, 0xf9, 0xe2, 0x75, 0xd7, 0xf9, 0xe7, 0xeb, 0xae, - 0xf3, 0xc7, 0x37, 0xdd, 0x3b, 0x5f, 0xbc, 0xe9, 0xde, 0xf9, 0xfb, 0x9b, 0xee, 0x1d, 0xbf, 0x8a, - 0x3f, 0x6f, 0xbe, 0xf5, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x08, 0x7e, 0x6e, 0x3f, 0x21, 0x12, - 0x00, 0x00, -} diff --git a/rpc/server/rpc_control.go b/rpc/server/rpc_control.go index 4271e2d7..ef2009eb 100644 --- a/rpc/server/rpc_control.go +++ b/rpc/server/rpc_control.go @@ -7,6 +7,8 @@ package rpc import ( "context" "fmt" + "strconv" + "time" "github.com/BOXFoundation/boxd/boxd/eventbus" "github.com/BOXFoundation/boxd/core/pb" @@ -205,3 +207,18 @@ func (s *ctlserver) GetBlock(ctx context.Context, req *rpcpb.GetBlockRequest) (* Message: "Internal Error", }, fmt.Errorf("Error converting proto message") } + +func (s *ctlserver) GetBlacklist(ctx context.Context, req *rpcpb.GetBlacklistRequest) (*rpcpb.GetBlacklistResponse, error) { + blacklist := s.server.GetBlacklist() + rpcMap := make(map[string]string) + blacklist.Details.Range(func(k, v interface{}) bool { + // rpcMap[strconv.Itoa(int(k.(uint32)))] = strconv.Itoa(int(v.(int64))) + rpcMap[strconv.Itoa(int(k.(uint32)))] = time.Unix(v.(int64), 0).Format("2006-01-02 15:04:05") + return true + }) + return &rpcpb.GetBlacklistResponse{ + Code: 0, + Message: "ok", + Details: rpcMap, + }, nil +} diff --git a/rpc/server/rpc_webapi_test.go b/rpc/server/rpc_webapi_test.go index 7608ab34..87186af6 100644 --- a/rpc/server/rpc_webapi_test.go +++ b/rpc/server/rpc_webapi_test.go @@ -17,6 +17,7 @@ import ( "github.com/BOXFoundation/boxd/boxd/eventbus" "github.com/BOXFoundation/boxd/core/chain" + ctl "github.com/BOXFoundation/boxd/core/controller" "github.com/BOXFoundation/boxd/core/types" "github.com/BOXFoundation/boxd/rpc/pb" "github.com/jbenet/goprocess" @@ -49,7 +50,7 @@ func setupWebAPIMockSvr() { } origServer := NewServer(goprocess.WithSignals(os.Interrupt), nil, nil, nil, nil, - testWebAPIBus) + testWebAPIBus, ctl.Default()) origServer.server = grpc.NewServer() registerWebapi(origServer) diff --git a/rpc/server/server.go b/rpc/server/server.go index 24f6c591..b223ffc6 100644 --- a/rpc/server/server.go +++ b/rpc/server/server.go @@ -14,6 +14,7 @@ import ( "github.com/BOXFoundation/boxd/boxd/eventbus" "github.com/BOXFoundation/boxd/boxd/service" + ctl "github.com/BOXFoundation/boxd/core/controller" "github.com/BOXFoundation/boxd/log" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/jbenet/goprocess" @@ -54,6 +55,7 @@ type Server struct { TxHandler service.TxHandler WalletAgent service.WalletAgent eventBus eventbus.Bus + blacklist *ctl.BlackListWrap server *grpc.Server gRPCProc goprocess.Process wggRPC sync.WaitGroup @@ -95,6 +97,7 @@ type GRPCServer interface { GetTxHandler() service.TxHandler GetWalletAgent() service.WalletAgent GetEventBus() eventbus.Bus + GetBlacklist() *ctl.BlackListWrap Proc() goprocess.Process Stop() } @@ -102,12 +105,14 @@ type GRPCServer interface { // NewServer creates a RPC server instance. func NewServer(parent goprocess.Process, cfg *Config, cr service.ChainReader, txh service.TxHandler, - wa service.WalletAgent, bus eventbus.Bus) *Server { + wa service.WalletAgent, bus eventbus.Bus, + blw *ctl.BlackListWrap) *Server { var server = &Server{ cfg: cfg, ChainReader: cr, TxHandler: txh, eventBus: bus, + blacklist: blw, WalletAgent: wa, gRPCProc: goprocess.WithParent(parent), } @@ -155,6 +160,11 @@ func (s *Server) GetEventBus() eventbus.Bus { return s.eventBus } +// GetBlacklist returns the blacklist containing the pubkeys +func (s *Server) GetBlacklist() *ctl.BlackListWrap { + return s.blacklist +} + func (s *Server) servegRPC(proc goprocess.Process) { var addr = fmt.Sprintf("%s:%d", s.cfg.Address, s.cfg.Port) logger.Infof("Starting RPC:gRPC server at %s", addr) diff --git a/script/script.go b/script/script.go index a0288333..48dc152f 100644 --- a/script/script.go +++ b/script/script.go @@ -600,6 +600,17 @@ func (s *Script) GetSplitAddrScriptPrefix() *Script { return NewScript().AddOpCode(opCode).AddOperand(operandHash) } +// GetPubKey get public key from script +func (s *Script) GetPubKey() ([]byte, bool) { + r := s.parse() + if s.IsPayToPubKeyHash() { + return r[2].(Operand), true + } else if s.IsPayToScriptHash() || s.IsSplitAddrScript() { + return r[1].(Operand), true + } + return nil, false +} + // CreateSplitAddrScriptPrefix creates a script prefix for split address with a hashed address func CreateSplitAddrScriptPrefix(addr types.Address) *Script { return NewScript().AddOpCode(OPRETURN).AddOperand(addr.Hash()) diff --git a/wallet/blockfetcher/rpc_blockfetcher.go b/wallet/blockfetcher/rpc_blockfetcher.go index 585c7e87..4d92b90a 100644 --- a/wallet/blockfetcher/rpc_blockfetcher.go +++ b/wallet/blockfetcher/rpc_blockfetcher.go @@ -8,10 +8,9 @@ import ( "fmt" "sync" - "github.com/BOXFoundation/boxd/wallet/walletdata" - "github.com/BOXFoundation/boxd/core/types" "github.com/BOXFoundation/boxd/rpc/client" + "github.com/BOXFoundation/boxd/wallet/walletdata" "google.golang.org/grpc" ) diff --git a/wallet/utxo/wallet_utxo.go b/wallet/utxo/wallet_utxo.go index b4f16db5..692fb3a1 100644 --- a/wallet/utxo/wallet_utxo.go +++ b/wallet/utxo/wallet_utxo.go @@ -10,15 +10,13 @@ import ( "strconv" "sync" - "github.com/BOXFoundation/boxd/log" - - "github.com/BOXFoundation/boxd/crypto" - key2 "github.com/BOXFoundation/boxd/storage/key" - "github.com/BOXFoundation/boxd/core/chain" "github.com/BOXFoundation/boxd/core/types" + "github.com/BOXFoundation/boxd/crypto" + "github.com/BOXFoundation/boxd/log" "github.com/BOXFoundation/boxd/script" "github.com/BOXFoundation/boxd/storage" + key2 "github.com/BOXFoundation/boxd/storage/key" ) var logger = log.NewLogger("wallet-utxo") @@ -248,9 +246,12 @@ func (wu *WalletUtxo) FetchUtxoForAddress(addr types.Address) error { func fetchUtxoFromDB(addr types.Address, db storage.Table) (map[types.OutPoint]*types.UtxoWrap, error) { utxoKey := chain.AddrAllUtxoKey(addr.String()) + // logger.Errorf("utxokey = %v", string(utxoKey)) keys := db.KeysWithPrefix(utxoKey) + // logger.Errorf("keys = %v", len(keys)) utxoMap := make(map[types.OutPoint]*types.UtxoWrap) for _, keyBytes := range keys { + // logger.Errorf("keyBytes = %v", string(keyBytes)) serialized, err := db.Get(keyBytes) if err != nil { return nil, err @@ -262,7 +263,9 @@ func fetchUtxoFromDB(addr types.Address, db storage.Table) (map[types.OutPoint]* if err := utxoWrap.Unmarshal(serialized); err != nil { return nil, err } + // logger.Errorf("utxoWrap = %v", utxoWrap) k := key2.NewKeyFromBytes(keyBytes) + // logger.Errorf("k = %v", k) segs := k.List() if len(segs) >= 4 { hash := new(crypto.HashType)