github.com/igggame/nebulas-go@v2.1.0+incompatible/core/pb/block.proto (about) 1 // Copyright (C) 2017 go-nebulas authors 2 // 3 // This file is part of the go-nebulas library. 4 // 5 // the go-nebulas library is free software: you can redistribute it and/or modify 6 // it under the terms of the GNU General Public License as published by 7 // the Free Software Foundation, either version 3 of the License, or 8 // (at your option) any later version. 9 // 10 // the go-nebulas library is distributed in the hope that it will be useful, 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 // GNU General Public License for more details. 14 // 15 // You should have received a copy of the GNU General Public License 16 // along with the go-nebulas library. If not, see <http://www.gnu.org/licenses/>. 17 // 18 syntax = "proto3"; 19 20 import "github.com/nebulasio/go-nebulas/common/dag/pb/dag.proto"; 21 import "github.com/nebulasio/go-nebulas/consensus/pb/state.proto"; 22 23 package corepb; 24 25 message Account { 26 bytes address = 1; 27 bytes balance = 2; 28 uint64 nonce = 3; 29 bytes vars_hash = 4; 30 bytes birth_place = 5; 31 ContractMeta contract_meta = 6; 32 } 33 34 message ContractMeta { 35 string version = 1; 36 } 37 38 message Data { 39 string type = 1; 40 bytes payload = 2; 41 } 42 43 message Transaction { 44 bytes hash = 1; 45 bytes from = 2; 46 bytes to = 3; 47 bytes value = 4; 48 uint64 nonce = 5; 49 int64 timestamp = 6; 50 Data data = 7; 51 uint32 chain_id = 8; 52 bytes gas_price = 9; 53 bytes gas_limit = 10; 54 55 uint32 alg = 11; 56 bytes sign = 12; 57 } 58 59 message BlockHeader { 60 bytes hash = 1; 61 bytes parent_hash = 2; 62 reserved 3; // uint64 nonce = 3; 63 bytes coinbase = 4; 64 int64 timestamp = 5; 65 uint32 chain_id = 6; 66 uint32 alg = 7; 67 bytes sign = 8; 68 bytes state_root = 9; 69 bytes txs_root = 10; 70 bytes events_root = 11; 71 consensuspb.ConsensusRoot consensus_root = 12; 72 Random random = 13; 73 } 74 75 message Block { 76 BlockHeader header = 1; 77 repeated Transaction transactions = 2; 78 dagpb.Dag dependency = 3; 79 80 uint64 height = 4; 81 } 82 83 message NetBlocks { 84 string from = 1; 85 uint64 batch = 2; 86 repeated Block blocks = 3; 87 } 88 89 message NetBlock { 90 string from = 1; 91 uint64 batch = 2; 92 Block block = 3; 93 } 94 95 message DownloadBlock { 96 bytes hash = 1; 97 bytes sign = 2; 98 } 99 100 message Random { 101 bytes vrf_seed = 1; 102 bytes vrf_proof = 2; 103 }