github.com/aergoio/aergo@v1.3.1/message/blockchainmsg.go (about) 1 /** 2 * @file 3 * @copyright defined in aergo/LICENSE.txt 4 */ 5 6 package message 7 8 import ( 9 "github.com/aergoio/aergo/types" 10 ) 11 12 const ChainSvc = "ChainSvc" 13 14 type GetBestBlockNo struct{} 15 type GetBestBlockNoRsp struct { 16 BlockNo types.BlockNo 17 } 18 19 type GetBestBlock struct{} 20 type GetBestBlockRsp GetBlockRsp 21 22 type GetBlock struct { 23 BlockHash []byte 24 } 25 type GetBlockRsp struct { 26 Block *types.Block 27 Err error 28 } 29 30 type GetBlockByNo struct { 31 BlockNo types.BlockNo 32 } 33 type GetBlockByNoRsp GetBlockRsp 34 35 type AddBlock struct { 36 PeerID types.PeerID 37 Block *types.Block 38 Bstate interface{} 39 IsSync bool 40 // Bstate *types.BlockState 41 } 42 type AddBlockRsp struct { 43 BlockNo types.BlockNo 44 BlockHash []byte 45 Err error 46 } 47 type GetState struct { 48 Account []byte 49 } 50 type GetStateRsp struct { 51 Account []byte 52 State *types.State 53 Err error 54 } 55 type GetStateAndProof struct { 56 Account []byte 57 Root []byte 58 Compressed bool 59 } 60 type GetStateAndProofRsp struct { 61 StateProof *types.AccountProof 62 Err error 63 } 64 type GetTx struct { 65 TxHash []byte 66 } 67 type GetTxRsp struct { 68 Tx *types.Tx 69 TxIds *types.TxIdx 70 Err error 71 } 72 73 type GetReceipt struct { 74 TxHash []byte 75 } 76 type GetReceiptRsp struct { 77 Receipt *types.Receipt 78 Err error 79 } 80 81 type GetABI struct { 82 Contract []byte 83 } 84 type GetABIRsp struct { 85 ABI *types.ABI 86 Err error 87 } 88 89 type GetQuery struct { 90 Contract []byte 91 Queryinfo []byte 92 } 93 type GetQueryRsp struct { 94 Result []byte 95 Err error 96 } 97 type GetStateQuery struct { 98 ContractAddress []byte 99 StorageKeys [][]byte 100 Root []byte 101 Compressed bool 102 } 103 type GetStateQueryRsp struct { 104 Result *types.StateQueryProof 105 Err error 106 } 107 108 // SyncBlockState is request to sync from remote peer. It returns sync result. 109 type SyncBlockState struct { 110 PeerID types.PeerID 111 BlockNo types.BlockNo 112 BlockHash []byte 113 } 114 115 // GetElected is request to get voting result about top N elect 116 type GetElected struct { 117 Id string 118 N uint32 119 } 120 121 type GetVote struct { 122 Addr []byte 123 Ids []string 124 } 125 126 // GetElectedRsp is return to get voting result 127 type GetVoteRsp struct { 128 Top *types.VoteList 129 Err error 130 } 131 type GetAccountVoteRsp struct { 132 Info *types.AccountVoteInfo 133 Err error 134 } 135 136 type GetStaking struct { 137 Addr []byte 138 } 139 140 type GetStakingRsp struct { 141 Staking *types.Staking 142 Err error 143 } 144 145 type GetNameInfo struct { 146 Name string 147 BlockNo types.BlockNo 148 } 149 150 type GetNameInfoRsp struct { 151 Owner *types.NameInfo 152 Err error 153 } 154 155 type GetEnterpriseConf struct { 156 Key string 157 } 158 159 type GetEnterpriseConfRsp struct { 160 Conf *types.EnterpriseConfig 161 Err error 162 } 163 164 type GetAnchors struct { 165 Seq uint64 166 } 167 168 type GetAnchorsRsp struct { 169 Seq uint64 170 Hashes [][]byte 171 LastNo types.BlockNo 172 Err error 173 } 174 175 // receive from p2p 176 type GetAncestor struct { 177 Hashes [][]byte 178 StopHash []byte 179 } 180 181 // response to p2p for GetAncestor message 182 type GetAncestorRsp struct { 183 Ancestor *types.BlockInfo 184 Err error 185 } 186 187 type ListEvents struct { 188 Filter *types.FilterInfo 189 } 190 191 // response to p2p for GetAncestor message 192 type ListEventsRsp struct { 193 Events []*types.Event 194 Err error 195 } 196 197 type VerifyStart struct { 198 }