syntax = "proto3"; package forge_abi; import "google/protobuf/timestamp.proto"; import "google/protobuf/any.proto"; import "vendor.proto"; import "enum.proto"; // basic type definition message BigUint { bytes value = 1; } message BigSint { bytes value = 1; bool minus = 2; } message WalletType { KeyType pk = 1; HashType hash = 2; EncodingType address = 3; RoleType role = 4; } message WalletInfo { WalletType type = 1 [ deprecated = true ]; bytes sk = 2; bytes pk = 3; string address = 4; } message ChainInfo { string id = 1; // node id. string network = 2; // which network the node belongs to. string moniker = 3; // name of the node. string consensus_version = 4; // consensus engine version for this node. bool synced = 5; // indicate if this node is fully synced. bytes app_hash = 6; // current application hash. bytes block_hash = 7; // current block hash. uint64 block_height = 8; // latest block height, in integer. google.protobuf.Timestamp block_time = 9; // latest block time. string address = 10; // the address of the node. uint64 voting_power = 11; // the voting power of the node, in integer. uint64 total_txs = 12; // total number of txs up to the latest block string version = 13; // current forge version // string data_version = 14; current data version deprecated map forge_apps_version = 15; repeated string supported_txs = 16; } message NodeInfo { string id = 1; // node id. string network = 2; // which network the node belongs to. string moniker = 3; // name of the node. string consensus_version = 4; // consensus engine version for this node. bool synced = 5; // indicate if this node is fully synced. bytes app_hash = 6; // current application hash. bytes block_hash = 7; // current block hash. uint64 block_height = 8; // latest block height, in integer. google.protobuf.Timestamp block_time = 9; // latest block time. string address = 10; // the address of the node. uint64 voting_power = 11; // the voting power of the node, in integer. uint64 total_txs = 12; // total number of txs up to the latest block string version = 13; // current forge version // string data_version = 14; current data version deprecated map forge_apps_version = 15; repeated string supported_txs = 16; string ip = 17; // self node ip GeoInfo geo_info = 18; // self node geo info string p2p_address = 19; // id@ip:port } message Validator { string address = 1; // setting power to 0 will remove existing address from validator uint64 power = 2; } message ConsensusParams { uint64 max_bytes = 1; sint64 max_gas = 2; // we keep max_validators + max_candidates items in validator list, and only // use max_validators items for the validators. uint32 max_validators = 3; uint32 max_candidates = 4; repeated string pub_key_types = 5; repeated Validator validators = 6; bool validator_changed = 7; bool param_changed = 8; } // a deferred task (need more consideration) message UpgradeTask { UpgradeType type = 1; string data_hash = 2; // data shall be first put into IPFS repeated UpgradeAction actions = 4; // actions } message UpgradeTasks { repeated UpgradeTask item = 1; } message AbciContext { // the hash of the transaction that being handled. Application can record this // in their state as a reference. string tx_hash = 1; // the height of the current block. uint64 block_height = 2; // the deterministic time of the current block. google.protobuf.Timestamp block_time = 3; // the total txs of the chain. uint64 total_txs = 4; // tx statistics TxStatistics tx_statistics = 5; uint32 tx_index = 6; // the deterministic time of the last block. google.protobuf.Timestamp last_block_time = 7; } message Multisig { // signer address string signer = 1; // public key for signer bytes pk = 2; // signature bytes signature = 3; // delegator string delegator = 4; // extra data google.protobuf.Any data = 15; } message Transaction { string from = 1; uint64 nonce = 2; // use DID for the chain. "did:" prefix is omitted string chain_id = 3; // public key of the sender bytes pk = 4; // gas required for this tx uint32 gas = 5; // delegator string delegator = 6; // signature of the transaction bytes signature = 13; // we will support multiple signatures in case of certain tx need multiple // parties' signature. repeated Multisig signatures = 14; google.protobuf.Any itx = 15; } message TransactionInfo { Transaction tx = 1; uint64 height = 2; uint32 index = 3; string hash = 4; repeated abci_vendor.KVPair tags = 5; StatusCode code = 6; google.protobuf.Timestamp time = 7; } message DeclareConfig { bool restricted = 1; uint32 hierarchy = 2; } message DelegateConfig { // the interval used for calculate the num_txs_delta / num_tokens_delta uint32 delta_interval = 1; // a list of type_urls that are allowed for delegation repeated string type_urls = 2; } message TransactionConfig { uint32 max_asset_size = 1; uint32 max_list_size = 2; uint32 max_multisig = 3; uint64 minimum_stake = 4; DeclareConfig declare = 5; DelegateConfig delegate = 6; PokeConfig poke = 7; StakeConfig stake = 8; } message BlockInfo { uint64 height = 1; uint32 num_txs = 2; google.protobuf.Timestamp time = 3; bytes app_hash = 4; bytes proposer = 5; repeated TransactionInfo txs = 6; uint64 total_txs = 7; repeated TransactionInfo invalid_txs = 8; repeated string txs_hashes = 9; repeated string invalid_txs_hashes = 10; bytes consensus_hash = 11; bytes data_hash = 12; bytes evidence_hash = 13; bytes last_commit_hash = 14; bytes last_results_hash = 15; bytes next_validators_hash = 16; bytes validators_hash = 17; abci_vendor.Version version = 18; abci_vendor.BlockID last_block_id = 19; } message BlockInfoSimple { uint64 height = 1; uint32 num_txs = 2; google.protobuf.Timestamp time = 3; bytes app_hash = 4; bytes proposer = 5; uint64 total_txs = 6; repeated string txs_hashes = 7; repeated string invalid_txs_hashes = 8; bytes consensus_hash = 9; bytes data_hash = 10; bytes evidence_hash = 11; bytes last_commit_hash = 12; bytes last_results_hash = 13; bytes next_validators_hash = 14; bytes validators_hash = 15; abci_vendor.Version version = 16; abci_vendor.BlockID last_block_id = 17; } message TxStatus { StatusCode code = 1; string hash = 2; } message CircularQueue { // each item is the value of the Any repeated bytes items = 1; // data inserted into the queue shall have same type_url string type_url = 2; // if max_items is 0, meaning the queue has no size limit (use it cautious). // Otherwise when queue is full, we either will not be able to add item // (circular = false), or (circlar = true) replace an item (based on fifo). uint32 max_items = 3; bool circular = 4; // default is false, meaning LIFO (last in first out). new items are prepend // to the queue and when we drop items we drop the tail item. When it is true, // new items are append to the tail, and when we drop items we drop the head. bool fifo = 5; } message StateContext { string genesis_tx = 1; string renaissance_tx = 2; google.protobuf.Timestamp genesis_time = 3; google.protobuf.Timestamp renaissance_time = 4; } message StakeContext { // total tokens staked for others BigUint total_stakes = 1; BigUint total_unstakes = 2; // total tokens being staked BigUint total_received_stakes = 3; // keep a list of stake address. Only store recent N (e.g. 128) stakes. CircularQueue recent_stakes = 4; // keep a list of received stake address. Only store recent N (e.g. 128) // stakes. CircularQueue recent_received_stakes = 15; } message StakeSummary { BigUint total_stakes = 1; BigUint total_unstakes = 2; StateContext context = 3; } message StakeConfig { uint32 timeout_general = 1; uint32 timeout_stake_for_node = 2; } message UnconfirmedTxs { uint32 n_txs = 1; repeated Transaction txs = 2; } message NetInfo { bool listening = 1; repeated string listeners = 2; uint32 n_peers = 3; repeated PeerInfo peers = 4; } message GeoInfo { string city = 1; string country = 2; float latitude = 3; float longitude = 4; } message PeerInfo { string id = 1; string network = 2; string consensus_version = 3; string moniker = 4; string ip = 5; GeoInfo geo_info = 6; } message ValidatorsInfo { uint64 block_height = 1; repeated ValidatorInfo validators = 2; } message ValidatorInfo { string address = 1; abci_vendor.PubKey pub_key = 2; uint64 voting_power = 3; string proposer_priority = 4; string name = 5; GeoInfo geo_info = 6; // validator geo info } message GenesisInfo { string genesis_time = 1; string chain_id = 2; abci_vendor.ConsensusParams consensus_params = 3; repeated ValidatorInfo validators = 4; string app_hash = 5; } message ForgeStats { repeated uint64 num_blocks = 1; repeated uint64 num_txs = 2; repeated BigUint num_stakes = 3; repeated uint32 num_validators = 4; repeated uint64 num_account_migrate_txs = 5; repeated uint64 num_create_asset_txs = 6; repeated uint32 num_consensus_upgrade_txs = 7; repeated uint64 num_declare_txs = 8; repeated uint64 num_declare_file_txs = 9; repeated uint64 num_exchange_txs = 10; repeated uint64 num_stake_txs = 11; repeated uint32 num_sys_upgrade_txs = 12; repeated uint64 num_transfer_txs = 13; repeated uint64 num_update_asset_txs = 14; repeated uint64 num_consume_asset_txs = 15; repeated uint64 num_poke_txs = 16; repeated uint32 tps = 17; uint32 max_tps = 18; // maximum tps in given time range uint32 avg_tps = 19; // average tps in given time range float avg_block_time = 20; // average blocks in given time range } message TxStatistics { uint64 num_account_migrate_txs = 1; uint64 num_create_asset_txs = 2; uint32 num_consensus_upgrade_txs = 3; uint64 num_declare_txs = 4; uint64 num_declare_file_txs = 5; uint64 num_exchange_txs = 6; uint64 num_stake_txs = 7; uint32 num_sys_upgrade_txs = 8; uint64 num_transfer_txs = 9; uint64 num_update_asset_txs = 10; uint64 num_consume_asset_txs = 11; uint64 num_poke_txs = 12; } message ForgeToken { string name = 1; // token name string symbol = 2; // token symbol string unit = 3; // token smallest unit string description = 4; // token description bytes icon = 5; // token icon file in bytes uint32 decimal = 6; // token decimal uint64 initial_supply = 7; // token initial supply amount uint64 total_supply = 8; // token total supply amount uint32 inflation_rate = 9; // token inflation rate in integer } message PokeInfo { BigUint daily_limit = 1; // poke daily supply amount BigUint leftover = 2; // remaining poke daily supply amount BigUint amount = 3; // poke once supply amount } message PokeConfig { // string address = 1; deprecated uint64 daily_limit = 2; // uint64 balance = 3; deprecated uint64 amount = 4; bool enabled = 5; } message UpgradeInfo { uint64 height = 1; string version = 2; } message WithdrawItem{ string hash = 1; BigUint value = 2; } message AccountConfig { string address = 1; bytes pk = 2; BigUint balance = 3; } message TokenSwapConfig { string commission_holder_address = 1; uint32 withdraw_interval = 2; BigUint commission = 3; uint32 commission_rate = 4; uint32 revoke_commission = 5; } message Evidence { string hash = 1; // tx hash from a foreign chain string chain_type = 2; // type of the chain, currently only "eth" string chain_id = 3; // chain id of the chain. Could be testnet or mainnet. bytes original_tx = 4; // the binary for the original tx string receiver_address = 5; // the address of the receiver (can only be controlled account) }