//IDL file for p2p message content schema. include "common_schema.fbs"; namespace fbschema.p2pmsg; table Peer_Challenge_Message { challenge:[ubyte]; } table Peer_Challenge_Response_Message { challenge:[ubyte]; sig:[ubyte]; } table UserSubmittedMessage { content:[ubyte]; signature:[ubyte]; } table UserSubmittedMessageGroup { pubkey:[ubyte]; messages:[UserSubmittedMessage]; } union Message { Peer_Challenge_Response_Message, Peer_Challenge_Message, NonUnl_Proposal_Message, Proposal_Message, Npl_Message, State_Request_Message, State_Response_Message, History_Request_Message, History_Response_Message } //message content type table Content { message:Message; } table NonUnl_Proposal_Message { usermessages:[UserSubmittedMessageGroup]; } table Proposal_Message { //Proposal type message schema stage:uint8; time:uint64; users:[ByteArray]; hash_inputs:[ByteArray]; //stage > 0 inputs (hash of stage 0 inputs) hash_outputs:[ByteArray]; //stage > 0 outputs (hash of stage 0 outputs) curr_state_hash: [ubyte]; } table Npl_Message { //NPL type message schema data:[ubyte]; } table History_Request_Message { //Ledger History request type message schema minimum_lcl:[ubyte]; required_lcl:[ubyte]; } enum Ledger_Response_Error : ubyte { None = 0, Invalid_Min_Ledger = 1, Req_Ledger_Not_Found = 2 } table History_Response_Message { //Ledger History request type message schema hist_ledgers:[HistoryLedgerPair]; error: Ledger_Response_Error; } table HistoryLedgerPair { //A key, value pair of byte[]. seq_no:uint64; ledger:HistoryLedger; } table HistoryLedger { state:[ubyte]; lcl:[ubyte]; raw_ledger:[ubyte]; } table State_Request_Message { //State request message schema parent_path:string; is_file:bool; block_id:int32; expected_hash:[ubyte]; } union State_Response{ File_HashMap_Response, Block_Response, Fs_Entry_Response } table State_Response_Message{ state_response:State_Response; hash:[ubyte]; } table Fs_Entry_Response{ path: string; entries: [State_FS_Hash_Entry]; } table File_HashMap_Response{ path: string; file_length:uint64; hash_map:[ubyte]; } table Block_Response{ path: string; block_id:uint32; data: [ubyte]; } table State_FS_Hash_Entry{ path: string; is_file: bool; hash: [ubyte]; } root_type Content; //root type for message content