github.com/turingchain2020/turingchain@v1.1.21/types/event.go (about)

     1  // Copyright Turing Corp. 2018 All Rights Reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package types
     6  
     7  // event
     8  const (
     9  	EventTx                   = 1
    10  	EventGetBlocks            = 2
    11  	EventBlocks               = 3
    12  	EventGetBlockHeight       = 4
    13  	EventReplyBlockHeight     = 5
    14  	EventQueryTx              = 6
    15  	EventTransactionDetail    = 7
    16  	EventReply                = 8
    17  	EventTxBroadcast          = 9
    18  	EventPeerInfo             = 10
    19  	EventTxList               = 11
    20  	EventReplyTxList          = 12
    21  	EventAddBlock             = 13
    22  	EventBlockBroadcast       = 14
    23  	EventFetchBlocks          = 15
    24  	EventAddBlocks            = 16
    25  	EventTxHashList           = 17
    26  	EventTxHashListReply      = 18
    27  	EventGetHeaders           = 19
    28  	EventHeaders              = 20
    29  	EventGetMempoolSize       = 21
    30  	EventMempoolSize          = 22
    31  	EventStoreGet             = 23
    32  	EventStoreSet             = 24
    33  	EventStoreGetReply        = 25
    34  	EventStoreSetReply        = 26
    35  	EventReceipts             = 27
    36  	EventExecTxList           = 28
    37  	EventPeerList             = 29
    38  	EventGetLastHeader        = 30
    39  	EventHeader               = 31
    40  	EventAddBlockDetail       = 32
    41  	EventGetMempool           = 33
    42  	EventGetTransactionByAddr = 34
    43  	EventGetTransactionByHash = 35
    44  	EventReplyTxInfo          = 36
    45  	EventWalletAccountList    = 38
    46  	EventWalletAccount        = 40
    47  	EventWalletExecutor       = 42
    48  	EventStoreDel             = 47
    49  	EventReplyHashes          = 49
    50  	EventTransactionDetails   = 53
    51  	EventBroadcastAddBlock    = 54
    52  	EventGetBlockOverview     = 55
    53  	EventGetAddrOverview      = 56
    54  	EventReplyBlockOverview   = 57
    55  	EventReplyAddrOverview    = 58
    56  	EventGetBlockHash         = 59
    57  	EventBlockHash            = 60
    58  	EventGetLastMempool       = 61
    59  	EventMinerStart           = 63
    60  	EventMinerStop            = 64
    61  	EventWalletTickets        = 65
    62  	EventStoreMemSet          = 66
    63  	EventStoreRollback        = 67
    64  	EventStoreCommit          = 68
    65  	EventCheckBlock           = 69
    66  	//seed
    67  	EventReplyGenSeed = 71
    68  	EventReplyGetSeed = 74
    69  	EventDelBlock     = 75
    70  	//local store
    71  	EventLocalGet                = 76
    72  	EventLocalReplyValue         = 77
    73  	EventLocalList               = 78
    74  	EventLocalSet                = 79
    75  	EventCheckTx                 = 81
    76  	EventReceiptCheckTx          = 82
    77  	EventReplyQuery              = 84
    78  	EventSubscribePush           = 85
    79  	EventFetchBlockHeaders       = 86
    80  	EventAddBlockHeaders         = 87
    81  	EventReplyWalletStatus       = 89
    82  	EventGetLastBlock            = 90
    83  	EventBlock                   = 91
    84  	EventGetTicketCount          = 92
    85  	EventReplyGetTicketCount     = 93
    86  	EventReplyPrivkey            = 95
    87  	EventIsSync                  = 96
    88  	EventReplyIsSync             = 97
    89  	EventCloseTickets            = 98
    90  	EventGetAddrTxs              = 99
    91  	EventReplyAddrTxs            = 100
    92  	EventIsNtpClockSync          = 101
    93  	EventReplyIsNtpClockSync     = 102
    94  	EventDelTxList               = 103
    95  	EventStoreGetTotalCoins      = 104
    96  	EventGetTotalCoinsReply      = 105
    97  	EventQueryTotalFee           = 106
    98  	EventReplySignRawTx          = 108
    99  	EventSyncBlock               = 109
   100  	EventGetNetInfo              = 110
   101  	EventReplyNetInfo            = 111
   102  	EventReplyFatalFailure       = 114
   103  	EventBindMiner               = 115
   104  	EventReplyBindMiner          = 116
   105  	EventDecodeRawTx             = 117
   106  	EventReplyDecodeRawTx        = 118
   107  	EventGetLastBlockSequence    = 119
   108  	EventReplyLastBlockSequence  = 120
   109  	EventGetBlockSequences       = 121
   110  	EventReplyBlockSequences     = 122
   111  	EventGetBlockByHashes        = 123
   112  	EventReplyBlockDetailsBySeqs = 124
   113  	EventDelParaChainBlockDetail = 125
   114  	EventAddParaChainBlockDetail = 126
   115  	EventGetSeqByHash            = 127
   116  	EventLocalPrefixCount        = 128
   117  	EventStoreList               = 130
   118  	EventStoreListReply          = 131
   119  	EventListPushes              = 132
   120  	EventGetPushLastNum          = 133
   121  	EventGetBlockBySeq           = 134
   122  
   123  	EventLocalBegin    = 135
   124  	EventLocalCommit   = 136
   125  	EventLocalRollback = 137
   126  	EventLocalNew      = 138
   127  	EventLocalClose    = 139
   128  
   129  	//mempool
   130  	EventGetProperFee   = 140
   131  	EventReplyProperFee = 141
   132  
   133  	EventReExecBlock  = 142
   134  	EventTxListByHash = 143
   135  	//exec
   136  	EventBlockChainQuery = 212
   137  	EventConsensusQuery  = 213
   138  	EventUpgrade         = 214
   139  
   140  	// BlockChain 接收的事件
   141  	EventGetLastBlockMainSequence   = 300
   142  	EventReplyLastBlockMainSequence = 301
   143  	EventGetMainSeqByHash           = 302
   144  	EventReplyMainSeqByHash         = 303
   145  	//其他模块读写blockchain db事件
   146  	EventSetValueByKey = 304
   147  	EventGetValueByKey = 305
   148  	//通过平行链title获取平行链的交易
   149  	EventGetParaTxByTitle   = 306
   150  	EventReplyParaTxByTitle = 307
   151  
   152  	//获取拥有此title交易的区块高度
   153  	EventGetHeightByTitle   = 308
   154  	EventReplyHeightByTitle = 309
   155  
   156  	//通过区块高度列表+title获取平行链交易
   157  	EventGetParaTxByTitleAndHeight = 310
   158  	//比较当前区块和新广播的区块最优区块
   159  	EventCmpBestBlock       = 311
   160  	EventReplySubscribePush = 312
   161  
   162  	// 通知其它节点进行数据归档存储
   163  	EventNotifyStoreChunk = 313
   164  	// 获取chunkBlock数据
   165  	EventGetChunkBlock = 314
   166  
   167  	// 添加addChunkBlock
   168  	EventAddChunkBlock = 315
   169  	// 获取chunkBody数据
   170  	EventGetChunkBlockBody = 316
   171  	// 获取ChunkRecord
   172  	EventGetChunkRecord = 317
   173  	// 添加ChunkRecord
   174  	EventAddChunkRecord = 318
   175  
   176  	//p2p 其他接收事件
   177  	EventSubTopic       = 350
   178  	EventPubTopicMsg    = 351
   179  	EventFetchTopics    = 352
   180  	EventRemoveTopic    = 353
   181  	EventReceiveSubData = 355
   182  	EventNetProtocols   = 356
   183  
   184  	//检测mempool是否存在该交易
   185  	EventCheckTxsExist = 357
   186  	//delete para blocks
   187  	EventDeleteParaBlocks = 358
   188  )
   189  
   190  var eventName = map[int]string{
   191  	1:   "EventTx",
   192  	2:   "EventGetBlocks",
   193  	3:   "EventBlocks",
   194  	4:   "EventGetBlockHeight",
   195  	5:   "EventReplyBlockHeight",
   196  	6:   "EventQueryTx",
   197  	7:   "EventTransactionDetail",
   198  	8:   "EventReply",
   199  	9:   "EventTxBroadcast",
   200  	10:  "EventPeerInfo",
   201  	11:  "EventTxList",
   202  	12:  "EventReplyTxList",
   203  	13:  "EventAddBlock",
   204  	14:  "EventBlockBroadcast",
   205  	15:  "EventFetchBlocks",
   206  	16:  "EventAddBlocks",
   207  	17:  "EventTxHashList",
   208  	18:  "EventTxHashListReply",
   209  	19:  "EventGetHeaders",
   210  	20:  "EventHeaders",
   211  	21:  "EventGetMempoolSize",
   212  	22:  "EventMempoolSize",
   213  	23:  "EventStoreGet",
   214  	24:  "EventStoreSet",
   215  	25:  "EventStoreGetReply",
   216  	26:  "EventStoreSetReply",
   217  	27:  "EventReceipts",
   218  	28:  "EventExecTxList",
   219  	29:  "EventPeerList",
   220  	30:  "EventGetLastHeader",
   221  	31:  "EventHeader",
   222  	32:  "EventAddBlockDetail",
   223  	33:  "EventGetMempool",
   224  	34:  "EventGetTransactionByAddr",
   225  	35:  "EventGetTransactionByHash",
   226  	36:  "EventReplyTxInfo",
   227  	38:  "EventWalletAccountList",
   228  	40:  "EventWalletAccount",
   229  	42:  "EventWalletExecutor",
   230  	47:  "EventStoreDel",
   231  	49:  "EventReplyHashes",
   232  	53:  "EventTransactionDetails",
   233  	54:  "EventBroadcastAddBlock",
   234  	55:  "EventGetBlockOverview",
   235  	56:  "EventGetAddrOverview",
   236  	57:  "EventReplyBlockOverview",
   237  	58:  "EventReplyAddrOverview",
   238  	59:  "EventGetBlockHash",
   239  	60:  "EventBlockHash",
   240  	61:  "EventGetLastMempool",
   241  	63:  "EventMinerStart",
   242  	64:  "EventMinerStop",
   243  	65:  "EventWalletTickets",
   244  	66:  "EventStoreMemSet",
   245  	67:  "EventStoreRollback",
   246  	68:  "EventStoreCommit",
   247  	69:  "EventCheckBlock",
   248  	71:  "EventReplyGenSeed",
   249  	74:  "EventReplyGetSeed",
   250  	75:  "EventDelBlock",
   251  	76:  "EventLocalGet",
   252  	77:  "EventLocalReplyValue",
   253  	78:  "EventLocalList",
   254  	79:  "EventLocalSet",
   255  	81:  "EventCheckTx",
   256  	82:  "EventReceiptCheckTx",
   257  	84:  "EventReplyQuery",
   258  	85:  "EventSubscribePush",
   259  	86:  "EventFetchBlockHeaders",
   260  	87:  "EventAddBlockHeaders",
   261  	89:  "EventReplyWalletStatus",
   262  	90:  "EventGetLastBlock",
   263  	91:  "EventBlock",
   264  	92:  "EventGetTicketCount",
   265  	93:  "EventReplyGetTicketCount",
   266  	95:  "EventReplyPrivkey",
   267  	96:  "EventIsSync",
   268  	97:  "EventReplyIsSync",
   269  	98:  "EventCloseTickets",
   270  	99:  "EventGetAddrTxs",
   271  	100: "EventReplyAddrTxs",
   272  	101: "EventIsNtpClockSync",
   273  	102: "EventReplyIsNtpClockSync",
   274  	103: "EventDelTxList",
   275  	104: "EventStoreGetTotalCoins",
   276  	105: "EventGetTotalCoinsReply",
   277  	106: "EventQueryTotalFee",
   278  	108: "EventReplySignRawTx",
   279  	109: "EventSyncBlock",
   280  	110: "EventGetNetInfo",
   281  	111: "EventReplyNetInfo",
   282  	114: "EventReplyFatalFailure",
   283  	115: "EventBindMiner",
   284  	116: "EventReplyBindMiner",
   285  	117: "EventDecodeRawTx",
   286  	118: "EventReplyDecodeRawTx",
   287  	119: "EventGetLastBlockSequence",
   288  	120: "EventReplyLastBlockSequence",
   289  	121: "EventGetBlockSequences",
   290  	122: "EventReplyBlockSequences",
   291  	123: "EventGetBlockByHashes",
   292  	124: "EventReplyBlockDetailsBySeqs",
   293  	125: "EventDelParaChainBlockDetail",
   294  	126: "EventAddParaChainBlockDetail",
   295  	127: "EventGetSeqByHash",
   296  	128: "EventLocalPrefixCount",
   297  	//todo: 这个可能后面会删除
   298  	EventStoreList:      "EventStoreList",
   299  	EventStoreListReply: "EventStoreListReply",
   300  	EventListPushes:     "EventListPushes",
   301  	EventGetPushLastNum: "EventGetPushLastNum",
   302  	// Token
   303  	EventBlockChainQuery: "EventBlockChainQuery",
   304  	EventConsensusQuery:  "EventConsensusQuery",
   305  	EventGetBlockBySeq:   "EventGetBlockBySeq",
   306  
   307  	EventLocalBegin:    "EventLocalBegin",
   308  	EventLocalCommit:   "EventLocalCommit",
   309  	EventLocalRollback: "EventLocalRollback",
   310  	EventLocalNew:      "EventLocalNew",
   311  	EventLocalClose:    "EventLocalClose",
   312  
   313  	//mempool
   314  	EventGetProperFee:   "EventGetProperFee",
   315  	EventReplyProperFee: "EventReplyProperFee",
   316  	EventTxListByHash:   "EventTxListByHash",
   317  	// block chain
   318  	EventGetLastBlockMainSequence:   "EventGetLastBlockMainSequence",
   319  	EventReplyLastBlockMainSequence: "EventReplyLastBlockMainSequence",
   320  	EventGetMainSeqByHash:           "EventGetMainSeqByHash",
   321  	EventReplyMainSeqByHash:         "EventReplyMainSeqByHash",
   322  	EventSetValueByKey:              "EventSetValueByKey",
   323  	EventGetValueByKey:              "EventGetValueByKey",
   324  	EventGetParaTxByTitle:           "EventGetParaTxByTitle",
   325  	EventReplyParaTxByTitle:         "EventReplyParaTxByTitle",
   326  	EventGetHeightByTitle:           "EventGetHeightByTitle",
   327  	EventReplyHeightByTitle:         "EventReplyHeightByTitle",
   328  	EventGetParaTxByTitleAndHeight:  "EventGetParaTxByTitleAndHeight",
   329  	EventCmpBestBlock:               "EventCmpBestBlock",
   330  	EventUpgrade:                    "EventUpgrade",
   331  	EventReplySubscribePush:         "EventReplySubscribePush",
   332  	EventNotifyStoreChunk:           "EventNotifyStoreChunk",
   333  	EventGetChunkBlock:              "EventGetChunkBlock",
   334  	EventAddChunkBlock:              "EventAddChunkBlock",
   335  	EventGetChunkBlockBody:          "EventGetChunkBlockBody",
   336  	EventGetChunkRecord:             "EventGetChunkRecord",
   337  	EventAddChunkRecord:             "EventAddChunkRecord",
   338  	EventSubTopic:                   "EventSubTopic",
   339  	EventPubTopicMsg:                "EventPubTopicMsg",
   340  	EventFetchTopics:                "EventFetchTopics",
   341  	EventRemoveTopic:                "EventRemoveTopic",
   342  	EventReceiveSubData:             "EventReceiveSubData",
   343  	EventNetProtocols:               "EventNetProtocols",
   344  	EventCheckTxsExist:              "EventCheckTxsExist",
   345  	EventDeleteParaBlocks:           "EventDeleteParaBlocks",
   346  }