diff --git a/Dockerfile b/Dockerfile index 75ec2bc..0a98cd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.13.1-alpine3.10 as builder +FROM golang:1.15.5-alpine3.12 as builder # Set up dependencies ENV PACKAGES go make git libc-dev bash @@ -16,7 +16,7 @@ WORKDIR $REPO_PATH RUN apk add --no-cache $PACKAGES && \ cd $REPO_PATH && make all -FROM alpine:3.10 +FROM alpine:3.12 ENV BINARY_NAME rainbow-sync-iris COPY --from=builder /go/src/$BINARY_NAME /usr/local/bin/$BINARY_NAME diff --git a/README.md b/README.md index 055a1bf..c3df147 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,8 @@ A daemon that synchronizes IRIS hub data for the Rainbow wallet backend - `model`: mongodb script to create database - `task`: main logic of sync-server, sync data from blockChain and write to database - `db`: database model -- `helper`: helper functions +- `msgs`: tx msgs model +- `lib`: cdc and client pool functions - `utils`: common functions - `main.go`: bootstrap project @@ -35,8 +36,7 @@ docker build -t rainbow-sync . docker run --name rainbow-sync \& -v /mnt/data/rainbow-sync/logs:/root/go/src/github.com/irisnet/rainbow-sync/logs \& -e "DB_ADDR=127.0.0.1:27217" -e "DB_USER=user" \& --e "DB_PASSWD=password" -e "DB_DATABASE=db_name" \& --e "IRIS_NETWORK=testnet" \& +-e "DB_PASSWD=password" -e "DB_DATABASE=db_name" \& -e "SER_BC_FULL_NODES=tcp://localhost:26657,..." rainbow-sync ``` @@ -49,14 +49,14 @@ docker run --name rainbow-sync \& | DB_USER | string | "" | db user | user | | DB_PASSWD | string | "" |db passwd | password | | DB_DATABASE | string | "" |database name | db_name | -| IRIS_NETWORK | string | "testnet" |irishub name | testnet or mainnet | | SER_BC_FULL_NODES | string | tcp://localhost:26657 | iris full node rpc url | tcp://localhost:26657, tcp://127.0.0.2:26657 | | WORKER_NUM_EXECUTE_TASK | string | 30 | number of threads executing synchronization TX task | 30 | | WORKER_MAX_SLEEP_TIME | string | 120 | the maximum time (in seconds) that synchronization TX threads are allowed to be out of work | 120 | | BLOCK_NUM_PER_WORKER_HANDLE | string | 50 | number of blocks per sync TX task | 50 | +| BEHIND_BLOCK_NUM | string | 0 | wait block num to handle tx | 0 | - Remarks - - synchronizes irishub data from specify block height(such as:17908 current time:1576208532) + - synchronizes block chain data from specify block height(such as:17908 current time:1576208532) At first,stop the rainbow-sync and create the task. Run: ```bash diff --git a/block/config.go b/block/config.go new file mode 100644 index 0000000..e143cd3 --- /dev/null +++ b/block/config.go @@ -0,0 +1,44 @@ +package block + +import ( + "github.com/irisnet/rainbow-sync/conf" + "github.com/kaifei-bianjie/msg-parser/codec" +) + +var ( + + // Bech32ChainPrefix defines the prefix of this chain + Bech32ChainPrefix = "i" + + // PrefixAcc is the prefix for account + PrefixAcc = "a" + + // PrefixValidator is the prefix for validator keys + PrefixValidator = "v" + + // PrefixConsensus is the prefix for consensus keys + PrefixConsensus = "c" + + // PrefixPublic is the prefix for public + PrefixPublic = "p" + + // PrefixAddress is the prefix for address + PrefixAddress = "a" + + // Bech32PrefixAccAddr defines the Bech32 prefix of an account's address + Bech32PrefixAccAddr = conf.SvrConf.Bech32ChainPrefix + PrefixAcc + PrefixAddress + // Bech32PrefixAccPub defines the Bech32 prefix of an account's public key + Bech32PrefixAccPub = conf.SvrConf.Bech32ChainPrefix + PrefixAcc + PrefixPublic + // Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address + Bech32PrefixValAddr = conf.SvrConf.Bech32ChainPrefix + PrefixValidator + PrefixAddress + // Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key + Bech32PrefixValPub = conf.SvrConf.Bech32ChainPrefix + PrefixValidator + PrefixPublic + // Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address + Bech32PrefixConsAddr = conf.SvrConf.Bech32ChainPrefix + PrefixConsensus + PrefixAddress + // Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key + Bech32PrefixConsPub = conf.SvrConf.Bech32ChainPrefix + PrefixConsensus + PrefixPublic +) + +func init() { + codec.SetBech32Prefix(Bech32PrefixAccAddr, Bech32PrefixAccPub, Bech32PrefixValAddr, Bech32PrefixValPub, Bech32PrefixConsAddr, Bech32PrefixConsPub) +} diff --git a/block/handler.go b/block/handler.go new file mode 100644 index 0000000..67f5766 --- /dev/null +++ b/block/handler.go @@ -0,0 +1,67 @@ +package block + +import ( + "github.com/irisnet/rainbow-sync/lib/msgparser" + . "github.com/kaifei-bianjie/msg-parser/modules" + "github.com/kaifei-bianjie/msg-parser/types" +) + +func HandleTxMsg(v types.SdkMsg) MsgDocInfo { + if BankDocInfo, ok := msgparser.MsgClient.Bank.HandleTxMsg(v); ok { + return BankDocInfo + } + if IServiceDocInfo, ok := msgparser.MsgClient.Service.HandleTxMsg(v); ok { + return IServiceDocInfo + } + if NftDocInfo, ok := msgparser.MsgClient.Nft.HandleTxMsg(v); ok { + return NftDocInfo + } + if RecordDocInfo, ok := msgparser.MsgClient.Record.HandleTxMsg(v); ok { + return RecordDocInfo + } + if TokenDocInfo, ok := msgparser.MsgClient.Token.HandleTxMsg(v); ok { + return TokenDocInfo + } + if CoinswapDocInfo, ok := msgparser.MsgClient.Coinswap.HandleTxMsg(v); ok { + return CoinswapDocInfo + } + if CrisisDocInfo, ok := msgparser.MsgClient.Crisis.HandleTxMsg(v); ok { + return CrisisDocInfo + } + if DistrubutionDocInfo, ok := msgparser.MsgClient.Distribution.HandleTxMsg(v); ok { + return DistrubutionDocInfo + } + if SlashingDocInfo, ok := msgparser.MsgClient.Slashing.HandleTxMsg(v); ok { + return SlashingDocInfo + } + if EvidenceDocInfo, ok := msgparser.MsgClient.Evidence.HandleTxMsg(v); ok { + return EvidenceDocInfo + } + if HtlcDocInfo, ok := msgparser.MsgClient.Htlc.HandleTxMsg(v); ok { + return HtlcDocInfo + } + if StakingDocInfo, ok := msgparser.MsgClient.Staking.HandleTxMsg(v); ok { + return StakingDocInfo + } + if GovDocInfo, ok := msgparser.MsgClient.Gov.HandleTxMsg(v); ok { + return GovDocInfo + } + if IbcDocInfo, ok := msgparser.MsgClient.Ibc.HandleTxMsg(v); ok { + return IbcDocInfo + } + return MsgDocInfo{} +} + +func removeDuplicatesFromSlice(data []string) (result []string) { + tempSet := make(map[string]string, len(data)) + for _, val := range data { + if _, ok := tempSet[val]; ok || val == "" { + continue + } + tempSet[val] = val + } + for one := range tempSet { + result = append(result, one) + } + return +} diff --git a/block/parse_asset_detail.go b/block/parse_asset_detail.go deleted file mode 100644 index 3202554..0000000 --- a/block/parse_asset_detail.go +++ /dev/null @@ -1,222 +0,0 @@ -package block - -import ( - "github.com/irisnet/rainbow-sync/logger" - model "github.com/irisnet/rainbow-sync/db" - imodel "github.com/irisnet/rainbow-sync/model" - "github.com/irisnet/rainbow-sync/helper" - "strings" - "gopkg.in/mgo.v2/txn" - "gopkg.in/mgo.v2/bson" - "time" - "fmt" -) - -var ( - assetDetailTriggers = map[string]bool{ - "stakeEndBlocker": true, - "slashBeginBlocker": true, - "slashEndBlocker": true, - "govEndBlocker": true, - } - - // adapt multiple asset - assetDenoms = []string{"iris-atto"} -) - -const ( - triggerTxHashLength = 64 - separator = "::" // tag value separator - triggerTx = "tx" - unDelegationSubject = "Undelegation" - IRIS = "Iris" -) - -type Iris_Block struct{} - -func (iris *Iris_Block) Name() string { - return IRIS -} - -func (iris *Iris_Block) SaveDocsWithTxn(blockDoc *imodel.Block, irisAssetDetail []*imodel.IrisAssetDetail, irisTxs []*imodel.IrisTx, taskDoc imodel.SyncTask) error { - var ( - ops, irisAssetDetailOps, irisTxsOps []txn.Op - ) - - if blockDoc.Height == 0 { - return fmt.Errorf("invalid block, height equal 0") - } - - blockOp := txn.Op{ - C: imodel.CollectionNameBlock, - Id: bson.NewObjectId(), - Insert: blockDoc, - } - - length_assetdetail := len(irisAssetDetail) - if length_assetdetail > 0 { - irisAssetDetailOps = make([]txn.Op, 0, length_assetdetail) - for _, v := range irisAssetDetail { - op := txn.Op{ - C: imodel.CollectionNameAssetDetail, - Id: bson.NewObjectId(), - Insert: v, - } - irisAssetDetailOps = append(irisAssetDetailOps, op) - } - } - length_txs := len(irisTxs) - if length_txs > 0 { - irisTxsOps = make([]txn.Op, 0, length_txs) - for _, v := range irisTxs { - op := txn.Op{ - C: imodel.CollectionNameIrisTx, - Id: bson.NewObjectId(), - Insert: v, - } - irisTxsOps = append(irisTxsOps, op) - } - } - - updateOp := txn.Op{ - C: imodel.CollectionNameSyncTask, - Id: taskDoc.ID, - Assert: txn.DocExists, - Update: bson.M{ - "$set": bson.M{ - "current_height": taskDoc.CurrentHeight, - "status": taskDoc.Status, - "last_update_time": taskDoc.LastUpdateTime, - }, - }, - } - - ops = make([]txn.Op, 0, length_assetdetail+length_txs+2) - ops = append(append(ops, blockOp, updateOp), irisAssetDetailOps...) - ops = append(ops, irisTxsOps...) - - if len(ops) > 0 { - err := model.Txn(ops) - if err != nil { - return err - } - } - - return nil -} - -func (iris *Iris_Block) ParseBlock(b int64, client *helper.Client) (resBlock *imodel.Block, resIrisAssetDetails []*imodel.IrisAssetDetail, resIrisTxs []*imodel.IrisTx, resErr error) { - - defer func() { - if err := recover(); err != nil { - logger.Error("parse iris block fail", logger.Int64("height", b), - logger.Any("err", err), logger.String("Chain Block", iris.Name())) - - resBlock = &imodel.Block{} - resIrisAssetDetails = nil - resIrisTxs = nil - resErr = fmt.Errorf("%v", err) - } - }() - - irisAssetDetails, err := iris.ParseIrisAssetDetail(b, client) - if err != nil { - logger.Error("parse iris asset detail error", logger.String("error", err.Error()), logger.String("Chain Block", iris.Name())) - } - - irisTxs, err := iris.ParseIrisTxs(b, client) - if err != nil { - logger.Error("parse iris txs", logger.String("error", err.Error()), logger.String("Chain Block", iris.Name())) - } - - resBlock = &imodel.Block{ - Height: b, - CreateTime: time.Now().Unix(), - } - resIrisAssetDetails = irisAssetDetails - resIrisTxs = irisTxs - resErr = err - - return -} - -// parse iris asset detail from block result tags -func (iris *Iris_Block) ParseIrisAssetDetail(b int64, client *helper.Client) ([]*imodel.IrisAssetDetail, error) { - var irisAssetDetails []*imodel.IrisAssetDetail - res, err := client.BlockResults(&b) - if err != nil { - logger.Warn("get block result err, now try again", logger.String("err", err.Error()), - logger.String("Chain Block", iris.Name())) - // there is possible parse block fail when in iterator - var err2 error - client2 := helper.GetClient() - res, err2 = client2.BlockResults(&b) - client2.Release() - if err2 != nil { - return nil, err2 - } - } - - tags := res.Results.EndBlock.Tags - //fmt.Printf("======>>tags:%+v\n",tags) - - // filter asset detail trigger from tags and build asset detail model - irisAssetDetails = make([]*imodel.IrisAssetDetail, 0, len(tags)) - for _, t := range tags { - tagKey := string(t.Key) - tagValue := string(t.Value) - - if assetDetailTriggers[tagKey] || len(tagKey) == triggerTxHashLength { - values := strings.Split(tagValue, separator) - if len(values) != 6 { - logger.Warn("struct of iris asset detail changed in block result, skip parse this asset detail", - logger.Int64("height", b), logger.String("tagKey", tagKey), - logger.String("Chain Block", iris.Name())) - continue - } - - irisAssetDetails = append(irisAssetDetails, buildIrisAssetDetailFromTag(tagKey, values, b)) - } - } - - return irisAssetDetails, nil -} - -// get asset detail info by parse tag key and values -func buildIrisAssetDetailFromTag(tagKey string, keyValues []string, height int64) *imodel.IrisAssetDetail { - values := keyValues - coinAmount, coinUnit := parseCoinAmountAndUnitFromStr(values[2]) - - irisAssetDetail := &imodel.IrisAssetDetail{ - From: values[0], - To: values[1], - CoinAmount: coinAmount, - CoinUnit: coinUnit, - Trigger: tagKey, - Subject: values[3], - Description: values[4], - Timestamp: values[5], - Height: height, - } - - if len(tagKey) == triggerTxHashLength { - irisAssetDetail.TxHash = tagKey - irisAssetDetail.Trigger = triggerTx - } - - if irisAssetDetail.Subject == unDelegationSubject { - irisAssetDetail.TxHash = irisAssetDetail.Description - } - - irisAssetDetail.TxHash = strings.ToUpper(irisAssetDetail.TxHash) - return irisAssetDetail -} - -func parseCoinAmountAndUnitFromStr(s string) (string, string) { - for _, denom := range assetDenoms { - if strings.HasSuffix(s, denom) { - return strings.Replace(s, denom, "", -1), denom - } - } - return "", "" -} diff --git a/block/parse_asset_detail_test.go b/block/parse_asset_detail_test.go deleted file mode 100644 index f9331b4..0000000 --- a/block/parse_asset_detail_test.go +++ /dev/null @@ -1,45 +0,0 @@ -package block - -import ( - "testing" - irisConf "github.com/irisnet/rainbow-sync/conf" - "encoding/json" - "github.com/irisnet/rainbow-sync/logger" - "github.com/irisnet/rainbow-sync/helper" -) - -func TestIris_Block_ParseIrisAssetDetail(t *testing.T) { - helper.Init(irisConf.BlockChainMonitorUrl, irisConf.MaxConnectionNum, irisConf.InitConnectionNum) - client := helper.GetClient() - defer func() { - client.Release() - logger.Info("Release tm client") - }() - type args struct { - b int64 - client *helper.Client - } - tests := []struct { - name string - args args - }{ - { - name: "test parse asset detail", - args: args{ - b: 19301, - client: client, - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - biris := Iris_Block{} - res, err := biris.ParseIrisAssetDetail(tt.args.b, tt.args.client) - if err != nil { - t.Fatal(err) - } - resBytes, _ := json.MarshalIndent(res, "", "\t") - t.Log(string(resBytes)) - }) - } -} diff --git a/block/parse_tx.go b/block/parse_tx.go index 9a6f086..0a34a14 100644 --- a/block/parse_tx.go +++ b/block/parse_tx.go @@ -1,464 +1,277 @@ package block import ( - "github.com/irisnet/irishub/app/v1/auth" - "github.com/irisnet/rainbow-sync/constant" - "github.com/irisnet/rainbow-sync/helper" - "github.com/irisnet/rainbow-sync/logger" - imodel "github.com/irisnet/rainbow-sync/model" - imsg "github.com/irisnet/rainbow-sync/model/msg" + "fmt" + "github.com/irisnet/rainbow-sync/db" + "github.com/irisnet/rainbow-sync/lib/logger" + "github.com/irisnet/rainbow-sync/lib/pool" + "github.com/irisnet/rainbow-sync/model" "github.com/irisnet/rainbow-sync/utils" - abci "github.com/tendermint/tendermint/abci/types" + "github.com/kaifei-bianjie/msg-parser/codec" + msgsdktypes "github.com/kaifei-bianjie/msg-parser/types" + aTypes "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/types" + "golang.org/x/net/context" + "gopkg.in/mgo.v2/bson" + "gopkg.in/mgo.v2/txn" + "time" ) -// parse iris txs from block result txs -func (iris *Iris_Block) ParseIrisTxs(b int64, client *helper.Client) ([]*imodel.IrisTx, error) { - resblock, err := client.Block(&b) +func SaveDocsWithTxn(blockDoc *model.Block, txs []*model.Tx, txMsgs []model.TxMsg, taskDoc model.SyncTask) error { + var ( + ops, insertOps []txn.Op + ) + + if blockDoc.Height == 0 { + return fmt.Errorf("invalid block, height equal 0") + } + + blockOp := txn.Op{ + C: model.CollectionNameBlock, + Id: bson.NewObjectId(), + Insert: blockDoc, + } + + txAndMsgNum := len(txs) + len(txMsgs) + if txAndMsgNum > 0 { + insertOps = make([]txn.Op, 0, txAndMsgNum) + for _, v := range txs { + op := txn.Op{ + C: model.CollectionNameIrisTx, + Id: bson.NewObjectId(), + Insert: v, + } + insertOps = append(insertOps, op) + } + + for _, v := range txMsgs { + op := txn.Op{ + C: model.CollectionNameIrisTxMsg, + Id: bson.NewObjectId(), + Insert: v, + } + insertOps = append(insertOps, op) + } + } + + updateOp := txn.Op{ + C: model.CollectionNameSyncTask, + Id: taskDoc.ID, + Assert: txn.DocExists, + Update: bson.M{ + "$set": bson.M{ + "current_height": taskDoc.CurrentHeight, + "status": taskDoc.Status, + "last_update_time": taskDoc.LastUpdateTime, + }, + }, + } + + ops = make([]txn.Op, 0, txAndMsgNum+2) + ops = append(append(ops, blockOp, updateOp), insertOps...) + + if len(ops) > 0 { + err := db.Txn(ops) + if err != nil { + return err + } + } + + return nil +} + +func ParseBlock(b int64, client *pool.Client) (*model.Block, []*model.Tx, []model.TxMsg, error) { + + defer func() { + if err := recover(); err != nil { + logger.Error("parse block fail", logger.Int64("height", b), + logger.Any("err", err)) + } + }() + ctx := context.Background() + resblock, err := client.Block(ctx, &b) if err != nil { - logger.Warn("get block result err, now try again", logger.String("err", err.Error()), - logger.String("Chain Block", iris.Name()), logger.Any("height", b)) + time.Sleep(1 * time.Second) // there is possible parse block fail when in iterator var err2 error - client2 := helper.GetClient() - resblock, err2 = client2.Block(&b) + client2 := pool.GetClient() + resblock, err2 = client2.Block(ctx, &b) client2.Release() if err2 != nil { - return nil, err2 + return nil, nil, nil, utils.ConvertErr(b, "", "ParseBlock", err2) } } - - irisTxs := make([]*imodel.IrisTx, 0, len(resblock.Block.Txs)) + blockDoc := model.Block{ + Height: b, + CreateTime: time.Now().Unix(), + } + txs := make([]*model.Tx, 0, len(resblock.Block.Txs)) + var docMsgs []model.TxMsg for _, tx := range resblock.Block.Txs { - iristx := iris.ParseIrisTxModel(tx, resblock.Block) - irisTxs = append(irisTxs, &iristx) + tx, msgs, err := ParseTx(tx, resblock.Block, client) + if err != nil { + return &blockDoc, txs, docMsgs, err + } + if tx.Height > 0 { + txs = append(txs, &tx) + docMsgs = append(docMsgs, msgs...) + } } - - return irisTxs, nil + return &blockDoc, txs, docMsgs, nil } // parse iris tx from iris block result tx -func (iris *Iris_Block) ParseIrisTxModel(txBytes types.Tx, block *types.Block) imodel.IrisTx { +func ParseTx(txBytes types.Tx, block *types.Block, client *pool.Client) (model.Tx, []model.TxMsg, error) { var ( - authTx auth.StdTx - methodName = "ParseTx" - docTx imodel.IrisTx - actualFee *imodel.ActualFee - docTxMsgs []imodel.DocTxMsg + docMsgs []model.TxMsg + docTxMsgs []msgsdktypes.TxMsg + docTx model.Tx + actualFee msgsdktypes.Coin ) - - cdc := utils.GetCodec() - - err := cdc.UnmarshalBinaryLengthPrefixed(txBytes, &authTx) - if err != nil { - logger.Error(err.Error()) - return docTx - } - height := block.Height - time := block.Time txHash := utils.BuildHex(txBytes.Hash()) - fee := utils.BuildFee(authTx.Fee) - memo := authTx.Memo - - // get tx status, gasUsed, gasPrice and actualFee from tx result - status, result, err := utils.QueryTxResult(txBytes.Hash()) + authTx, err := codec.GetSigningTx(txBytes) if err != nil { - logger.Error("get txResult err", logger.String("method", methodName), logger.String("err", err.Error())) + logger.Warn(err.Error(), + logger.String("errTag", "TxDecoder"), + logger.String("txhash", txHash), + logger.Int64("height", block.Height)) + return docTx, docMsgs, nil } - gasUsed := Min(result.GasUsed, fee.Gas) - if len(fee.Amount) > 0 { - gasPrice := fee.Amount[0].Amount / float64(fee.Gas) - actualFee = &imodel.ActualFee{ - Denom: fee.Amount[0].Denom, - Amount: float64(gasUsed) * gasPrice, + fee := msgsdktypes.BuildFee(authTx.GetFee(), authTx.GetGas()) + memo := authTx.GetMemo() + ctx := context.Background() + res, err := client.Tx(ctx, txBytes.Hash(), false) + if err != nil { + time.Sleep(1 * time.Second) + var err1 error + client2 := pool.GetClient() + res, err1 = client2.Tx(ctx, txBytes.Hash(), false) + client2.Release() + if err1 != nil { + return docTx, docMsgs, utils.ConvertErr(block.Height, txHash, "TxResult", err1) } - } else { - actualFee = &imodel.ActualFee{} } - msgs := authTx.GetMsgs() - if len(msgs) <= 0 { - logger.Error("can't get msgs", logger.String("method", methodName)) - return docTx + + if len(fee.Amount) > 0 { + actualFee = fee.Amount[0] } - msg := msgs[0] - docTx = imodel.IrisTx{ + docTx = model.Tx{ Height: height, - Time: time, + Time: block.Time.Unix(), TxHash: txHash, Fee: fee, ActualFee: actualFee, Memo: memo, - Status: status, - Log: result.Log, - Code: result.Code, - Tags: parseTags(result), + TxIndex: res.Index, } - switch msg.(type) { - case imodel.MsgTransfer: - msg := msg.(imodel.MsgTransfer) - - docTx.From = msg.Inputs[0].Address.String() - docTx.To = msg.Outputs[0].Address.String() - docTx.Initiator = msg.Inputs[0].Address.String() - docTx.Amount = utils.ParseCoins(msg.Inputs[0].Coins.String()) - docTx.Type = constant.Iris_TxTypeTransfer - case imodel.MsgBurn: - msg := msg.(imodel.MsgBurn) - docTx.From = msg.Owner.String() - docTx.To = "" - docTx.Initiator = msg.Owner.String() - docTx.Amount = utils.ParseCoins(msg.Coins.String()) - docTx.Type = constant.Iris_TxTypeBurn - case imodel.MsgSetMemoRegexp: - msg := msg.(imodel.MsgSetMemoRegexp) - docTx.From = msg.Owner.String() - docTx.To = "" - docTx.Initiator = msg.Owner.String() - docTx.Amount = []*imodel.Coin{} - docTx.Type = constant.Iris_TxTypeSetMemoRegexp - txMsg := imsg.DocTxMsgSetMemoRegexp{} - txMsg.BuildMsg(msg) - docTx.Msgs = append(docTxMsgs, imodel.DocTxMsg{ - Type: txMsg.Type(), - Msg: &txMsg, - }) - return docTx + docTx.Status = utils.TxStatusSuccess + if res.TxResult.Code != 0 { + docTx.Status = utils.TxStatusFail + docTx.Log = res.TxResult.Log - case imodel.MsgStakeCreate: - msg := msg.(imodel.MsgStakeCreate) - docTx.From = msg.DelegatorAddr.String() - docTx.To = msg.ValidatorAddr.String() - docTx.Initiator = msg.DelegatorAddr.String() - docTx.Amount = []*imodel.Coin{utils.ParseCoin(msg.Delegation.String())} - docTx.Type = constant.Iris_TxTypeStakeCreateValidator - - case imodel.MsgStakeEdit: - msg := msg.(imodel.MsgStakeEdit) - - docTx.From = msg.ValidatorAddr.String() - docTx.To = "" - docTx.Initiator = msg.ValidatorAddr.String() - docTx.Amount = []*imodel.Coin{} - docTx.Type = constant.Iris_TxTypeStakeEditValidator - - case imodel.MsgStakeDelegate: - msg := msg.(imodel.MsgStakeDelegate) - - docTx.From = msg.DelegatorAddr.String() - docTx.To = msg.ValidatorAddr.String() - docTx.Initiator = msg.DelegatorAddr.String() - docTx.Amount = []*imodel.Coin{utils.ParseCoin(msg.Delegation.String())} - docTx.Type = constant.Iris_TxTypeStakeDelegate - - case imodel.MsgStakeBeginUnbonding: - msg := msg.(imodel.MsgStakeBeginUnbonding) + } + docTx.Events = parseEvents(res.TxResult.Events) + eventsIndexMap := make(map[int]model.MsgEvent) + if res.TxResult.Code == 0 { + eventsIndexMap = splitEvents(res.TxResult.Log) + } - shares := utils.ParseFloat(msg.SharesAmount.String()) - docTx.From = msg.DelegatorAddr.String() - docTx.To = msg.ValidatorAddr.String() - docTx.Initiator = msg.DelegatorAddr.String() - coin := imodel.Coin{ - Amount: shares, + msgs := authTx.GetMsgs() + if len(msgs) == 0 { + return docTx, docMsgs, nil + } + for i, v := range msgs { + msgDocInfo := HandleTxMsg(v) + if len(msgDocInfo.Addrs) == 0 { + continue } - docTx.Amount = []*imodel.Coin{&coin} - docTx.Type = constant.Iris_TxTypeStakeBeginUnbonding - case imodel.MsgBeginRedelegate: - msg := msg.(imodel.MsgBeginRedelegate) - shares := utils.ParseFloat(msg.SharesAmount.String()) - docTx.From = msg.ValidatorSrcAddr.String() - docTx.To = msg.ValidatorDstAddr.String() - docTx.Initiator = msg.DelegatorAddr.String() - coin := imodel.Coin{ - Amount: shares, + docTx.Signers = append(docTx.Signers, removeDuplicatesFromSlice(msgDocInfo.Signers)...) + docTx.Addrs = append(docTx.Addrs, removeDuplicatesFromSlice(msgDocInfo.Addrs)...) + docTxMsgs = append(docTxMsgs, msgDocInfo.DocTxMsg) + docTx.Types = append(docTx.Types, msgDocInfo.DocTxMsg.Type) + + docMsg := model.TxMsg{ + Time: docTx.Time, + TxFee: docTx.ActualFee, + Height: docTx.Height, + TxHash: docTx.TxHash, + Type: msgDocInfo.DocTxMsg.Type, + MsgIndex: i, + TxIndex: res.Index, + TxStatus: docTx.Status, + TxMemo: memo, + TxLog: docTx.Log, + GasUsed: res.TxResult.GasUsed, + GasWanted: res.TxResult.GasWanted, } - docTx.Amount = []*imodel.Coin{&coin} - docTx.Type = constant.Iris_TxTypeBeginRedelegate - case imodel.MsgUnjail: - msg := msg.(imodel.MsgUnjail) - - docTx.From = msg.ValidatorAddr.String() - docTx.Initiator = msg.ValidatorAddr.String() - docTx.Type = constant.Iris_TxTypeUnjail - case imodel.MsgSetWithdrawAddress: - msg := msg.(imodel.MsgSetWithdrawAddress) - - docTx.From = msg.DelegatorAddr.String() - docTx.To = msg.WithdrawAddr.String() - docTx.Initiator = msg.DelegatorAddr.String() - docTx.Type = constant.Iris_TxTypeSetWithdrawAddress - case imodel.MsgWithdrawDelegatorReward: - msg := msg.(imodel.MsgWithdrawDelegatorReward) - - docTx.From = msg.DelegatorAddr.String() - docTx.To = msg.ValidatorAddr.String() - docTx.Initiator = msg.DelegatorAddr.String() - docTx.Type = constant.Iris_TxTypeWithdrawDelegatorReward - - for _, tag := range result.Tags { - key := string(tag.Key) - if key == imodel.TagDistributionReward { - reward := string(tag.Value) - docTx.Amount = utils.ParseCoins(reward) - break - } + docMsg.Msg = msgDocInfo.DocTxMsg + if val, ok := eventsIndexMap[i]; ok { + docMsg.Events = val.Events } - case imodel.MsgWithdrawDelegatorRewardsAll: - msg := msg.(imodel.MsgWithdrawDelegatorRewardsAll) + docMsg.Addrs = removeDuplicatesFromSlice(msgDocInfo.Addrs) + docMsg.Signers = removeDuplicatesFromSlice(msgDocInfo.Signers) + docMsgs = append(docMsgs, docMsg) - docTx.From = msg.DelegatorAddr.String() - docTx.Initiator = msg.DelegatorAddr.String() - docTx.Type = constant.Iris_TxTypeWithdrawDelegatorRewardsAll - for _, tag := range result.Tags { - key := string(tag.Key) - if key == imodel.TagDistributionReward { - reward := string(tag.Value) - docTx.Amount = utils.ParseCoins(reward) - break - } - } - case imodel.MsgWithdrawValidatorRewardsAll: - msg := msg.(imodel.MsgWithdrawValidatorRewardsAll) + } + docTx.Addrs = removeDuplicatesFromSlice(docTx.Addrs) + docTx.Types = removeDuplicatesFromSlice(docTx.Types) + docTx.Signers = removeDuplicatesFromSlice(docTx.Signers) + docTx.Msgs = docTxMsgs + + // don't save txs which have not parsed + if len(docTx.Addrs) == 0 { + logger.Warn(utils.NoSupportMsgTypeTag, + logger.String("errTag", "TxMsg"), + logger.String("txhash", txHash), + logger.Int64("height", height)) + return docTx, docMsgs, nil + } - docTx.From = msg.ValidatorAddr.String() - if v := msg.GetSigners(); len(v) > 0 { - docTx.Initiator = v[0].String() - } - docTx.Type = constant.Iris_TxTypeWithdrawValidatorRewardsAll + for i, _ := range docMsgs { + docMsgs[i].TxAddrs = docTx.Addrs + docMsgs[i].TxSigners = docTx.Signers + } + return docTx, docMsgs, nil - var totalReward string - var withdrawAddr string - for _, tag := range result.Tags { - key := string(tag.Key) - switch key { - case imodel.TagDistributionReward: - if totalReward == "" { - totalReward = string(tag.Value) - } - case imodel.TagDistributionWithdrawAddr: - if withdrawAddr == "" { - withdrawAddr = string(tag.Value) +} + +func parseEvents(events []aTypes.Event) []model.Event { + var eventDocs []model.Event + if len(events) > 0 { + for _, e := range events { + var kvPairDocs []model.KvPair + if len(e.Attributes) > 0 { + for _, v := range e.Attributes { + kvPairDocs = append(kvPairDocs, model.KvPair{ + Key: string(v.Key), + Value: string(v.Value), + }) } } + eventDocs = append(eventDocs, model.Event{ + Type: e.Type, + Attributes: kvPairDocs, + }) } - - docTx.To = withdrawAddr - docTx.Amount = utils.ParseCoins(totalReward) - case imodel.MsgSubmitProposal: - msg := msg.(imodel.MsgSubmitProposal) - - docTx.From = msg.Proposer.String() - docTx.To = "" - docTx.Initiator = msg.Proposer.String() - docTx.Amount = utils.ParseCoins(msg.InitialDeposit.String()) - docTx.Type = constant.Iris_TxTypeSubmitProposal - txMsg := imsg.DocTxMsgSubmitProposal{} - txMsg.BuildMsg(msg) - docTx.Msgs = append(docTxMsgs, imodel.DocTxMsg{ - Type: txMsg.Type(), - Msg: &txMsg, - }) - - case imodel.MsgSubmitSoftwareUpgradeProposal: - msg := msg.(imodel.MsgSubmitSoftwareUpgradeProposal) - - docTx.From = msg.Proposer.String() - docTx.To = "" - docTx.Initiator = msg.Proposer.String() - docTx.Amount = utils.ParseCoins(msg.InitialDeposit.String()) - docTx.Type = constant.Iris_TxTypeSubmitProposal - txMsg := imsg.DocTxMsgSubmitSoftwareUpgradeProposal{} - txMsg.BuildMsg(msg) - docTx.Msgs = append(docTxMsgs, imodel.DocTxMsg{ - Type: txMsg.Type(), - Msg: &txMsg, - }) - - case imodel.MsgSubmitTaxUsageProposal: - msg := msg.(imodel.MsgSubmitTaxUsageProposal) - - docTx.From = msg.Proposer.String() - docTx.To = "" - docTx.Initiator = msg.Proposer.String() - docTx.Amount = utils.ParseCoins(msg.InitialDeposit.String()) - docTx.Type = constant.Iris_TxTypeSubmitProposal - txMsg := imsg.DocTxMsgSubmitCommunityTaxUsageProposal{} - txMsg.BuildMsg(msg) - docTx.Msgs = append(docTxMsgs, imodel.DocTxMsg{ - Type: txMsg.Type(), - Msg: &txMsg, - }) - - case imodel.MsgSubmitTokenAdditionProposal: - msg := msg.(imodel.MsgSubmitTokenAdditionProposal) - - docTx.From = msg.Proposer.String() - docTx.To = "" - docTx.Initiator = msg.Proposer.String() - docTx.Amount = utils.ParseCoins(msg.InitialDeposit.String()) - docTx.Type = constant.Iris_TxTypeSubmitProposal - txMsg := imsg.DocTxMsgSubmitTokenAdditionProposal{} - txMsg.BuildMsg(msg) - docTx.Msgs = append(docTxMsgs, imodel.DocTxMsg{ - Type: txMsg.Type(), - Msg: &txMsg, - }) - return docTx - - case imodel.MsgDeposit: - msg := msg.(imodel.MsgDeposit) - - docTx.From = msg.Depositor.String() - docTx.Initiator = msg.Depositor.String() - docTx.Amount = utils.ParseCoins(msg.Amount.String()) - docTx.Type = constant.Iris_TxTypeDeposit - case imodel.MsgVote: - msg := msg.(imodel.MsgVote) - - docTx.From = msg.Voter.String() - docTx.Initiator = msg.Voter.String() - docTx.Amount = []*imodel.Coin{} - docTx.Type = constant.Iris_TxTypeVote - txMsg := imsg.DocTxMsgVote{} - txMsg.BuildMsg(msg) - docTx.Msgs = append(docTxMsgs, imodel.DocTxMsg{ - Type: txMsg.Type(), - Msg: &txMsg, - }) - - case imodel.MsgRequestRand: - msg := msg.(imodel.MsgRequestRand) - - docTx.From = msg.Consumer.String() - docTx.Initiator = msg.Consumer.String() - docTx.Amount = []*imodel.Coin{} - docTx.Type = constant.Iris_TxTypeRequestRand - txMsg := imsg.DocTxMsgRequestRand{} - txMsg.BuildMsg(msg) - docTx.Msgs = append(docTxMsgs, imodel.DocTxMsg{ - Type: txMsg.Type(), - Msg: &txMsg, - }) - - return docTx - - case imodel.AssetIssueToken: - msg := msg.(imodel.AssetIssueToken) - - docTx.From = msg.Owner.String() - docTx.Type = constant.TxTypeAssetIssueToken - txMsg := imsg.DocTxMsgIssueToken{} - txMsg.BuildMsg(msg) - docTx.Msgs = append(docTxMsgs, imodel.DocTxMsg{ - Type: txMsg.Type(), - Msg: &txMsg, - }) - - return docTx - case imodel.AssetEditToken: - msg := msg.(imodel.AssetEditToken) - - docTx.From = msg.Owner.String() - docTx.Type = constant.TxTypeAssetEditToken - txMsg := imsg.DocTxMsgEditToken{} - txMsg.BuildMsg(msg) - docTx.Msgs = append(docTxMsgs, imodel.DocTxMsg{ - Type: txMsg.Type(), - Msg: &txMsg, - }) - - return docTx - case imodel.AssetMintToken: - msg := msg.(imodel.AssetMintToken) - - docTx.From = msg.Owner.String() - docTx.To = msg.To.String() - docTx.Type = constant.TxTypeAssetMintToken - txMsg := imsg.DocTxMsgMintToken{} - txMsg.BuildMsg(msg) - docTx.Msgs = append(docTxMsgs, imodel.DocTxMsg{ - Type: txMsg.Type(), - Msg: &txMsg, - }) - - return docTx - case imodel.AssetTransferTokenOwner: - msg := msg.(imodel.AssetTransferTokenOwner) - - docTx.From = msg.SrcOwner.String() - docTx.To = msg.DstOwner.String() - docTx.Type = constant.TxTypeAssetTransferTokenOwner - txMsg := imsg.DocTxMsgTransferTokenOwner{} - txMsg.BuildMsg(msg) - docTx.Msgs = append(docTxMsgs, imodel.DocTxMsg{ - Type: txMsg.Type(), - Msg: &txMsg, - }) - - return docTx - case imodel.AssetCreateGateway: - msg := msg.(imodel.AssetCreateGateway) - - docTx.From = msg.Owner.String() - docTx.Type = constant.TxTypeAssetCreateGateway - txMsg := imsg.DocTxMsgCreateGateway{} - txMsg.BuildMsg(msg) - docTx.Msgs = append(docTxMsgs, imodel.DocTxMsg{ - Type: txMsg.Type(), - Msg: &txMsg, - }) - - return docTx - case imodel.AssetEditGateWay: - msg := msg.(imodel.AssetEditGateWay) - - docTx.From = msg.Owner.String() - docTx.Type = constant.TxTypeAssetEditGateway - txMsg := imsg.DocTxMsgEditGateway{} - txMsg.BuildMsg(msg) - docTx.Msgs = append(docTxMsgs, imodel.DocTxMsg{ - Type: txMsg.Type(), - Msg: &txMsg, - }) - - return docTx - case imodel.AssetTransferGatewayOwner: - msg := msg.(imodel.AssetTransferGatewayOwner) - - docTx.From = msg.Owner.String() - docTx.To = msg.To.String() - docTx.Type = constant.TxTypeAssetTransferGatewayOwner - txMsg := imsg.DocTxMsgTransferGatewayOwner{} - txMsg.BuildMsg(msg) - docTx.Msgs = append(docTxMsgs, imodel.DocTxMsg{ - Type: txMsg.Type(), - Msg: &txMsg, - }) - return docTx - default: - logger.Warn("unknown msg type") } - return docTx - + return eventDocs } -func parseTags(result abci.ResponseDeliverTx) map[string]string { - tags := make(map[string]string, 0) - for _, tag := range result.Tags { - key := string(tag.Key) - value := string(tag.Value) - tags[key] = value +func splitEvents(log string) map[int]model.MsgEvent { + var eventDocs []model.MsgEvent + if log != "" { + utils.UnMarshalJsonIgnoreErr(log, &eventDocs) + } - return tags -} -func Min(x, y int64) int64 { - if x < y { - return x + msgIndexMap := make(map[int]model.MsgEvent, len(eventDocs)) + for _, val := range eventDocs { + msgIndexMap[val.MsgIndex] = val } - return y + return msgIndexMap } diff --git a/block/parse_tx_test.go b/block/parse_tx_test.go index dba69bb..46f13bb 100644 --- a/block/parse_tx_test.go +++ b/block/parse_tx_test.go @@ -2,20 +2,18 @@ package block import ( "encoding/json" - irisConf "github.com/irisnet/rainbow-sync/conf" - "github.com/irisnet/rainbow-sync/helper" + "github.com/irisnet/rainbow-sync/lib/pool" "testing" ) func TestIris_Block_ParseIrisTx(t *testing.T) { - helper.Init(irisConf.BlockChainMonitorUrl, irisConf.MaxConnectionNum, irisConf.InitConnectionNum) - client := helper.GetClient() + client := pool.GetClient() defer func() { client.Release() }() type args struct { b int64 - client *helper.Client + client *pool.Client } tests := []struct { name string @@ -24,19 +22,22 @@ func TestIris_Block_ParseIrisTx(t *testing.T) { { name: "test parse iris tx", args: args{ - b: 2877965, + b: 559216, client: client, }, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - iris := Iris_Block{} - res, err := iris.ParseIrisTxs(tt.args.b, tt.args.client) + block, res, msg, err := ParseBlock(tt.args.b, tt.args.client) if err != nil { t.Fatal(err) } - resBytes, _ := json.Marshal(res) + resBytes, _ := json.Marshal(block) + t.Log(string(resBytes)) + resBytes, _ = json.Marshal(res) + t.Log(string(resBytes)) + resBytes, _ = json.Marshal(msg) t.Log(string(resBytes)) }) } diff --git a/conf/db/types.go b/conf/db/types.go index 17c8ea9..0c5ce7a 100644 --- a/conf/db/types.go +++ b/conf/db/types.go @@ -1,13 +1,13 @@ package db import ( - "github.com/irisnet/rainbow-sync/logger" constant "github.com/irisnet/rainbow-sync/conf" + "github.com/irisnet/rainbow-sync/lib/logger" "os" ) var ( - Addrs = "localhost:27019" + Addrs = "localhost:27018" User = "iris" Passwd = "irispassword" Database = "rainbow-server" diff --git a/conf/types.go b/conf/types.go index 9a2b09e..2cc3f88 100644 --- a/conf/types.go +++ b/conf/types.go @@ -1,25 +1,41 @@ package conf import ( - "github.com/irisnet/rainbow-sync/logger" + "github.com/irisnet/rainbow-sync/lib/logger" + "github.com/irisnet/rainbow-sync/utils" "os" "strconv" "strings" ) var ( - BlockChainMonitorUrl = []string{"tcp://192.168.150.31:26657"} + SvrConf *ServerConf + blockChainMonitorUrl = []string{"tcp://192.168.150.31:56657"} - IrisNetwork = "testnet" - WorkerNumCreateTask = 1 - WorkerNumExecuteTask = 30 - WorkerMaxSleepTime = 2 * 60 - BlockNumPerWorkerHandle = 50 + workerNumCreateTask = 1 + workerNumExecuteTask = 30 + workerMaxSleepTime = 2 * 60 + blockNumPerWorkerHandle = 50 - InitConnectionNum = 50 // fast init num of tendermint client pool - MaxConnectionNum = 100 // max size of tendermint client pool + initConnectionNum = 50 // fast init num of tendermint client pool + maxConnectionNum = 100 // max size of tendermint client pool + behindBlockNum = 0 + bech32ChainPrefix = "i" ) +type ServerConf struct { + NodeUrls []string + WorkerNumCreateTask int + WorkerNumExecuteTask int + WorkerMaxSleepTime int + BlockNumPerWorkerHandle int + + MaxConnectionNum int + InitConnectionNum int + BehindBlockNum int + Bech32ChainPrefix string +} + const ( EnvNameDbAddr = "DB_ADDR" EnvNameDbUser = "DB_USER" @@ -30,7 +46,8 @@ const ( EnvNameWorkerNumExecuteTask = "WORKER_NUM_EXECUTE_TASK" EnvNameWorkerMaxSleepTime = "WORKER_MAX_SLEEP_TIME" EnvNameBlockNumPerWorkerHandle = "BLOCK_NUM_PER_WORKER_HANDLE" - EnvNameIrisNetwork = "IRIS_NETWORK" + EnvNameBehindBlockNum = "BEHIND_BLOCK_NUM" + EnvNameBech32ChainPrefix = "BECH32_CHAIN_PREFIX" ) // get value of env var @@ -39,42 +56,49 @@ func init() { nodeUrl, found := os.LookupEnv(EnvNameSerNetworkFullNodes) if found { - BlockChainMonitorUrl = strings.Split(nodeUrl, ",") + blockChainMonitorUrl = strings.Split(nodeUrl, ",") } - logger.Info("Env Value", logger.Any(EnvNameSerNetworkFullNodes, BlockChainMonitorUrl)) - - workerNumExecuteTask, found := os.LookupEnv(EnvNameWorkerNumExecuteTask) - if found { - WorkerNumExecuteTask, err = strconv.Atoi(workerNumExecuteTask) + if v, found := os.LookupEnv(EnvNameWorkerNumExecuteTask); found { + workerNumExecuteTask, err = strconv.Atoi(v) if err != nil { - logger.Fatal("Can't convert str to int", logger.String(EnvNameWorkerNumExecuteTask, workerNumExecuteTask)) + logger.Fatal("Can't convert str to int", logger.String(EnvNameWorkerNumExecuteTask, v)) } } - logger.Info("Env Value", logger.Int(EnvNameWorkerNumExecuteTask, WorkerNumExecuteTask)) - workerMaxSleepTime, found := os.LookupEnv(EnvNameWorkerMaxSleepTime) - if found { - WorkerMaxSleepTime, err = strconv.Atoi(workerMaxSleepTime) + if v, found := os.LookupEnv(EnvNameWorkerMaxSleepTime); found { + workerMaxSleepTime, err = strconv.Atoi(v) if err != nil { - logger.Fatal("Can't convert str to int", logger.String(EnvNameWorkerMaxSleepTime, workerMaxSleepTime)) + logger.Fatal("Can't convert str to int", logger.String(EnvNameWorkerMaxSleepTime, v)) } } - logger.Info("Env Value", logger.Int(EnvNameWorkerMaxSleepTime, WorkerMaxSleepTime)) - - blockNumPerWorkerHandle, found := os.LookupEnv(EnvNameBlockNumPerWorkerHandle) - if found { - BlockNumPerWorkerHandle, err = strconv.Atoi(blockNumPerWorkerHandle) + if v, ok := os.LookupEnv(EnvNameBech32ChainPrefix); ok { + bech32ChainPrefix = v + } + if v, found := os.LookupEnv(EnvNameBlockNumPerWorkerHandle); found { + blockNumPerWorkerHandle, err = strconv.Atoi(v) if err != nil { - logger.Fatal("Can't convert str to int", logger.String(EnvNameBlockNumPerWorkerHandle, blockNumPerWorkerHandle)) + logger.Fatal("Can't convert str to int", logger.String(EnvNameBlockNumPerWorkerHandle, v)) } } - logger.Info("Env Value", logger.Int(EnvNameBlockNumPerWorkerHandle, BlockNumPerWorkerHandle)) - network, found := os.LookupEnv(EnvNameIrisNetwork) - if found { - IrisNetwork = network - } else { - panic("not found " + EnvNameIrisNetwork) + if v, ok := os.LookupEnv(EnvNameBehindBlockNum); ok { + if n, err := strconv.Atoi(v); err != nil { + logger.Fatal("convert str to int fail", logger.String(EnvNameBehindBlockNum, v)) + } else { + behindBlockNum = n + } + } + SvrConf = &ServerConf{ + NodeUrls: blockChainMonitorUrl, + WorkerNumCreateTask: workerNumCreateTask, + WorkerNumExecuteTask: workerNumExecuteTask, + WorkerMaxSleepTime: workerMaxSleepTime, + BlockNumPerWorkerHandle: blockNumPerWorkerHandle, + + MaxConnectionNum: maxConnectionNum, + InitConnectionNum: initConnectionNum, + BehindBlockNum: behindBlockNum, + Bech32ChainPrefix: bech32ChainPrefix, } - logger.Info("Env Value", logger.String(EnvNameIrisNetwork, IrisNetwork)) + logger.Debug("print server config", logger.String("serverConf", utils.MarshalJsonIgnoreErr(SvrConf))) } diff --git a/constant/types.go b/constant/types.go deleted file mode 100644 index 0997dd3..0000000 --- a/constant/types.go +++ /dev/null @@ -1,41 +0,0 @@ -package constant - -const ( - Iris_TxTypeTransfer = "Transfer" - Iris_TxTypeBurn = "Burn" - Iris_TxTypeSetMemoRegexp = "SetMemoRegexp" - Iris_TxTypeStakeCreateValidator = "CreateValidator" - Iris_TxTypeStakeEditValidator = "EditValidator" - Iris_TxTypeStakeDelegate = "Delegate" - Iris_TxTypeStakeBeginUnbonding = "BeginUnbonding" - Iris_TxTypeBeginRedelegate = "BeginRedelegate" - Iris_TxTypeUnjail = "Unjail" - Iris_TxTypeSetWithdrawAddress = "SetWithdrawAddress" - Iris_TxTypeWithdrawDelegatorReward = "WithdrawDelegatorReward" - Iris_TxTypeWithdrawDelegatorRewardsAll = "WithdrawDelegatorRewardsAll" - Iris_TxTypeWithdrawValidatorRewardsAll = "WithdrawValidatorRewardsAll" - Iris_TxTypeSubmitProposal = "SubmitProposal" - Iris_TxTypeSubmitTokenAdditionProposal = "SubmitTokenAdditionProposal" - Iris_TxTypeDeposit = "Deposit" - Iris_TxTypeVote = "Vote" - Iris_TxTypeRequestRand = "RequestRand" - - TxTypeAssetIssueToken = "IssueToken" - TxTypeAssetEditToken = "EditToken" - TxTypeAssetMintToken = "MintToken" - TxTypeAssetTransferTokenOwner = "TransferTokenOwner" - TxTypeAssetCreateGateway = "CreateGateway" - TxTypeAssetEditGateway = "EditGateway" - TxTypeAssetTransferGatewayOwner = "TransferGatewayOwner" - - TxMsgTypeAssetIssueToken = "IssueToken" - TxMsgTypeAssetEditToken = "EditToken" - TxMsgTypeAssetMintToken = "MintToken" - TxMsgTypeAssetTransferTokenOwner = "TransferTokenOwner" - TxMsgTypeAssetCreateGateway = "CreateGateway" - TxMsgTypeAssetEditGateway = "EditGateway" - TxMsgTypeAssetTransferGatewayOwner = "TransferGatewayOwner" - - TxStatusSuccess = "success" - TxStatusFail = "fail" -) diff --git a/cron/cron_task.go b/cron/cron_task.go deleted file mode 100644 index 96bf160..0000000 --- a/cron/cron_task.go +++ /dev/null @@ -1,198 +0,0 @@ -package cron - -import ( - "time" - "os" - "os/signal" - "github.com/irisnet/rainbow-sync/logger" - "github.com/irisnet/rainbow-sync/db" - model "github.com/irisnet/rainbow-sync/model" - "github.com/irisnet/rainbow-sync/block" - "github.com/irisnet/rainbow-sync/helper" - "gopkg.in/mgo.v2" - "gopkg.in/mgo.v2/bson" - "gopkg.in/mgo.v2/txn" - "fmt" -) - -type CronService struct{} - -func (s *CronService) StartCronService() { - fn := func() { - logger.Debug("Start CronService ...") - ticker := time.NewTicker(5 * time.Minute) - defer ticker.Stop() - stop := make(chan os.Signal) - signal.Notify(stop, os.Interrupt) - - fn_update := func() { - defer func() { - if r := recover(); r != nil { - logger.Error("CronService have error", logger.Any("err", r)) - } - }() - - runValue := true - skip := 0 - for runValue { - total, err := GetUnknownTxsByPage(skip, 20) - if err != nil { - logger.Error("GetUnknownTxsByPage have error", logger.String("err", err.Error())) - } - if total < 20 { - runValue = false - logger.Debug("finish GetUnknownTxsByPage.") - } else { - skip = skip + total - logger.Debug("continue GetUnknownTxsByPage", logger.Int("skip", skip)) - } - } - - logger.Debug("finish update txs.") - } - fn_update() - for { - select { - case <-ticker.C: - fn_update() - case <-stop: - close(stop) - logger.Debug(" CronService Quit...") - return - } - - } - } - - go fn() -} - -func GetUnknownTxsByPage(skip, limit int) (int, error) { - - var res []model.IrisTx - q := bson.M{"status": "unknown"} - sorts := []string{"-height"} - - fn := func(c *mgo.Collection) error { - return c.Find(q).Sort(sorts...).Skip(skip).Limit(limit).All(&res) - } - - if err := db.ExecCollection(model.CollectionNameIrisTx, fn); err != nil { - return 0, err - } - - if len(res) > 0 { - doWork(res) - } - - return len(res), nil -} - -func GetCoinFlowByHash(txhash string) ([]model.IrisAssetDetail, error) { - var res []model.IrisAssetDetail - q := bson.M{"tx_hash": txhash} - sorts := []string{"-height"} - - fn := func(c *mgo.Collection) error { - return c.Find(q).Sort(sorts...).All(&res) - } - - if err := db.ExecCollection(model.CollectionNameAssetDetail, fn); err != nil { - return nil, err - } - - return res, nil -} - -func doWork(iristxs []model.IrisTx) { - client := helper.GetClient() - defer func() { - client.Release() - }() - - for _, val := range iristxs { - txs, err := ParseUnknownTxs(val.Height, client) - if err != nil { - continue - } - if err := UpdateUnknowTxs(txs); err != nil { - logger.Warn("UpdateUnknowTxs have error", logger.String("error", err.Error())) - } - if err := UpdateCoinFlow(val.TxHash, val.Height, client); err != nil { - logger.Warn("UpdateCoinFlow have error", logger.String("error", err.Error())) - } - } - -} - -func ParseUnknownTxs(height int64, client *helper.Client) (resIrisTxs []*model.IrisTx, err error) { - var irisBlock block.Iris_Block - resIrisTxs, err = irisBlock.ParseIrisTxs(height, client) - if err != nil { - logger.Error("Parse block txs fail", logger.Int64("block", height), - logger.String("err", err.Error())) - } - return -} - -func ParseCoinflows(height int64, client *helper.Client) (coinflows []*model.IrisAssetDetail, err error) { - var irisBlock block.Iris_Block - coinflows, err = irisBlock.ParseIrisAssetDetail(height, client) - if err != nil { - logger.Error("Parse block coinflow fail", logger.Int64("block", height), - logger.String("err", err.Error())) - } - return -} - -func UpdateUnknowTxs(iristx []*model.IrisTx) error { - - update_fn := func(tx *model.IrisTx) error { - fn := func(c *mgo.Collection) error { - return c.Update(bson.M{"tx_hash": tx.TxHash}, - bson.M{"$set": bson.M{"actual_fee": tx.ActualFee, "status": tx.Status, "tags": tx.Tags}}) - } - - if err := db.ExecCollection(model.CollectionNameIrisTx, fn); err != nil { - return err - } - return nil - } - - for _, dbval := range iristx { - update_fn(dbval) - } - - return nil -} - -func UpdateCoinFlow(txhash string, height int64, client *helper.Client) error { - - coinflows, err := GetCoinFlowByHash(txhash) - if err != nil { - return err - } - var ops []txn.Op - - if len(coinflows) > 0 { - return fmt.Errorf("coinflow not need to update") - } - assetdetail, err := ParseCoinflows(height, client) - for _, dbval := range assetdetail { - ops = append(ops, txn.Op{ - C: model.CollectionNameAssetDetail, - Id: bson.NewObjectId(), - Insert: dbval, - }) - - } - - if len(ops) > 0 { - err := db.Txn(ops) - if err != nil { - return err - } - } - - return nil -} diff --git a/cron/cron_task_test.go b/cron/cron_task_test.go deleted file mode 100644 index 75b6655..0000000 --- a/cron/cron_task_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package cron - -import ( - "testing" - "time" - "github.com/irisnet/rainbow-sync/db" - "github.com/irisnet/rainbow-sync/helper" - "github.com/irisnet/rainbow-sync/conf" -) - -func TestGetUnknownTxsByPage(t *testing.T) { - helper.Init(conf.BlockChainMonitorUrl, conf.MaxConnectionNum, conf.InitConnectionNum) - db.Start() - defer func() { - db.Stop() - }() - GetUnknownTxsByPage(0, 2) -} - -func TestCronService_StartCronService(t *testing.T) { - helper.Init(conf.BlockChainMonitorUrl, conf.MaxConnectionNum, conf.InitConnectionNum) - db.Start() - defer func() { - db.Stop() - }() - new(CronService).StartCronService() - time.Sleep(1 * time.Minute) -} diff --git a/db/db.go b/db/db.go index eca033e..6e60bbc 100644 --- a/db/db.go +++ b/db/db.go @@ -3,7 +3,7 @@ package db import ( "fmt" conf "github.com/irisnet/rainbow-sync/conf/db" - "github.com/irisnet/rainbow-sync/logger" + "github.com/irisnet/rainbow-sync/lib/logger" "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" "gopkg.in/mgo.v2/txn" diff --git a/go.mod b/go.mod index 0d56bcf..178f8ff 100644 --- a/go.mod +++ b/go.mod @@ -1,19 +1,16 @@ module github.com/irisnet/rainbow-sync -go 1.13 +go 1.15 require ( - github.com/irisnet/irishub v0.16.0 github.com/jolestar/go-commons-pool v2.0.0+incompatible - github.com/tendermint/tendermint v0.32.8 + github.com/tendermint/tendermint v0.34.3 + github.com/kaifei-bianjie/msg-parser v0.0.0-20210205025444-68411682d9a1 go.uber.org/zap v1.13.0 + golang.org/x/net v0.0.0-20201021035429-f5854403a974 gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 gopkg.in/natefinch/lumberjack.v2 v2.0.0 gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 // indirect ) -replace ( - github.com/tendermint/iavl => github.com/irisnet/iavl v0.12.3 - github.com/tendermint/tendermint => github.com/irisnet/tendermint v0.32.1 - golang.org/x/crypto => github.com/tendermint/crypto v0.0.0-20180820045704-3764759f34a5 -) +replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.2-alpha.regen.4 diff --git a/go.sum b/go.sum index 3b4db34..2de05a4 100644 --- a/go.sum +++ b/go.sum @@ -1,211 +1,859 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/99designs/keyring v1.1.6 h1:kVDC2uCgVwecxCk+9zoCt2uEL6dt+dfVzMvGgnVcIuM= +github.com/99designs/keyring v1.1.6/go.mod h1:16e0ds7LGQQcT59QqkTg72Hh5ShM51Byv5PEmW6uoRU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= +github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= +github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= +github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/Workiva/go-datastructures v1.0.52/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= -github.com/bartekn/go-bip39 v0.0.0-20171116152956-a05967ea095d/go.mod h1:icNx/6QdFblhsEjZehARqbNumymUT/ydwlLojFdv7Sk= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-metrics v0.3.6 h1:x/tmtOF9cDBoXH7XoAGOz2qqm1DknFD1590XmD/DUJ8= +github.com/armon/go-metrics v0.3.6/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= +github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/btcsuite/btcd v0.0.0-20190115013929-ed77733ec07d h1:xG8Pj6Y6J760xwETNmMzmlt38QSwz0BLp1cZ09g27uw= +github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/btcsuite/btcd v0.0.0-20190115013929-ed77733ec07d/go.mod h1:d3C0AkH6BRcvO8T0UEPu53cnw4IbV63x1bEjildYhO0= +github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= +github.com/btcsuite/btcd v0.21.0-beta h1:At9hIZdJW0s9E/fAz28nrz6AmcNlSVucCH796ZteX1M= +github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20180524032703-d4cc87b86016/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a h1:RQMUrEILyYJEoAT34XS/kLu40vC0+po/UfxrBBA4qZE= github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= +github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= +github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= +github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= +github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= +github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cosmos/go-bip39 v0.0.0-20180618194314-52158e4697b8 h1:Iwin12wRQtyZhH6FV3ykFcdGNlYEzoeR0jN8Vn+JWsI= -github.com/cosmos/go-bip39 v0.0.0-20180618194314-52158e4697b8/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= -github.com/cosmos/ledger-cosmos-go v0.10.3 h1:Qhi5yTR5Pg1CaTpd00pxlGwNl4sFRdtK1J96OTjeFFc= -github.com/cosmos/ledger-cosmos-go v0.10.3/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/confio/ics23/go v0.0.0-20200817220745-f173e6211efb/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= +github.com/confio/ics23/go v0.6.3 h1:PuGK2V1NJWZ8sSkNDq91jgT/cahFEW9RGp4Y5jxulf0= +github.com/confio/ics23/go v0.6.3/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cosmos/cosmos-sdk v0.40.1 h1:gjrtV3MQj/CMeyXN4+sosHMG6Xwa2uH6HITSjSNL/0E= +github.com/cosmos/cosmos-sdk v0.40.1/go.mod h1:vlgqdPpUGSxgqSbZea6fjszoLkPKwCuiqSBySLlv4ro= +github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= +github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= +github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= +github.com/cosmos/iavl v0.15.0-rc3.0.20201009144442-230e9bdf52cd/go.mod h1:3xOIaNNX19p0QrX0VqWa6voPRoJRGGYtny+DH8NEPvE= +github.com/cosmos/iavl v0.15.0-rc5/go.mod h1:WqoPL9yPTQ85QBMT45OOUzPxG/U/JcJoN7uMjgxke/I= +github.com/cosmos/iavl v0.15.3 h1:xE9r6HW8GeKeoYJN4zefpljZ1oukVScP/7M8oj6SUts= +github.com/cosmos/iavl v0.15.3/go.mod h1:OLjQiAQ4fGD2KDZooyJG9yz+p2ao2IAYSbke8mVvSA4= +github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4= +github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= github.com/cosmos/ledger-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI= github.com/cosmos/ledger-go v0.9.2/go.mod h1:oZJ2hHAZROdlHiwTg4t7kP+GKIIkBT+o6c9QWFanOyI= +github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/danieljoos/wincred v1.0.2 h1:zf4bhty2iLuwgjgpraD2E9UbvO+fe54XXGJbOwe23fU= +github.com/danieljoos/wincred v1.0.2/go.mod h1:SnuYRW9lp1oJrZX/dXJqr0cPK5gYXqx3EJbmjhLdK9U= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/emicklei/proto v1.6.5 h1:HiOjyLb7plgNx11OAafETxIKZpHynl+wRSob6QRc9QA= -github.com/emicklei/proto v1.6.5/go.mod h1:Dqn751twH9SasYqvA59Lb9Hz+itoJgmMoivX6k7OPZc= -github.com/etcd-io/bbolt v1.3.3 h1:gSJmxrs37LgTqR/oyJBWok6k6SvXEUerFTbltIhXkBM= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/fortytw2/leaktest v1.2.0 h1:cj6GCiwJDH7l3tMHLjZDo0QqPtrXJiWSI9JgpeQKw+Q= -github.com/fortytw2/leaktest v1.2.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= +github.com/dgraph-io/badger/v2 v2.2007.1/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= +github.com/dgraph-io/badger/v2 v2.2007.2 h1:EjjK0KqwaFMlPin1ajhP943VPENHJdEz1KLIegjaI3k= +github.com/dgraph-io/badger/v2 v2.2007.2/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= +github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgraph-io/ristretto v0.0.3 h1:jh22xisGBjrEVnRZ1DVTpBVQm0Xndu8sMl0CWDzSIBI= +github.com/dgraph-io/ristretto v0.0.3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= +github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b h1:HBah4D48ypg3J7Np4N+HY/ZR76fx3HEUGxDU6Uk39oQ= +github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b/go.mod h1:7BvyPhdbLxMXIYTFPLsyJRFMsKmOZnQmzh6Gb+uquuM= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25 h1:2vLKys4RBU4pn2T/hjXMbvwTr1Cvy5THHrQkbeY9HRk= +github.com/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25/go.mod h1:hTr8+TLQmkUkgcuh3mcr5fjrT9c64ZzsBCdCEC6UppY= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= +github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= +github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/go-kit/kit v0.6.0 h1:wTifptAGIyIuir4bRyN4h7+kAa2a4eepLYVmRe5qqQ8= -github.com/go-kit/kit v0.6.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo= +github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= +github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= +github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= +github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.2 h1:aeE13tS0IiQgFjYdoL8qN3K1N2bXXtI6Vi51/y7BpMw= +github.com/golang/snappy v0.0.2/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/websocket v1.2.0 h1:VJtLvh6VQym50czpZzx07z/kw9EgAxI3x1ZB8taTMQQ= -github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.2.1/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= +github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 h1:FlFbCRLd5Jr4iYXZufAvgWN6Ao0JrI5chLINnUXDDr0= +github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.14.7/go.mod h1:oYZKL012gGh6LMyg/xA7Q2yq6j8bu0wa+9w14EEthWU= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= +github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= +github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= +github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= +github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= +github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= +github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/irisnet/iavl v0.12.3 h1:AYqI1q/EVAOCWznYx4FtEZIq8x9yPBs9ZA/Rk3zsTDo= -github.com/irisnet/iavl v0.12.3/go.mod h1:qofGh9236iFgVez+gPk7bC+ef5wCw7aIMvAVBK3lT84= -github.com/irisnet/irishub v0.16.0 h1:Xuvynxz2TsrTsBym3HAcbleogqR4GXP+NUxW25JJcmk= -github.com/irisnet/irishub v0.16.0/go.mod h1:S6Y1vyjutENBFt7mS8UTh6L+91TpenYtmfu0KtND9I8= -github.com/irisnet/tendermint v0.32.1 h1:INUYX36ZDUozg22WdAhtrjsWAqUqVVM4Q3nCRRBd1NM= -github.com/irisnet/tendermint v0.32.1/go.mod h1:36RAXv6V/Ar3H6ofEtmtxU2u80tYRdQh1z51gxoG9Nk= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/irisnet/irismod v1.2.1 h1:MWFLpG9gq82ArA2/2WwYEJ0eGb8AHFpal38hMDHwYKc= +github.com/irisnet/irismod v1.2.1/go.mod h1:wVU9KNSJwWgJ/jVroGENDe96QOk690EisCi9jPo+9m4= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/jolestar/go-commons-pool v2.0.0+incompatible h1:uHn5uRKsLLQSf9f1J5QPY2xREWx/YH+e4bIIXcAuAaE= github.com/jolestar/go-commons-pool v2.0.0+incompatible/go.mod h1:ChJYIbIch0DMCSU6VU0t0xhPoWDR2mMFIQek3XWU0s8= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/kaifei-bianjie/msg-parser v0.0.0-20210205025444-68411682d9a1 h1:l9zWJSv6W4UBNI+WlYXAcezCeswcEqQ9HkXX4Vhgnio= +github.com/kaifei-bianjie/msg-parser v0.0.0-20210205025444-68411682d9a1/go.mod h1:6hD28imVMlfwHOzwBa5maA7IwLgbtTcF6FpFx1XgPN4= +github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d h1:Z+RDyXzjKE0i2sTjZ/b1uxiGtPhFy34Ou/Tk0qwN0kM= +github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNrCn9otv/2QP4D7SMJBgaleKpOf66PnW6F5WGNRIc= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= +github.com/kkdai/bstream v1.0.0/go.mod h1:FDnDOHt5Yx4p3FaHcioFT0QjDOtgUpvjeZqAs+NVZZA= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/libp2p/go-buffer-pool v0.0.2 h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= -github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= +github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= +github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= +github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.4 h1:8KGKTcQQGm0Kv7vEbKFErAoAOFyyacLStRtQSeYtvkY= +github.com/magiconair/properties v1.8.4/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 h1:hLDRPB66XQT/8+wG9WsDpiCvZf1yKO7sz7scAjSlBa0= +github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= +github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= +github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= +github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= +github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= +github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/otiai10/copy v1.4.2/go.mod h1:XWfuS3CrI0R6IE0FbgHsEazaXO8G0LpMp9o8tos0x4E= +github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= +github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= +github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= +github.com/otiai10/mint v1.3.2/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= +github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pelletier/go-toml v1.8.0 h1:Keo9qb7iRJs2voHvunFtuuYFsbWeOBh8/P9v/kVMFtw= +github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs= +github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= +github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.9.1 h1:K47Rk0v/fkEfwfQet2KWhscE0cJzjgCCDBG2KHZoVno= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 h1:idejC8f05m9MGOsuEi1ATq9shN03HrxNkD/luQvxCv8= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.8.0 h1:zvJNkoCFAnYFNC24FV8nW4JdRJ3GIFcLbg65lL/JDcw= +github.com/prometheus/client_golang v1.8.0/go.mod h1:O9VU6huf47PktckDQfMTX0Y8tY0/7TSWwj+ITvv0TnM= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/common v0.0.0-20181020173914-7e9e6cabbd39 h1:Cto4X6SVMWRPBkJ/3YHn1iDGDGc/Z+sW+AEMKHMVvN4= -github.com/prometheus/common v0.0.0-20181020173914-7e9e6cabbd39/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d h1:GoAlyOgbOEIFdaDqxJVlbOQ1DtGmZWs/Qau0hIlk+WQ= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/common v0.15.0 h1:4fgOnadei3EZvgRwxJ7RMpG1k1pOZth5Pc13tyspaKM= +github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/rakyll/statik v0.1.6/go.mod h1:OEi9wJV/fMUAGx1eNjq75DKDsJVuEv1U0oYdX6GX8Zs= -github.com/rcrowley/go-metrics v0.0.0-20180503174638-e2704e165165 h1:nkcn14uNmFEuGCb2mBZbBb24RdNRL08b/wb+xBOYpuk= -github.com/rcrowley/go-metrics v0.0.0-20180503174638-e2704e165165/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= +github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= +github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg= +github.com/regen-network/cosmos-proto v0.3.1/go.mod h1:jO0sVX6a1B36nmE8C9xBFXpNwWejXC7QqCOnH3O0+YM= +github.com/regen-network/protobuf v1.3.2-alpha.regen.4 h1:c9jEnU+xm6vqyrQe3M94UFWqiXxRIKKnqBOh2EACmBE= +github.com/regen-network/protobuf v1.3.2-alpha.regen.4/go.mod h1:/J8/bR1T/NXyIdQDLUaq15LjNE83nRzkyrLAMcPewig= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rs/cors v1.6.0 h1:G9tHG9lebljV9mfp9SNPDL36nCDxmo3zTlAf1YgvzmI= -github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= +github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/zerolog v1.20.0/go.mod h1:IzD0RJ65iWH0w97OQQebJEvTZYvsCUm9WVLWBQrJRjo= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/sasha-s/go-deadlock v0.2.0 h1:lMqc+fUb7RrFS3gQLtoQsJ7/6TV/pAIFvBsqX73DK8Y= +github.com/sasha-s/go-deadlock v0.2.0/go.mod h1:StQn567HiB1fF2yJ44N9au7wOhrPS3iZqiDbRupzT10= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa/go.mod h1:oJyF+mSPHbB5mVY2iO9KV3pTt/QbIkGaO8gQ2WrDbP4= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= +github.com/spf13/afero v1.3.4 h1:8q6vk3hthlpb2SouZcnBVKboxWQWMDNF38bwholZrJc= +github.com/spf13/afero v1.3.4/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.1 h1:zZh3X5aZbdnoj+4XkaBxKfhO4ot82icYdhhREIAXIj8= -github.com/spf13/cobra v0.0.1/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= +github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4= +github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.0.0 h1:RUA/ghS2i64rlnn4ydTfblY8Og8QzcPtCcHvgMn+w/I= -github.com/spf13/viper v1.0.0/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= +github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= +github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965 h1:1oFLiOyVl+W7bnBzGhf7BbIv9loSFQcieWWYIjLqcAw= -github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca h1:Ld/zXl5t4+D69SiV4JoN7kkfvJdOWlPpfxrzxpLMoUk= +github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= +github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= +github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/btcd v0.1.1 h1:0VcxPfflS2zZ3RiOAHkBiFUcPvbtRj5O7zHmcJWHV7s= github.com/tendermint/btcd v0.1.1/go.mod h1:DC6/m53jtQzr/NFmMNEu0rxf18/ktVoVtMrnDD5pN+U= -github.com/tendermint/crypto v0.0.0-20180820045704-3764759f34a5 h1:u8i49c+BxloX3XQ55cvzFNXplizZP/q00i+IlttUjAU= -github.com/tendermint/crypto v0.0.0-20180820045704-3764759f34a5/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk= -github.com/tendermint/go-amino v0.14.1 h1:o2WudxNfdLNBwMyl2dqOJxiro5rfrEaU0Ugs6offJMk= -github.com/tendermint/go-amino v0.14.1/go.mod h1:i/UKE5Uocn+argJJBb12qTZsCDBcAYMbR92AaJVmKso= -github.com/tendermint/tm-db v0.1.1 h1:G3Xezy3sOk9+ekhjZ/kjArYIs1SmwV+1OUgNkj7RgV0= -github.com/tendermint/tm-db v0.1.1/go.mod h1:0cPKWu2Mou3IlxecH+MEUSYc1Ch537alLe6CpFrKzgw= +github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RMWx1aInLzndwxKalgi5rTqgfXxOxbEI= +github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk= +github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= +github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= +github.com/tendermint/tendermint v0.34.0-rc4/go.mod h1:yotsojf2C1QBOw4dZrTcxbyxmPUrT4hNuOQWX9XUwB4= +github.com/tendermint/tendermint v0.34.0-rc6/go.mod h1:ugzyZO5foutZImv0Iyx/gOFCX6mjJTgbLHTwi17VDVg= +github.com/tendermint/tendermint v0.34.0/go.mod h1:Aj3PIipBFSNO21r+Lq3TtzQ+uKESxkbA3yo/INM4QwQ= +github.com/tendermint/tendermint v0.34.3 h1:9yEsf3WO5VAwPVwrmM+RffDMiijmNfWaBwNttHm0q5w= +github.com/tendermint/tendermint v0.34.3/go.mod h1:h57vnXeOlrdvvNFCqPBSaOrpOivl+2swWEtlUAqStYE= +github.com/tendermint/tm-db v0.6.2/go.mod h1:GYtQ67SUvATOcoY8/+x6ylk8Qo02BQyLrAs+yAcLvGI= +github.com/tendermint/tm-db v0.6.3 h1:ZkhQcKnB8/2jr5EaZwGndN4owkPsGezW2fSisS9zGbg= +github.com/tendermint/tm-db v0.6.3/go.mod h1:lfA1dL9/Y/Y8wwyPp2NMLyn5P5Ptr/gvDFNWtrCWSf8= github.com/tendermint/tmlibs v0.9.0/go.mod h1:4L0tAKpLTioy14VnmbXYTLIJN0pCMiehxDMdN6zZfM8= +github.com/tidwall/gjson v1.6.0 h1:9VEQWz6LLMUsUl6PueE49ir4Ka6CzLymOAZDxpFsTDc= +github.com/tidwall/gjson v1.6.0/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls= +github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc= +github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E= +github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= +github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8= github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0= +go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0 h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0 h1:sFPn2GLc3poCkfrpIXGhBD2X0CMIo4Q/zSULXrj/+uc= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0 h1:nR6NoDBgAf67s68NhaXbsojM+2gxp3S1hWkHDl27pVU= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7 h1:rTIdg5QFRR7XCaK4LCjBiPbx8j4DQRpdYMnGn/bJUEU= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211 h1:9UQO31fZ+0aKQOFldThf7BKPMJTiBfWycGh/u3UoO88= +golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190828213141-aed303cbaa74/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64bikrLBkAgPir1TNCj3Zs= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200110213125-a7a6caa82ab2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa h1:5E4dL8+NgFOgjwbTKz+OOEGGhP+ectTmF842l6KjupQ= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2 h1:67iHsV9djwGdZpdZNbLuQj6FOzCaZe3w+vhLjn5AcFA= -google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/grpc v1.22.0 h1:J0UbZOIrCAl+fpTOf8YLs4dJo8L/owV4LYVtAXQoPkw= -google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201111145450-ac7456db90a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210114201628-6edceaf6022f h1:izedQ6yVIc5mZsRuXzmSreCOlzI0lCU1HpG8yEdMiKw= +google.golang.org/genproto v0.0.0-20210114201628-6edceaf6022f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.35.0 h1:TwIQcH3es+MojMVojxxfQ3l3OF2KzlRxML2xZq0kRo8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= +gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= +gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 h1:VpOs+IwYnYBaFnrNAeB8UUWtL3vEUnzSCL1nVjPhqrw= gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 h1:yiW+nvdHb9LVqSHQBXfZCieqV4fzYhNBql77zY0ykqs= gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/logger/zap_logger.go b/lib/logger/zap_logger.go similarity index 100% rename from logger/zap_logger.go rename to lib/logger/zap_logger.go diff --git a/lib/msgparser/msgparser.go b/lib/msgparser/msgparser.go new file mode 100644 index 0000000..ad3cd68 --- /dev/null +++ b/lib/msgparser/msgparser.go @@ -0,0 +1,11 @@ +package msgparser + +import "github.com/kaifei-bianjie/msg-parser" + +var ( + MsgClient msg_parser.MsgClient +) + +func init() { + MsgClient = msg_parser.NewMsgClient() +} diff --git a/helper/pool_client.go b/lib/pool/pool_client.go similarity index 66% rename from helper/pool_client.go rename to lib/pool/pool_client.go index 93f8b4c..08b8667 100644 --- a/helper/pool_client.go +++ b/lib/pool/pool_client.go @@ -1,25 +1,27 @@ //init client from clientPool. //client is httpClient of tendermint -package helper +package pool import ( + "context" "fmt" - rpcClient "github.com/tendermint/tendermint/rpc/client" - "github.com/irisnet/rainbow-sync/logger" + "github.com/irisnet/rainbow-sync/lib/logger" + rpcClient "github.com/tendermint/tendermint/rpc/client/http" "time" ) type Client struct { Id string - rpcClient.Client + *rpcClient.HTTP } -func newClient(addr string) *Client { +func newClient(addr string) (*Client, error) { + client, err := rpcClient.New(addr, "/websocket") return &Client{ - Id: generateId(addr), - Client: rpcClient.NewHTTP(addr, "/websocket"), - } + Id: generateId(addr), + HTTP: client, + }, err } // get client from pool @@ -43,8 +45,8 @@ func (c *Client) Release() { } func (c *Client) HeartBeat() error { - http := c.Client.(*rpcClient.HTTP) - _, err := http.Health() + http := c.HTTP + _, err := http.Health(context.Background()) return err } diff --git a/helper/pool_factory.go b/lib/pool/pool_factory.go similarity index 81% rename from helper/pool_factory.go rename to lib/pool/pool_factory.go index 1466ac7..f78fe84 100644 --- a/helper/pool_factory.go +++ b/lib/pool/pool_factory.go @@ -1,9 +1,10 @@ -package helper +package pool import ( "context" + "github.com/irisnet/rainbow-sync/conf" + "github.com/irisnet/rainbow-sync/lib/logger" commonPool "github.com/jolestar/go-commons-pool" - "github.com/irisnet/rainbow-sync/logger" "math/rand" "sync" ) @@ -24,9 +25,9 @@ var ( ctx = context.Background() ) -func Init(BlockChainMonitorUrl []string, MaxConnectionNum, InitConnectionNum int) { +func init() { var syncMap sync.Map - for _, url := range BlockChainMonitorUrl { + for _, url := range conf.SvrConf.NodeUrls { key := generateId(url) endPoint := EndPoint{ Address: url, @@ -40,9 +41,9 @@ func Init(BlockChainMonitorUrl []string, MaxConnectionNum, InitConnectionNum int } config := commonPool.NewDefaultPoolConfig() - config.MaxTotal = MaxConnectionNum - config.MaxIdle = InitConnectionNum - config.MinIdle = InitConnectionNum + config.MaxTotal = conf.SvrConf.MaxConnectionNum + config.MaxIdle = conf.SvrConf.InitConnectionNum + config.MinIdle = conf.SvrConf.InitConnectionNum config.TestOnBorrow = true config.TestOnCreate = true config.TestWhileIdle = true @@ -59,7 +60,12 @@ func ClosePool() { func (f *PoolFactory) MakeObject(ctx context.Context) (*commonPool.PooledObject, error) { endpoint := f.GetEndPoint() - return commonPool.NewPooledObject(newClient(endpoint.Address)), nil + c, err := newClient(endpoint.Address) + if err != nil { + return nil, err + } else { + return commonPool.NewPooledObject(c), nil + } } func (f *PoolFactory) DestroyObject(ctx context.Context, object *commonPool.PooledObject) error { @@ -82,6 +88,13 @@ func (f *PoolFactory) ValidateObject(ctx context.Context, object *commonPool.Poo } return false } + stat, err := c.Status(ctx) + if err != nil { + return false + } + if stat.SyncInfo.CatchingUp { + return false + } return true } diff --git a/main.go b/main.go index 9b4e66f..f839dff 100644 --- a/main.go +++ b/main.go @@ -1,13 +1,14 @@ package main import ( + "github.com/irisnet/rainbow-sync/db" + "github.com/irisnet/rainbow-sync/lib/logger" + "github.com/irisnet/rainbow-sync/lib/pool" + "github.com/irisnet/rainbow-sync/model" + "github.com/irisnet/rainbow-sync/task" "os" "os/signal" "syscall" - "github.com/irisnet/rainbow-sync/logger" - "github.com/irisnet/rainbow-sync/db" - "github.com/irisnet/rainbow-sync/task" - "github.com/irisnet/rainbow-sync/model" "runtime" ) @@ -20,6 +21,7 @@ func main() { logger.Info("System Exit") db.Stop() + pool.ClosePool() if err := recover(); err != nil { logger.Error("", logger.Any("err", err)) diff --git a/model/iris_asset_detail.go b/model/iris_asset_detail.go deleted file mode 100644 index d851052..0000000 --- a/model/iris_asset_detail.go +++ /dev/null @@ -1,48 +0,0 @@ -package model - -import ( - "gopkg.in/mgo.v2/bson" - "gopkg.in/mgo.v2" - "github.com/irisnet/rainbow-sync/db" -) - -type ( - IrisAssetDetail struct { - From string `bson:"from"` - To string `bson:"to"` - CoinAmount string `bson:"coin_amount"` - CoinUnit string `bson:"coin_unit"` - Trigger string `bson:"trigger"` - Subject string `bson:"subject"` - Description string `bson:"description"` - Timestamp string `bson:"timestamp"` - Height int64 `bson:"height"` - TxHash string `bson:"tx_hash"` - Ext string `bson:"ext"` - } -) - -const ( - CollectionNameAssetDetail = "sync_iris_asset_detail" -) - -func (d IrisAssetDetail) Name() string { - return CollectionNameAssetDetail -} - -func (d IrisAssetDetail) PkKvPair() map[string]interface{} { - return bson.M{} -} - -func (d IrisAssetDetail) EnsureIndexes() { - var indexes []mgo.Index - indexes = append(indexes, mgo.Index{ - Key: []string{"-to", "-height"}, - Background: true, - }) - indexes = append(indexes, mgo.Index{ - Key: []string{"-to", "-subject"}, - Background: true, - }) - db.EnsureIndexes(d.Name(), indexes) -} diff --git a/model/msg/asset.go b/model/msg/asset.go deleted file mode 100644 index 98c69e0..0000000 --- a/model/msg/asset.go +++ /dev/null @@ -1,234 +0,0 @@ -package msg - -import ( - "strings" - "github.com/irisnet/rainbow-sync/constant" - "github.com/irisnet/rainbow-sync/logger" - imodel "github.com/irisnet/rainbow-sync/model" -) - -type ( - DocTxMsgIssueToken struct { - Family string `bson:"family"` - Source string `bson:"source"` - Gateway string `bson:"gateway"` - Symbol string `bson:"symbol"` - CanonicalSymbol string `bson:"canonical_symbol"` - Name string `bson:"name"` - Decimal uint8 `bson:"decimal"` - MinUnitAlias string `bson:"min_unit_alias"` - InitialSupply uint64 `bson:"initial_supply"` - MaxSupply uint64 `bson:"max_supply"` - Mintable bool `bson:"mintable"` - Owner string `bson:"owner"` - UdInfo assetTokenUdInfo `bson:"ud_info"` - } - - DocTxMsgEditToken struct { - TokenId string `bson:"token_id"` // id of token - Owner string `bson:"owner"` // owner of token - CanonicalSymbol string `bson:"canonical_symbol"` // canonical_symbol of token - MinUnitAlias string `bson:"min_unit_alias"` // min_unit_alias of token - MaxSupply uint64 `bson:"max_supply"` - Mintable string `bson:"mintable"` // mintable of token - Name string `bson:"name"` - UdInfo assetTokenUdInfo `bson:"ud_info"` - } - - DocTxMsgMintToken struct { - TokenId string `bson:"token_id"` // the unique id of the token - Owner string `bson:"owner"` // the current owner address of the token - To string `bson:"to"` // address of mint token to - Amount uint64 `bson:"amount"` // amount of mint token - UdInfo assetTokenUdInfo `bson:"ud_info"` - } - - DocTxMsgTransferTokenOwner struct { - SrcOwner string `bson:"src_owner"` // the current owner address of the token - DstOwner string `bson:"dst_owner"` // the new owner - TokenId string `bson:"token_id"` - UdInfo assetTokenUdInfo `bson:"ud_info"` - } - - DocTxMsgCreateGateway struct { - Owner string `bson:"owner"` // the owner address of the gateway - Moniker string `bson:"moniker"` // the globally unique name of the gateway - Identity string `bson:"identity"` // the identity of the gateway - Details string `bson:"details"` // the description of the gateway - Website string `bson:"website"` // the external website of the gateway - } - - DocTxMsgEditGateway struct { - Owner string `bson:"owner"` // Owner of the gateway - Moniker string `bson:"moniker"` // Moniker of the gateway - Identity string `bson:"identity"` // Identity of the gateway - Details string `bson:"details"` // Details of the gateway - Website string `bson:"website"` // Website of the gateway - } - - DocTxMsgTransferGatewayOwner struct { - Owner string `bson:"owner"` // the current owner address of the gateway - Moniker string `bson:"moniker"` // the unique name of the gateway to be transferred - To string `bson:"to"` // the new owner to which the gateway ownership will be transferred - } - - assetTokenUdInfo struct { - Source string `bson:"source"` - Gateway string `bson:"gateway"` - Symbol string `bson:"symbol"` - } -) - -const ( - separatorOfSymbolInTokenId = "." - externalTokenPrefix = "x" - SourceNative = "native" - SourceExternal = "external" - SourceGateWay = "gateway" -) - -func (m *DocTxMsgIssueToken) Type() string { - return constant.TxMsgTypeAssetIssueToken -} - -func (m *DocTxMsgIssueToken) BuildMsg(txMsg interface{}) { - msg := txMsg.(imodel.AssetIssueToken) - - m.Family = msg.Family.String() - m.Source = msg.Source.String() - m.Gateway = msg.Gateway - m.Symbol = msg.Symbol - m.CanonicalSymbol = msg.CanonicalSymbol - m.Name = msg.Name - m.Decimal = msg.Decimal - m.MinUnitAlias = msg.MinUnitAlias - m.InitialSupply = msg.InitialSupply - m.MaxSupply = msg.MaxSupply - m.Mintable = msg.Mintable - m.Owner = msg.Owner.String() - m.UdInfo = assetTokenUdInfo{ - Source: msg.Source.String(), - Gateway: msg.Gateway, - Symbol: msg.Symbol, - } -} - -func (m *DocTxMsgEditToken) Type() string { - return constant.TxMsgTypeAssetEditToken -} - -func (m *DocTxMsgEditToken) BuildMsg(txMsg interface{}) { - msg := txMsg.(imodel.AssetEditToken) - - m.TokenId = msg.TokenId - m.Owner = msg.Owner.String() - m.CanonicalSymbol = msg.CanonicalSymbol - m.MinUnitAlias = msg.MinUnitAlias - m.MaxSupply = msg.MaxSupply - m.Mintable = string(msg.Mintable) - m.Name = msg.Name - m.UdInfo = getAssetTokenUdInfo(msg.TokenId) -} - -func (m *DocTxMsgMintToken) Type() string { - return constant.TxMsgTypeAssetMintToken -} - -func (m *DocTxMsgMintToken) BuildMsg(txMsg interface{}) { - msg := txMsg.(imodel.AssetMintToken) - - m.TokenId = msg.TokenId - m.Owner = msg.Owner.String() - m.To = msg.To.String() - m.Amount = msg.Amount - m.UdInfo = getAssetTokenUdInfo(msg.TokenId) -} - -func (m *DocTxMsgTransferTokenOwner) Type() string { - return constant.TxMsgTypeAssetTransferTokenOwner -} - -func (m *DocTxMsgTransferTokenOwner) BuildMsg(txMsg interface{}) { - msg := txMsg.(imodel.AssetTransferTokenOwner) - - m.SrcOwner = msg.SrcOwner.String() - m.DstOwner = msg.DstOwner.String() - m.TokenId = msg.TokenId - m.UdInfo = getAssetTokenUdInfo(msg.TokenId) -} - -func (m *DocTxMsgCreateGateway) Type() string { - return constant.TxMsgTypeAssetCreateGateway -} - -func (m *DocTxMsgCreateGateway) BuildMsg(txMsg interface{}) { - msg := txMsg.(imodel.AssetCreateGateway) - - m.Owner = msg.Owner.String() - m.Moniker = msg.Moniker - m.Identity = msg.Identity - m.Details = msg.Details - m.Website = msg.Website -} - -func (m *DocTxMsgEditGateway) Type() string { - return constant.TxMsgTypeAssetEditGateway -} - -func (m *DocTxMsgEditGateway) BuildMsg(txMsg interface{}) { - msg := txMsg.(imodel.AssetEditGateWay) - - m.Owner = msg.Owner.String() - m.Moniker = msg.Moniker - m.Identity = msg.Identity - m.Details = msg.Details - m.Website = msg.Website -} - -func (m *DocTxMsgTransferGatewayOwner) Type() string { - return constant.TxMsgTypeAssetTransferGatewayOwner -} - -func (m *DocTxMsgTransferGatewayOwner) BuildMsg(txMsg interface{}) { - msg := txMsg.(imodel.AssetTransferGatewayOwner) - - m.Owner = msg.Owner.String() - m.Moniker = msg.Moniker - m.To = msg.To.String() -} - -// get assetTokenUdInfo by parse tokenId -// Global Unique Token ID Generation Rule -// When Source is native: ID = [Symbol], e.g. iris -// When Source is external: ID = x.[Symbol], e.g. x.btc -// When Source is gateway: ID = [Gateway].[Symbol], e.g. cats.kitty -func getAssetTokenUdInfo(tokenId string) assetTokenUdInfo { - var ( - source, gateway, symbol string - ) - strs := strings.Split(tokenId, separatorOfSymbolInTokenId) - - switch len(strs) { - case 1: - source = SourceNative - symbol = tokenId - break - case 2: - if strs[0] == externalTokenPrefix { - source = SourceExternal - symbol = strs[1] - } else { - source = SourceGateWay - gateway = strs[0] - symbol = strs[1] - } - default: - logger.Warn("can't get assetUserDefinedInfo by tokenId", logger.String("tokenId", tokenId)) - } - - return assetTokenUdInfo{ - Source: source, - Gateway: gateway, - Symbol: symbol, - } -} diff --git a/model/msg/bank.go b/model/msg/bank.go deleted file mode 100644 index de8b148..0000000 --- a/model/msg/bank.go +++ /dev/null @@ -1,21 +0,0 @@ -package msg - -import ( - "github.com/irisnet/rainbow-sync/constant" - imodel "github.com/irisnet/rainbow-sync/model" -) - -type DocTxMsgSetMemoRegexp struct { - Owner string `bson:"owner"` - MemoRegexp string `bson:"memo_regexp"` -} - -func (doctx *DocTxMsgSetMemoRegexp) Type() string { - return constant.Iris_TxTypeSetMemoRegexp -} - -func (doctx *DocTxMsgSetMemoRegexp) BuildMsg(txMsg interface{}) { - msg := txMsg.(imodel.MsgSetMemoRegexp) - doctx.MemoRegexp = msg.MemoRegexp - doctx.Owner = msg.Owner.String() -} diff --git a/model/msg/gov.go b/model/msg/gov.go deleted file mode 100644 index 96e134a..0000000 --- a/model/msg/gov.go +++ /dev/null @@ -1,152 +0,0 @@ -package msg - -import ( - "github.com/irisnet/rainbow-sync/constant" - imodel "github.com/irisnet/rainbow-sync/model" - "github.com/irisnet/irishub/app/v1/gov" - "strconv" -) - -type Param struct { - Subspace string `bson:"subspace"` - Key string `bson:"key"` - Value string `bson:"value"` -} - -type Params []Param - -type DocTxMsgSubmitProposal struct { - Title string `bson:"title"` // Title of the proposal - Description string `bson:"description"` // Description of the proposal - Proposer string `bson:"proposer"` // Address of the proposer - InitialDeposit imodel.Coins `bson:"initialDeposit"` // Initial deposit paid by sender. Must be strictly positive. - ProposalType string `bson:"proposalType"` // Initial deposit paid by sender. Must be strictly positive. - Params Params `bson:"params"` -} - -func (doctx *DocTxMsgSubmitProposal) Type() string { - return constant.Iris_TxTypeSubmitProposal -} - -func (doctx *DocTxMsgSubmitProposal) BuildMsg(txMsg interface{}) { - msg := txMsg.(imodel.MsgSubmitProposal) - doctx.Title = msg.Title - doctx.Description = msg.Description - doctx.ProposalType = msg.ProposalType.String() - doctx.Proposer = msg.Proposer.String() - doctx.Params = loadParams(msg.Params) - doctx.InitialDeposit = loadInitialDeposit(msg.InitialDeposit) -} - -type DocTxMsgSubmitSoftwareUpgradeProposal struct { - DocTxMsgSubmitProposal - Version uint64 `bson:"version"` - Software string `bson:"software"` - SwitchHeight uint64 `bson:"switch_height"` - Threshold string `bson:"threshold"` -} - -func (doctx *DocTxMsgSubmitSoftwareUpgradeProposal) Type() string { - return constant.Iris_TxTypeSubmitProposal -} - -func (doctx *DocTxMsgSubmitSoftwareUpgradeProposal) BuildMsg(txMsg interface{}) { - msg := txMsg.(imodel.MsgSubmitSoftwareUpgradeProposal) - doctx.Title = msg.Title - doctx.Description = msg.Description - doctx.ProposalType = msg.ProposalType.String() - doctx.Proposer = msg.Proposer.String() - doctx.Params = loadParams(msg.Params) - doctx.InitialDeposit = loadInitialDeposit(msg.InitialDeposit) - doctx.Version = msg.Version - doctx.Software = msg.Software - doctx.SwitchHeight = msg.SwitchHeight - doctx.Threshold = msg.Threshold.String() -} - -type DocTxMsgSubmitCommunityTaxUsageProposal struct { - DocTxMsgSubmitProposal - Usage string `bson:"usage"` - DestAddress string `bson:"dest_address"` - Percent string `bson:"percent"` -} - -func (doctx *DocTxMsgSubmitCommunityTaxUsageProposal) Type() string { - return constant.Iris_TxTypeSubmitProposal -} - -func (doctx *DocTxMsgSubmitCommunityTaxUsageProposal) BuildMsg(txMsg interface{}) { - msg := txMsg.(imodel.MsgSubmitTaxUsageProposal) - doctx.Title = msg.Title - doctx.Description = msg.Description - doctx.ProposalType = msg.ProposalType.String() - doctx.Proposer = msg.Proposer.String() - doctx.Params = loadParams(msg.Params) - doctx.InitialDeposit = loadInitialDeposit(msg.InitialDeposit) - doctx.Usage = msg.Usage.String() - doctx.DestAddress = msg.DestAddress.String() - doctx.Percent = msg.Percent.String() -} - -type DocTxMsgSubmitTokenAdditionProposal struct { - DocTxMsgSubmitProposal - Symbol string `bson:"symbol"` - CanonicalSymbol string `bson:"canonical_symbol"` - Name string `bson:"name"` - Decimal uint8 `bson:"decimal"` - MinUnitAlias string `bson:"min_unit_alias"` - //InitialSupply uint64 `bson:"initial_supply"` -} - -func (doctx *DocTxMsgSubmitTokenAdditionProposal) Type() string { - return constant.Iris_TxTypeSubmitTokenAdditionProposal -} - -func (doctx *DocTxMsgSubmitTokenAdditionProposal) BuildMsg(txMsg interface{}) { - msg := txMsg.(imodel.MsgSubmitTokenAdditionProposal) - doctx.Title = msg.Title - doctx.Description = msg.Description - doctx.ProposalType = msg.ProposalType.String() - doctx.Proposer = msg.Proposer.String() - doctx.Params = loadParams(msg.Params) - doctx.InitialDeposit = loadInitialDeposit(msg.InitialDeposit) - doctx.Symbol = msg.Symbol - doctx.MinUnitAlias = msg.MinUnitAlias - doctx.CanonicalSymbol = msg.CanonicalSymbol - doctx.Name = msg.Name - doctx.Decimal = msg.Decimal - //doctx.InitialSupply = msg.InitialSupply -} - -func loadParams(params []gov.Param) (result []Param) { - for _, val := range params { - result = append(result, Param{Subspace: val.Subspace, Value: val.Value, Key: val.Key}) - } - return -} - -func loadInitialDeposit(coins imodel.SdkCoins) (result imodel.Coins) { - for _, val := range coins { - amt, _ := strconv.ParseFloat(val.Amount.String(), 64) - result = append(result, &imodel.Coin{Amount: amt, Denom: val.Denom}) - } - return -} - -// MsgVote -type DocTxMsgVote struct { - ProposalID uint64 `bson:"proposal_id"` // ID of the proposal - Voter string `bson:"voter"` // address of the voter - Option string `bson:"option"` // option from OptionSet chosen by the voter -} - -func (doctx *DocTxMsgVote) Type() string { - return constant.Iris_TxTypeVote -} - -func (doctx *DocTxMsgVote) BuildMsg(txMsg interface{}) { - msg := txMsg.(imodel.MsgVote) - doctx.Voter = msg.Voter.String() - doctx.Option = msg.Option.String() - doctx.ProposalID = msg.ProposalID -} diff --git a/model/msg/rand.go b/model/msg/rand.go deleted file mode 100644 index 3ec7bf4..0000000 --- a/model/msg/rand.go +++ /dev/null @@ -1,21 +0,0 @@ -package msg - -import ( - "github.com/irisnet/rainbow-sync/constant" - imodel "github.com/irisnet/rainbow-sync/model" -) - -type DocTxMsgRequestRand struct { - Consumer string `bson:"consumer"` // request address - BlockInterval uint64 `bson:"block-interval"` // block interval after which the requested random number will be generated -} - -func (doctx *DocTxMsgRequestRand) Type() string { - return constant.Iris_TxTypeRequestRand -} - -func (doctx *DocTxMsgRequestRand) BuildMsg(txMsg interface{}) { - msg := txMsg.(imodel.MsgRequestRand) - doctx.Consumer = msg.Consumer.String() - doctx.BlockInterval = msg.BlockInterval -} diff --git a/model/tx.go b/model/tx.go index 7e0c7a2..37ff45f 100644 --- a/model/tx.go +++ b/model/tx.go @@ -1,142 +1,71 @@ package model import ( - "github.com/irisnet/irishub/app/v1/asset" - "github.com/irisnet/irishub/app/v1/bank" - "github.com/irisnet/irishub/app/v1/distribution" - dtags "github.com/irisnet/irishub/app/v1/distribution/tags" - dtypes "github.com/irisnet/irishub/app/v1/distribution/types" - "github.com/irisnet/irishub/app/v1/gov" - "github.com/irisnet/irishub/app/v1/rand" - "github.com/irisnet/irishub/app/v1/slashing" - "github.com/irisnet/irishub/app/v1/stake" - "github.com/irisnet/irishub/types" "github.com/irisnet/rainbow-sync/db" + "github.com/kaifei-bianjie/msg-parser/types" "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" - "time" ) -type IrisTx struct { - Time time.Time `json:"time" bson:"time"` - Height int64 `json:"height" bson:"height"` - TxHash string `json:"tx_hash" bson:"tx_hash"` - From string `json:"from" bson:"from"` - To string `json:"to" bson:"to"` - Initiator string `json:"initiator" bson:"initiator"` - Amount []*Coin `json:"amount" bson:"amount"` - Type string `json:"type" bson:"type"` - Fee *Fee `json:"fee" bson:"fee"` - ActualFee *ActualFee `json:"actual_fee" bson:"actual_fee"` - Memo string `json:"memo" bson:"memo"` - Status string `json:"status" bson:"status"` - Code uint32 `json:"code" bson:"code"` - Log string `json:"log" bson:"log"` - Tags map[string]string `json:"tags" bson:"tags"` - Msgs []DocTxMsg `bson:"msgs"` +type Tx struct { + Time int64 `bson:"time"` + Height int64 `bson:"height"` + TxHash string `bson:"tx_hash"` + Fee *types.Fee `bson:"fee"` + ActualFee types.Coin `bson:"actual_fee"` + Memo string `bson:"memo"` + Status string `bson:"status"` + Log string `bson:"log"` + Types []string `bson:"types"` + Events []Event `bson:"events"` + Msgs []types.TxMsg `bson:"msgs"` + Signers []string `bson:"signers"` + Addrs []string `bson:"addrs"` + TxIndex uint32 `bson:"tx_index"` + Ext interface{} `bson:"ext"` } -type DocTxMsg struct { - Type string `bson:"type"` - Msg Msg `bson:"msg"` -} - -type Msg interface { - Type() string - BuildMsg(msg interface{}) -} +type ( + Event struct { + Type string `bson:"type" json:"type"` + Attributes []KvPair `bson:"attributes" json:"attributes"` + } + + KvPair struct { + Key string `bson:"key" json:"key"` + Value string `bson:"value" json:"value"` + } + + MsgEvent struct { + MsgIndex int `bson:"msg_index" json:"msg_index"` + Events []Event `bson:"events" json:"events"` + } +) const ( CollectionNameIrisTx = "sync_iris_tx" ) -func (d IrisTx) Name() string { +func (d Tx) Name() string { return CollectionNameIrisTx } -func (d IrisTx) PkKvPair() map[string]interface{} { - return bson.M{} +func (d Tx) PkKvPair() map[string]interface{} { + return bson.M{"height": d.Height, "tx_index": d.TxIndex} } -func (d IrisTx) EnsureIndexes() { +func (d Tx) EnsureIndexes() { var indexes []mgo.Index indexes = append(indexes, mgo.Index{ - Key: []string{"-tx_hash"}, + Key: []string{"-height", "-tx_index"}, Unique: true, Background: true}, mgo.Index{ - Key: []string{"-type"}, - Background: true}, - mgo.Index{ - Key: []string{"-from"}, - Background: true}, - mgo.Index{ - Key: []string{"-to", "-height"}, - Background: true}, - mgo.Index{ - Key: []string{"-initiator"}, + Key: []string{"-tx_hash"}, + Unique: true, Background: true}, ) db.EnsureIndexes(d.Name(), indexes) } - -type ( - MsgTransfer = bank.MsgSend - MsgBurn = bank.MsgBurn - MsgSetMemoRegexp = bank.MsgSetMemoRegexp - - MsgStakeCreate = stake.MsgCreateValidator - MsgStakeEdit = stake.MsgEditValidator - MsgStakeDelegate = stake.MsgDelegate - MsgStakeBeginUnbonding = stake.MsgBeginUnbonding - MsgBeginRedelegate = stake.MsgBeginRedelegate - MsgUnjail = slashing.MsgUnjail - MsgSetWithdrawAddress = dtypes.MsgSetWithdrawAddress - MsgWithdrawDelegatorReward = distribution.MsgWithdrawDelegatorReward - MsgWithdrawDelegatorRewardsAll = distribution.MsgWithdrawDelegatorRewardsAll - MsgWithdrawValidatorRewardsAll = distribution.MsgWithdrawValidatorRewardsAll - - MsgDeposit = gov.MsgDeposit - MsgSubmitProposal = gov.MsgSubmitProposal - MsgSubmitSoftwareUpgradeProposal = gov.MsgSubmitSoftwareUpgradeProposal - MsgSubmitTaxUsageProposal = gov.MsgSubmitCommunityTaxUsageProposal - MsgSubmitTokenAdditionProposal = gov.MsgSubmitTokenAdditionProposal - MsgVote = gov.MsgVote - - MsgRequestRand = rand.MsgRequestRand - - AssetIssueToken = asset.MsgIssueToken - AssetEditToken = asset.MsgEditToken - AssetMintToken = asset.MsgMintToken - AssetTransferTokenOwner = asset.MsgTransferTokenOwner - AssetCreateGateway = asset.MsgCreateGateway - AssetEditGateWay = asset.MsgEditGateway - AssetTransferGatewayOwner = asset.MsgTransferGatewayOwner - - SdkCoins = types.Coins - KVPair = types.KVPair -) - -var ( - TagDistributionReward = dtags.Reward - TagDistributionWithdrawAddr = dtags.WithdrawAddr -) - -type Coin struct { - Denom string `bson:"denom" json:"denom"` - Amount float64 `bson:"amount" json:"amount"` -} - -type Coins []*Coin - -type Fee struct { - Amount Coins `bson:"amount" json:"amount"` - Gas int64 `bson:"gas" json:"gas"` -} - -type ActualFee struct { - Denom string `json:"denom"` - Amount float64 `json:"amount"` -} diff --git a/model/tx_msg.go b/model/tx_msg.go new file mode 100644 index 0000000..cae2a18 --- /dev/null +++ b/model/tx_msg.go @@ -0,0 +1,54 @@ +package model + +import ( + "github.com/irisnet/rainbow-sync/db" + "github.com/kaifei-bianjie/msg-parser/types" + "gopkg.in/mgo.v2" + "gopkg.in/mgo.v2/bson" +) + +type TxMsg struct { + Time int64 `bson:"time"` + TxFee types.Coin `bson:"tx_fee"` + Height int64 `bson:"height"` + TxHash string `bson:"tx_hash"` + Type string `bson:"type"` + MsgIndex int `bson:"msg_index"` + TxIndex uint32 `bson:"tx_index"` + TxStatus string `bson:"tx_status"` + TxMemo string `bson:"tx_memo"` + TxLog string `bson:"tx_log"` + GasUsed int64 `bson:"gas_used"` + GasWanted int64 `bson:"gas_wanted"` + Events []Event `bson:"events"` + Msg types.TxMsg `bson:"msg"` + Addrs []string `bson:"addrs"` + TxAddrs []string `bson:"tx_addrs"` + Signers []string `bson:"signers"` + TxSigners []string `bson:"tx_signers"` +} + +const ( + IrisTxMsgStatus = "tx_status" + CollectionNameIrisTxMsg = "sync_iris_tx_msg" +) + +func (d TxMsg) Name() string { + return CollectionNameIrisTxMsg +} + +func (d TxMsg) PkKvPair() map[string]interface{} { + return bson.M{"tx_hash": d.TxHash, "msg_index": d.MsgIndex} +} + +func (d TxMsg) EnsureIndexes() { + var indexes []mgo.Index + indexes = append(indexes, + mgo.Index{ + Key: []string{"-tx_hash", "-msg_index"}, + Unique: true, + Background: true}, + ) + + db.EnsureIndexes(d.Name(), indexes) +} diff --git a/model/types.go b/model/types.go index a80ea65..a63f60e 100644 --- a/model/types.go +++ b/model/types.go @@ -3,16 +3,15 @@ package model import "github.com/irisnet/rainbow-sync/db" var ( - SyncTaskModel SyncTask - BlockModel Block - TxModel IrisTx - AssetDetailModel IrisAssetDetail + SyncTaskModel SyncTask + BlockModel Block + TxModel Tx Collections = []db.Docs{ SyncTaskModel, BlockModel, TxModel, - AssetDetailModel, + new(TxMsg), } ) diff --git a/script/mongodb.js b/script/mongodb.js deleted file mode 100644 index 672484e..0000000 --- a/script/mongodb.js +++ /dev/null @@ -1,34 +0,0 @@ -// create database and user -// use rainbow-server -// db.createUser( -// { -// user:"iris", -// pwd:"irispassword", -// roles:[{role:"root",db:"admin"}] -// } -// ) -// create table -// db.createCollection("sync_iris_asset_detail"); -// db.createCollection("sync_iris_block"); -// db.createCollection("sync_iris_task"); -// db.createCollection("sync_iris_tx"); - - -// create index -// db.sync_iris_task.createIndex({"status": 1}, {"background": true}); -// db.sync_iris_tx.createIndex({"to": -1, "height": -1}); -// db.sync_iris_asset_detail.createIndex({"to": -1, "height": -1}); -// db.sync_iris_asset_detail.createIndex({"to": -1, "subject": -1}); -// db.sync_iris_block.createIndex({"height": -1}, {"unique": true}); -// db.sync_iris_task.createIndex({"start_height": 1, "end_height": 1}, {"unique": true}); -// -// -// db.sync_iris_tx.createIndex({'from': 1}, {'background': true}); -// db.sync_iris_tx.createIndex({'initiator': 1}, {'background': true}); -// db.sync_iris_tx.createIndex({"type": 1}, {"background": true}); -/* - * remove collection data - */ -// db.sync_iris_asset_detail.deleteMany({}); -// db.sync_block.deleteMany({}); -// db.sync_task.deleteMany({}); \ No newline at end of file diff --git a/task/create.go b/task/create.go index 7019018..260c0b9 100644 --- a/task/create.go +++ b/task/create.go @@ -2,10 +2,9 @@ package task import ( "fmt" - "github.com/irisnet/rainbow-sync/block" "github.com/irisnet/rainbow-sync/conf" model "github.com/irisnet/rainbow-sync/db" - "github.com/irisnet/rainbow-sync/logger" + "github.com/irisnet/rainbow-sync/lib/logger" imodel "github.com/irisnet/rainbow-sync/model" "gopkg.in/mgo.v2/bson" "gopkg.in/mgo.v2/txn" @@ -13,19 +12,18 @@ import ( ) type TaskIrisService struct { - blockType block.Iris_Block syncIrisModel imodel.SyncTask } const maxRecordNumForBatchInsert = 1000 func (s *TaskIrisService) StartCreateTask() { - blockNumPerWorkerHandle := int64(conf.BlockNumPerWorkerHandle) + blockNumPerWorkerHandle := int64(conf.SvrConf.BlockNumPerWorkerHandle) - logger.Info("Start create task", logger.String("Chain Block", s.blockType.Name())) + logger.Info("Start create task") // buffer channel to limit goroutine num - chanLimit := make(chan bool, conf.WorkerNumCreateTask) + chanLimit := make(chan bool, conf.SvrConf.WorkerNumCreateTask) for { chanLimit <- true @@ -44,12 +42,10 @@ func (s *TaskIrisService) createTask(blockNumPerWorkerHandle int64, chanLimit ch defer func() { if err := recover(); err != nil { - logger.Error("Create task failed", logger.Any("err", err), - logger.String("Chain Block", s.blockType.Name())) + logger.Error("Create task failed", logger.Any("err", err)) } <-chanLimit }() - // check valid follow task if exist // status of valid follow task is unhandled or underway validFollowTasks, err := s.syncIrisModel.QueryAll( @@ -58,41 +54,37 @@ func (s *TaskIrisService) createTask(blockNumPerWorkerHandle int64, chanLimit ch model.SyncTaskStatusUnderway, }, model.SyncTaskTypeFollow) if err != nil { - logger.Error("Query sync task failed", logger.String("err", err.Error()), - logger.String("Chain Block", s.blockType.Name())) + logger.Error("Query sync task failed", logger.String("err", err.Error())) return } if len(validFollowTasks) == 0 { // get max end_height from sync_task maxEndHeight, err := s.syncIrisModel.GetMaxBlockHeight() if err != nil { - logger.Error("Get max endBlock failed", logger.String("err", err.Error()), - logger.String("Chain Block", s.blockType.Name())) + logger.Error("Get max endBlock failed", logger.String("err", err.Error())) return } blockChainLatestHeight, err := getBlockChainLatestHeight() if err != nil { - logger.Error("Get current block height failed", logger.String("err", err.Error()), - logger.String("Chain Block", s.blockType.Name())) + logger.Error("Get current block height failed", logger.String("err", err.Error())) return } if maxEndHeight+blockNumPerWorkerHandle <= blockChainLatestHeight { syncIrisTasks = createCatchUpTask(maxEndHeight, blockNumPerWorkerHandle, blockChainLatestHeight) - logMsg = fmt.Sprintf("Create catch up task during follow task not exist,from-to:%v-%v,Chain Block:%v", - maxEndHeight+1, blockChainLatestHeight, s.blockType.Name()) + logMsg = fmt.Sprintf("Create catch up task during follow task not exist,from-to:%v-%v", + maxEndHeight+1, blockChainLatestHeight) } else { finished, err := s.assertAllCatchUpTaskFinished() if err != nil { - logger.Error("AssertAllCatchUpTaskFinished failed", logger.String("err", err.Error()), - logger.String("Chain Block", s.blockType.Name())) + logger.Error("AssertAllCatchUpTaskFinished failed", logger.String("err", err.Error())) return } if finished { syncIrisTasks = createFollowTask(maxEndHeight, blockNumPerWorkerHandle, blockChainLatestHeight) - logMsg = fmt.Sprintf("Create follow task during follow task not exist,from-to:%v-%v,Chain Block:%v", - maxEndHeight+1, blockChainLatestHeight, s.blockType.Name()) + logMsg = fmt.Sprintf("Create follow task during follow task not exist,from-to:%v-%v", + maxEndHeight+1, blockChainLatestHeight) } } } else { @@ -104,8 +96,7 @@ func (s *TaskIrisService) createTask(blockNumPerWorkerHandle int64, chanLimit ch blockChainLatestHeight, err := getBlockChainLatestHeight() if err != nil { - logger.Error("Get blockChain latest height failed", logger.String("err", err.Error()), - logger.String("Chain Block", s.blockType.Name())) + logger.Error("Get blockChain latest height failed", logger.String("err", err.Error())) return } @@ -113,8 +104,8 @@ func (s *TaskIrisService) createTask(blockNumPerWorkerHandle int64, chanLimit ch syncIrisTasks = createCatchUpTask(followedHeight, blockNumPerWorkerHandle, blockChainLatestHeight) invalidFollowTask = followTask - logMsg = fmt.Sprintf("Create catch up task during follow task exist,from-to:%v-%v,invalidFollowTaskId:%v,invalidFollowTaskCurHeight:%v,Chain Block:%v", - followedHeight+1, blockChainLatestHeight, invalidFollowTask.ID.Hex(), invalidFollowTask.CurrentHeight, s.blockType.Name()) + logMsg = fmt.Sprintf("Create catch up task during follow task exist,from-to:%v-%v,invalidFollowTaskId:%v,invalidFollowTaskCurHeight:%v", + followedHeight+1, blockChainLatestHeight, invalidFollowTask.ID.Hex(), invalidFollowTask.CurrentHeight) } } @@ -157,10 +148,9 @@ func (s *TaskIrisService) createTask(blockNumPerWorkerHandle int64, chanLimit ch if len(ops) > 0 { err := model.Txn(ops) if err != nil { - logger.Warn("Create sync task fail", logger.String("err", err.Error()), - logger.String("Chain Block", s.blockType.Name())) + logger.Warn("Create sync task fail", logger.String("err", err.Error())) } else { - logger.Info(fmt.Sprintf("Create sync task success,%v", logMsg), logger.String("Chain Block", s.blockType.Name())) + logger.Info(fmt.Sprintf("Create sync task success,%v", logMsg)) } } diff --git a/task/execute.go b/task/execute.go index 0470dea..f939afb 100644 --- a/task/execute.go +++ b/task/execute.go @@ -1,36 +1,35 @@ package task import ( + "context" "fmt" - "github.com/irisnet/rainbow-sync/logger" - imodel "github.com/irisnet/rainbow-sync/model" + "github.com/irisnet/rainbow-sync/block" "github.com/irisnet/rainbow-sync/conf" model "github.com/irisnet/rainbow-sync/db" - "github.com/irisnet/rainbow-sync/helper" + "github.com/irisnet/rainbow-sync/lib/logger" + "github.com/irisnet/rainbow-sync/lib/pool" + imodel "github.com/irisnet/rainbow-sync/model" + "github.com/irisnet/rainbow-sync/utils" "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" "os" + "strings" "time" - "github.com/irisnet/rainbow-sync/utils" ) func (s *TaskIrisService) StartExecuteTask() { var ( - blockNumPerWorkerHandle = int64(conf.BlockNumPerWorkerHandle) - workerMaxSleepTime = int64(conf.WorkerMaxSleepTime) + blockNumPerWorkerHandle = int64(conf.SvrConf.BlockNumPerWorkerHandle) + workerMaxSleepTime = int64(conf.SvrConf.WorkerMaxSleepTime) ) if workerMaxSleepTime <= 1*60 { logger.Fatal("workerMaxSleepTime shouldn't less than 1 minute") } - logger.Info("Start execute task", logger.String("Chain Block", s.blockType.Name())) + logger.Info("Start execute task") // buffer channel to limit goroutine num - chanLimit := make(chan bool, conf.WorkerNumExecuteTask) - helper.Init(conf.BlockChainMonitorUrl, conf.MaxConnectionNum, conf.InitConnectionNum) - defer func() { - helper.ClosePool() - }() + chanLimit := make(chan bool, conf.SvrConf.WorkerNumExecuteTask) for { chanLimit <- true @@ -52,7 +51,7 @@ func (s *TaskIrisService) executeTask(blockNumPerWorkerHandle, maxWorkerSleepTim healthCheckQuit := make(chan bool) workerId = genWorkerId() - client := helper.GetClient() + client := pool.GetClient() defer func() { if r := recover(); r != nil { @@ -62,7 +61,6 @@ func (s *TaskIrisService) executeTask(blockNumPerWorkerHandle, maxWorkerSleepTim <-chanLimit client.Release() }() - // check whether exist executable task // status = unhandled or // status = underway and now - lastUpdateTime > confTime @@ -82,9 +80,9 @@ func (s *TaskIrisService) executeTask(blockNumPerWorkerHandle, maxWorkerSleepTim if err != nil { if err == mgo.ErrNotFound { // this task has been take over by other goroutine - logger.Info("Task has been take over by other goroutine", logger.String("Chain Block", s.blockType.Name())) + logger.Info("Task has been take over by other goroutine") } else { - logger.Error("Take over task fail", logger.String("Chain Block", s.blockType.Name()), logger.String("err", err.Error())) + logger.Error("Take over task fail", logger.String("err", err.Error())) } return } else { @@ -97,7 +95,7 @@ func (s *TaskIrisService) executeTask(blockNumPerWorkerHandle, maxWorkerSleepTim } else { taskType = model.SyncTaskTypeFollow } - logger.Info("worker begin execute task", logger.String("Chain Block", s.blockType.Name()), + logger.Info("worker begin execute task", logger.String("curWorker", workerId), logger.Any("taskId", task.ID), logger.String("from-to", fmt.Sprintf("%v-%v", task.StartHeight, task.EndHeight))) @@ -108,7 +106,7 @@ func (s *TaskIrisService) executeTask(blockNumPerWorkerHandle, maxWorkerSleepTim workerHealthCheck := func(taskId bson.ObjectId, currentWorker string) { defer func() { if r := recover(); r != nil { - logger.Error("worker health check err", logger.String("Chain Block", s.blockType.Name()), logger.Any("err", r)) + logger.Error("worker health check err", logger.Any("err", r)) } }() @@ -116,7 +114,7 @@ func (s *TaskIrisService) executeTask(blockNumPerWorkerHandle, maxWorkerSleepTim for { select { case <-healthCheckQuit: - logger.Info("get health check quit signal, now exit health check", logger.String("Chain Block", s.blockType.Name())) + logger.Info("get health check quit signal, now exit health check") return default: task, err := s.syncIrisModel.GetTaskByIdAndWorker(taskId, workerId) @@ -124,19 +122,19 @@ func (s *TaskIrisService) executeTask(blockNumPerWorkerHandle, maxWorkerSleepTim if _, valid := assertTaskValid(task, blockNumPerWorkerHandle); valid { // update task last update time if err := s.syncIrisModel.UpdateLastUpdateTime(task); err != nil { - logger.Error("update last update time fail", logger.String("Chain Block", s.blockType.Name()), logger.String("err", err.Error())) + logger.Error("update last update time fail", logger.String("err", err.Error())) } } else { - logger.Info("task is invalid, exit health check", logger.String("Chain Block", s.blockType.Name()), logger.String("taskId", taskId.Hex())) + logger.Info("task is invalid, exit health check", logger.String("taskId", taskId.Hex())) return } } else { if err == mgo.ErrNotFound { - logger.Info("task may be task over by other goroutine, exit health check", logger.String("Chain Block", s.blockType.Name()), + logger.Info("task may be task over by other goroutine, exit health check", logger.String("taskId", taskId.Hex()), logger.String("curWorker", workerId)) return } else { - logger.Error("get task by id and worker fail", logger.String("Chain Block", s.blockType.Name()), logger.String("taskId", taskId.Hex()), + logger.Error("get task by id and worker fail", logger.String("taskId", taskId.Hex()), logger.String("curWorker", workerId)) } } @@ -160,8 +158,9 @@ func (s *TaskIrisService) executeTask(blockNumPerWorkerHandle, maxWorkerSleepTim } // if inProcessBlock > blockChainLatestHeight, should wait blockChainLatestHeight update - if taskType == model.SyncTaskTypeFollow && inProcessBlock > blockChainLatestHeight { - logger.Info("wait blockChain latest height update.", logger.String("Chain Block", s.blockType.Name()), + if taskType == model.SyncTaskTypeFollow && inProcessBlock+int64(conf.SvrConf.BehindBlockNum) > blockChainLatestHeight { + logger.Info(fmt.Sprintf("wait blockChain latest height update, must interval %v block", + conf.SvrConf.BehindBlockNum), logger.Int64("curSyncedHeight", inProcessBlock-1), logger.Int64("blockChainLatestHeight", blockChainLatestHeight)) time.Sleep(2 * time.Second) @@ -171,16 +170,21 @@ func (s *TaskIrisService) executeTask(blockNumPerWorkerHandle, maxWorkerSleepTim } // parse data from block - blockDoc, assetDetailDocs, txDocs, err := s.blockType.ParseBlock(inProcessBlock, client) + blockDoc, txDocs, txMsgs, err := block.ParseBlock(inProcessBlock, client) if err != nil { - logger.Error("Parse block fail", logger.String("Chain Block", s.blockType.Name()), logger.Int64("block", inProcessBlock), + logger.Error("Parse block fail", + logger.Int64("height", inProcessBlock), + logger.String("errTag", utils.GetErrTag(err)), logger.String("err", err.Error())) + //continue to assert task is valid + blockChainLatestHeight, isValid = assertTaskValid(task, blockNumPerWorkerHandle) + continue } // check task owner workerUnchanged, err := assertTaskWorkerUnchanged(task.ID, task.WorkerId) if err != nil { - logger.Error("assert task worker is unchanged fail", logger.String("Chain Block", s.blockType.Name()), logger.String("err", err.Error())) + logger.Error("assert task worker is unchanged fail", logger.String("err", err.Error())) } if workerUnchanged { // save data and update sync task @@ -192,9 +196,16 @@ func (s *TaskIrisService) executeTask(blockNumPerWorkerHandle, maxWorkerSleepTim taskDoc.Status = model.SyncTaskStatusCompleted } - err := s.blockType.SaveDocsWithTxn(blockDoc, assetDetailDocs, txDocs, taskDoc) + err := block.SaveDocsWithTxn(blockDoc, txDocs, txMsgs, taskDoc) if err != nil { - logger.Error("save docs fail", logger.String("Chain Block", s.blockType.Name()), logger.String("err", err.Error())) + if !strings.Contains(err.Error(), utils.ErrDbNotFindTransaction) { + logger.Error("save docs fail", + logger.Int64("height", inProcessBlock), + logger.String("err", err.Error())) + //continue to assert task is valid + blockChainLatestHeight, isValid = assertTaskValid(task, blockNumPerWorkerHandle) + continue + } } else { task.CurrentHeight = inProcessBlock } @@ -202,13 +213,13 @@ func (s *TaskIrisService) executeTask(blockNumPerWorkerHandle, maxWorkerSleepTim // continue to assert task is valid blockChainLatestHeight, isValid = assertTaskValid(task, blockNumPerWorkerHandle) } else { - logger.Info("task worker changed", logger.String("Chain Block", s.blockType.Name()), logger.Any("task_id", task.ID), + logger.Info("task worker changed", logger.Any("task_id", task.ID), logger.String("origin worker", workerId), logger.String("current worker", task.WorkerId)) return } } - logger.Info("worker finish execute task", logger.String("Chain Block", s.blockType.Name()), + logger.Info("worker finish execute task", logger.String("task_worker", task.WorkerId), logger.Any("task_id", task.ID), logger.String("from-to-current", fmt.Sprintf("%v-%v-%v", task.StartHeight, task.EndHeight, task.CurrentHeight))) } @@ -273,11 +284,11 @@ func assertTaskWorkerUnchanged(taskId bson.ObjectId, workerId string) (bool, err // get current block height func getBlockChainLatestHeight() (int64, error) { - client := helper.GetClient() + client := pool.GetClient() defer func() { client.Release() }() - status, err := client.Status() + status, err := client.Status(context.Background()) if err != nil { return 0, err } diff --git a/task/start.go b/task/start.go index 781401f..7528655 100644 --- a/task/start.go +++ b/task/start.go @@ -1,10 +1,7 @@ package task -import "github.com/irisnet/rainbow-sync/cron" - func Start() { synctask := new(TaskIrisService) go synctask.StartCreateTask() go synctask.StartExecuteTask() - go new(cron.CronService).StartCronService() } diff --git a/utils/constant.go b/utils/constant.go new file mode 100644 index 0000000..a6f94e7 --- /dev/null +++ b/utils/constant.go @@ -0,0 +1,10 @@ +package utils + +const ( + TxStatusSuccess = "success" + TxStatusFail = "fail" + NoSupportMsgTypeTag = "no support msg parse" + + //cannot find transaction 601bf70ccdee4dde1c8be0d2_f018677a in queue for document {sync_task ObjectIdHex(\"601bdb0ccdee4dd7c214d167\")} + ErrDbNotFindTransaction = "cannot find transaction" +) diff --git a/utils/utils.go b/utils/utils.go index 756f19e..5e43418 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -1,147 +1,30 @@ package utils import ( - "strings" "encoding/hex" - "strconv" - "github.com/irisnet/irishub/codec" - "github.com/irisnet/irishub/modules/auth" - abci "github.com/tendermint/tendermint/abci/types" - imodel "github.com/irisnet/rainbow-sync/model" - "github.com/irisnet/rainbow-sync/helper" - "github.com/irisnet/rainbow-sync/constant" - "github.com/irisnet/rainbow-sync/logger" + "encoding/json" "fmt" - "regexp" - "github.com/irisnet/irishub/app" - "github.com/irisnet/irishub/types" - "github.com/irisnet/rainbow-sync/conf" - "time" + "github.com/irisnet/rainbow-sync/lib/logger" "math/rand" + "strconv" + "strings" + "time" ) -var ( - cdc *codec.Codec -) - -// 初始化账户地址前缀 -func init() { - if conf.IrisNetwork == types.Mainnet { - types.SetNetworkType(types.Mainnet) - } - cdc = app.MakeLatestCodec() -} - -func GetCodec() *codec.Codec { - return cdc -} - func BuildHex(bytes []byte) string { return strings.ToUpper(hex.EncodeToString(bytes)) } -func ParseCoins(coinsStr string) (coins imodel.Coins) { - coinsStr = strings.TrimSpace(coinsStr) - if len(coinsStr) == 0 { - return - } - - coinStrs := strings.Split(coinsStr, ",") - for _, coinStr := range coinStrs { - coin := ParseCoin(coinStr) - coins = append(coins, coin) - } - return coins -} - -func ParseCoin(coinStr string) (coin *imodel.Coin) { - var ( - reDnm = `[A-Za-z0-9]{2,}\S*` - reAmt = `[0-9]+[.]?[0-9]*` - reSpc = `[[:space:]]*` - reCoin = regexp.MustCompile(fmt.Sprintf(`^(%s)%s(%s)$`, reAmt, reSpc, reDnm)) - ) - - coinStr = strings.TrimSpace(coinStr) - - matches := reCoin.FindStringSubmatch(coinStr) - if matches == nil { - logger.Error("invalid coin expression", logger.Any("coin", coinStr)) - return coin - } - denom, amount := matches[2], matches[1] - - amount = getPrecision(amount) - amt, err := strconv.ParseFloat(amount, 64) - if err != nil { - logger.Error("Convert str to int failed", logger.Any("amount", amount)) - return coin - } - - return &imodel.Coin{ - Denom: denom, - Amount: amt, - } -} - -func getPrecision(amount string) string { - length := len(amount) - if length > 15 { - nums := strings.Split(amount, ".") - if len(nums) > 2 { - return amount - } - - if len_num0 := len(nums[0]); len_num0 > 15 { - amount = string([]byte(nums[0])[:15]) - for i := 1; i <= len_num0-15; i++ { - amount += "0" - } - } else { - //leng_num1 := len(nums[1]) - leng_append := 16 - len_num0 - amount = nums[0] + "." + string([]byte(nums[1])[:leng_append]) - //for i := 1; i <= leng_num1-leng_append; i++ { - // amount += "0" - //} - } - } - return amount +func ConvertErr(height int64, txHash, errTag string, err error) error { + return fmt.Errorf("%v-%v-%v-%v", err.Error(), errTag, height, txHash) } -func BuildFee(fee auth.StdFee) *imodel.Fee { - return &imodel.Fee{ - Amount: ParseCoins(fee.Amount.String()), - Gas: int64(fee.Gas), +func GetErrTag(err error) string { + slice := strings.Split(err.Error(), "-") + if len(slice) == 4 { + return slice[1] } -} - -// get tx status and log by query txHash -func QueryTxResult(txHash []byte) (string, abci.ResponseDeliverTx, error) { - var resDeliverTx abci.ResponseDeliverTx - status := constant.TxStatusSuccess - - client := helper.GetClient() - defer client.Release() - - res, err := client.Tx(txHash, false) - if err != nil { - logger.Warn("QueryTxResult have error, now try again", logger.String("err", err.Error())) - time.Sleep(time.Duration(1) * time.Second) - var err1 error - client2 := helper.GetClient() - res, err1 = client2.Tx(txHash, false) - client2.Release() - if err1 != nil { - return "unknown", resDeliverTx, err1 - } - } - result := res.TxResult - if result.Code != 0 { - status = constant.TxStatusFail - } - - return status, result, nil + return "" } func Min(x, y int64) int64 { @@ -182,3 +65,12 @@ func RandInt(n int) int { rand.NewSource(time.Now().Unix()) return rand.Intn(n) } + +func MarshalJsonIgnoreErr(v interface{}) string { + data, _ := json.Marshal(v) + return string(data) +} + +func UnMarshalJsonIgnoreErr(data string, v interface{}) { + json.Unmarshal([]byte(data), &v) +} diff --git a/utils/utils_test.go b/utils/utils_test.go index 57c1c86..d4b585b 100644 --- a/utils/utils_test.go +++ b/utils/utils_test.go @@ -1,50 +1 @@ package utils - -import ( - "testing" - "fmt" - "strconv" -) - -func Test_getPrecision(t *testing.T) { - exam1 := "4999999999999999999999" - exam2 := "49999999999999999999.99" - exam3 := "49999999.999999.99999" - exam4 := "49999999.999999" - exam5 := "4999999999999.9999999" - - data := getPrecision(exam1) - if data == "4999999999999990000000" { - t.Log("OK") - } else { - t.Fatal("Failed") - } - data = getPrecision(exam2) - if data == "49999999999999900000" { - t.Log("OK") - - } else { - t.Fatal("Failed") - } - data = getPrecision(exam3) - if data == "49999999.999999.99999" { - t.Log("OK") - } else { - t.Fatal("Failed") - } - data = getPrecision(exam4) - if data == "49999999.999999" { - t.Log("OK") - } else { - t.Fatal("Failed") - } - data = getPrecision(exam5) - fmt.Println(data) - amt, _ := strconv.ParseFloat(data, 64) - fmt.Println(amt) - if data == "4999999999999.999" { - t.Log("OK") - } else { - t.Fatal("Failed") - } -}