diff --git a/api/api.go b/api/api.go index 4e70acc..7bfbaea 100644 --- a/api/api.go +++ b/api/api.go @@ -65,141 +65,9 @@ func init() { docs.SwaggerInfo.BasePath = BasePath } -// dashboardHandler godoc -// -// @Summary Statistics dashboard -// @Description Query statistics dashboard includes `storage fee` and `log sync height` -// @Tags (deprecated)statistic -// @Produce json -// @Success 200 {object} api.BusinessError{Data=Dashboard} -// @Failure 600 {object} api.BusinessError -// @Router /statistic/dashboard [get] -func dashboardHandler(c *gin.Context) { - api.Wrap(dashboard)(c) -} - -// listTxStatHandler godoc -// -// @Summary Transaction statistics -// @Description Query transaction statistics, including incremental and full data, and support querying at hourly or daily time intervals -// @Tags (deprecated)statistic -// @Accept json -// @Produce json -// @Param skip query int false "The number of skipped records, usually it's pageSize * (pageNumber - 1)" minimum(0) default(0) -// @Param limit query int false "The number of records displayed on the page" minimum(1) maximum(2000) default(10) -// @Param minTimestamp query int false "Timestamp in seconds" -// @Param maxTimestamp query int false "Timestamp in seconds" -// @Param intervalType query string false "Statistics interval" Enums(hour, day) default(day) -// @Param sort query string false "Sort by timestamp" Enums(asc, desc) default(desc) -// @Success 200 {object} api.BusinessError{Data=TxStatList} -// @Failure 600 {object} api.BusinessError -// @Router /statistic/transaction/list [get] -func listTxStatHandler(c *gin.Context) { - api.Wrap(listTxStat)(c) -} - -// listDataStatHandler godoc -// -// @Summary Data storage statistics -// @Description Query data storage statistics, including incremental and full data, and support querying at hourly or daily time intervals -// @Tags (deprecated)statistic -// @Accept json -// @Produce json -// @Param skip query int false "The number of skipped records, usually it's pageSize * (pageNumber - 1)" minimum(0) default(0) -// @Param limit query int false "The number of records displayed on the page" minimum(1) maximum(2000) default(10) -// @Param minTimestamp query int false "Timestamp in seconds" -// @Param maxTimestamp query int false "Timestamp in seconds" -// @Param intervalType query string false "Statistics interval" Enums(hour, day) default(day) -// @Param sort query string false "Sort by timestamp" Enums(asc, desc) default(desc) -// @Success 200 {object} api.BusinessError{Data=DataStatList} -// @Failure 600 {object} api.BusinessError -// @Router /statistic/storage/list [get] -func listDataStatHandler(c *gin.Context) { - api.Wrap(listDataStat)(c) -} - -// listFeeStatHandler godoc -// -// @Summary fee statistics -// @Description Query fee statistics, including incremental and full data, and support querying at hourly or daily time intervals -// @Tags (deprecated)statistic -// @Accept json -// @Produce json -// @Param skip query int false "The number of skipped records, usually it's pageSize * (pageNumber - 1)" minimum(0) default(0) -// @Param limit query int false "The number of records displayed on the page" minimum(1) maximum(2000) default(10) -// @Param minTimestamp query int false "Timestamp in seconds" -// @Param maxTimestamp query int false "Timestamp in seconds" -// @Param intervalType query string false "Statistics interval" Enums(hour, day) default(day) -// @Param sort query string false "Sort by timestamp" Enums(asc, desc) default(desc) -// @Success 200 {object} api.BusinessError{Data=FeeStatList} -// @Failure 600 {object} api.BusinessError -// @Router /statistic/fee/list [get] -func listFeeStatHandler(c *gin.Context) { - api.Wrap(listFeeStat)(c) -} - -// listTxHandler godoc -// -// @Summary Layer2 transaction list -// @Description Query layer2 transactions, support address and root hash filter -// @Tags (deprecated)transaction -// @Accept json -// @Produce json -// @Param skip query int false "The number of skipped records, usually it's pageSize * (pageNumber - 1)" minimum(0) default(0) -// @Param limit query int false "The number of records displayed on the page" minimum(1) maximum(100) default(10) -// @Param address query string false "The submitter address of the uploaded file" -// @Param rootHash query string false "The merkle root hash of the uploaded file" -// @Success 200 {object} api.BusinessError{Data=TxList} -// @Failure 600 {object} api.BusinessError -// @Router /transaction/list [get] -func listTxHandler(c *gin.Context) { - api.Wrap(listTx)(c) -} - -// getTxBriefHandler godoc -// -// @Summary Layer2 transaction overview -// @Description Query layer2 transaction overview by txSeq -// @Tags (deprecated)transaction -// @Accept json -// @Produce json -// @Param txSeq query string true "Lay2 transaction sequence number" -// @Success 200 {object} api.BusinessError{Data=TxBrief} -// @Failure 600 {object} api.BusinessError -// @Router /transaction/brief [get] -func getTxBriefHandler(c *gin.Context) { - api.Wrap(getTxBrief)(c) -} - -// getTxDetailHandler godoc -// -// @Summary Layer2 transaction advanced info -// @Description Query layer2 transaction advanced info by txSeq -// @Tags (deprecated)transaction -// @Accept json -// @Produce json -// @Param txSeq query string true "Lay2 transaction sequence number" -// @Success 200 {object} api.BusinessError{Data=TxDetail} -// @Failure 600 {object} api.BusinessError -// @Router /transaction/detail [get] -func getTxDetailHandler(c *gin.Context) { - api.Wrap(getTxDetail)(c) -} - func RegisterRouter(router *gin.Engine) { apiRoute := router.Group(BasePath) - statRoute := apiRoute.Group("/statistic") - statRoute.GET("dashboard", dashboardHandler) - statRoute.GET("transaction/list", listTxStatHandler) - statRoute.GET("storage/list", listDataStatHandler) - statRoute.GET("fee/list", listFeeStatHandler) - - txRoute := apiRoute.Group("/transaction") - txRoute.GET("list", listTxHandler) - txRoute.GET("brief", getTxBriefHandler) - txRoute.GET("detail", getTxDetailHandler) - statsRoute := apiRoute.Group("/stats") statsRoute.GET("summary", summaryHandler) statsRoute.GET("layer1-tx", listTxStatsHandler) diff --git a/api/stat_api.go b/api/stat_api.go index 4392a7a..f048136 100644 --- a/api/stat_api.go +++ b/api/stat_api.go @@ -17,40 +17,6 @@ const ( FeeStatType ) -func dashboard(_ *gin.Context) (interface{}, error) { - value, exist, err := db.ConfigStore.Get(store.KeyLogSyncInfo) - if err != nil { - return nil, commonApi.ErrInternal(err) - } - if !exist { - return nil, ErrConfigNotFound - } - - var logSyncInfo stat.LogSyncInfo - if err := json.Unmarshal([]byte(value), &logSyncInfo); err != nil { - return nil, commonApi.ErrInternal(err) - } - - submitStat, err := db.SubmitStatStore.LastByType(store.Day) - if err != nil { - return nil, commonApi.ErrInternal(err) - } - if submitStat == nil { - return nil, ErrStorageBaseFeeNotStat - } - - storageBasicCost := StorageBasicCost{ - TokenInfo: *chargeToken, - BasicCostTotal: submitStat.BaseFeeTotal, - } - result := Dashboard{ - StorageBasicCost: storageBasicCost, - LogSyncInfo: logSyncInfo, - } - - return result, nil -} - func listDataStat(c *gin.Context) (interface{}, error) { return getSubmitStatByType(c, StorageStatType) } diff --git a/api/tx_api.go b/api/tx_api.go index e5026c1..da98f00 100644 --- a/api/tx_api.go +++ b/api/tx_api.go @@ -4,7 +4,6 @@ import ( "encoding/json" "strconv" - "github.com/0glabs/0g-storage-client/core" "github.com/0glabs/0g-storage-scan/store" commonApi "github.com/Conflux-Chain/go-conflux-util/api" "github.com/ethereum/go-ethereum/common" @@ -13,150 +12,6 @@ import ( "github.com/sirupsen/logrus" ) -func listTx(c *gin.Context) (interface{}, error) { - var param listTxParam - if err := c.ShouldBind(¶m); err != nil { - return nil, err - } - - var addrIDPtr *uint64 - if param.Address != nil { - addr, exist, err := db.AddressStore.Get(*param.Address) - if err != nil { - return nil, commonApi.ErrInternal(err) - } - if !exist { - return TxList{}, nil - } - addrIDPtr = &addr.ID - } - - total, submits, err := listSubmits(addrIDPtr, param.RootHash, param.isDesc(), param.Skip, param.Limit) - if err != nil { - return nil, err - } - - addrIDs := make([]uint64, 0) - for _, submit := range submits { - addrIDs = append(addrIDs, submit.SenderID) - } - addrMap, err := db.BatchGetAddresses(addrIDs) - if err != nil { - return nil, err - } - - storageTxs := make([]StorageTx, 0) - for _, submit := range submits { - storageTx := StorageTx{ - TxSeq: submit.SubmissionIndex, - BlockNum: submit.BlockNumber, - TxHash: submit.TxHash, - RootHash: submit.RootHash, - Address: addrMap[submit.SenderID].Address, - Method: "submit", - Status: submit.Status, - Timestamp: submit.BlockTime.Unix(), - DataSize: submit.Length, - BaseFee: submit.Fee, - } - storageTxs = append(storageTxs, storageTx) - } - - return TxList{ - Total: total, - List: storageTxs, - }, nil -} - -func getTxBrief(c *gin.Context) (interface{}, error) { - var param queryTxParam - if err := c.ShouldBind(¶m); err != nil { - return nil, err - } - - var submit store.Submit - exist, err := db.Store.Exists(&submit, "submission_index = ?", param.TxSeq) - if err != nil { - logrus.WithError(err).Error("Failed to query databases") - return nil, errors.Errorf("Biz error, txSeq %v", *param.TxSeq) - } - if !exist { - return nil, errors.Errorf("Record not found, txSeq %v", *param.TxSeq) - } - - addrIDs := []uint64{submit.SenderID} - addrMap, err := db.BatchGetAddresses(addrIDs) - if err != nil { - return nil, err - } - - result := TxBrief{ - TxSeq: strconv.FormatUint(submit.SubmissionIndex, 10), - From: addrMap[submit.SenderID].Address, - Method: "submit", - RootHash: submit.RootHash, - Status: submit.Status, - DataSize: submit.Length, - CostInfo: &CostInfo{ - TokenInfo: *chargeToken, - BasicCost: submit.Fee, - }, - BlockNumber: submit.BlockNumber, - TxHash: submit.TxHash, - Timestamp: uint64(submit.BlockTime.Unix()), - } - - hash := common.HexToHash(submit.TxHash) - tx, err := sdk.Eth.TransactionByHash(hash) - if err != nil { - logrus.WithError(err).WithField("txSeq", param.TxSeq).Error("Failed to get transaction") - return nil, errors.Errorf("Get tx error, txSeq %v", param.TxSeq) - } - rcpt, err := sdk.Eth.TransactionReceipt(hash) - if err != nil { - logrus.WithError(err).WithField("txSeq", param.TxSeq).Error("Failed to get receipt") - return nil, errors.Errorf("Get receitp error, txSeq %v", param.TxSeq) - } - result.GasFee = tx.GasPrice.Uint64() * rcpt.GasUsed - result.GasUsed = rcpt.GasUsed - result.GasLimit = tx.Gas - - return result, nil -} - -func getTxDetail(c *gin.Context) (interface{}, error) { - var param queryTxParam - if err := c.ShouldBind(¶m); err != nil { - return nil, err - } - - var submit store.Submit - exist, err := db.Exists(&submit, "submission_index = ?", param.TxSeq) - if err != nil { - logrus.WithError(err).Error("Failed to query databases") - return nil, errors.Errorf("Biz error, txSeq %v", *param.TxSeq) - } - if !exist { - return nil, errors.Errorf("Record not found, txSeq %v", *param.TxSeq) - } - - var extra store.SubmitExtra - if err := json.Unmarshal(submit.Extra, &extra); err != nil { - logrus.WithError(err).Error("Failed to unmarshal submit extra") - return nil, errors.Errorf("Unmarshal submit extra error, txSeq %v", *param.TxSeq) - } - - result := TxDetail{ - TxSeq: strconv.FormatUint(submit.SubmissionIndex, 10), - RootHash: submit.RootHash, - StartPos: extra.StartPos.Uint64(), - EndPos: extra.StartPos.Uint64() + submit.Length, - PieceCounts: (submit.Length-1)/core.DefaultSegmentSize + 1, - } - - return result, nil -} - func listSubmits(addressID *uint64, rootHash *string, idDesc bool, skip, limit int) (int64, []store.Submit, error) { if addressID == nil { return db.SubmitStore.List(rootHash, idDesc, skip, limit) diff --git a/docs/docs.go b/docs/docs.go index 3ca094e..6563992 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -87,326 +87,6 @@ const docTemplate = `{ } } }, - "/statistic/dashboard": { - "get": { - "description": "Query statistics dashboard includes ` + "`" + `storage fee` + "`" + ` and ` + "`" + `log sync height` + "`" + `", - "produces": [ - "application/json" - ], - "tags": [ - "(deprecated)statistic" - ], - "summary": "Statistics dashboard", - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/api.BusinessError" - }, - { - "type": "object", - "properties": { - "Data": { - "$ref": "#/definitions/api.Dashboard" - } - } - } - ] - } - }, - "600": { - "description": "", - "schema": { - "$ref": "#/definitions/api.BusinessError" - } - } - } - } - }, - "/statistic/fee/list": { - "get": { - "description": "Query fee statistics, including incremental and full data, and support querying at hourly or daily time intervals", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "(deprecated)statistic" - ], - "summary": "fee statistics", - "parameters": [ - { - "minimum": 0, - "type": "integer", - "default": 0, - "description": "The number of skipped records, usually it's pageSize * (pageNumber - 1)", - "name": "skip", - "in": "query" - }, - { - "maximum": 2000, - "minimum": 1, - "type": "integer", - "default": 10, - "description": "The number of records displayed on the page", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Timestamp in seconds", - "name": "minTimestamp", - "in": "query" - }, - { - "type": "integer", - "description": "Timestamp in seconds", - "name": "maxTimestamp", - "in": "query" - }, - { - "enum": [ - "hour", - "day" - ], - "type": "string", - "default": "day", - "description": "Statistics interval", - "name": "intervalType", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "default": "desc", - "description": "Sort by timestamp", - "name": "sort", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/api.BusinessError" - }, - { - "type": "object", - "properties": { - "Data": { - "$ref": "#/definitions/api.FeeStatList" - } - } - } - ] - } - }, - "600": { - "description": "", - "schema": { - "$ref": "#/definitions/api.BusinessError" - } - } - } - } - }, - "/statistic/storage/list": { - "get": { - "description": "Query data storage statistics, including incremental and full data, and support querying at hourly or daily time intervals", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "(deprecated)statistic" - ], - "summary": "Data storage statistics", - "parameters": [ - { - "minimum": 0, - "type": "integer", - "default": 0, - "description": "The number of skipped records, usually it's pageSize * (pageNumber - 1)", - "name": "skip", - "in": "query" - }, - { - "maximum": 2000, - "minimum": 1, - "type": "integer", - "default": 10, - "description": "The number of records displayed on the page", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Timestamp in seconds", - "name": "minTimestamp", - "in": "query" - }, - { - "type": "integer", - "description": "Timestamp in seconds", - "name": "maxTimestamp", - "in": "query" - }, - { - "enum": [ - "hour", - "day" - ], - "type": "string", - "default": "day", - "description": "Statistics interval", - "name": "intervalType", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "default": "desc", - "description": "Sort by timestamp", - "name": "sort", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/api.BusinessError" - }, - { - "type": "object", - "properties": { - "Data": { - "$ref": "#/definitions/api.DataStatList" - } - } - } - ] - } - }, - "600": { - "description": "", - "schema": { - "$ref": "#/definitions/api.BusinessError" - } - } - } - } - }, - "/statistic/transaction/list": { - "get": { - "description": "Query transaction statistics, including incremental and full data, and support querying at hourly or daily time intervals", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "(deprecated)statistic" - ], - "summary": "Transaction statistics", - "parameters": [ - { - "minimum": 0, - "type": "integer", - "default": 0, - "description": "The number of skipped records, usually it's pageSize * (pageNumber - 1)", - "name": "skip", - "in": "query" - }, - { - "maximum": 2000, - "minimum": 1, - "type": "integer", - "default": 10, - "description": "The number of records displayed on the page", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Timestamp in seconds", - "name": "minTimestamp", - "in": "query" - }, - { - "type": "integer", - "description": "Timestamp in seconds", - "name": "maxTimestamp", - "in": "query" - }, - { - "enum": [ - "hour", - "day" - ], - "type": "string", - "default": "day", - "description": "Statistics interval", - "name": "intervalType", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "default": "desc", - "description": "Sort by timestamp", - "name": "sort", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/api.BusinessError" - }, - { - "type": "object", - "properties": { - "Data": { - "$ref": "#/definitions/api.TxStatList" - } - } - } - ] - } - }, - "600": { - "description": "", - "schema": { - "$ref": "#/definitions/api.BusinessError" - } - } - } - } - }, "/stats/fee": { "get": { "description": "Query fee statistics, including incremental and full data, and support querying at hourly or daily time intervals", @@ -639,164 +319,26 @@ const docTemplate = `{ "in": "query" }, { - "enum": [ - "hour", - "day" - ], - "type": "string", - "default": "day", - "description": "Statistics interval", - "name": "intervalType", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "default": "desc", - "description": "Sort by timestamp", - "name": "sort", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/api.BusinessError" - }, - { - "type": "object", - "properties": { - "Data": { - "$ref": "#/definitions/api.DataStatList" - } - } - } - ] - } - }, - "600": { - "description": "", - "schema": { - "$ref": "#/definitions/api.BusinessError" - } - } - } - } - }, - "/stats/summary": { - "get": { - "description": "Query statistics summary includes ` + "`" + `storage fee` + "`" + ` and ` + "`" + `log sync height` + "`" + `", - "produces": [ - "application/json" - ], - "tags": [ - "statistic" - ], - "summary": "Statistics summary", - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/api.BusinessError" - }, - { - "type": "object", - "properties": { - "Data": { - "$ref": "#/definitions/api.Summary" - } - } - } - ] - } - }, - "600": { - "description": "", - "schema": { - "$ref": "#/definitions/api.BusinessError" - } - } - } - } - }, - "/transaction/brief": { - "get": { - "description": "Query layer2 transaction overview by txSeq", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "(deprecated)transaction" - ], - "summary": "Layer2 transaction overview", - "parameters": [ - { - "type": "string", - "description": "Lay2 transaction sequence number", - "name": "txSeq", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/api.BusinessError" - }, - { - "type": "object", - "properties": { - "Data": { - "$ref": "#/definitions/api.TxBrief" - } - } - } - ] - } - }, - "600": { - "description": "", - "schema": { - "$ref": "#/definitions/api.BusinessError" - } - } - } - } - }, - "/transaction/detail": { - "get": { - "description": "Query layer2 transaction advanced info by txSeq", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "(deprecated)transaction" - ], - "summary": "Layer2 transaction advanced info", - "parameters": [ + "enum": [ + "hour", + "day" + ], + "type": "string", + "default": "day", + "description": "Statistics interval", + "name": "intervalType", + "in": "query" + }, { + "enum": [ + "asc", + "desc" + ], "type": "string", - "description": "Lay2 transaction sequence number", - "name": "txSeq", - "in": "query", - "required": true + "default": "desc", + "description": "Sort by timestamp", + "name": "sort", + "in": "query" } ], "responses": { @@ -811,7 +353,7 @@ const docTemplate = `{ "type": "object", "properties": { "Data": { - "$ref": "#/definitions/api.TxDetail" + "$ref": "#/definitions/api.DataStatList" } } } @@ -827,50 +369,16 @@ const docTemplate = `{ } } }, - "/transaction/list": { + "/stats/summary": { "get": { - "description": "Query layer2 transactions, support address and root hash filter", - "consumes": [ - "application/json" - ], + "description": "Query statistics summary includes ` + "`" + `storage fee` + "`" + ` and ` + "`" + `log sync height` + "`" + `", "produces": [ "application/json" ], "tags": [ - "(deprecated)transaction" - ], - "summary": "Layer2 transaction list", - "parameters": [ - { - "minimum": 0, - "type": "integer", - "default": 0, - "description": "The number of skipped records, usually it's pageSize * (pageNumber - 1)", - "name": "skip", - "in": "query" - }, - { - "maximum": 100, - "minimum": 1, - "type": "integer", - "default": 10, - "description": "The number of records displayed on the page", - "name": "limit", - "in": "query" - }, - { - "type": "string", - "description": "The submitter address of the uploaded file", - "name": "address", - "in": "query" - }, - { - "type": "string", - "description": "The merkle root hash of the uploaded file", - "name": "rootHash", - "in": "query" - } + "statistic" ], + "summary": "Statistics summary", "responses": { "200": { "description": "OK", @@ -883,7 +391,7 @@ const docTemplate = `{ "type": "object", "properties": { "Data": { - "$ref": "#/definitions/api.TxList" + "$ref": "#/definitions/api.Summary" } } } @@ -1023,46 +531,6 @@ const docTemplate = `{ } } }, - "api.CostInfo": { - "description": "Charge fee information", - "type": "object", - "properties": { - "basicCost": { - "description": "Charge fee", - "type": "number" - }, - "tokenInfo": { - "description": "Charge token info", - "allOf": [ - { - "$ref": "#/definitions/api.TokenInfo" - } - ] - } - } - }, - "api.Dashboard": { - "description": "Storage status information", - "type": "object", - "properties": { - "logSyncInfo": { - "description": "Synchronization information of submit event", - "allOf": [ - { - "$ref": "#/definitions/stat.LogSyncInfo" - } - ] - }, - "storageBasicCost": { - "description": "Storage fee information", - "allOf": [ - { - "$ref": "#/definitions/api.StorageBasicCost" - } - ] - } - } - }, "api.DataStat": { "description": "Storage data information", "type": "object", @@ -1141,36 +609,6 @@ const docTemplate = `{ } } }, - "api.StorageBasicCost": { - "description": "Storage fee information", - "type": "object", - "properties": { - "address": { - "description": "The address of the token contract", - "type": "string" - }, - "basicCostTotal": { - "description": "Total storage fee", - "type": "number" - }, - "decimals": { - "description": "Token decimals", - "type": "integer" - }, - "name": { - "description": "Token name", - "type": "string" - }, - "native": { - "description": "True is native token, otherwise is not", - "type": "boolean" - }, - "symbol": { - "description": "Token symbol", - "type": "string" - } - } - }, "api.StorageFeeStat": { "description": "Stat storage fee information", "type": "object", @@ -1189,52 +627,6 @@ const docTemplate = `{ } } }, - "api.StorageTx": { - "description": "Submission information", - "type": "object", - "properties": { - "address": { - "description": "File uploader address", - "type": "string" - }, - "baseFee": { - "description": "The storage fee required to upload the file", - "type": "number" - }, - "blockNum": { - "description": "The block where the submit event is emitted", - "type": "integer" - }, - "dataSize": { - "description": "File size in bytes", - "type": "integer" - }, - "method": { - "description": "The name of the submit event is always ` + "`" + `submit` + "`" + `", - "type": "string" - }, - "rootHash": { - "description": "Merkle root of the file to upload", - "type": "string" - }, - "status": { - "description": "File upload status, 0-not uploaded,1-uploading,2-uploaded", - "type": "integer" - }, - "timestamp": { - "description": "The block time when submit event emits", - "type": "integer" - }, - "txHash": { - "description": "The transaction where the submit event is emitted", - "type": "string" - }, - "txSeq": { - "description": "Submission index in submit event", - "type": "integer" - } - } - }, "api.StorageTxDetail": { "description": "Submission transaction information", "type": "object", @@ -1428,115 +820,6 @@ const docTemplate = `{ } } }, - "api.TxBrief": { - "description": "Submission brief information", - "type": "object", - "properties": { - "blockNumber": { - "description": "The block where the submit event is emitted", - "type": "integer" - }, - "costInfo": { - "description": "Charge fee information", - "allOf": [ - { - "$ref": "#/definitions/api.CostInfo" - } - ] - }, - "dataSize": { - "description": "File size in bytes", - "type": "integer" - }, - "expiration": { - "description": "Expiration date of the uploaded file", - "type": "integer" - }, - "from": { - "description": "File uploader address", - "type": "string" - }, - "gasFee": { - "description": "The gas fee of the transaction on layer1", - "type": "integer" - }, - "gasLimit": { - "description": "The gas limit of the transaction on layer1", - "type": "integer" - }, - "gasUsed": { - "description": "The gas used of the transaction on layer1", - "type": "integer" - }, - "method": { - "description": "The name of the submit event is always ` + "`" + `submit` + "`" + `", - "type": "string" - }, - "rootHash": { - "description": "Merkle root of the file to upload", - "type": "string" - }, - "status": { - "description": "The status of the transaction on layer1", - "type": "integer" - }, - "timestamp": { - "description": "The block time when submit event emits", - "type": "integer" - }, - "txHash": { - "description": "The transaction where the submit event is emitted", - "type": "string" - }, - "txSeq": { - "description": "Submission index in submit event", - "type": "string" - } - } - }, - "api.TxDetail": { - "description": "Submission detail information", - "type": "object", - "properties": { - "endPos": { - "description": "The ending position of the file stored in the storage node", - "type": "integer" - }, - "pieceCounts": { - "description": "The total number of segments the file is split into", - "type": "integer" - }, - "rootHash": { - "description": "Merkle root of the file to upload", - "type": "string" - }, - "startPos": { - "description": "The starting position of the file stored in the storage node", - "type": "integer" - }, - "txSeq": { - "description": "Submission index in submit event", - "type": "string" - } - } - }, - "api.TxList": { - "description": "Submission information list", - "type": "object", - "properties": { - "list": { - "description": "Submission list", - "type": "array", - "items": { - "$ref": "#/definitions/api.StorageTx" - } - }, - "total": { - "description": "The total number of submission returned", - "type": "integer" - } - } - }, "api.TxStat": { "description": "Storage transaction information", "type": "object", diff --git a/docs/swagger.json b/docs/swagger.json index 75aa506..ef0a5f0 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -79,326 +79,6 @@ } } }, - "/statistic/dashboard": { - "get": { - "description": "Query statistics dashboard includes `storage fee` and `log sync height`", - "produces": [ - "application/json" - ], - "tags": [ - "(deprecated)statistic" - ], - "summary": "Statistics dashboard", - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/api.BusinessError" - }, - { - "type": "object", - "properties": { - "Data": { - "$ref": "#/definitions/api.Dashboard" - } - } - } - ] - } - }, - "600": { - "description": "", - "schema": { - "$ref": "#/definitions/api.BusinessError" - } - } - } - } - }, - "/statistic/fee/list": { - "get": { - "description": "Query fee statistics, including incremental and full data, and support querying at hourly or daily time intervals", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "(deprecated)statistic" - ], - "summary": "fee statistics", - "parameters": [ - { - "minimum": 0, - "type": "integer", - "default": 0, - "description": "The number of skipped records, usually it's pageSize * (pageNumber - 1)", - "name": "skip", - "in": "query" - }, - { - "maximum": 2000, - "minimum": 1, - "type": "integer", - "default": 10, - "description": "The number of records displayed on the page", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Timestamp in seconds", - "name": "minTimestamp", - "in": "query" - }, - { - "type": "integer", - "description": "Timestamp in seconds", - "name": "maxTimestamp", - "in": "query" - }, - { - "enum": [ - "hour", - "day" - ], - "type": "string", - "default": "day", - "description": "Statistics interval", - "name": "intervalType", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "default": "desc", - "description": "Sort by timestamp", - "name": "sort", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/api.BusinessError" - }, - { - "type": "object", - "properties": { - "Data": { - "$ref": "#/definitions/api.FeeStatList" - } - } - } - ] - } - }, - "600": { - "description": "", - "schema": { - "$ref": "#/definitions/api.BusinessError" - } - } - } - } - }, - "/statistic/storage/list": { - "get": { - "description": "Query data storage statistics, including incremental and full data, and support querying at hourly or daily time intervals", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "(deprecated)statistic" - ], - "summary": "Data storage statistics", - "parameters": [ - { - "minimum": 0, - "type": "integer", - "default": 0, - "description": "The number of skipped records, usually it's pageSize * (pageNumber - 1)", - "name": "skip", - "in": "query" - }, - { - "maximum": 2000, - "minimum": 1, - "type": "integer", - "default": 10, - "description": "The number of records displayed on the page", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Timestamp in seconds", - "name": "minTimestamp", - "in": "query" - }, - { - "type": "integer", - "description": "Timestamp in seconds", - "name": "maxTimestamp", - "in": "query" - }, - { - "enum": [ - "hour", - "day" - ], - "type": "string", - "default": "day", - "description": "Statistics interval", - "name": "intervalType", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "default": "desc", - "description": "Sort by timestamp", - "name": "sort", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/api.BusinessError" - }, - { - "type": "object", - "properties": { - "Data": { - "$ref": "#/definitions/api.DataStatList" - } - } - } - ] - } - }, - "600": { - "description": "", - "schema": { - "$ref": "#/definitions/api.BusinessError" - } - } - } - } - }, - "/statistic/transaction/list": { - "get": { - "description": "Query transaction statistics, including incremental and full data, and support querying at hourly or daily time intervals", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "(deprecated)statistic" - ], - "summary": "Transaction statistics", - "parameters": [ - { - "minimum": 0, - "type": "integer", - "default": 0, - "description": "The number of skipped records, usually it's pageSize * (pageNumber - 1)", - "name": "skip", - "in": "query" - }, - { - "maximum": 2000, - "minimum": 1, - "type": "integer", - "default": 10, - "description": "The number of records displayed on the page", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Timestamp in seconds", - "name": "minTimestamp", - "in": "query" - }, - { - "type": "integer", - "description": "Timestamp in seconds", - "name": "maxTimestamp", - "in": "query" - }, - { - "enum": [ - "hour", - "day" - ], - "type": "string", - "default": "day", - "description": "Statistics interval", - "name": "intervalType", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "default": "desc", - "description": "Sort by timestamp", - "name": "sort", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/api.BusinessError" - }, - { - "type": "object", - "properties": { - "Data": { - "$ref": "#/definitions/api.TxStatList" - } - } - } - ] - } - }, - "600": { - "description": "", - "schema": { - "$ref": "#/definitions/api.BusinessError" - } - } - } - } - }, "/stats/fee": { "get": { "description": "Query fee statistics, including incremental and full data, and support querying at hourly or daily time intervals", @@ -631,164 +311,26 @@ "in": "query" }, { - "enum": [ - "hour", - "day" - ], - "type": "string", - "default": "day", - "description": "Statistics interval", - "name": "intervalType", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "default": "desc", - "description": "Sort by timestamp", - "name": "sort", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/api.BusinessError" - }, - { - "type": "object", - "properties": { - "Data": { - "$ref": "#/definitions/api.DataStatList" - } - } - } - ] - } - }, - "600": { - "description": "", - "schema": { - "$ref": "#/definitions/api.BusinessError" - } - } - } - } - }, - "/stats/summary": { - "get": { - "description": "Query statistics summary includes `storage fee` and `log sync height`", - "produces": [ - "application/json" - ], - "tags": [ - "statistic" - ], - "summary": "Statistics summary", - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/api.BusinessError" - }, - { - "type": "object", - "properties": { - "Data": { - "$ref": "#/definitions/api.Summary" - } - } - } - ] - } - }, - "600": { - "description": "", - "schema": { - "$ref": "#/definitions/api.BusinessError" - } - } - } - } - }, - "/transaction/brief": { - "get": { - "description": "Query layer2 transaction overview by txSeq", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "(deprecated)transaction" - ], - "summary": "Layer2 transaction overview", - "parameters": [ - { - "type": "string", - "description": "Lay2 transaction sequence number", - "name": "txSeq", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/api.BusinessError" - }, - { - "type": "object", - "properties": { - "Data": { - "$ref": "#/definitions/api.TxBrief" - } - } - } - ] - } - }, - "600": { - "description": "", - "schema": { - "$ref": "#/definitions/api.BusinessError" - } - } - } - } - }, - "/transaction/detail": { - "get": { - "description": "Query layer2 transaction advanced info by txSeq", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "(deprecated)transaction" - ], - "summary": "Layer2 transaction advanced info", - "parameters": [ + "enum": [ + "hour", + "day" + ], + "type": "string", + "default": "day", + "description": "Statistics interval", + "name": "intervalType", + "in": "query" + }, { + "enum": [ + "asc", + "desc" + ], "type": "string", - "description": "Lay2 transaction sequence number", - "name": "txSeq", - "in": "query", - "required": true + "default": "desc", + "description": "Sort by timestamp", + "name": "sort", + "in": "query" } ], "responses": { @@ -803,7 +345,7 @@ "type": "object", "properties": { "Data": { - "$ref": "#/definitions/api.TxDetail" + "$ref": "#/definitions/api.DataStatList" } } } @@ -819,50 +361,16 @@ } } }, - "/transaction/list": { + "/stats/summary": { "get": { - "description": "Query layer2 transactions, support address and root hash filter", - "consumes": [ - "application/json" - ], + "description": "Query statistics summary includes `storage fee` and `log sync height`", "produces": [ "application/json" ], "tags": [ - "(deprecated)transaction" - ], - "summary": "Layer2 transaction list", - "parameters": [ - { - "minimum": 0, - "type": "integer", - "default": 0, - "description": "The number of skipped records, usually it's pageSize * (pageNumber - 1)", - "name": "skip", - "in": "query" - }, - { - "maximum": 100, - "minimum": 1, - "type": "integer", - "default": 10, - "description": "The number of records displayed on the page", - "name": "limit", - "in": "query" - }, - { - "type": "string", - "description": "The submitter address of the uploaded file", - "name": "address", - "in": "query" - }, - { - "type": "string", - "description": "The merkle root hash of the uploaded file", - "name": "rootHash", - "in": "query" - } + "statistic" ], + "summary": "Statistics summary", "responses": { "200": { "description": "OK", @@ -875,7 +383,7 @@ "type": "object", "properties": { "Data": { - "$ref": "#/definitions/api.TxList" + "$ref": "#/definitions/api.Summary" } } } @@ -1015,46 +523,6 @@ } } }, - "api.CostInfo": { - "description": "Charge fee information", - "type": "object", - "properties": { - "basicCost": { - "description": "Charge fee", - "type": "number" - }, - "tokenInfo": { - "description": "Charge token info", - "allOf": [ - { - "$ref": "#/definitions/api.TokenInfo" - } - ] - } - } - }, - "api.Dashboard": { - "description": "Storage status information", - "type": "object", - "properties": { - "logSyncInfo": { - "description": "Synchronization information of submit event", - "allOf": [ - { - "$ref": "#/definitions/stat.LogSyncInfo" - } - ] - }, - "storageBasicCost": { - "description": "Storage fee information", - "allOf": [ - { - "$ref": "#/definitions/api.StorageBasicCost" - } - ] - } - } - }, "api.DataStat": { "description": "Storage data information", "type": "object", @@ -1133,36 +601,6 @@ } } }, - "api.StorageBasicCost": { - "description": "Storage fee information", - "type": "object", - "properties": { - "address": { - "description": "The address of the token contract", - "type": "string" - }, - "basicCostTotal": { - "description": "Total storage fee", - "type": "number" - }, - "decimals": { - "description": "Token decimals", - "type": "integer" - }, - "name": { - "description": "Token name", - "type": "string" - }, - "native": { - "description": "True is native token, otherwise is not", - "type": "boolean" - }, - "symbol": { - "description": "Token symbol", - "type": "string" - } - } - }, "api.StorageFeeStat": { "description": "Stat storage fee information", "type": "object", @@ -1181,52 +619,6 @@ } } }, - "api.StorageTx": { - "description": "Submission information", - "type": "object", - "properties": { - "address": { - "description": "File uploader address", - "type": "string" - }, - "baseFee": { - "description": "The storage fee required to upload the file", - "type": "number" - }, - "blockNum": { - "description": "The block where the submit event is emitted", - "type": "integer" - }, - "dataSize": { - "description": "File size in bytes", - "type": "integer" - }, - "method": { - "description": "The name of the submit event is always `submit`", - "type": "string" - }, - "rootHash": { - "description": "Merkle root of the file to upload", - "type": "string" - }, - "status": { - "description": "File upload status, 0-not uploaded,1-uploading,2-uploaded", - "type": "integer" - }, - "timestamp": { - "description": "The block time when submit event emits", - "type": "integer" - }, - "txHash": { - "description": "The transaction where the submit event is emitted", - "type": "string" - }, - "txSeq": { - "description": "Submission index in submit event", - "type": "integer" - } - } - }, "api.StorageTxDetail": { "description": "Submission transaction information", "type": "object", @@ -1420,115 +812,6 @@ } } }, - "api.TxBrief": { - "description": "Submission brief information", - "type": "object", - "properties": { - "blockNumber": { - "description": "The block where the submit event is emitted", - "type": "integer" - }, - "costInfo": { - "description": "Charge fee information", - "allOf": [ - { - "$ref": "#/definitions/api.CostInfo" - } - ] - }, - "dataSize": { - "description": "File size in bytes", - "type": "integer" - }, - "expiration": { - "description": "Expiration date of the uploaded file", - "type": "integer" - }, - "from": { - "description": "File uploader address", - "type": "string" - }, - "gasFee": { - "description": "The gas fee of the transaction on layer1", - "type": "integer" - }, - "gasLimit": { - "description": "The gas limit of the transaction on layer1", - "type": "integer" - }, - "gasUsed": { - "description": "The gas used of the transaction on layer1", - "type": "integer" - }, - "method": { - "description": "The name of the submit event is always `submit`", - "type": "string" - }, - "rootHash": { - "description": "Merkle root of the file to upload", - "type": "string" - }, - "status": { - "description": "The status of the transaction on layer1", - "type": "integer" - }, - "timestamp": { - "description": "The block time when submit event emits", - "type": "integer" - }, - "txHash": { - "description": "The transaction where the submit event is emitted", - "type": "string" - }, - "txSeq": { - "description": "Submission index in submit event", - "type": "string" - } - } - }, - "api.TxDetail": { - "description": "Submission detail information", - "type": "object", - "properties": { - "endPos": { - "description": "The ending position of the file stored in the storage node", - "type": "integer" - }, - "pieceCounts": { - "description": "The total number of segments the file is split into", - "type": "integer" - }, - "rootHash": { - "description": "Merkle root of the file to upload", - "type": "string" - }, - "startPos": { - "description": "The starting position of the file stored in the storage node", - "type": "integer" - }, - "txSeq": { - "description": "Submission index in submit event", - "type": "string" - } - } - }, - "api.TxList": { - "description": "Submission information list", - "type": "object", - "properties": { - "list": { - "description": "Submission list", - "type": "array", - "items": { - "$ref": "#/definitions/api.StorageTx" - } - }, - "total": { - "description": "The total number of submission returned", - "type": "integer" - } - } - }, "api.TxStat": { "description": "Storage transaction information", "type": "object", diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 21f9a91..09d9476 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -7,29 +7,6 @@ definitions: message: type: string type: object - api.CostInfo: - description: Charge fee information - properties: - basicCost: - description: Charge fee - type: number - tokenInfo: - allOf: - - $ref: '#/definitions/api.TokenInfo' - description: Charge token info - type: object - api.Dashboard: - description: Storage status information - properties: - logSyncInfo: - allOf: - - $ref: '#/definitions/stat.LogSyncInfo' - description: Synchronization information of submit event - storageBasicCost: - allOf: - - $ref: '#/definitions/api.StorageBasicCost' - description: Storage fee information - type: object api.DataStat: description: Storage data information properties: @@ -86,28 +63,6 @@ definitions: description: The total number of stat returned type: integer type: object - api.StorageBasicCost: - description: Storage fee information - properties: - address: - description: The address of the token contract - type: string - basicCostTotal: - description: Total storage fee - type: number - decimals: - description: Token decimals - type: integer - name: - description: Token name - type: string - native: - description: True is native token, otherwise is not - type: boolean - symbol: - description: Token symbol - type: string - type: object api.StorageFeeStat: description: Stat storage fee information properties: @@ -119,40 +74,6 @@ definitions: description: Total storage fee type: number type: object - api.StorageTx: - description: Submission information - properties: - address: - description: File uploader address - type: string - baseFee: - description: The storage fee required to upload the file - type: number - blockNum: - description: The block where the submit event is emitted - type: integer - dataSize: - description: File size in bytes - type: integer - method: - description: The name of the submit event is always `submit` - type: string - rootHash: - description: Merkle root of the file to upload - type: string - status: - description: File upload status, 0-not uploaded,1-uploading,2-uploaded - type: integer - timestamp: - description: The block time when submit event emits - type: integer - txHash: - description: The transaction where the submit event is emitted - type: string - txSeq: - description: Submission index in submit event - type: integer - type: object api.StorageTxDetail: description: Submission transaction information properties: @@ -291,84 +212,6 @@ definitions: description: Token symbol type: string type: object - api.TxBrief: - description: Submission brief information - properties: - blockNumber: - description: The block where the submit event is emitted - type: integer - costInfo: - allOf: - - $ref: '#/definitions/api.CostInfo' - description: Charge fee information - dataSize: - description: File size in bytes - type: integer - expiration: - description: Expiration date of the uploaded file - type: integer - from: - description: File uploader address - type: string - gasFee: - description: The gas fee of the transaction on layer1 - type: integer - gasLimit: - description: The gas limit of the transaction on layer1 - type: integer - gasUsed: - description: The gas used of the transaction on layer1 - type: integer - method: - description: The name of the submit event is always `submit` - type: string - rootHash: - description: Merkle root of the file to upload - type: string - status: - description: The status of the transaction on layer1 - type: integer - timestamp: - description: The block time when submit event emits - type: integer - txHash: - description: The transaction where the submit event is emitted - type: string - txSeq: - description: Submission index in submit event - type: string - type: object - api.TxDetail: - description: Submission detail information - properties: - endPos: - description: The ending position of the file stored in the storage node - type: integer - pieceCounts: - description: The total number of segments the file is split into - type: integer - rootHash: - description: Merkle root of the file to upload - type: string - startPos: - description: The starting position of the file stored in the storage node - type: integer - txSeq: - description: Submission index in submit event - type: string - type: object - api.TxList: - description: Submission information list - properties: - list: - description: Submission list - items: - $ref: '#/definitions/api.StorageTx' - type: array - total: - description: The total number of submission returned - type: integer - type: object api.TxStat: description: Storage transaction information properties: @@ -458,221 +301,6 @@ paths: summary: Account's storage transaction list tags: - account - /statistic/dashboard: - get: - description: Query statistics dashboard includes `storage fee` and `log sync - height` - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/api.BusinessError' - - properties: - Data: - $ref: '#/definitions/api.Dashboard' - type: object - "600": - description: "" - schema: - $ref: '#/definitions/api.BusinessError' - summary: Statistics dashboard - tags: - - (deprecated)statistic - /statistic/fee/list: - get: - consumes: - - application/json - description: Query fee statistics, including incremental and full data, and - support querying at hourly or daily time intervals - parameters: - - default: 0 - description: The number of skipped records, usually it's pageSize * (pageNumber - - 1) - in: query - minimum: 0 - name: skip - type: integer - - default: 10 - description: The number of records displayed on the page - in: query - maximum: 2000 - minimum: 1 - name: limit - type: integer - - description: Timestamp in seconds - in: query - name: minTimestamp - type: integer - - description: Timestamp in seconds - in: query - name: maxTimestamp - type: integer - - default: day - description: Statistics interval - enum: - - hour - - day - in: query - name: intervalType - type: string - - default: desc - description: Sort by timestamp - enum: - - asc - - desc - in: query - name: sort - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/api.BusinessError' - - properties: - Data: - $ref: '#/definitions/api.FeeStatList' - type: object - "600": - description: "" - schema: - $ref: '#/definitions/api.BusinessError' - summary: fee statistics - tags: - - (deprecated)statistic - /statistic/storage/list: - get: - consumes: - - application/json - description: Query data storage statistics, including incremental and full data, - and support querying at hourly or daily time intervals - parameters: - - default: 0 - description: The number of skipped records, usually it's pageSize * (pageNumber - - 1) - in: query - minimum: 0 - name: skip - type: integer - - default: 10 - description: The number of records displayed on the page - in: query - maximum: 2000 - minimum: 1 - name: limit - type: integer - - description: Timestamp in seconds - in: query - name: minTimestamp - type: integer - - description: Timestamp in seconds - in: query - name: maxTimestamp - type: integer - - default: day - description: Statistics interval - enum: - - hour - - day - in: query - name: intervalType - type: string - - default: desc - description: Sort by timestamp - enum: - - asc - - desc - in: query - name: sort - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/api.BusinessError' - - properties: - Data: - $ref: '#/definitions/api.DataStatList' - type: object - "600": - description: "" - schema: - $ref: '#/definitions/api.BusinessError' - summary: Data storage statistics - tags: - - (deprecated)statistic - /statistic/transaction/list: - get: - consumes: - - application/json - description: Query transaction statistics, including incremental and full data, - and support querying at hourly or daily time intervals - parameters: - - default: 0 - description: The number of skipped records, usually it's pageSize * (pageNumber - - 1) - in: query - minimum: 0 - name: skip - type: integer - - default: 10 - description: The number of records displayed on the page - in: query - maximum: 2000 - minimum: 1 - name: limit - type: integer - - description: Timestamp in seconds - in: query - name: minTimestamp - type: integer - - description: Timestamp in seconds - in: query - name: maxTimestamp - type: integer - - default: day - description: Statistics interval - enum: - - hour - - day - in: query - name: intervalType - type: string - - default: desc - description: Sort by timestamp - enum: - - asc - - desc - in: query - name: sort - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/api.BusinessError' - - properties: - Data: - $ref: '#/definitions/api.TxStatList' - type: object - "600": - description: "" - schema: - $ref: '#/definitions/api.BusinessError' - summary: Transaction statistics - tags: - - (deprecated)statistic /stats/fee: get: consumes: @@ -887,113 +515,6 @@ paths: summary: Statistics summary tags: - statistic - /transaction/brief: - get: - consumes: - - application/json - description: Query layer2 transaction overview by txSeq - parameters: - - description: Lay2 transaction sequence number - in: query - name: txSeq - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/api.BusinessError' - - properties: - Data: - $ref: '#/definitions/api.TxBrief' - type: object - "600": - description: "" - schema: - $ref: '#/definitions/api.BusinessError' - summary: Layer2 transaction overview - tags: - - (deprecated)transaction - /transaction/detail: - get: - consumes: - - application/json - description: Query layer2 transaction advanced info by txSeq - parameters: - - description: Lay2 transaction sequence number - in: query - name: txSeq - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/api.BusinessError' - - properties: - Data: - $ref: '#/definitions/api.TxDetail' - type: object - "600": - description: "" - schema: - $ref: '#/definitions/api.BusinessError' - summary: Layer2 transaction advanced info - tags: - - (deprecated)transaction - /transaction/list: - get: - consumes: - - application/json - description: Query layer2 transactions, support address and root hash filter - parameters: - - default: 0 - description: The number of skipped records, usually it's pageSize * (pageNumber - - 1) - in: query - minimum: 0 - name: skip - type: integer - - default: 10 - description: The number of records displayed on the page - in: query - maximum: 100 - minimum: 1 - name: limit - type: integer - - description: The submitter address of the uploaded file - in: query - name: address - type: string - - description: The merkle root hash of the uploaded file - in: query - name: rootHash - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/api.BusinessError' - - properties: - Data: - $ref: '#/definitions/api.TxList' - type: object - "600": - description: "" - schema: - $ref: '#/definitions/api.BusinessError' - summary: Layer2 transaction list - tags: - - (deprecated)transaction /txs: get: consumes: diff --git a/sync/catchup.go b/sync/catchup.go index 871b2ca..f6801b9 100644 --- a/sync/catchup.go +++ b/sync/catchup.go @@ -141,7 +141,8 @@ func (s *CatchupSyncer) batchGetFlowSubmitsBestEffort(w3c *web3go.Client, bnFrom } if strings.Contains(err.Error(), "please narrow down your filter condition") || - strings.Contains(err.Error(), "block range") { + strings.Contains(err.Error(), "block range") || + strings.Contains(err.Error(), "blocks distance") { end = start + (end-start)/2 continue }