diff --git a/go.mod b/go.mod index 6700d36..df01694 100644 --- a/go.mod +++ b/go.mod @@ -6,15 +6,16 @@ toolchain go1.23.1 require ( github.com/btcsuite/btcd v0.24.2 + github.com/golang/protobuf v1.5.4 github.com/zeromq/goczmq v4.1.0+incompatible go.uber.org/zap v1.27.0 + google.golang.org/protobuf v1.36.6 ) require ( golang.org/x/net v0.41.0 // indirect golang.org/x/text v0.26.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 // indirect - google.golang.org/protobuf v1.36.6 // indirect ) require ( diff --git a/internal/gbt/tari/minotari_miner/src/cli.rs b/internal/gbt/tari/minotari_miner/src/cli.rs index 039e935..bae79c8 100644 --- a/internal/gbt/tari/minotari_miner/src/cli.rs +++ b/internal/gbt/tari/minotari_miner/src/cli.rs @@ -41,10 +41,15 @@ pub struct Cli { pub non_interactive_mode: bool, - #[clap(long, alias = "zmq-pub-port", default_value = "11113")] - zmq_pub_port: u16, - #[clap(long, alias = "zmq-sub-port", default_value = "11112")] - zmq_sub_port: u16, + /// Select ZMQ job algorithm: sha3x | randomxt. If omitted, defaults from config pow algo. + #[clap(long)] + pub zmq_algo: Option, + /// Optional override for ZMQ publisher port (otherwise defaults by algorithm) + #[clap(long, alias = "zmq-pub-port")] + pub zmq_pub_port: Option, + /// Optional override for ZMQ subscriber port (otherwise defaults by algorithm) + #[clap(long, alias = "zmq-sub-port")] + pub zmq_sub_port: Option, } impl ConfigOverrideProvider for Cli { diff --git a/internal/gbt/tari/minotari_miner/src/miner.rs b/internal/gbt/tari/minotari_miner/src/miner.rs index 9a6afa5..ba173bc 100644 --- a/internal/gbt/tari/minotari_miner/src/miner.rs +++ b/internal/gbt/tari/minotari_miner/src/miner.rs @@ -27,7 +27,7 @@ use std::{ time::{Duration, Instant}, }; -use chrono::Utc; +// use chrono::Utc; use crossbeam::channel::{bounded, Select, Sender, TrySendError}; use futures::Stream; use log::*; @@ -37,6 +37,7 @@ use tari_core::proof_of_work::randomx_factory::RandomXFactory; use thread::JoinHandle; use super::difficulty::BlockHeaderSha3; +use tari_utilities::hex::Hex; use zmq::{Socket}; @@ -87,6 +88,7 @@ pub struct Miner { publisher_socket: Arc>, subscriber_socket: Arc>, base_node_client: BaseNodeGrpcClient, + zmq_algorithm: String, } impl Miner { @@ -100,6 +102,7 @@ impl Miner { rx_factory: Option, publisher_socket: Arc>, subscriber_socket: Arc>, + zmq_algorithm: String, ) -> Self { Self { threads: vec![], @@ -113,6 +116,7 @@ impl Miner { publisher_socket, subscriber_socket, base_node_client, + zmq_algorithm, } } @@ -144,8 +148,9 @@ impl Miner { let pub_socket = Arc::clone(&self.publisher_socket); let sub_socket = Arc::clone(&self.subscriber_socket); let base_node_client_clone = self.base_node_client.clone(); + let zmq_algo = self.zmq_algorithm.clone(); let handle = thread - .spawn(move || mining_task(base_node_client_clone, header, difficulty, tx, waker, i, share_mode, vm_key, rx_factory, pub_socket, sub_socket)) + .spawn(move || mining_task(base_node_client_clone, header, difficulty, tx, waker, i, share_mode, vm_key, rx_factory, pub_socket, sub_socket, zmq_algo)) .expect("Failed to create mining thread"); (handle, rx) }); @@ -214,6 +219,8 @@ pub struct GbtMsg { pub height: u64, pub header: String, pub u64target: u64, + /// RandomXT需要的vm_key(hex字符串);Sha3X可为空字符串 + pub vmkey: String, } #[derive(Debug, Serialize, Deserialize)] @@ -230,18 +237,26 @@ pub struct SubmitRequest { pub submitidx: u64, } -fn send_gbt_message(socket: &Arc>, msg: &GbtMsg) -> Result<(), Box> { +fn send_gbt_message( + socket: &Arc>, + msg: &GbtMsg, + algorithm: &str, +) -> Result<(), Box> { let msg_json = serde_json::to_string(msg)?; + let topic = match algorithm { + "randomxt" | "TariRandomXT" => "jobrandomxt", + _ => "jobsha3x", + }; if let Ok(pub_socket) = socket.try_lock() { - pub_socket.send_multipart(&["jobsha3x".as_bytes(), msg_json.as_bytes()], 0)?; - println!("send_gbt_message"); + pub_socket.send_multipart(&[topic.as_bytes(), msg_json.as_bytes()], 0)?; + println!("send_gbt_message for {}", algorithm); Ok(()) } else { Err("Socket lock busy".into()) } } -fn try_receive_nonce(socket: &Arc>) -> Option { +fn try_receive_nonce(socket: &Arc>, algorithm: &str) -> Option { let sub_socket = match socket.try_lock() { Ok(sub_socket) => sub_socket, Err(_) => return None, @@ -267,7 +282,11 @@ fn try_receive_nonce(socket: &Arc>) -> Option { //println!("First frame: {:?}", frames.first().unwrap().as_slice()); //println!("Nonce frame: {:?}", &frames[1]); - if frames.first().map(Vec::as_slice) != Some(b"blksha3x") { + let expected_topic = match algorithm { + "randomxt" | "TariRandomXT" => b"blkrandomxt".as_slice(), + _ => b"blksha3x".as_slice(), + }; + if frames.first().map(Vec::as_slice) != Some(expected_topic) { return None; } @@ -296,6 +315,7 @@ pub fn mining_task( rx_factory: Option, publisher_socket: Arc>, subscriber_socket: Arc>, + zmq_algorithm: String, ) { let mining_algorithm = if rx_factory.is_some() { "RandomXT" } else { "Sha3X" }; let start = Instant::now(); @@ -316,10 +336,15 @@ pub fn mining_task( height: hasher.header.height, header: hasher.header.mining_hash().to_string(), u64target: target_difficulty, + vmkey: if zmq_algorithm == "randomxt" || zmq_algorithm == "TariRandomXT" { + hasher.vm_key.to_hex() + } else { + String::new() + }, }; - if let Err(e) = send_gbt_message(&publisher_socket, &gbt_msg) { + if let Err(e) = send_gbt_message(&publisher_socket, &gbt_msg, &zmq_algorithm) { error!( target: LOG_TARGET, "Miner {} failed to send GBT message: {}", miner, e @@ -334,7 +359,7 @@ pub fn mining_task( let mut check_count:u64 = 0; // Mining work loop { - if let Some(nonce) = try_receive_nonce(&subscriber_socket) { + if let Some(nonce) = try_receive_nonce(&subscriber_socket, &zmq_algorithm) { check_count = 0; hasher.header.nonce = nonce; println!("nonce {} {}", nonce, hasher.header.nonce); diff --git a/internal/gbt/tari/minotari_miner/src/run_miner.rs b/internal/gbt/tari/minotari_miner/src/run_miner.rs index 8f5eb19..2309cb4 100644 --- a/internal/gbt/tari/minotari_miner/src/run_miner.rs +++ b/internal/gbt/tari/minotari_miner/src/run_miner.rs @@ -185,15 +185,28 @@ pub async fn start_miner(cli: Cli) -> Result<(), ExitError> { return Err(ExitError::new(ExitCode::GrpcError, e.to_string())); } } - config.zmq_publisher_port = 11113; - config.zmq_subscriber_port = 11112; - println!("pub port:{}, sub port {}", config.zmq_publisher_port, config.zmq_subscriber_port); + // Decide ZMQ algorithm from CLI flag or pow algo + let zmq_algo = cli + .zmq_algo + .as_ref() + .map(|s| s.as_str()) + .unwrap_or_else(|| if config.proof_of_work_algo == PowAlgorithm::RandomXT { "randomxt" } else { "sha3x" }); + + // Default ports per algorithm, allow CLI override (do not rely on config fields) + let (default_pub, default_sub) = if zmq_algo == "randomxt" { + (11114u16, 11115u16) + } else { + (11112u16, 11113u16) + }; + let publisher_port = cli.zmq_pub_port.unwrap_or(default_pub); + let subscriber_port = cli.zmq_sub_port.unwrap_or(default_sub); + println!("Using ZMQ ({}) ports: pub port:{}, sub port {}", zmq_algo, publisher_port, subscriber_port); let zmq_context = ZmqContext::new(); let publisher_socket = zmq_context .socket(zmq::PUB) .map_err(|e| anyhow!("ZMQ publisher error: {}", e))?; - let publisher_addr = format!("tcp://0.0.0.0:{}", config.zmq_publisher_port); + let publisher_addr = format!("tcp://0.0.0.0:{}", publisher_port); println!("publisher_addr:{}",publisher_addr); publisher_socket .bind(&publisher_addr) @@ -202,7 +215,7 @@ pub async fn start_miner(cli: Cli) -> Result<(), ExitError> { let subscriber_socket = zmq_context .socket(SUB) .context("Failed to create SUB socket")?; - let subscriber_addr = format!("tcp://172.17.0.1:{}", config.zmq_subscriber_port); + let subscriber_addr = format!("tcp://127.0.0.1:{}", subscriber_port); println!("subscriber_addr:{}",subscriber_addr); subscriber_socket .connect(&subscriber_addr) @@ -602,6 +615,13 @@ async fn mining_cycle( debug!(target: LOG_TARGET, "Initializing miner"); + // Determine ZMQ algorithm for miner streams (sha3x | randomxt) + let zmq_algo = cli + .zmq_algo + .as_ref() + .map(|s| s.as_str()) + .unwrap_or_else(|| if config.proof_of_work_algo == PowAlgorithm::RandomXT { "randomxt" } else { "sha3x" }); + let rx_factory = if config.proof_of_work_algo == PowAlgorithm::RandomXT { Some(RandomXFactory::new(config.num_mining_threads)) } else { @@ -618,6 +638,7 @@ async fn mining_cycle( rx_factory, publisher_socket, subscriber_socket, + zmq_algo.to_string(), ); let mut reporting_timeout = Instant::now(); let mut block_submitted = false; diff --git a/internal/msg/msg.go b/internal/msg/msg.go index 6089f2e..1190f21 100644 --- a/internal/msg/msg.go +++ b/internal/msg/msg.go @@ -75,6 +75,22 @@ type Sha3xStratumJob struct { U64target uint64 `json:"u64target, omitempty"` } +type RandomxTStratumJob struct { + Header string `json:"header, omitempty"` + NBits string `json:"nBits, omitempty"` + Id uint64 `json:"id, omitempty"` + CurTime uint64 `json:"timestamp, omitempty"` + Target string `json:"target, omitempty"` + Height uint32 `json:"height, omitempty"` + Nonce string `json:"nonce, omitempty"` + Extranonce1 string `json:"extranonce1, omitempty"` + Extranonce2_size uint64 `json:"extranonce2_size, omitempty"` + Extranonce2 string `json:"extranonce2, omitempty"` + JobDifficulty float64 `json:"diff, omitempty"` + U64target uint64 `json:"u64target, omitempty"` + SeedHash string `json:"seedhash, omitempty"` +} + type BlockSha3xMsg struct { Id uint64 `json:"id"` User string `json:"user"` diff --git a/internal/server/coin/coin.go b/internal/server/coin/coin.go index 0879f2f..bdd2afe 100644 --- a/internal/server/coin/coin.go +++ b/internal/server/coin/coin.go @@ -178,11 +178,11 @@ type ServerContext struct { ExitDbPoolStats chan bool - NexaJob msg.NexaStratumJob - Sha3xJob msg.Sha3xStratumJob - MoneroJob msg.MoneroStratumJob - Tari_Sha3xJob msg.GbtSendMsg - ExitDiffVar chan bool + NexaJob msg.NexaStratumJob + Sha3xJob msg.Sha3xStratumJob + MoneroJob msg.MoneroStratumJob + RandomxTJob msg.RandomxTStratumJob + ExitDiffVar chan bool RedisClient *redis.Client @@ -387,10 +387,10 @@ type MinerObj struct { PongFailCnt int PingCnt int - NexaJob msg.NexaStratumJob - Sha3xJob msg.Sha3xStratumJob - MoneroJob msg.MoneroStratumJob - Tari_Sha3xJob msg.GbtSendMsg + NexaJob msg.NexaStratumJob + Sha3xJob msg.Sha3xStratumJob + MoneroJob msg.MoneroStratumJob + RandomxTJob msg.RandomxTStratumJob FromIP string diff --git a/internal/server/proxy/proto/base_node.pb.go b/internal/server/proxy/proto/base_node.pb.go new file mode 100644 index 0000000..3bb38de --- /dev/null +++ b/internal/server/proxy/proto/base_node.pb.go @@ -0,0 +1,4609 @@ +// Copyright 2020. The Tari Project +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +// following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the +// following disclaimer in the documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote +// products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v3.6.1 +// source: base_node.proto + +package base_node + +import ( + block "pool/internal/server/proxy/proto/block" + net_work "pool/internal/server/proxy/proto/net_work" + sidechain_types "pool/internal/server/proxy/proto/sidechain_types" + transaction "pool/internal/server/proxy/proto/transaction" + types "pool/internal/server/proxy/proto/types" + reflect "reflect" + sync "sync" + unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type BaseNodeState int32 + +const ( + BaseNodeState_START_UP BaseNodeState = 0 + BaseNodeState_HEADER_SYNC BaseNodeState = 1 + BaseNodeState_HORIZON_SYNC BaseNodeState = 2 + BaseNodeState_CONNECTING BaseNodeState = 3 + BaseNodeState_BLOCK_SYNC BaseNodeState = 4 + BaseNodeState_LISTENING BaseNodeState = 5 + BaseNodeState_SYNC_FAILED BaseNodeState = 6 +) + +// Enum value maps for BaseNodeState. +var ( + BaseNodeState_name = map[int32]string{ + 0: "START_UP", + 1: "HEADER_SYNC", + 2: "HORIZON_SYNC", + 3: "CONNECTING", + 4: "BLOCK_SYNC", + 5: "LISTENING", + 6: "SYNC_FAILED", + } + BaseNodeState_value = map[string]int32{ + "START_UP": 0, + "HEADER_SYNC": 1, + "HORIZON_SYNC": 2, + "CONNECTING": 3, + "BLOCK_SYNC": 4, + "LISTENING": 5, + "SYNC_FAILED": 6, + } +) + +func (x BaseNodeState) Enum() *BaseNodeState { + p := new(BaseNodeState) + *p = x + return p +} + +func (x BaseNodeState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (BaseNodeState) Descriptor() protoreflect.EnumDescriptor { + return file_base_node_proto_enumTypes[0].Descriptor() +} + +func (BaseNodeState) Type() protoreflect.EnumType { + return &file_base_node_proto_enumTypes[0] +} + +func (x BaseNodeState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use BaseNodeState.Descriptor instead. +func (BaseNodeState) EnumDescriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{0} +} + +type CalcType int32 + +const ( + CalcType_MEAN CalcType = 0 + CalcType_MEDIAN CalcType = 1 + CalcType_QUANTILE CalcType = 2 + CalcType_QUARTILE CalcType = 3 +) + +// Enum value maps for CalcType. +var ( + CalcType_name = map[int32]string{ + 0: "MEAN", + 1: "MEDIAN", + 2: "QUANTILE", + 3: "QUARTILE", + } + CalcType_value = map[string]int32{ + "MEAN": 0, + "MEDIAN": 1, + "QUANTILE": 2, + "QUARTILE": 3, + } +) + +func (x CalcType) Enum() *CalcType { + p := new(CalcType) + *p = x + return p +} + +func (x CalcType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CalcType) Descriptor() protoreflect.EnumDescriptor { + return file_base_node_proto_enumTypes[1].Descriptor() +} + +func (CalcType) Type() protoreflect.EnumType { + return &file_base_node_proto_enumTypes[1] +} + +func (x CalcType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CalcType.Descriptor instead. +func (CalcType) EnumDescriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{1} +} + +type Sorting int32 + +const ( + Sorting_SORTING_DESC Sorting = 0 + Sorting_SORTING_ASC Sorting = 1 +) + +// Enum value maps for Sorting. +var ( + Sorting_name = map[int32]string{ + 0: "SORTING_DESC", + 1: "SORTING_ASC", + } + Sorting_value = map[string]int32{ + "SORTING_DESC": 0, + "SORTING_ASC": 1, + } +) + +func (x Sorting) Enum() *Sorting { + p := new(Sorting) + *p = x + return p +} + +func (x Sorting) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Sorting) Descriptor() protoreflect.EnumDescriptor { + return file_base_node_proto_enumTypes[2].Descriptor() +} + +func (Sorting) Type() protoreflect.EnumType { + return &file_base_node_proto_enumTypes[2] +} + +func (x Sorting) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Sorting.Descriptor instead. +func (Sorting) EnumDescriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{2} +} + +type SyncState int32 + +const ( + SyncState_STARTUP SyncState = 0 + SyncState_HEADER_STARTING SyncState = 1 + SyncState_HEADER SyncState = 2 + SyncState_BLOCK_STARTING SyncState = 3 + SyncState_BLOCK SyncState = 4 + SyncState_DONE SyncState = 5 +) + +// Enum value maps for SyncState. +var ( + SyncState_name = map[int32]string{ + 0: "STARTUP", + 1: "HEADER_STARTING", + 2: "HEADER", + 3: "BLOCK_STARTING", + 4: "BLOCK", + 5: "DONE", + } + SyncState_value = map[string]int32{ + "STARTUP": 0, + "HEADER_STARTING": 1, + "HEADER": 2, + "BLOCK_STARTING": 3, + "BLOCK": 4, + "DONE": 5, + } +) + +func (x SyncState) Enum() *SyncState { + p := new(SyncState) + *p = x + return p +} + +func (x SyncState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SyncState) Descriptor() protoreflect.EnumDescriptor { + return file_base_node_proto_enumTypes[3].Descriptor() +} + +func (SyncState) Type() protoreflect.EnumType { + return &file_base_node_proto_enumTypes[3] +} + +func (x SyncState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SyncState.Descriptor instead. +func (SyncState) EnumDescriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{3} +} + +type SubmitTransactionResult int32 + +const ( + SubmitTransactionResult_NONE SubmitTransactionResult = 0 + SubmitTransactionResult_ACCEPTED SubmitTransactionResult = 1 + SubmitTransactionResult_NOT_PROCESSABLE_AT_THIS_TIME SubmitTransactionResult = 2 + SubmitTransactionResult_ALREADY_MINED SubmitTransactionResult = 3 + SubmitTransactionResult_REJECTED SubmitTransactionResult = 4 +) + +// Enum value maps for SubmitTransactionResult. +var ( + SubmitTransactionResult_name = map[int32]string{ + 0: "NONE", + 1: "ACCEPTED", + 2: "NOT_PROCESSABLE_AT_THIS_TIME", + 3: "ALREADY_MINED", + 4: "REJECTED", + } + SubmitTransactionResult_value = map[string]int32{ + "NONE": 0, + "ACCEPTED": 1, + "NOT_PROCESSABLE_AT_THIS_TIME": 2, + "ALREADY_MINED": 3, + "REJECTED": 4, + } +) + +func (x SubmitTransactionResult) Enum() *SubmitTransactionResult { + p := new(SubmitTransactionResult) + *p = x + return p +} + +func (x SubmitTransactionResult) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SubmitTransactionResult) Descriptor() protoreflect.EnumDescriptor { + return file_base_node_proto_enumTypes[4].Descriptor() +} + +func (SubmitTransactionResult) Type() protoreflect.EnumType { + return &file_base_node_proto_enumTypes[4] +} + +func (x SubmitTransactionResult) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SubmitTransactionResult.Descriptor instead. +func (SubmitTransactionResult) EnumDescriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{4} +} + +type TransactionLocation int32 + +const ( + TransactionLocation_UNKNOWN TransactionLocation = 0 + TransactionLocation_MEMPOOL TransactionLocation = 1 + TransactionLocation_MINED TransactionLocation = 2 + TransactionLocation_NOT_STORED TransactionLocation = 3 +) + +// Enum value maps for TransactionLocation. +var ( + TransactionLocation_name = map[int32]string{ + 0: "UNKNOWN", + 1: "MEMPOOL", + 2: "MINED", + 3: "NOT_STORED", + } + TransactionLocation_value = map[string]int32{ + "UNKNOWN": 0, + "MEMPOOL": 1, + "MINED": 2, + "NOT_STORED": 3, + } +) + +func (x TransactionLocation) Enum() *TransactionLocation { + p := new(TransactionLocation) + *p = x + return p +} + +func (x TransactionLocation) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TransactionLocation) Descriptor() protoreflect.EnumDescriptor { + return file_base_node_proto_enumTypes[5].Descriptor() +} + +func (TransactionLocation) Type() protoreflect.EnumType { + return &file_base_node_proto_enumTypes[5] +} + +func (x TransactionLocation) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TransactionLocation.Descriptor instead. +func (TransactionLocation) EnumDescriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{5} +} + +type GetAssetMetadataRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AssetPublicKey []byte `protobuf:"bytes,1,opt,name=asset_public_key,json=assetPublicKey,proto3" json:"asset_public_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAssetMetadataRequest) Reset() { + *x = GetAssetMetadataRequest{} + mi := &file_base_node_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAssetMetadataRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAssetMetadataRequest) ProtoMessage() {} + +func (x *GetAssetMetadataRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAssetMetadataRequest.ProtoReflect.Descriptor instead. +func (*GetAssetMetadataRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{0} +} + +func (x *GetAssetMetadataRequest) GetAssetPublicKey() []byte { + if x != nil { + return x.AssetPublicKey + } + return nil +} + +type GetAssetMetadataResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Image string `protobuf:"bytes,4,opt,name=image,proto3" json:"image,omitempty"` + OwnerCommitment []byte `protobuf:"bytes,5,opt,name=owner_commitment,json=ownerCommitment,proto3" json:"owner_commitment,omitempty"` + Features *transaction.OutputFeatures `protobuf:"bytes,6,opt,name=features,proto3" json:"features,omitempty"` + MinedHeight uint64 `protobuf:"varint,7,opt,name=mined_height,json=minedHeight,proto3" json:"mined_height,omitempty"` + MinedInBlock []byte `protobuf:"bytes,8,opt,name=mined_in_block,json=minedInBlock,proto3" json:"mined_in_block,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetAssetMetadataResponse) Reset() { + *x = GetAssetMetadataResponse{} + mi := &file_base_node_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetAssetMetadataResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAssetMetadataResponse) ProtoMessage() {} + +func (x *GetAssetMetadataResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAssetMetadataResponse.ProtoReflect.Descriptor instead. +func (*GetAssetMetadataResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{1} +} + +func (x *GetAssetMetadataResponse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *GetAssetMetadataResponse) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *GetAssetMetadataResponse) GetImage() string { + if x != nil { + return x.Image + } + return "" +} + +func (x *GetAssetMetadataResponse) GetOwnerCommitment() []byte { + if x != nil { + return x.OwnerCommitment + } + return nil +} + +func (x *GetAssetMetadataResponse) GetFeatures() *transaction.OutputFeatures { + if x != nil { + return x.Features + } + return nil +} + +func (x *GetAssetMetadataResponse) GetMinedHeight() uint64 { + if x != nil { + return x.MinedHeight + } + return 0 +} + +func (x *GetAssetMetadataResponse) GetMinedInBlock() []byte { + if x != nil { + return x.MinedInBlock + } + return nil +} + +type ListAssetRegistrationsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Offset uint64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` + Count uint64 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAssetRegistrationsRequest) Reset() { + *x = ListAssetRegistrationsRequest{} + mi := &file_base_node_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAssetRegistrationsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAssetRegistrationsRequest) ProtoMessage() {} + +func (x *ListAssetRegistrationsRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAssetRegistrationsRequest.ProtoReflect.Descriptor instead. +func (*ListAssetRegistrationsRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{2} +} + +func (x *ListAssetRegistrationsRequest) GetOffset() uint64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *ListAssetRegistrationsRequest) GetCount() uint64 { + if x != nil { + return x.Count + } + return 0 +} + +type ListAssetRegistrationsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + AssetPublicKey []byte `protobuf:"bytes,1,opt,name=asset_public_key,json=assetPublicKey,proto3" json:"asset_public_key,omitempty"` + UniqueId []byte `protobuf:"bytes,2,opt,name=unique_id,json=uniqueId,proto3" json:"unique_id,omitempty"` + OwnerCommitment []byte `protobuf:"bytes,3,opt,name=owner_commitment,json=ownerCommitment,proto3" json:"owner_commitment,omitempty"` + MinedHeight uint64 `protobuf:"varint,4,opt,name=mined_height,json=minedHeight,proto3" json:"mined_height,omitempty"` + MinedInBlock []byte `protobuf:"bytes,5,opt,name=mined_in_block,json=minedInBlock,proto3" json:"mined_in_block,omitempty"` + Features *transaction.OutputFeatures `protobuf:"bytes,6,opt,name=features,proto3" json:"features,omitempty"` + Script []byte `protobuf:"bytes,7,opt,name=script,proto3" json:"script,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListAssetRegistrationsResponse) Reset() { + *x = ListAssetRegistrationsResponse{} + mi := &file_base_node_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListAssetRegistrationsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAssetRegistrationsResponse) ProtoMessage() {} + +func (x *ListAssetRegistrationsResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAssetRegistrationsResponse.ProtoReflect.Descriptor instead. +func (*ListAssetRegistrationsResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{3} +} + +func (x *ListAssetRegistrationsResponse) GetAssetPublicKey() []byte { + if x != nil { + return x.AssetPublicKey + } + return nil +} + +func (x *ListAssetRegistrationsResponse) GetUniqueId() []byte { + if x != nil { + return x.UniqueId + } + return nil +} + +func (x *ListAssetRegistrationsResponse) GetOwnerCommitment() []byte { + if x != nil { + return x.OwnerCommitment + } + return nil +} + +func (x *ListAssetRegistrationsResponse) GetMinedHeight() uint64 { + if x != nil { + return x.MinedHeight + } + return 0 +} + +func (x *ListAssetRegistrationsResponse) GetMinedInBlock() []byte { + if x != nil { + return x.MinedInBlock + } + return nil +} + +func (x *ListAssetRegistrationsResponse) GetFeatures() *transaction.OutputFeatures { + if x != nil { + return x.Features + } + return nil +} + +func (x *ListAssetRegistrationsResponse) GetScript() []byte { + if x != nil { + return x.Script + } + return nil +} + +type GetTokensRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AssetPublicKey []byte `protobuf:"bytes,1,opt,name=asset_public_key,json=assetPublicKey,proto3" json:"asset_public_key,omitempty"` + // Optionally get a set of specific unique_ids + UniqueIds [][]byte `protobuf:"bytes,2,rep,name=unique_ids,json=uniqueIds,proto3" json:"unique_ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetTokensRequest) Reset() { + *x = GetTokensRequest{} + mi := &file_base_node_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetTokensRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTokensRequest) ProtoMessage() {} + +func (x *GetTokensRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetTokensRequest.ProtoReflect.Descriptor instead. +func (*GetTokensRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{4} +} + +func (x *GetTokensRequest) GetAssetPublicKey() []byte { + if x != nil { + return x.AssetPublicKey + } + return nil +} + +func (x *GetTokensRequest) GetUniqueIds() [][]byte { + if x != nil { + return x.UniqueIds + } + return nil +} + +type GetTokensResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + UniqueId []byte `protobuf:"bytes,1,opt,name=unique_id,json=uniqueId,proto3" json:"unique_id,omitempty"` + AssetPublicKey []byte `protobuf:"bytes,2,opt,name=asset_public_key,json=assetPublicKey,proto3" json:"asset_public_key,omitempty"` + OwnerCommitment []byte `protobuf:"bytes,3,opt,name=owner_commitment,json=ownerCommitment,proto3" json:"owner_commitment,omitempty"` + MinedInBlock []byte `protobuf:"bytes,4,opt,name=mined_in_block,json=minedInBlock,proto3" json:"mined_in_block,omitempty"` + MinedHeight uint64 `protobuf:"varint,5,opt,name=mined_height,json=minedHeight,proto3" json:"mined_height,omitempty"` + Features *transaction.OutputFeatures `protobuf:"bytes,6,opt,name=features,proto3" json:"features,omitempty"` + Script []byte `protobuf:"bytes,7,opt,name=script,proto3" json:"script,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetTokensResponse) Reset() { + *x = GetTokensResponse{} + mi := &file_base_node_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetTokensResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTokensResponse) ProtoMessage() {} + +func (x *GetTokensResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetTokensResponse.ProtoReflect.Descriptor instead. +func (*GetTokensResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{5} +} + +func (x *GetTokensResponse) GetUniqueId() []byte { + if x != nil { + return x.UniqueId + } + return nil +} + +func (x *GetTokensResponse) GetAssetPublicKey() []byte { + if x != nil { + return x.AssetPublicKey + } + return nil +} + +func (x *GetTokensResponse) GetOwnerCommitment() []byte { + if x != nil { + return x.OwnerCommitment + } + return nil +} + +func (x *GetTokensResponse) GetMinedInBlock() []byte { + if x != nil { + return x.MinedInBlock + } + return nil +} + +func (x *GetTokensResponse) GetMinedHeight() uint64 { + if x != nil { + return x.MinedHeight + } + return 0 +} + +func (x *GetTokensResponse) GetFeatures() *transaction.OutputFeatures { + if x != nil { + return x.Features + } + return nil +} + +func (x *GetTokensResponse) GetScript() []byte { + if x != nil { + return x.Script + } + return nil +} + +type SubmitBlockResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + BlockHash []byte `protobuf:"bytes,1,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SubmitBlockResponse) Reset() { + *x = SubmitBlockResponse{} + mi := &file_base_node_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SubmitBlockResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubmitBlockResponse) ProtoMessage() {} + +func (x *SubmitBlockResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubmitBlockResponse.ProtoReflect.Descriptor instead. +func (*SubmitBlockResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{6} +} + +func (x *SubmitBlockResponse) GetBlockHash() []byte { + if x != nil { + return x.BlockHash + } + return nil +} + +type BlockBlobRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + HeaderBlob []byte `protobuf:"bytes,1,opt,name=header_blob,json=headerBlob,proto3" json:"header_blob,omitempty"` + BodyBlob []byte `protobuf:"bytes,2,opt,name=body_blob,json=bodyBlob,proto3" json:"body_blob,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BlockBlobRequest) Reset() { + *x = BlockBlobRequest{} + mi := &file_base_node_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlockBlobRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockBlobRequest) ProtoMessage() {} + +func (x *BlockBlobRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockBlobRequest.ProtoReflect.Descriptor instead. +func (*BlockBlobRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{7} +} + +func (x *BlockBlobRequest) GetHeaderBlob() []byte { + if x != nil { + return x.HeaderBlob + } + return nil +} + +func (x *BlockBlobRequest) GetBodyBlob() []byte { + if x != nil { + return x.BodyBlob + } + return nil +} + +// / return type of GetTipInfo +type TipInfoResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Metadata *MetaData `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + InitialSyncAchieved bool `protobuf:"varint,2,opt,name=initial_sync_achieved,json=initialSyncAchieved,proto3" json:"initial_sync_achieved,omitempty"` + BaseNodeState BaseNodeState `protobuf:"varint,3,opt,name=base_node_state,json=baseNodeState,proto3,enum=tari.rpc.BaseNodeState" json:"base_node_state,omitempty"` + FailedCheckpoints bool `protobuf:"varint,4,opt,name=failed_checkpoints,json=failedCheckpoints,proto3" json:"failed_checkpoints,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TipInfoResponse) Reset() { + *x = TipInfoResponse{} + mi := &file_base_node_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TipInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TipInfoResponse) ProtoMessage() {} + +func (x *TipInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TipInfoResponse.ProtoReflect.Descriptor instead. +func (*TipInfoResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{8} +} + +func (x *TipInfoResponse) GetMetadata() *MetaData { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *TipInfoResponse) GetInitialSyncAchieved() bool { + if x != nil { + return x.InitialSyncAchieved + } + return false +} + +func (x *TipInfoResponse) GetBaseNodeState() BaseNodeState { + if x != nil { + return x.BaseNodeState + } + return BaseNodeState_START_UP +} + +func (x *TipInfoResponse) GetFailedCheckpoints() bool { + if x != nil { + return x.FailedCheckpoints + } + return false +} + +// / return type of GetNewBlockTemplate +type NewBlockTemplateResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + NewBlockTemplate *block.NewBlockTemplate `protobuf:"bytes,1,opt,name=new_block_template,json=newBlockTemplate,proto3" json:"new_block_template,omitempty"` + InitialSyncAchieved bool `protobuf:"varint,3,opt,name=initial_sync_achieved,json=initialSyncAchieved,proto3" json:"initial_sync_achieved,omitempty"` + MinerData *MinerData `protobuf:"bytes,4,opt,name=miner_data,json=minerData,proto3" json:"miner_data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NewBlockTemplateResponse) Reset() { + *x = NewBlockTemplateResponse{} + mi := &file_base_node_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *NewBlockTemplateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NewBlockTemplateResponse) ProtoMessage() {} + +func (x *NewBlockTemplateResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NewBlockTemplateResponse.ProtoReflect.Descriptor instead. +func (*NewBlockTemplateResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{9} +} + +func (x *NewBlockTemplateResponse) GetNewBlockTemplate() *block.NewBlockTemplate { + if x != nil { + return x.NewBlockTemplate + } + return nil +} + +func (x *NewBlockTemplateResponse) GetInitialSyncAchieved() bool { + if x != nil { + return x.InitialSyncAchieved + } + return false +} + +func (x *NewBlockTemplateResponse) GetMinerData() *MinerData { + if x != nil { + return x.MinerData + } + return nil +} + +// / return type of NewBlockTemplateRequest +type NewBlockTemplateRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Algo *block.PowAlgo `protobuf:"bytes,1,opt,name=algo,proto3" json:"algo,omitempty"` + // This field should be moved to optional once optional keyword is standard + MaxWeight uint64 `protobuf:"varint,2,opt,name=max_weight,json=maxWeight,proto3" json:"max_weight,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NewBlockTemplateRequest) Reset() { + *x = NewBlockTemplateRequest{} + mi := &file_base_node_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *NewBlockTemplateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NewBlockTemplateRequest) ProtoMessage() {} + +func (x *NewBlockTemplateRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NewBlockTemplateRequest.ProtoReflect.Descriptor instead. +func (*NewBlockTemplateRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{10} +} + +func (x *NewBlockTemplateRequest) GetAlgo() *block.PowAlgo { + if x != nil { + return x.Algo + } + return nil +} + +func (x *NewBlockTemplateRequest) GetMaxWeight() uint64 { + if x != nil { + return x.MaxWeight + } + return 0 +} + +// / return type of NewBlockTemplateRequest +type GetNewBlockTemplateWithCoinbasesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Algo *block.PowAlgo `protobuf:"bytes,1,opt,name=algo,proto3" json:"algo,omitempty"` + // This field should be moved to optional once optional keyword is standard + MaxWeight uint64 `protobuf:"varint,2,opt,name=max_weight,json=maxWeight,proto3" json:"max_weight,omitempty"` + Coinbases []*NewBlockCoinbase `protobuf:"bytes,3,rep,name=coinbases,proto3" json:"coinbases,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetNewBlockTemplateWithCoinbasesRequest) Reset() { + *x = GetNewBlockTemplateWithCoinbasesRequest{} + mi := &file_base_node_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetNewBlockTemplateWithCoinbasesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNewBlockTemplateWithCoinbasesRequest) ProtoMessage() {} + +func (x *GetNewBlockTemplateWithCoinbasesRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetNewBlockTemplateWithCoinbasesRequest.ProtoReflect.Descriptor instead. +func (*GetNewBlockTemplateWithCoinbasesRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{11} +} + +func (x *GetNewBlockTemplateWithCoinbasesRequest) GetAlgo() *block.PowAlgo { + if x != nil { + return x.Algo + } + return nil +} + +func (x *GetNewBlockTemplateWithCoinbasesRequest) GetMaxWeight() uint64 { + if x != nil { + return x.MaxWeight + } + return 0 +} + +func (x *GetNewBlockTemplateWithCoinbasesRequest) GetCoinbases() []*NewBlockCoinbase { + if x != nil { + return x.Coinbases + } + return nil +} + +// / request type of GetNewBlockWithCoinbasesRequest +type GetNewBlockWithCoinbasesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + NewTemplate *block.NewBlockTemplate `protobuf:"bytes,1,opt,name=new_template,json=newTemplate,proto3" json:"new_template,omitempty"` + Coinbases []*NewBlockCoinbase `protobuf:"bytes,2,rep,name=coinbases,proto3" json:"coinbases,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetNewBlockWithCoinbasesRequest) Reset() { + *x = GetNewBlockWithCoinbasesRequest{} + mi := &file_base_node_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetNewBlockWithCoinbasesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNewBlockWithCoinbasesRequest) ProtoMessage() {} + +func (x *GetNewBlockWithCoinbasesRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetNewBlockWithCoinbasesRequest.ProtoReflect.Descriptor instead. +func (*GetNewBlockWithCoinbasesRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{12} +} + +func (x *GetNewBlockWithCoinbasesRequest) GetNewTemplate() *block.NewBlockTemplate { + if x != nil { + return x.NewTemplate + } + return nil +} + +func (x *GetNewBlockWithCoinbasesRequest) GetCoinbases() []*NewBlockCoinbase { + if x != nil { + return x.Coinbases + } + return nil +} + +type NewBlockCoinbase struct { + state protoimpl.MessageState `protogen:"open.v1"` + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Value uint64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` + StealthPayment bool `protobuf:"varint,3,opt,name=stealth_payment,json=stealthPayment,proto3" json:"stealth_payment,omitempty"` + RevealedValueProof bool `protobuf:"varint,4,opt,name=revealed_value_proof,json=revealedValueProof,proto3" json:"revealed_value_proof,omitempty"` + CoinbaseExtra []byte `protobuf:"bytes,5,opt,name=coinbase_extra,json=coinbaseExtra,proto3" json:"coinbase_extra,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NewBlockCoinbase) Reset() { + *x = NewBlockCoinbase{} + mi := &file_base_node_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *NewBlockCoinbase) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NewBlockCoinbase) ProtoMessage() {} + +func (x *NewBlockCoinbase) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NewBlockCoinbase.ProtoReflect.Descriptor instead. +func (*NewBlockCoinbase) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{13} +} + +func (x *NewBlockCoinbase) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *NewBlockCoinbase) GetValue() uint64 { + if x != nil { + return x.Value + } + return 0 +} + +func (x *NewBlockCoinbase) GetStealthPayment() bool { + if x != nil { + return x.StealthPayment + } + return false +} + +func (x *NewBlockCoinbase) GetRevealedValueProof() bool { + if x != nil { + return x.RevealedValueProof + } + return false +} + +func (x *NewBlockCoinbase) GetCoinbaseExtra() []byte { + if x != nil { + return x.CoinbaseExtra + } + return nil +} + +// Network difficulty response +type NetworkDifficultyResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Difficulty uint64 `protobuf:"varint,1,opt,name=difficulty,proto3" json:"difficulty,omitempty"` + EstimatedHashRate uint64 `protobuf:"varint,2,opt,name=estimated_hash_rate,json=estimatedHashRate,proto3" json:"estimated_hash_rate,omitempty"` + Height uint64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + Timestamp uint64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + PowAlgo uint64 `protobuf:"varint,5,opt,name=pow_algo,json=powAlgo,proto3" json:"pow_algo,omitempty"` + Sha3XEstimatedHashRate uint64 `protobuf:"varint,6,opt,name=sha3x_estimated_hash_rate,json=sha3xEstimatedHashRate,proto3" json:"sha3x_estimated_hash_rate,omitempty"` + MoneroRandomxEstimatedHashRate uint64 `protobuf:"varint,7,opt,name=monero_randomx_estimated_hash_rate,json=moneroRandomxEstimatedHashRate,proto3" json:"monero_randomx_estimated_hash_rate,omitempty"` + TariRandomxEstimatedHashRate uint64 `protobuf:"varint,10,opt,name=tari_randomx_estimated_hash_rate,json=tariRandomxEstimatedHashRate,proto3" json:"tari_randomx_estimated_hash_rate,omitempty"` + NumCoinbases uint64 `protobuf:"varint,8,opt,name=num_coinbases,json=numCoinbases,proto3" json:"num_coinbases,omitempty"` + CoinbaseExtras [][]byte `protobuf:"bytes,9,rep,name=coinbase_extras,json=coinbaseExtras,proto3" json:"coinbase_extras,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetworkDifficultyResponse) Reset() { + *x = NetworkDifficultyResponse{} + mi := &file_base_node_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *NetworkDifficultyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NetworkDifficultyResponse) ProtoMessage() {} + +func (x *NetworkDifficultyResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NetworkDifficultyResponse.ProtoReflect.Descriptor instead. +func (*NetworkDifficultyResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{14} +} + +func (x *NetworkDifficultyResponse) GetDifficulty() uint64 { + if x != nil { + return x.Difficulty + } + return 0 +} + +func (x *NetworkDifficultyResponse) GetEstimatedHashRate() uint64 { + if x != nil { + return x.EstimatedHashRate + } + return 0 +} + +func (x *NetworkDifficultyResponse) GetHeight() uint64 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *NetworkDifficultyResponse) GetTimestamp() uint64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *NetworkDifficultyResponse) GetPowAlgo() uint64 { + if x != nil { + return x.PowAlgo + } + return 0 +} + +func (x *NetworkDifficultyResponse) GetSha3XEstimatedHashRate() uint64 { + if x != nil { + return x.Sha3XEstimatedHashRate + } + return 0 +} + +func (x *NetworkDifficultyResponse) GetMoneroRandomxEstimatedHashRate() uint64 { + if x != nil { + return x.MoneroRandomxEstimatedHashRate + } + return 0 +} + +func (x *NetworkDifficultyResponse) GetTariRandomxEstimatedHashRate() uint64 { + if x != nil { + return x.TariRandomxEstimatedHashRate + } + return 0 +} + +func (x *NetworkDifficultyResponse) GetNumCoinbases() uint64 { + if x != nil { + return x.NumCoinbases + } + return 0 +} + +func (x *NetworkDifficultyResponse) GetCoinbaseExtras() [][]byte { + if x != nil { + return x.CoinbaseExtras + } + return nil +} + +// A generic single value response for a specific height +type ValueAtHeightResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // uint64 circulating_supply = 1; // No longer used + // uint64 spendable_supply = 2; // No longer used + Height uint64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + MinedRewards uint64 `protobuf:"varint,4,opt,name=mined_rewards,json=minedRewards,proto3" json:"mined_rewards,omitempty"` + SpendableRewards uint64 `protobuf:"varint,5,opt,name=spendable_rewards,json=spendableRewards,proto3" json:"spendable_rewards,omitempty"` + SpendablePreMine uint64 `protobuf:"varint,6,opt,name=spendable_pre_mine,json=spendablePreMine,proto3" json:"spendable_pre_mine,omitempty"` + TotalSpendable uint64 `protobuf:"varint,7,opt,name=total_spendable,json=totalSpendable,proto3" json:"total_spendable,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ValueAtHeightResponse) Reset() { + *x = ValueAtHeightResponse{} + mi := &file_base_node_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ValueAtHeightResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValueAtHeightResponse) ProtoMessage() {} + +func (x *ValueAtHeightResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValueAtHeightResponse.ProtoReflect.Descriptor instead. +func (*ValueAtHeightResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{15} +} + +func (x *ValueAtHeightResponse) GetHeight() uint64 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *ValueAtHeightResponse) GetMinedRewards() uint64 { + if x != nil { + return x.MinedRewards + } + return 0 +} + +func (x *ValueAtHeightResponse) GetSpendableRewards() uint64 { + if x != nil { + return x.SpendableRewards + } + return 0 +} + +func (x *ValueAtHeightResponse) GetSpendablePreMine() uint64 { + if x != nil { + return x.SpendablePreMine + } + return 0 +} + +func (x *ValueAtHeightResponse) GetTotalSpendable() uint64 { + if x != nil { + return x.TotalSpendable + } + return 0 +} + +// A generic uint value +type IntegerValue struct { + state protoimpl.MessageState `protogen:"open.v1"` + Value uint64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IntegerValue) Reset() { + *x = IntegerValue{} + mi := &file_base_node_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IntegerValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IntegerValue) ProtoMessage() {} + +func (x *IntegerValue) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IntegerValue.ProtoReflect.Descriptor instead. +func (*IntegerValue) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{16} +} + +func (x *IntegerValue) GetValue() uint64 { + if x != nil { + return x.Value + } + return 0 +} + +// A generic String value +type StringValue struct { + state protoimpl.MessageState `protogen:"open.v1"` + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StringValue) Reset() { + *x = StringValue{} + mi := &file_base_node_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StringValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StringValue) ProtoMessage() {} + +func (x *StringValue) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StringValue.ProtoReflect.Descriptor instead. +func (*StringValue) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{17} +} + +func (x *StringValue) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +// / GetBlockSize / GetBlockFees Request +// / Either the starting and ending heights OR the from_tip param must be specified +type BlockGroupRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The height from the chain tip (optional) + FromTip uint64 `protobuf:"varint,1,opt,name=from_tip,json=fromTip,proto3" json:"from_tip,omitempty"` + // The starting height (optional) + StartHeight uint64 `protobuf:"varint,2,opt,name=start_height,json=startHeight,proto3" json:"start_height,omitempty"` + // The ending height (optional) + EndHeight uint64 `protobuf:"varint,3,opt,name=end_height,json=endHeight,proto3" json:"end_height,omitempty"` + // / The type of calculation required (optional) + // / Defaults to median + // / median, mean, quartile, quantile + CalcType CalcType `protobuf:"varint,4,opt,name=calc_type,json=calcType,proto3,enum=tari.rpc.CalcType" json:"calc_type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BlockGroupRequest) Reset() { + *x = BlockGroupRequest{} + mi := &file_base_node_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlockGroupRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockGroupRequest) ProtoMessage() {} + +func (x *BlockGroupRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockGroupRequest.ProtoReflect.Descriptor instead. +func (*BlockGroupRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{18} +} + +func (x *BlockGroupRequest) GetFromTip() uint64 { + if x != nil { + return x.FromTip + } + return 0 +} + +func (x *BlockGroupRequest) GetStartHeight() uint64 { + if x != nil { + return x.StartHeight + } + return 0 +} + +func (x *BlockGroupRequest) GetEndHeight() uint64 { + if x != nil { + return x.EndHeight + } + return 0 +} + +func (x *BlockGroupRequest) GetCalcType() CalcType { + if x != nil { + return x.CalcType + } + return CalcType_MEAN +} + +// / GetBlockSize / GetBlockFees Response +type BlockGroupResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Value []float64 `protobuf:"fixed64,1,rep,packed,name=value,proto3" json:"value,omitempty"` + CalcType CalcType `protobuf:"varint,2,opt,name=calc_type,json=calcType,proto3,enum=tari.rpc.CalcType" json:"calc_type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BlockGroupResponse) Reset() { + *x = BlockGroupResponse{} + mi := &file_base_node_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlockGroupResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockGroupResponse) ProtoMessage() {} + +func (x *BlockGroupResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockGroupResponse.ProtoReflect.Descriptor instead. +func (*BlockGroupResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{19} +} + +func (x *BlockGroupResponse) GetValue() []float64 { + if x != nil { + return x.Value + } + return nil +} + +func (x *BlockGroupResponse) GetCalcType() CalcType { + if x != nil { + return x.CalcType + } + return CalcType_MEAN +} + +// The request used for querying a function that requires a height, either between 2 points or from the chain tip +// If start_height and end_height are set and > 0, they take precedence, otherwise from_tip is used +type HeightRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The height from the chain tip (optional) + FromTip uint64 `protobuf:"varint,1,opt,name=from_tip,json=fromTip,proto3" json:"from_tip,omitempty"` + // The starting height (optional) + StartHeight uint64 `protobuf:"varint,2,opt,name=start_height,json=startHeight,proto3" json:"start_height,omitempty"` + // The ending height (optional) + EndHeight uint64 `protobuf:"varint,3,opt,name=end_height,json=endHeight,proto3" json:"end_height,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HeightRequest) Reset() { + *x = HeightRequest{} + mi := &file_base_node_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *HeightRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeightRequest) ProtoMessage() {} + +func (x *HeightRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HeightRequest.ProtoReflect.Descriptor instead. +func (*HeightRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{20} +} + +func (x *HeightRequest) GetFromTip() uint64 { + if x != nil { + return x.FromTip + } + return 0 +} + +func (x *HeightRequest) GetStartHeight() uint64 { + if x != nil { + return x.StartHeight + } + return 0 +} + +func (x *HeightRequest) GetEndHeight() uint64 { + if x != nil { + return x.EndHeight + } + return 0 +} + +// The return type of the rpc GetBlockTiming +type BlockTimingResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Max uint64 `protobuf:"varint,1,opt,name=max,proto3" json:"max,omitempty"` + Min uint64 `protobuf:"varint,2,opt,name=min,proto3" json:"min,omitempty"` + Avg float64 `protobuf:"fixed64,3,opt,name=avg,proto3" json:"avg,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BlockTimingResponse) Reset() { + *x = BlockTimingResponse{} + mi := &file_base_node_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlockTimingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockTimingResponse) ProtoMessage() {} + +func (x *BlockTimingResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockTimingResponse.ProtoReflect.Descriptor instead. +func (*BlockTimingResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{21} +} + +func (x *BlockTimingResponse) GetMax() uint64 { + if x != nil { + return x.Max + } + return 0 +} + +func (x *BlockTimingResponse) GetMin() uint64 { + if x != nil { + return x.Min + } + return 0 +} + +func (x *BlockTimingResponse) GetAvg() float64 { + if x != nil { + return x.Avg + } + return 0 +} + +// Request that returns a header based by hash +type GetHeaderByHashRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The hash of the block header + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetHeaderByHashRequest) Reset() { + *x = GetHeaderByHashRequest{} + mi := &file_base_node_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetHeaderByHashRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetHeaderByHashRequest) ProtoMessage() {} + +func (x *GetHeaderByHashRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetHeaderByHashRequest.ProtoReflect.Descriptor instead. +func (*GetHeaderByHashRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{22} +} + +func (x *GetHeaderByHashRequest) GetHash() []byte { + if x != nil { + return x.Hash + } + return nil +} + +type BlockHeaderResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The block header + Header *block.BlockHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // The number of blocks from the tip of this block (a.k.a depth) + Confirmations uint64 `protobuf:"varint,2,opt,name=confirmations,proto3" json:"confirmations,omitempty"` + // The block reward i.e mining reward + fees + Reward uint64 `protobuf:"varint,3,opt,name=reward,proto3" json:"reward,omitempty"` + // Achieved difficulty + Difficulty uint64 `protobuf:"varint,4,opt,name=difficulty,proto3" json:"difficulty,omitempty"` + // The number of transactions contained in the block + NumTransactions uint32 `protobuf:"varint,5,opt,name=num_transactions,json=numTransactions,proto3" json:"num_transactions,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BlockHeaderResponse) Reset() { + *x = BlockHeaderResponse{} + mi := &file_base_node_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlockHeaderResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockHeaderResponse) ProtoMessage() {} + +func (x *BlockHeaderResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockHeaderResponse.ProtoReflect.Descriptor instead. +func (*BlockHeaderResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{23} +} + +func (x *BlockHeaderResponse) GetHeader() *block.BlockHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *BlockHeaderResponse) GetConfirmations() uint64 { + if x != nil { + return x.Confirmations + } + return 0 +} + +func (x *BlockHeaderResponse) GetReward() uint64 { + if x != nil { + return x.Reward + } + return 0 +} + +func (x *BlockHeaderResponse) GetDifficulty() uint64 { + if x != nil { + return x.Difficulty + } + return 0 +} + +func (x *BlockHeaderResponse) GetNumTransactions() uint32 { + if x != nil { + return x.NumTransactions + } + return 0 +} + +// The request used for querying headers from the base node. The parameters `from_height` and `num_headers` can be used +// to page through the current best chain. +type ListHeadersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The height to start at. Depending on sorting, will either default to use the tip or genesis block, for `SORTING_DESC` + // and `SORTING_ASC` respectively, if a value is not provided. The first header returned will be at this height + // followed by `num_headers` - 1 headers in the direction specified by `sorting`. If greater than the current tip, + // the current tip will be used. + FromHeight uint64 `protobuf:"varint,1,opt,name=from_height,json=fromHeight,proto3" json:"from_height,omitempty"` + // The number of headers to return. If not specified, it will default to 10 + NumHeaders uint64 `protobuf:"varint,2,opt,name=num_headers,json=numHeaders,proto3" json:"num_headers,omitempty"` + // The ordering to return the headers in. If not specified will default to SORTING_DESC. Note that if `from_height` + // is not specified or is 0, if `sorting` is SORTING_DESC, the tip will be used as `from_height`, otherwise the + // block at height 0 will be used. + Sorting Sorting `protobuf:"varint,3,opt,name=sorting,proto3,enum=tari.rpc.Sorting" json:"sorting,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListHeadersRequest) Reset() { + *x = ListHeadersRequest{} + mi := &file_base_node_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListHeadersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListHeadersRequest) ProtoMessage() {} + +func (x *ListHeadersRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListHeadersRequest.ProtoReflect.Descriptor instead. +func (*ListHeadersRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{24} +} + +func (x *ListHeadersRequest) GetFromHeight() uint64 { + if x != nil { + return x.FromHeight + } + return 0 +} + +func (x *ListHeadersRequest) GetNumHeaders() uint64 { + if x != nil { + return x.NumHeaders + } + return 0 +} + +func (x *ListHeadersRequest) GetSorting() Sorting { + if x != nil { + return x.Sorting + } + return Sorting_SORTING_DESC +} + +// The request used for querying blocks in the base node's current best chain. Currently only querying by height is +// available. Multiple blocks may be queried.e.g. [189092,100023,122424]. The order in which they are returned is not +// guaranteed. +type GetBlocksRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Heights []uint64 `protobuf:"varint,1,rep,packed,name=heights,proto3" json:"heights,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetBlocksRequest) Reset() { + *x = GetBlocksRequest{} + mi := &file_base_node_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetBlocksRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBlocksRequest) ProtoMessage() {} + +func (x *GetBlocksRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBlocksRequest.ProtoReflect.Descriptor instead. +func (*GetBlocksRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{25} +} + +func (x *GetBlocksRequest) GetHeights() []uint64 { + if x != nil { + return x.Heights + } + return nil +} + +// The return type of the rpc GetBlocks. Blocks are not guaranteed to be returned in the order requested. +type GetBlocksResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Blocks []*block.HistoricalBlock `protobuf:"bytes,1,rep,name=blocks,proto3" json:"blocks,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetBlocksResponse) Reset() { + *x = GetBlocksResponse{} + mi := &file_base_node_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetBlocksResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBlocksResponse) ProtoMessage() {} + +func (x *GetBlocksResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBlocksResponse.ProtoReflect.Descriptor instead. +func (*GetBlocksResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{26} +} + +func (x *GetBlocksResponse) GetBlocks() []*block.HistoricalBlock { + if x != nil { + return x.Blocks + } + return nil +} + +type MetaData struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The current chain height, or the block number of the longest valid chain, or `None` if there is no chain + BestBlockHeight uint64 `protobuf:"varint,1,opt,name=best_block_height,json=bestBlockHeight,proto3" json:"best_block_height,omitempty"` + // The block hash of the current tip of the longest valid chain, or `None` for an empty chain + BestBlockHash []byte `protobuf:"bytes,2,opt,name=best_block_hash,json=bestBlockHash,proto3" json:"best_block_hash,omitempty"` + // The current geometric mean of the pow of the chain tip, or `None` if there is no chain + AccumulatedDifficulty []byte `protobuf:"bytes,5,opt,name=accumulated_difficulty,json=accumulatedDifficulty,proto3" json:"accumulated_difficulty,omitempty"` + // This is the min height this node can provide complete blocks for. A 0 here means this node is archival and can provide complete blocks for every height. + PrunedHeight uint64 `protobuf:"varint,6,opt,name=pruned_height,json=prunedHeight,proto3" json:"pruned_height,omitempty"` + Timestamp uint64 `protobuf:"varint,7,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MetaData) Reset() { + *x = MetaData{} + mi := &file_base_node_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MetaData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MetaData) ProtoMessage() {} + +func (x *MetaData) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MetaData.ProtoReflect.Descriptor instead. +func (*MetaData) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{27} +} + +func (x *MetaData) GetBestBlockHeight() uint64 { + if x != nil { + return x.BestBlockHeight + } + return 0 +} + +func (x *MetaData) GetBestBlockHash() []byte { + if x != nil { + return x.BestBlockHash + } + return nil +} + +func (x *MetaData) GetAccumulatedDifficulty() []byte { + if x != nil { + return x.AccumulatedDifficulty + } + return nil +} + +func (x *MetaData) GetPrunedHeight() uint64 { + if x != nil { + return x.PrunedHeight + } + return 0 +} + +func (x *MetaData) GetTimestamp() uint64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +type SyncInfoResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + TipHeight uint64 `protobuf:"varint,1,opt,name=tip_height,json=tipHeight,proto3" json:"tip_height,omitempty"` + LocalHeight uint64 `protobuf:"varint,2,opt,name=local_height,json=localHeight,proto3" json:"local_height,omitempty"` + PeerNodeId [][]byte `protobuf:"bytes,3,rep,name=peer_node_id,json=peerNodeId,proto3" json:"peer_node_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SyncInfoResponse) Reset() { + *x = SyncInfoResponse{} + mi := &file_base_node_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SyncInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncInfoResponse) ProtoMessage() {} + +func (x *SyncInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncInfoResponse.ProtoReflect.Descriptor instead. +func (*SyncInfoResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{28} +} + +func (x *SyncInfoResponse) GetTipHeight() uint64 { + if x != nil { + return x.TipHeight + } + return 0 +} + +func (x *SyncInfoResponse) GetLocalHeight() uint64 { + if x != nil { + return x.LocalHeight + } + return 0 +} + +func (x *SyncInfoResponse) GetPeerNodeId() [][]byte { + if x != nil { + return x.PeerNodeId + } + return nil +} + +type SyncProgressResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + TipHeight uint64 `protobuf:"varint,1,opt,name=tip_height,json=tipHeight,proto3" json:"tip_height,omitempty"` + LocalHeight uint64 `protobuf:"varint,2,opt,name=local_height,json=localHeight,proto3" json:"local_height,omitempty"` + State SyncState `protobuf:"varint,3,opt,name=state,proto3,enum=tari.rpc.SyncState" json:"state,omitempty"` + ShortDesc string `protobuf:"bytes,4,opt,name=short_desc,json=shortDesc,proto3" json:"short_desc,omitempty"` + InitialConnectedPeers uint64 `protobuf:"varint,5,opt,name=initial_connected_peers,json=initialConnectedPeers,proto3" json:"initial_connected_peers,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SyncProgressResponse) Reset() { + *x = SyncProgressResponse{} + mi := &file_base_node_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SyncProgressResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncProgressResponse) ProtoMessage() {} + +func (x *SyncProgressResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncProgressResponse.ProtoReflect.Descriptor instead. +func (*SyncProgressResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{29} +} + +func (x *SyncProgressResponse) GetTipHeight() uint64 { + if x != nil { + return x.TipHeight + } + return 0 +} + +func (x *SyncProgressResponse) GetLocalHeight() uint64 { + if x != nil { + return x.LocalHeight + } + return 0 +} + +func (x *SyncProgressResponse) GetState() SyncState { + if x != nil { + return x.State + } + return SyncState_STARTUP +} + +func (x *SyncProgressResponse) GetShortDesc() string { + if x != nil { + return x.ShortDesc + } + return "" +} + +func (x *SyncProgressResponse) GetInitialConnectedPeers() uint64 { + if x != nil { + return x.InitialConnectedPeers + } + return 0 +} + +// This is the message that is returned for a miner after it asks for a new block. +type GetNewBlockResult struct { + state protoimpl.MessageState `protogen:"open.v1"` + // This is the header hash of the completed block + BlockHash []byte `protobuf:"bytes,1,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` + // This is the completed block + Block *block.Block `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` + MergeMiningHash []byte `protobuf:"bytes,3,opt,name=merge_mining_hash,json=mergeMiningHash,proto3" json:"merge_mining_hash,omitempty"` + TariUniqueId []byte `protobuf:"bytes,4,opt,name=tari_unique_id,json=tariUniqueId,proto3" json:"tari_unique_id,omitempty"` + MinerData *MinerData `protobuf:"bytes,5,opt,name=miner_data,json=minerData,proto3" json:"miner_data,omitempty"` + VmKey []byte `protobuf:"bytes,6,opt,name=vm_key,json=vmKey,proto3" json:"vm_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetNewBlockResult) Reset() { + *x = GetNewBlockResult{} + mi := &file_base_node_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetNewBlockResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNewBlockResult) ProtoMessage() {} + +func (x *GetNewBlockResult) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetNewBlockResult.ProtoReflect.Descriptor instead. +func (*GetNewBlockResult) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{30} +} + +func (x *GetNewBlockResult) GetBlockHash() []byte { + if x != nil { + return x.BlockHash + } + return nil +} + +func (x *GetNewBlockResult) GetBlock() *block.Block { + if x != nil { + return x.Block + } + return nil +} + +func (x *GetNewBlockResult) GetMergeMiningHash() []byte { + if x != nil { + return x.MergeMiningHash + } + return nil +} + +func (x *GetNewBlockResult) GetTariUniqueId() []byte { + if x != nil { + return x.TariUniqueId + } + return nil +} + +func (x *GetNewBlockResult) GetMinerData() *MinerData { + if x != nil { + return x.MinerData + } + return nil +} + +func (x *GetNewBlockResult) GetVmKey() []byte { + if x != nil { + return x.VmKey + } + return nil +} + +// This is the message that is returned for a miner after it asks for a new block. +type GetNewBlockBlobResult struct { + state protoimpl.MessageState `protogen:"open.v1"` + // This is the header hash of the completed block + BlockHash []byte `protobuf:"bytes,1,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` + // This is the completed block's header + Header []byte `protobuf:"bytes,2,opt,name=header,proto3" json:"header,omitempty"` + // This is the completed block's body + BlockBody []byte `protobuf:"bytes,3,opt,name=block_body,json=blockBody,proto3" json:"block_body,omitempty"` + MergeMiningHash []byte `protobuf:"bytes,4,opt,name=merge_mining_hash,json=mergeMiningHash,proto3" json:"merge_mining_hash,omitempty"` + UtxoMr []byte `protobuf:"bytes,5,opt,name=utxo_mr,json=utxoMr,proto3" json:"utxo_mr,omitempty"` + TariUniqueId []byte `protobuf:"bytes,6,opt,name=tari_unique_id,json=tariUniqueId,proto3" json:"tari_unique_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetNewBlockBlobResult) Reset() { + *x = GetNewBlockBlobResult{} + mi := &file_base_node_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetNewBlockBlobResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNewBlockBlobResult) ProtoMessage() {} + +func (x *GetNewBlockBlobResult) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetNewBlockBlobResult.ProtoReflect.Descriptor instead. +func (*GetNewBlockBlobResult) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{31} +} + +func (x *GetNewBlockBlobResult) GetBlockHash() []byte { + if x != nil { + return x.BlockHash + } + return nil +} + +func (x *GetNewBlockBlobResult) GetHeader() []byte { + if x != nil { + return x.Header + } + return nil +} + +func (x *GetNewBlockBlobResult) GetBlockBody() []byte { + if x != nil { + return x.BlockBody + } + return nil +} + +func (x *GetNewBlockBlobResult) GetMergeMiningHash() []byte { + if x != nil { + return x.MergeMiningHash + } + return nil +} + +func (x *GetNewBlockBlobResult) GetUtxoMr() []byte { + if x != nil { + return x.UtxoMr + } + return nil +} + +func (x *GetNewBlockBlobResult) GetTariUniqueId() []byte { + if x != nil { + return x.TariUniqueId + } + return nil +} + +// This is mining data for the miner asking for a new block +type MinerData struct { + state protoimpl.MessageState `protogen:"open.v1"` + Algo *block.PowAlgo `protobuf:"bytes,1,opt,name=algo,proto3" json:"algo,omitempty"` + TargetDifficulty uint64 `protobuf:"varint,2,opt,name=target_difficulty,json=targetDifficulty,proto3" json:"target_difficulty,omitempty"` + Reward uint64 `protobuf:"varint,3,opt,name=reward,proto3" json:"reward,omitempty"` + // bytes merge_mining_hash =4; + TotalFees uint64 `protobuf:"varint,5,opt,name=total_fees,json=totalFees,proto3" json:"total_fees,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MinerData) Reset() { + *x = MinerData{} + mi := &file_base_node_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MinerData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MinerData) ProtoMessage() {} + +func (x *MinerData) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[32] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MinerData.ProtoReflect.Descriptor instead. +func (*MinerData) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{32} +} + +func (x *MinerData) GetAlgo() *block.PowAlgo { + if x != nil { + return x.Algo + } + return nil +} + +func (x *MinerData) GetTargetDifficulty() uint64 { + if x != nil { + return x.TargetDifficulty + } + return 0 +} + +func (x *MinerData) GetReward() uint64 { + if x != nil { + return x.Reward + } + return 0 +} + +func (x *MinerData) GetTotalFees() uint64 { + if x != nil { + return x.TotalFees + } + return 0 +} + +// This is the request type for the Search Kernels rpc +type SearchKernelsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Signatures []*types.Signature `protobuf:"bytes,1,rep,name=signatures,proto3" json:"signatures,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchKernelsRequest) Reset() { + *x = SearchKernelsRequest{} + mi := &file_base_node_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SearchKernelsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchKernelsRequest) ProtoMessage() {} + +func (x *SearchKernelsRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[33] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchKernelsRequest.ProtoReflect.Descriptor instead. +func (*SearchKernelsRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{33} +} + +func (x *SearchKernelsRequest) GetSignatures() []*types.Signature { + if x != nil { + return x.Signatures + } + return nil +} + +// This is the request type for the Search Utxo rpc +type SearchUtxosRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Commitments [][]byte `protobuf:"bytes,1,rep,name=commitments,proto3" json:"commitments,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchUtxosRequest) Reset() { + *x = SearchUtxosRequest{} + mi := &file_base_node_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SearchUtxosRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchUtxosRequest) ProtoMessage() {} + +func (x *SearchUtxosRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[34] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchUtxosRequest.ProtoReflect.Descriptor instead. +func (*SearchUtxosRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{34} +} + +func (x *SearchUtxosRequest) GetCommitments() [][]byte { + if x != nil { + return x.Commitments + } + return nil +} + +type FetchMatchingUtxosRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Hashes [][]byte `protobuf:"bytes,1,rep,name=hashes,proto3" json:"hashes,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FetchMatchingUtxosRequest) Reset() { + *x = FetchMatchingUtxosRequest{} + mi := &file_base_node_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FetchMatchingUtxosRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchMatchingUtxosRequest) ProtoMessage() {} + +func (x *FetchMatchingUtxosRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[35] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FetchMatchingUtxosRequest.ProtoReflect.Descriptor instead. +func (*FetchMatchingUtxosRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{35} +} + +func (x *FetchMatchingUtxosRequest) GetHashes() [][]byte { + if x != nil { + return x.Hashes + } + return nil +} + +type FetchMatchingUtxosResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Output *transaction.TransactionOutput `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FetchMatchingUtxosResponse) Reset() { + *x = FetchMatchingUtxosResponse{} + mi := &file_base_node_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FetchMatchingUtxosResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FetchMatchingUtxosResponse) ProtoMessage() {} + +func (x *FetchMatchingUtxosResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[36] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FetchMatchingUtxosResponse.ProtoReflect.Descriptor instead. +func (*FetchMatchingUtxosResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{36} +} + +func (x *FetchMatchingUtxosResponse) GetOutput() *transaction.TransactionOutput { + if x != nil { + return x.Output + } + return nil +} + +// This is the request type of the get all peers rpc call +type GetPeersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Peer *net_work.Peer `protobuf:"bytes,1,opt,name=peer,proto3" json:"peer,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetPeersResponse) Reset() { + *x = GetPeersResponse{} + mi := &file_base_node_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetPeersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPeersResponse) ProtoMessage() {} + +func (x *GetPeersResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[37] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPeersResponse.ProtoReflect.Descriptor instead. +func (*GetPeersResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{37} +} + +func (x *GetPeersResponse) GetPeer() *net_work.Peer { + if x != nil { + return x.Peer + } + return nil +} + +type GetPeersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetPeersRequest) Reset() { + *x = GetPeersRequest{} + mi := &file_base_node_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetPeersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPeersRequest) ProtoMessage() {} + +func (x *GetPeersRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[38] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPeersRequest.ProtoReflect.Descriptor instead. +func (*GetPeersRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{38} +} + +type SubmitTransactionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Transaction *transaction.Transaction `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SubmitTransactionRequest) Reset() { + *x = SubmitTransactionRequest{} + mi := &file_base_node_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SubmitTransactionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubmitTransactionRequest) ProtoMessage() {} + +func (x *SubmitTransactionRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[39] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubmitTransactionRequest.ProtoReflect.Descriptor instead. +func (*SubmitTransactionRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{39} +} + +func (x *SubmitTransactionRequest) GetTransaction() *transaction.Transaction { + if x != nil { + return x.Transaction + } + return nil +} + +type SubmitTransactionResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Result SubmitTransactionResult `protobuf:"varint,1,opt,name=result,proto3,enum=tari.rpc.SubmitTransactionResult" json:"result,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SubmitTransactionResponse) Reset() { + *x = SubmitTransactionResponse{} + mi := &file_base_node_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SubmitTransactionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubmitTransactionResponse) ProtoMessage() {} + +func (x *SubmitTransactionResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[40] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubmitTransactionResponse.ProtoReflect.Descriptor instead. +func (*SubmitTransactionResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{40} +} + +func (x *SubmitTransactionResponse) GetResult() SubmitTransactionResult { + if x != nil { + return x.Result + } + return SubmitTransactionResult_NONE +} + +type GetMempoolTransactionsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetMempoolTransactionsRequest) Reset() { + *x = GetMempoolTransactionsRequest{} + mi := &file_base_node_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetMempoolTransactionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMempoolTransactionsRequest) ProtoMessage() {} + +func (x *GetMempoolTransactionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[41] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetMempoolTransactionsRequest.ProtoReflect.Descriptor instead. +func (*GetMempoolTransactionsRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{41} +} + +type GetMempoolTransactionsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Transaction *transaction.Transaction `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetMempoolTransactionsResponse) Reset() { + *x = GetMempoolTransactionsResponse{} + mi := &file_base_node_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetMempoolTransactionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMempoolTransactionsResponse) ProtoMessage() {} + +func (x *GetMempoolTransactionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[42] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetMempoolTransactionsResponse.ProtoReflect.Descriptor instead. +func (*GetMempoolTransactionsResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{42} +} + +func (x *GetMempoolTransactionsResponse) GetTransaction() *transaction.Transaction { + if x != nil { + return x.Transaction + } + return nil +} + +type TransactionStateRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ExcessSig *types.Signature `protobuf:"bytes,1,opt,name=excess_sig,json=excessSig,proto3" json:"excess_sig,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TransactionStateRequest) Reset() { + *x = TransactionStateRequest{} + mi := &file_base_node_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TransactionStateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransactionStateRequest) ProtoMessage() {} + +func (x *TransactionStateRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[43] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransactionStateRequest.ProtoReflect.Descriptor instead. +func (*TransactionStateRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{43} +} + +func (x *TransactionStateRequest) GetExcessSig() *types.Signature { + if x != nil { + return x.ExcessSig + } + return nil +} + +type TransactionStateResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Result TransactionLocation `protobuf:"varint,1,opt,name=result,proto3,enum=tari.rpc.TransactionLocation" json:"result,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TransactionStateResponse) Reset() { + *x = TransactionStateResponse{} + mi := &file_base_node_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TransactionStateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransactionStateResponse) ProtoMessage() {} + +func (x *TransactionStateResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[44] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransactionStateResponse.ProtoReflect.Descriptor instead. +func (*TransactionStateResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{44} +} + +func (x *TransactionStateResponse) GetResult() TransactionLocation { + if x != nil { + return x.Result + } + return TransactionLocation_UNKNOWN +} + +type MempoolStatsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + UnconfirmedTxs uint64 `protobuf:"varint,2,opt,name=unconfirmed_txs,json=unconfirmedTxs,proto3" json:"unconfirmed_txs,omitempty"` + ReorgTxs uint64 `protobuf:"varint,3,opt,name=reorg_txs,json=reorgTxs,proto3" json:"reorg_txs,omitempty"` + UnconfirmedWeight uint64 `protobuf:"varint,4,opt,name=unconfirmed_weight,json=unconfirmedWeight,proto3" json:"unconfirmed_weight,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MempoolStatsResponse) Reset() { + *x = MempoolStatsResponse{} + mi := &file_base_node_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MempoolStatsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MempoolStatsResponse) ProtoMessage() {} + +func (x *MempoolStatsResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[45] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MempoolStatsResponse.ProtoReflect.Descriptor instead. +func (*MempoolStatsResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{45} +} + +func (x *MempoolStatsResponse) GetUnconfirmedTxs() uint64 { + if x != nil { + return x.UnconfirmedTxs + } + return 0 +} + +func (x *MempoolStatsResponse) GetReorgTxs() uint64 { + if x != nil { + return x.ReorgTxs + } + return 0 +} + +func (x *MempoolStatsResponse) GetUnconfirmedWeight() uint64 { + if x != nil { + return x.UnconfirmedWeight + } + return 0 +} + +type GetActiveValidatorNodesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetActiveValidatorNodesRequest) Reset() { + *x = GetActiveValidatorNodesRequest{} + mi := &file_base_node_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetActiveValidatorNodesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetActiveValidatorNodesRequest) ProtoMessage() {} + +func (x *GetActiveValidatorNodesRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[46] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetActiveValidatorNodesRequest.ProtoReflect.Descriptor instead. +func (*GetActiveValidatorNodesRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{46} +} + +func (x *GetActiveValidatorNodesRequest) GetHeight() uint64 { + if x != nil { + return x.Height + } + return 0 +} + +type GetActiveValidatorNodesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + ShardKey []byte `protobuf:"bytes,1,opt,name=shard_key,json=shardKey,proto3" json:"shard_key,omitempty"` + PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetActiveValidatorNodesResponse) Reset() { + *x = GetActiveValidatorNodesResponse{} + mi := &file_base_node_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetActiveValidatorNodesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetActiveValidatorNodesResponse) ProtoMessage() {} + +func (x *GetActiveValidatorNodesResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[47] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetActiveValidatorNodesResponse.ProtoReflect.Descriptor instead. +func (*GetActiveValidatorNodesResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{47} +} + +func (x *GetActiveValidatorNodesResponse) GetShardKey() []byte { + if x != nil { + return x.ShardKey + } + return nil +} + +func (x *GetActiveValidatorNodesResponse) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +type GetShardKeyRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetShardKeyRequest) Reset() { + *x = GetShardKeyRequest{} + mi := &file_base_node_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetShardKeyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetShardKeyRequest) ProtoMessage() {} + +func (x *GetShardKeyRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[48] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetShardKeyRequest.ProtoReflect.Descriptor instead. +func (*GetShardKeyRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{48} +} + +func (x *GetShardKeyRequest) GetHeight() uint64 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *GetShardKeyRequest) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +type GetShardKeyResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + ShardKey []byte `protobuf:"bytes,1,opt,name=shard_key,json=shardKey,proto3" json:"shard_key,omitempty"` + Found bool `protobuf:"varint,2,opt,name=found,proto3" json:"found,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetShardKeyResponse) Reset() { + *x = GetShardKeyResponse{} + mi := &file_base_node_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetShardKeyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetShardKeyResponse) ProtoMessage() {} + +func (x *GetShardKeyResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[49] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetShardKeyResponse.ProtoReflect.Descriptor instead. +func (*GetShardKeyResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{49} +} + +func (x *GetShardKeyResponse) GetShardKey() []byte { + if x != nil { + return x.ShardKey + } + return nil +} + +func (x *GetShardKeyResponse) GetFound() bool { + if x != nil { + return x.Found + } + return false +} + +type GetTemplateRegistrationsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + StartHash []byte `protobuf:"bytes,1,opt,name=start_hash,json=startHash,proto3" json:"start_hash,omitempty"` + Count uint64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetTemplateRegistrationsRequest) Reset() { + *x = GetTemplateRegistrationsRequest{} + mi := &file_base_node_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetTemplateRegistrationsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTemplateRegistrationsRequest) ProtoMessage() {} + +func (x *GetTemplateRegistrationsRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[50] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetTemplateRegistrationsRequest.ProtoReflect.Descriptor instead. +func (*GetTemplateRegistrationsRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{50} +} + +func (x *GetTemplateRegistrationsRequest) GetStartHash() []byte { + if x != nil { + return x.StartHash + } + return nil +} + +func (x *GetTemplateRegistrationsRequest) GetCount() uint64 { + if x != nil { + return x.Count + } + return 0 +} + +type GetTemplateRegistrationResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + UtxoHash []byte `protobuf:"bytes,1,opt,name=utxo_hash,json=utxoHash,proto3" json:"utxo_hash,omitempty"` + Registration *sidechain_types.TemplateRegistration `protobuf:"bytes,2,opt,name=registration,proto3" json:"registration,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetTemplateRegistrationResponse) Reset() { + *x = GetTemplateRegistrationResponse{} + mi := &file_base_node_proto_msgTypes[51] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetTemplateRegistrationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTemplateRegistrationResponse) ProtoMessage() {} + +func (x *GetTemplateRegistrationResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[51] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetTemplateRegistrationResponse.ProtoReflect.Descriptor instead. +func (*GetTemplateRegistrationResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{51} +} + +func (x *GetTemplateRegistrationResponse) GetUtxoHash() []byte { + if x != nil { + return x.UtxoHash + } + return nil +} + +func (x *GetTemplateRegistrationResponse) GetRegistration() *sidechain_types.TemplateRegistration { + if x != nil { + return x.Registration + } + return nil +} + +type BlockInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` + NextBlockHash []byte `protobuf:"bytes,3,opt,name=next_block_hash,json=nextBlockHash,proto3" json:"next_block_hash,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BlockInfo) Reset() { + *x = BlockInfo{} + mi := &file_base_node_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlockInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockInfo) ProtoMessage() {} + +func (x *BlockInfo) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[52] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockInfo.ProtoReflect.Descriptor instead. +func (*BlockInfo) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{52} +} + +func (x *BlockInfo) GetHeight() uint64 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *BlockInfo) GetHash() []byte { + if x != nil { + return x.Hash + } + return nil +} + +func (x *BlockInfo) GetNextBlockHash() []byte { + if x != nil { + return x.NextBlockHash + } + return nil +} + +type GetSideChainUtxosRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + StartHash []byte `protobuf:"bytes,1,opt,name=start_hash,json=startHash,proto3" json:"start_hash,omitempty"` + Count uint64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetSideChainUtxosRequest) Reset() { + *x = GetSideChainUtxosRequest{} + mi := &file_base_node_proto_msgTypes[53] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSideChainUtxosRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSideChainUtxosRequest) ProtoMessage() {} + +func (x *GetSideChainUtxosRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[53] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSideChainUtxosRequest.ProtoReflect.Descriptor instead. +func (*GetSideChainUtxosRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{53} +} + +func (x *GetSideChainUtxosRequest) GetStartHash() []byte { + if x != nil { + return x.StartHash + } + return nil +} + +func (x *GetSideChainUtxosRequest) GetCount() uint64 { + if x != nil { + return x.Count + } + return 0 +} + +type GetSideChainUtxosResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + BlockInfo *BlockInfo `protobuf:"bytes,1,opt,name=block_info,json=blockInfo,proto3" json:"block_info,omitempty"` + Outputs []*transaction.TransactionOutput `protobuf:"bytes,2,rep,name=outputs,proto3" json:"outputs,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetSideChainUtxosResponse) Reset() { + *x = GetSideChainUtxosResponse{} + mi := &file_base_node_proto_msgTypes[54] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSideChainUtxosResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSideChainUtxosResponse) ProtoMessage() {} + +func (x *GetSideChainUtxosResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[54] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSideChainUtxosResponse.ProtoReflect.Descriptor instead. +func (*GetSideChainUtxosResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{54} +} + +func (x *GetSideChainUtxosResponse) GetBlockInfo() *BlockInfo { + if x != nil { + return x.BlockInfo + } + return nil +} + +func (x *GetSideChainUtxosResponse) GetOutputs() []*transaction.TransactionOutput { + if x != nil { + return x.Outputs + } + return nil +} + +type GetNetworkStateRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetNetworkStateRequest) Reset() { + *x = GetNetworkStateRequest{} + mi := &file_base_node_proto_msgTypes[55] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetNetworkStateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNetworkStateRequest) ProtoMessage() {} + +func (x *GetNetworkStateRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[55] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetNetworkStateRequest.ProtoReflect.Descriptor instead. +func (*GetNetworkStateRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{55} +} + +type GetNetworkStateResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // metadata + Metadata *MetaData `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + // has the base node synced + InitialSyncAchieved bool `protobuf:"varint,2,opt,name=initial_sync_achieved,json=initialSyncAchieved,proto3" json:"initial_sync_achieved,omitempty"` + // current state of the base node + BaseNodeState BaseNodeState `protobuf:"varint,3,opt,name=base_node_state,json=baseNodeState,proto3,enum=tari.rpc.BaseNodeState" json:"base_node_state,omitempty"` + // do we have failed checkpoints + FailedCheckpoints bool `protobuf:"varint,4,opt,name=failed_checkpoints,json=failedCheckpoints,proto3" json:"failed_checkpoints,omitempty"` + // The block reward of the next tip + Reward uint64 `protobuf:"varint,5,opt,name=reward,proto3" json:"reward,omitempty"` + // estimate sha3x hash rate + Sha3XEstimatedHashRate uint64 `protobuf:"varint,6,opt,name=sha3x_estimated_hash_rate,json=sha3xEstimatedHashRate,proto3" json:"sha3x_estimated_hash_rate,omitempty"` + // estimate randomx hash rate + MoneroRandomxEstimatedHashRate uint64 `protobuf:"varint,7,opt,name=monero_randomx_estimated_hash_rate,json=moneroRandomxEstimatedHashRate,proto3" json:"monero_randomx_estimated_hash_rate,omitempty"` + TariRandomxEstimatedHashRate uint64 `protobuf:"varint,10,opt,name=tari_randomx_estimated_hash_rate,json=tariRandomxEstimatedHashRate,proto3" json:"tari_randomx_estimated_hash_rate,omitempty"` + // number of connections + NumConnections uint64 `protobuf:"varint,8,opt,name=num_connections,json=numConnections,proto3" json:"num_connections,omitempty"` + // liveness results + LivenessResults []*LivenessResult `protobuf:"bytes,9,rep,name=liveness_results,json=livenessResults,proto3" json:"liveness_results,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetNetworkStateResponse) Reset() { + *x = GetNetworkStateResponse{} + mi := &file_base_node_proto_msgTypes[56] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetNetworkStateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNetworkStateResponse) ProtoMessage() {} + +func (x *GetNetworkStateResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[56] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetNetworkStateResponse.ProtoReflect.Descriptor instead. +func (*GetNetworkStateResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{56} +} + +func (x *GetNetworkStateResponse) GetMetadata() *MetaData { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *GetNetworkStateResponse) GetInitialSyncAchieved() bool { + if x != nil { + return x.InitialSyncAchieved + } + return false +} + +func (x *GetNetworkStateResponse) GetBaseNodeState() BaseNodeState { + if x != nil { + return x.BaseNodeState + } + return BaseNodeState_START_UP +} + +func (x *GetNetworkStateResponse) GetFailedCheckpoints() bool { + if x != nil { + return x.FailedCheckpoints + } + return false +} + +func (x *GetNetworkStateResponse) GetReward() uint64 { + if x != nil { + return x.Reward + } + return 0 +} + +func (x *GetNetworkStateResponse) GetSha3XEstimatedHashRate() uint64 { + if x != nil { + return x.Sha3XEstimatedHashRate + } + return 0 +} + +func (x *GetNetworkStateResponse) GetMoneroRandomxEstimatedHashRate() uint64 { + if x != nil { + return x.MoneroRandomxEstimatedHashRate + } + return 0 +} + +func (x *GetNetworkStateResponse) GetTariRandomxEstimatedHashRate() uint64 { + if x != nil { + return x.TariRandomxEstimatedHashRate + } + return 0 +} + +func (x *GetNetworkStateResponse) GetNumConnections() uint64 { + if x != nil { + return x.NumConnections + } + return 0 +} + +func (x *GetNetworkStateResponse) GetLivenessResults() []*LivenessResult { + if x != nil { + return x.LivenessResults + } + return nil +} + +type LivenessResult struct { + state protoimpl.MessageState `protogen:"open.v1"` + // node id + PeerNodeId []byte `protobuf:"bytes,1,opt,name=peer_node_id,json=peerNodeId,proto3" json:"peer_node_id,omitempty"` + // time to discover + DiscoverLatency uint64 `protobuf:"varint,2,opt,name=discover_latency,json=discoverLatency,proto3" json:"discover_latency,omitempty"` + // Dial latency + PingLatency uint64 `protobuf:"varint,3,opt,name=ping_latency,json=pingLatency,proto3" json:"ping_latency,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *LivenessResult) Reset() { + *x = LivenessResult{} + mi := &file_base_node_proto_msgTypes[57] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LivenessResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LivenessResult) ProtoMessage() {} + +func (x *LivenessResult) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[57] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LivenessResult.ProtoReflect.Descriptor instead. +func (*LivenessResult) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{57} +} + +func (x *LivenessResult) GetPeerNodeId() []byte { + if x != nil { + return x.PeerNodeId + } + return nil +} + +func (x *LivenessResult) GetDiscoverLatency() uint64 { + if x != nil { + return x.DiscoverLatency + } + return 0 +} + +func (x *LivenessResult) GetPingLatency() uint64 { + if x != nil { + return x.PingLatency + } + return 0 +} + +// Request to search for outputs by payment reference +type SearchPaymentReferencesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Payment reference as hex string (64 characters) + PaymentReferenceHex []string `protobuf:"bytes,1,rep,name=payment_reference_hex,json=paymentReferenceHex,proto3" json:"payment_reference_hex,omitempty"` + PaymentReferenceBytes [][]byte `protobuf:"bytes,2,rep,name=payment_reference_bytes,json=paymentReferenceBytes,proto3" json:"payment_reference_bytes,omitempty"` + // Optional: include spent outputs in results + IncludeSpent bool `protobuf:"varint,3,opt,name=include_spent,json=includeSpent,proto3" json:"include_spent,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchPaymentReferencesRequest) Reset() { + *x = SearchPaymentReferencesRequest{} + mi := &file_base_node_proto_msgTypes[58] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SearchPaymentReferencesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchPaymentReferencesRequest) ProtoMessage() {} + +func (x *SearchPaymentReferencesRequest) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[58] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchPaymentReferencesRequest.ProtoReflect.Descriptor instead. +func (*SearchPaymentReferencesRequest) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{58} +} + +func (x *SearchPaymentReferencesRequest) GetPaymentReferenceHex() []string { + if x != nil { + return x.PaymentReferenceHex + } + return nil +} + +func (x *SearchPaymentReferencesRequest) GetPaymentReferenceBytes() [][]byte { + if x != nil { + return x.PaymentReferenceBytes + } + return nil +} + +func (x *SearchPaymentReferencesRequest) GetIncludeSpent() bool { + if x != nil { + return x.IncludeSpent + } + return false +} + +// Response containing payment reference match +type PaymentReferenceResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The payment reference that was found + PaymentReferenceHex string `protobuf:"bytes,1,opt,name=payment_reference_hex,json=paymentReferenceHex,proto3" json:"payment_reference_hex,omitempty"` + // Block height where the output was mined + BlockHeight uint64 `protobuf:"varint,2,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + // Block hash where the output was mined + BlockHash []byte `protobuf:"bytes,3,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` + // Timestamp when the output was mined + MinedTimestamp uint64 `protobuf:"varint,4,opt,name=mined_timestamp,json=minedTimestamp,proto3" json:"mined_timestamp,omitempty"` + // Output commitment (32 bytes) + Commitment []byte `protobuf:"bytes,5,opt,name=commitment,proto3" json:"commitment,omitempty"` + // Whether this output has been spent + IsSpent bool `protobuf:"varint,6,opt,name=is_spent,json=isSpent,proto3" json:"is_spent,omitempty"` + // Height where output was spent (if spent) + SpentHeight uint64 `protobuf:"varint,7,opt,name=spent_height,json=spentHeight,proto3" json:"spent_height,omitempty"` + // Block hash where output was spent (if spent) + SpentBlockHash []byte `protobuf:"bytes,8,opt,name=spent_block_hash,json=spentBlockHash,proto3" json:"spent_block_hash,omitempty"` + // Transaction output amount will be 0 for non set a + MinValuePromise uint64 `protobuf:"varint,9,opt,name=min_value_promise,json=minValuePromise,proto3" json:"min_value_promise,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PaymentReferenceResponse) Reset() { + *x = PaymentReferenceResponse{} + mi := &file_base_node_proto_msgTypes[59] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PaymentReferenceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PaymentReferenceResponse) ProtoMessage() {} + +func (x *PaymentReferenceResponse) ProtoReflect() protoreflect.Message { + mi := &file_base_node_proto_msgTypes[59] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PaymentReferenceResponse.ProtoReflect.Descriptor instead. +func (*PaymentReferenceResponse) Descriptor() ([]byte, []int) { + return file_base_node_proto_rawDescGZIP(), []int{59} +} + +func (x *PaymentReferenceResponse) GetPaymentReferenceHex() string { + if x != nil { + return x.PaymentReferenceHex + } + return "" +} + +func (x *PaymentReferenceResponse) GetBlockHeight() uint64 { + if x != nil { + return x.BlockHeight + } + return 0 +} + +func (x *PaymentReferenceResponse) GetBlockHash() []byte { + if x != nil { + return x.BlockHash + } + return nil +} + +func (x *PaymentReferenceResponse) GetMinedTimestamp() uint64 { + if x != nil { + return x.MinedTimestamp + } + return 0 +} + +func (x *PaymentReferenceResponse) GetCommitment() []byte { + if x != nil { + return x.Commitment + } + return nil +} + +func (x *PaymentReferenceResponse) GetIsSpent() bool { + if x != nil { + return x.IsSpent + } + return false +} + +func (x *PaymentReferenceResponse) GetSpentHeight() uint64 { + if x != nil { + return x.SpentHeight + } + return 0 +} + +func (x *PaymentReferenceResponse) GetSpentBlockHash() []byte { + if x != nil { + return x.SpentBlockHash + } + return nil +} + +func (x *PaymentReferenceResponse) GetMinValuePromise() uint64 { + if x != nil { + return x.MinValuePromise + } + return 0 +} + +var File_base_node_proto protoreflect.FileDescriptor + +const file_base_node_proto_rawDesc = "" + + "\n" + + "\x0fbase_node.proto\x12\btari.rpc\x1a\vtypes.proto\x1a\x11transaction.proto\x1a\vblock.proto\x1a\rnetwork.proto\x1a\x15sidechain_types.proto\"C\n" + + "\x17GetAssetMetadataRequest\x12(\n" + + "\x10asset_public_key\x18\x01 \x01(\fR\x0eassetPublicKey\"\x90\x02\n" + + "\x18GetAssetMetadataResponse\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x14\n" + + "\x05image\x18\x04 \x01(\tR\x05image\x12)\n" + + "\x10owner_commitment\x18\x05 \x01(\fR\x0fownerCommitment\x124\n" + + "\bfeatures\x18\x06 \x01(\v2\x18.tari.rpc.OutputFeaturesR\bfeatures\x12!\n" + + "\fmined_height\x18\a \x01(\x04R\vminedHeight\x12$\n" + + "\x0emined_in_block\x18\b \x01(\fR\fminedInBlock\"M\n" + + "\x1dListAssetRegistrationsRequest\x12\x16\n" + + "\x06offset\x18\x02 \x01(\x04R\x06offset\x12\x14\n" + + "\x05count\x18\x03 \x01(\x04R\x05count\"\xa9\x02\n" + + "\x1eListAssetRegistrationsResponse\x12(\n" + + "\x10asset_public_key\x18\x01 \x01(\fR\x0eassetPublicKey\x12\x1b\n" + + "\tunique_id\x18\x02 \x01(\fR\buniqueId\x12)\n" + + "\x10owner_commitment\x18\x03 \x01(\fR\x0fownerCommitment\x12!\n" + + "\fmined_height\x18\x04 \x01(\x04R\vminedHeight\x12$\n" + + "\x0emined_in_block\x18\x05 \x01(\fR\fminedInBlock\x124\n" + + "\bfeatures\x18\x06 \x01(\v2\x18.tari.rpc.OutputFeaturesR\bfeatures\x12\x16\n" + + "\x06script\x18\a \x01(\fR\x06script\"[\n" + + "\x10GetTokensRequest\x12(\n" + + "\x10asset_public_key\x18\x01 \x01(\fR\x0eassetPublicKey\x12\x1d\n" + + "\n" + + "unique_ids\x18\x02 \x03(\fR\tuniqueIds\"\x9c\x02\n" + + "\x11GetTokensResponse\x12\x1b\n" + + "\tunique_id\x18\x01 \x01(\fR\buniqueId\x12(\n" + + "\x10asset_public_key\x18\x02 \x01(\fR\x0eassetPublicKey\x12)\n" + + "\x10owner_commitment\x18\x03 \x01(\fR\x0fownerCommitment\x12$\n" + + "\x0emined_in_block\x18\x04 \x01(\fR\fminedInBlock\x12!\n" + + "\fmined_height\x18\x05 \x01(\x04R\vminedHeight\x124\n" + + "\bfeatures\x18\x06 \x01(\v2\x18.tari.rpc.OutputFeaturesR\bfeatures\x12\x16\n" + + "\x06script\x18\a \x01(\fR\x06script\"4\n" + + "\x13SubmitBlockResponse\x12\x1d\n" + + "\n" + + "block_hash\x18\x01 \x01(\fR\tblockHash\"P\n" + + "\x10BlockBlobRequest\x12\x1f\n" + + "\vheader_blob\x18\x01 \x01(\fR\n" + + "headerBlob\x12\x1b\n" + + "\tbody_blob\x18\x02 \x01(\fR\bbodyBlob\"\xe5\x01\n" + + "\x0fTipInfoResponse\x12.\n" + + "\bmetadata\x18\x01 \x01(\v2\x12.tari.rpc.MetaDataR\bmetadata\x122\n" + + "\x15initial_sync_achieved\x18\x02 \x01(\bR\x13initialSyncAchieved\x12?\n" + + "\x0fbase_node_state\x18\x03 \x01(\x0e2\x17.tari.rpc.BaseNodeStateR\rbaseNodeState\x12-\n" + + "\x12failed_checkpoints\x18\x04 \x01(\bR\x11failedCheckpoints\"\xcc\x01\n" + + "\x18NewBlockTemplateResponse\x12H\n" + + "\x12new_block_template\x18\x01 \x01(\v2\x1a.tari.rpc.NewBlockTemplateR\x10newBlockTemplate\x122\n" + + "\x15initial_sync_achieved\x18\x03 \x01(\bR\x13initialSyncAchieved\x122\n" + + "\n" + + "miner_data\x18\x04 \x01(\v2\x13.tari.rpc.MinerDataR\tminerData\"_\n" + + "\x17NewBlockTemplateRequest\x12%\n" + + "\x04algo\x18\x01 \x01(\v2\x11.tari.rpc.PowAlgoR\x04algo\x12\x1d\n" + + "\n" + + "max_weight\x18\x02 \x01(\x04R\tmaxWeight\"\xa9\x01\n" + + "'GetNewBlockTemplateWithCoinbasesRequest\x12%\n" + + "\x04algo\x18\x01 \x01(\v2\x11.tari.rpc.PowAlgoR\x04algo\x12\x1d\n" + + "\n" + + "max_weight\x18\x02 \x01(\x04R\tmaxWeight\x128\n" + + "\tcoinbases\x18\x03 \x03(\v2\x1a.tari.rpc.NewBlockCoinbaseR\tcoinbases\"\x9a\x01\n" + + "\x1fGetNewBlockWithCoinbasesRequest\x12=\n" + + "\fnew_template\x18\x01 \x01(\v2\x1a.tari.rpc.NewBlockTemplateR\vnewTemplate\x128\n" + + "\tcoinbases\x18\x02 \x03(\v2\x1a.tari.rpc.NewBlockCoinbaseR\tcoinbases\"\xc4\x01\n" + + "\x10NewBlockCoinbase\x12\x18\n" + + "\aaddress\x18\x01 \x01(\tR\aaddress\x12\x14\n" + + "\x05value\x18\x02 \x01(\x04R\x05value\x12'\n" + + "\x0fstealth_payment\x18\x03 \x01(\bR\x0estealthPayment\x120\n" + + "\x14revealed_value_proof\x18\x04 \x01(\bR\x12revealedValueProof\x12%\n" + + "\x0ecoinbase_extra\x18\x05 \x01(\fR\rcoinbaseExtra\"\xd9\x03\n" + + "\x19NetworkDifficultyResponse\x12\x1e\n" + + "\n" + + "difficulty\x18\x01 \x01(\x04R\n" + + "difficulty\x12.\n" + + "\x13estimated_hash_rate\x18\x02 \x01(\x04R\x11estimatedHashRate\x12\x16\n" + + "\x06height\x18\x03 \x01(\x04R\x06height\x12\x1c\n" + + "\ttimestamp\x18\x04 \x01(\x04R\ttimestamp\x12\x19\n" + + "\bpow_algo\x18\x05 \x01(\x04R\apowAlgo\x129\n" + + "\x19sha3x_estimated_hash_rate\x18\x06 \x01(\x04R\x16sha3xEstimatedHashRate\x12J\n" + + "\"monero_randomx_estimated_hash_rate\x18\a \x01(\x04R\x1emoneroRandomxEstimatedHashRate\x12F\n" + + " tari_randomx_estimated_hash_rate\x18\n" + + " \x01(\x04R\x1ctariRandomxEstimatedHashRate\x12#\n" + + "\rnum_coinbases\x18\b \x01(\x04R\fnumCoinbases\x12'\n" + + "\x0fcoinbase_extras\x18\t \x03(\fR\x0ecoinbaseExtras\"\xd8\x01\n" + + "\x15ValueAtHeightResponse\x12\x16\n" + + "\x06height\x18\x03 \x01(\x04R\x06height\x12#\n" + + "\rmined_rewards\x18\x04 \x01(\x04R\fminedRewards\x12+\n" + + "\x11spendable_rewards\x18\x05 \x01(\x04R\x10spendableRewards\x12,\n" + + "\x12spendable_pre_mine\x18\x06 \x01(\x04R\x10spendablePreMine\x12'\n" + + "\x0ftotal_spendable\x18\a \x01(\x04R\x0etotalSpendable\"$\n" + + "\fIntegerValue\x12\x14\n" + + "\x05value\x18\x01 \x01(\x04R\x05value\"#\n" + + "\vStringValue\x12\x14\n" + + "\x05value\x18\x01 \x01(\tR\x05value\"\xa1\x01\n" + + "\x11BlockGroupRequest\x12\x19\n" + + "\bfrom_tip\x18\x01 \x01(\x04R\afromTip\x12!\n" + + "\fstart_height\x18\x02 \x01(\x04R\vstartHeight\x12\x1d\n" + + "\n" + + "end_height\x18\x03 \x01(\x04R\tendHeight\x12/\n" + + "\tcalc_type\x18\x04 \x01(\x0e2\x12.tari.rpc.CalcTypeR\bcalcType\"[\n" + + "\x12BlockGroupResponse\x12\x14\n" + + "\x05value\x18\x01 \x03(\x01R\x05value\x12/\n" + + "\tcalc_type\x18\x02 \x01(\x0e2\x12.tari.rpc.CalcTypeR\bcalcType\"l\n" + + "\rHeightRequest\x12\x19\n" + + "\bfrom_tip\x18\x01 \x01(\x04R\afromTip\x12!\n" + + "\fstart_height\x18\x02 \x01(\x04R\vstartHeight\x12\x1d\n" + + "\n" + + "end_height\x18\x03 \x01(\x04R\tendHeight\"K\n" + + "\x13BlockTimingResponse\x12\x10\n" + + "\x03max\x18\x01 \x01(\x04R\x03max\x12\x10\n" + + "\x03min\x18\x02 \x01(\x04R\x03min\x12\x10\n" + + "\x03avg\x18\x03 \x01(\x01R\x03avg\",\n" + + "\x16GetHeaderByHashRequest\x12\x12\n" + + "\x04hash\x18\x01 \x01(\fR\x04hash\"\xcd\x01\n" + + "\x13BlockHeaderResponse\x12-\n" + + "\x06header\x18\x01 \x01(\v2\x15.tari.rpc.BlockHeaderR\x06header\x12$\n" + + "\rconfirmations\x18\x02 \x01(\x04R\rconfirmations\x12\x16\n" + + "\x06reward\x18\x03 \x01(\x04R\x06reward\x12\x1e\n" + + "\n" + + "difficulty\x18\x04 \x01(\x04R\n" + + "difficulty\x12)\n" + + "\x10num_transactions\x18\x05 \x01(\rR\x0fnumTransactions\"\x83\x01\n" + + "\x12ListHeadersRequest\x12\x1f\n" + + "\vfrom_height\x18\x01 \x01(\x04R\n" + + "fromHeight\x12\x1f\n" + + "\vnum_headers\x18\x02 \x01(\x04R\n" + + "numHeaders\x12+\n" + + "\asorting\x18\x03 \x01(\x0e2\x11.tari.rpc.SortingR\asorting\",\n" + + "\x10GetBlocksRequest\x12\x18\n" + + "\aheights\x18\x01 \x03(\x04R\aheights\"F\n" + + "\x11GetBlocksResponse\x121\n" + + "\x06blocks\x18\x01 \x03(\v2\x19.tari.rpc.HistoricalBlockR\x06blocks\"\xd8\x01\n" + + "\bMetaData\x12*\n" + + "\x11best_block_height\x18\x01 \x01(\x04R\x0fbestBlockHeight\x12&\n" + + "\x0fbest_block_hash\x18\x02 \x01(\fR\rbestBlockHash\x125\n" + + "\x16accumulated_difficulty\x18\x05 \x01(\fR\x15accumulatedDifficulty\x12#\n" + + "\rpruned_height\x18\x06 \x01(\x04R\fprunedHeight\x12\x1c\n" + + "\ttimestamp\x18\a \x01(\x04R\ttimestamp\"v\n" + + "\x10SyncInfoResponse\x12\x1d\n" + + "\n" + + "tip_height\x18\x01 \x01(\x04R\ttipHeight\x12!\n" + + "\flocal_height\x18\x02 \x01(\x04R\vlocalHeight\x12 \n" + + "\fpeer_node_id\x18\x03 \x03(\fR\n" + + "peerNodeId\"\xda\x01\n" + + "\x14SyncProgressResponse\x12\x1d\n" + + "\n" + + "tip_height\x18\x01 \x01(\x04R\ttipHeight\x12!\n" + + "\flocal_height\x18\x02 \x01(\x04R\vlocalHeight\x12)\n" + + "\x05state\x18\x03 \x01(\x0e2\x13.tari.rpc.SyncStateR\x05state\x12\x1d\n" + + "\n" + + "short_desc\x18\x04 \x01(\tR\tshortDesc\x126\n" + + "\x17initial_connected_peers\x18\x05 \x01(\x04R\x15initialConnectedPeers\"\xf6\x01\n" + + "\x11GetNewBlockResult\x12\x1d\n" + + "\n" + + "block_hash\x18\x01 \x01(\fR\tblockHash\x12%\n" + + "\x05block\x18\x02 \x01(\v2\x0f.tari.rpc.BlockR\x05block\x12*\n" + + "\x11merge_mining_hash\x18\x03 \x01(\fR\x0fmergeMiningHash\x12$\n" + + "\x0etari_unique_id\x18\x04 \x01(\fR\ftariUniqueId\x122\n" + + "\n" + + "miner_data\x18\x05 \x01(\v2\x13.tari.rpc.MinerDataR\tminerData\x12\x15\n" + + "\x06vm_key\x18\x06 \x01(\fR\x05vmKey\"\xd8\x01\n" + + "\x15GetNewBlockBlobResult\x12\x1d\n" + + "\n" + + "block_hash\x18\x01 \x01(\fR\tblockHash\x12\x16\n" + + "\x06header\x18\x02 \x01(\fR\x06header\x12\x1d\n" + + "\n" + + "block_body\x18\x03 \x01(\fR\tblockBody\x12*\n" + + "\x11merge_mining_hash\x18\x04 \x01(\fR\x0fmergeMiningHash\x12\x17\n" + + "\autxo_mr\x18\x05 \x01(\fR\x06utxoMr\x12$\n" + + "\x0etari_unique_id\x18\x06 \x01(\fR\ftariUniqueId\"\x96\x01\n" + + "\tMinerData\x12%\n" + + "\x04algo\x18\x01 \x01(\v2\x11.tari.rpc.PowAlgoR\x04algo\x12+\n" + + "\x11target_difficulty\x18\x02 \x01(\x04R\x10targetDifficulty\x12\x16\n" + + "\x06reward\x18\x03 \x01(\x04R\x06reward\x12\x1d\n" + + "\n" + + "total_fees\x18\x05 \x01(\x04R\ttotalFees\"K\n" + + "\x14SearchKernelsRequest\x123\n" + + "\n" + + "signatures\x18\x01 \x03(\v2\x13.tari.rpc.SignatureR\n" + + "signatures\"6\n" + + "\x12SearchUtxosRequest\x12 \n" + + "\vcommitments\x18\x01 \x03(\fR\vcommitments\"3\n" + + "\x19FetchMatchingUtxosRequest\x12\x16\n" + + "\x06hashes\x18\x01 \x03(\fR\x06hashes\"Q\n" + + "\x1aFetchMatchingUtxosResponse\x123\n" + + "\x06output\x18\x01 \x01(\v2\x1b.tari.rpc.TransactionOutputR\x06output\"6\n" + + "\x10GetPeersResponse\x12\"\n" + + "\x04peer\x18\x01 \x01(\v2\x0e.tari.rpc.PeerR\x04peer\"\x11\n" + + "\x0fGetPeersRequest\"S\n" + + "\x18SubmitTransactionRequest\x127\n" + + "\vtransaction\x18\x01 \x01(\v2\x15.tari.rpc.TransactionR\vtransaction\"V\n" + + "\x19SubmitTransactionResponse\x129\n" + + "\x06result\x18\x01 \x01(\x0e2!.tari.rpc.SubmitTransactionResultR\x06result\"\x1f\n" + + "\x1dGetMempoolTransactionsRequest\"Y\n" + + "\x1eGetMempoolTransactionsResponse\x127\n" + + "\vtransaction\x18\x01 \x01(\v2\x15.tari.rpc.TransactionR\vtransaction\"M\n" + + "\x17TransactionStateRequest\x122\n" + + "\n" + + "excess_sig\x18\x01 \x01(\v2\x13.tari.rpc.SignatureR\texcessSig\"Q\n" + + "\x18TransactionStateResponse\x125\n" + + "\x06result\x18\x01 \x01(\x0e2\x1d.tari.rpc.TransactionLocationR\x06result\"\x8b\x01\n" + + "\x14MempoolStatsResponse\x12'\n" + + "\x0funconfirmed_txs\x18\x02 \x01(\x04R\x0eunconfirmedTxs\x12\x1b\n" + + "\treorg_txs\x18\x03 \x01(\x04R\breorgTxs\x12-\n" + + "\x12unconfirmed_weight\x18\x04 \x01(\x04R\x11unconfirmedWeight\"8\n" + + "\x1eGetActiveValidatorNodesRequest\x12\x16\n" + + "\x06height\x18\x01 \x01(\x04R\x06height\"]\n" + + "\x1fGetActiveValidatorNodesResponse\x12\x1b\n" + + "\tshard_key\x18\x01 \x01(\fR\bshardKey\x12\x1d\n" + + "\n" + + "public_key\x18\x02 \x01(\fR\tpublicKey\"K\n" + + "\x12GetShardKeyRequest\x12\x16\n" + + "\x06height\x18\x01 \x01(\x04R\x06height\x12\x1d\n" + + "\n" + + "public_key\x18\x02 \x01(\fR\tpublicKey\"H\n" + + "\x13GetShardKeyResponse\x12\x1b\n" + + "\tshard_key\x18\x01 \x01(\fR\bshardKey\x12\x14\n" + + "\x05found\x18\x02 \x01(\bR\x05found\"V\n" + + "\x1fGetTemplateRegistrationsRequest\x12\x1d\n" + + "\n" + + "start_hash\x18\x01 \x01(\fR\tstartHash\x12\x14\n" + + "\x05count\x18\x02 \x01(\x04R\x05count\"\x82\x01\n" + + "\x1fGetTemplateRegistrationResponse\x12\x1b\n" + + "\tutxo_hash\x18\x01 \x01(\fR\butxoHash\x12B\n" + + "\fregistration\x18\x02 \x01(\v2\x1e.tari.rpc.TemplateRegistrationR\fregistration\"_\n" + + "\tBlockInfo\x12\x16\n" + + "\x06height\x18\x01 \x01(\x04R\x06height\x12\x12\n" + + "\x04hash\x18\x02 \x01(\fR\x04hash\x12&\n" + + "\x0fnext_block_hash\x18\x03 \x01(\fR\rnextBlockHash\"O\n" + + "\x18GetSideChainUtxosRequest\x12\x1d\n" + + "\n" + + "start_hash\x18\x01 \x01(\fR\tstartHash\x12\x14\n" + + "\x05count\x18\x02 \x01(\x04R\x05count\"\x86\x01\n" + + "\x19GetSideChainUtxosResponse\x122\n" + + "\n" + + "block_info\x18\x01 \x01(\v2\x13.tari.rpc.BlockInfoR\tblockInfo\x125\n" + + "\aoutputs\x18\x02 \x03(\v2\x1b.tari.rpc.TransactionOutputR\aoutputs\"\x18\n" + + "\x16GetNetworkStateRequest\"\xc2\x04\n" + + "\x17GetNetworkStateResponse\x12.\n" + + "\bmetadata\x18\x01 \x01(\v2\x12.tari.rpc.MetaDataR\bmetadata\x122\n" + + "\x15initial_sync_achieved\x18\x02 \x01(\bR\x13initialSyncAchieved\x12?\n" + + "\x0fbase_node_state\x18\x03 \x01(\x0e2\x17.tari.rpc.BaseNodeStateR\rbaseNodeState\x12-\n" + + "\x12failed_checkpoints\x18\x04 \x01(\bR\x11failedCheckpoints\x12\x16\n" + + "\x06reward\x18\x05 \x01(\x04R\x06reward\x129\n" + + "\x19sha3x_estimated_hash_rate\x18\x06 \x01(\x04R\x16sha3xEstimatedHashRate\x12J\n" + + "\"monero_randomx_estimated_hash_rate\x18\a \x01(\x04R\x1emoneroRandomxEstimatedHashRate\x12F\n" + + " tari_randomx_estimated_hash_rate\x18\n" + + " \x01(\x04R\x1ctariRandomxEstimatedHashRate\x12'\n" + + "\x0fnum_connections\x18\b \x01(\x04R\x0enumConnections\x12C\n" + + "\x10liveness_results\x18\t \x03(\v2\x18.tari.rpc.LivenessResultR\x0flivenessResults\"\x80\x01\n" + + "\x0eLivenessResult\x12 \n" + + "\fpeer_node_id\x18\x01 \x01(\fR\n" + + "peerNodeId\x12)\n" + + "\x10discover_latency\x18\x02 \x01(\x04R\x0fdiscoverLatency\x12!\n" + + "\fping_latency\x18\x03 \x01(\x04R\vpingLatency\"\xb1\x01\n" + + "\x1eSearchPaymentReferencesRequest\x122\n" + + "\x15payment_reference_hex\x18\x01 \x03(\tR\x13paymentReferenceHex\x126\n" + + "\x17payment_reference_bytes\x18\x02 \x03(\fR\x15paymentReferenceBytes\x12#\n" + + "\rinclude_spent\x18\x03 \x01(\bR\fincludeSpent\"\xed\x02\n" + + "\x18PaymentReferenceResponse\x122\n" + + "\x15payment_reference_hex\x18\x01 \x01(\tR\x13paymentReferenceHex\x12!\n" + + "\fblock_height\x18\x02 \x01(\x04R\vblockHeight\x12\x1d\n" + + "\n" + + "block_hash\x18\x03 \x01(\fR\tblockHash\x12'\n" + + "\x0fmined_timestamp\x18\x04 \x01(\x04R\x0eminedTimestamp\x12\x1e\n" + + "\n" + + "commitment\x18\x05 \x01(\fR\n" + + "commitment\x12\x19\n" + + "\bis_spent\x18\x06 \x01(\bR\aisSpent\x12!\n" + + "\fspent_height\x18\a \x01(\x04R\vspentHeight\x12(\n" + + "\x10spent_block_hash\x18\b \x01(\fR\x0espentBlockHash\x12*\n" + + "\x11min_value_promise\x18\t \x01(\x04R\x0fminValuePromise*\x80\x01\n" + + "\rBaseNodeState\x12\f\n" + + "\bSTART_UP\x10\x00\x12\x0f\n" + + "\vHEADER_SYNC\x10\x01\x12\x10\n" + + "\fHORIZON_SYNC\x10\x02\x12\x0e\n" + + "\n" + + "CONNECTING\x10\x03\x12\x0e\n" + + "\n" + + "BLOCK_SYNC\x10\x04\x12\r\n" + + "\tLISTENING\x10\x05\x12\x0f\n" + + "\vSYNC_FAILED\x10\x06*<\n" + + "\bCalcType\x12\b\n" + + "\x04MEAN\x10\x00\x12\n" + + "\n" + + "\x06MEDIAN\x10\x01\x12\f\n" + + "\bQUANTILE\x10\x02\x12\f\n" + + "\bQUARTILE\x10\x03*,\n" + + "\aSorting\x12\x10\n" + + "\fSORTING_DESC\x10\x00\x12\x0f\n" + + "\vSORTING_ASC\x10\x01*b\n" + + "\tSyncState\x12\v\n" + + "\aSTARTUP\x10\x00\x12\x13\n" + + "\x0fHEADER_STARTING\x10\x01\x12\n" + + "\n" + + "\x06HEADER\x10\x02\x12\x12\n" + + "\x0eBLOCK_STARTING\x10\x03\x12\t\n" + + "\x05BLOCK\x10\x04\x12\b\n" + + "\x04DONE\x10\x05*t\n" + + "\x17SubmitTransactionResult\x12\b\n" + + "\x04NONE\x10\x00\x12\f\n" + + "\bACCEPTED\x10\x01\x12 \n" + + "\x1cNOT_PROCESSABLE_AT_THIS_TIME\x10\x02\x12\x11\n" + + "\rALREADY_MINED\x10\x03\x12\f\n" + + "\bREJECTED\x10\x04*J\n" + + "\x13TransactionLocation\x12\v\n" + + "\aUNKNOWN\x10\x00\x12\v\n" + + "\aMEMPOOL\x10\x01\x12\t\n" + + "\x05MINED\x10\x02\x12\x0e\n" + + "\n" + + "NOT_STORED\x10\x032\x9a\x18\n" + + "\bBaseNode\x12L\n" + + "\vListHeaders\x12\x1c.tari.rpc.ListHeadersRequest\x1a\x1d.tari.rpc.BlockHeaderResponse0\x01\x12R\n" + + "\x0fGetHeaderByHash\x12 .tari.rpc.GetHeaderByHashRequest\x1a\x1d.tari.rpc.BlockHeaderResponse\x12D\n" + + "\tGetBlocks\x12\x1a.tari.rpc.GetBlocksRequest\x1a\x19.tari.rpc.HistoricalBlock0\x01\x12H\n" + + "\x0eGetBlockTiming\x12\x17.tari.rpc.HeightRequest\x1a\x1d.tari.rpc.BlockTimingResponse\x12C\n" + + "\fGetConstants\x12\x15.tari.rpc.BlockHeight\x1a\x1c.tari.rpc.ConsensusConstants\x12I\n" + + "\fGetBlockSize\x12\x1b.tari.rpc.BlockGroupRequest\x1a\x1c.tari.rpc.BlockGroupResponse\x12I\n" + + "\fGetBlockFees\x12\x1b.tari.rpc.BlockGroupRequest\x1a\x1c.tari.rpc.BlockGroupResponse\x124\n" + + "\n" + + "GetVersion\x12\x0f.tari.rpc.Empty\x1a\x15.tari.rpc.StringValue\x12<\n" + + "\x0fCheckForUpdates\x12\x0f.tari.rpc.Empty\x1a\x18.tari.rpc.SoftwareUpdate\x12W\n" + + "\x16GetTokensInCirculation\x12\x1a.tari.rpc.GetBlocksRequest\x1a\x1f.tari.rpc.ValueAtHeightResponse0\x01\x12V\n" + + "\x14GetNetworkDifficulty\x12\x17.tari.rpc.HeightRequest\x1a#.tari.rpc.NetworkDifficultyResponse0\x01\x12\\\n" + + "\x13GetNewBlockTemplate\x12!.tari.rpc.NewBlockTemplateRequest\x1a\".tari.rpc.NewBlockTemplateResponse\x12F\n" + + "\vGetNewBlock\x12\x1a.tari.rpc.NewBlockTemplate\x1a\x1b.tari.rpc.GetNewBlockResult\x12b\n" + + "\x18GetNewBlockWithCoinbases\x12).tari.rpc.GetNewBlockWithCoinbasesRequest\x1a\x1b.tari.rpc.GetNewBlockResult\x12r\n" + + " GetNewBlockTemplateWithCoinbases\x121.tari.rpc.GetNewBlockTemplateWithCoinbasesRequest\x1a\x1b.tari.rpc.GetNewBlockResult\x12N\n" + + "\x0fGetNewBlockBlob\x12\x1a.tari.rpc.NewBlockTemplate\x1a\x1f.tari.rpc.GetNewBlockBlobResult\x12=\n" + + "\vSubmitBlock\x12\x0f.tari.rpc.Block\x1a\x1d.tari.rpc.SubmitBlockResponse\x12L\n" + + "\x0fSubmitBlockBlob\x12\x1a.tari.rpc.BlockBlobRequest\x1a\x1d.tari.rpc.SubmitBlockResponse\x12\\\n" + + "\x11SubmitTransaction\x12\".tari.rpc.SubmitTransactionRequest\x1a#.tari.rpc.SubmitTransactionResponse\x12:\n" + + "\vGetSyncInfo\x12\x0f.tari.rpc.Empty\x1a\x1a.tari.rpc.SyncInfoResponse\x12B\n" + + "\x0fGetSyncProgress\x12\x0f.tari.rpc.Empty\x1a\x1e.tari.rpc.SyncProgressResponse\x128\n" + + "\n" + + "GetTipInfo\x12\x0f.tari.rpc.Empty\x1a\x19.tari.rpc.TipInfoResponse\x12L\n" + + "\rSearchKernels\x12\x1e.tari.rpc.SearchKernelsRequest\x1a\x19.tari.rpc.HistoricalBlock0\x01\x12H\n" + + "\vSearchUtxos\x12\x1c.tari.rpc.SearchUtxosRequest\x1a\x19.tari.rpc.HistoricalBlock0\x01\x12a\n" + + "\x12FetchMatchingUtxos\x12#.tari.rpc.FetchMatchingUtxosRequest\x1a$.tari.rpc.FetchMatchingUtxosResponse0\x01\x12C\n" + + "\bGetPeers\x12\x19.tari.rpc.GetPeersRequest\x1a\x1a.tari.rpc.GetPeersResponse0\x01\x12m\n" + + "\x16GetMempoolTransactions\x12'.tari.rpc.GetMempoolTransactionsRequest\x1a(.tari.rpc.GetMempoolTransactionsResponse0\x01\x12Y\n" + + "\x10TransactionState\x12!.tari.rpc.TransactionStateRequest\x1a\".tari.rpc.TransactionStateResponse\x123\n" + + "\bIdentify\x12\x0f.tari.rpc.Empty\x1a\x16.tari.rpc.NodeIdentity\x12D\n" + + "\x10GetNetworkStatus\x12\x0f.tari.rpc.Empty\x1a\x1f.tari.rpc.NetworkStatusResponse\x12K\n" + + "\x12ListConnectedPeers\x12\x0f.tari.rpc.Empty\x1a$.tari.rpc.ListConnectedPeersResponse\x12B\n" + + "\x0fGetMempoolStats\x12\x0f.tari.rpc.Empty\x1a\x1e.tari.rpc.MempoolStatsResponse\x12p\n" + + "\x17GetActiveValidatorNodes\x12(.tari.rpc.GetActiveValidatorNodesRequest\x1a).tari.rpc.GetActiveValidatorNodesResponse0\x01\x12J\n" + + "\vGetShardKey\x12\x1c.tari.rpc.GetShardKeyRequest\x1a\x1d.tari.rpc.GetShardKeyResponse\x12r\n" + + "\x18GetTemplateRegistrations\x12).tari.rpc.GetTemplateRegistrationsRequest\x1a).tari.rpc.GetTemplateRegistrationResponse0\x01\x12^\n" + + "\x11GetSideChainUtxos\x12\".tari.rpc.GetSideChainUtxosRequest\x1a#.tari.rpc.GetSideChainUtxosResponse0\x01\x12V\n" + + "\x0fGetNetworkState\x12 .tari.rpc.GetNetworkStateRequest\x1a!.tari.rpc.GetNetworkStateResponse\x12i\n" + + "\x17SearchPaymentReferences\x12(.tari.rpc.SearchPaymentReferencesRequest\x1a\".tari.rpc.PaymentReferenceResponse0\x01B,Z*pool/internal/gbt/tari/base_node;base_nodeb\x06proto3" + +var ( + file_base_node_proto_rawDescOnce sync.Once + file_base_node_proto_rawDescData []byte +) + +func file_base_node_proto_rawDescGZIP() []byte { + file_base_node_proto_rawDescOnce.Do(func() { + file_base_node_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_base_node_proto_rawDesc), len(file_base_node_proto_rawDesc))) + }) + return file_base_node_proto_rawDescData +} + +var file_base_node_proto_enumTypes = make([]protoimpl.EnumInfo, 6) +var file_base_node_proto_msgTypes = make([]protoimpl.MessageInfo, 60) +var file_base_node_proto_goTypes = []any{ + (BaseNodeState)(0), // 0: tari.rpc.BaseNodeState + (CalcType)(0), // 1: tari.rpc.CalcType + (Sorting)(0), // 2: tari.rpc.Sorting + (SyncState)(0), // 3: tari.rpc.SyncState + (SubmitTransactionResult)(0), // 4: tari.rpc.SubmitTransactionResult + (TransactionLocation)(0), // 5: tari.rpc.TransactionLocation + (*GetAssetMetadataRequest)(nil), // 6: tari.rpc.GetAssetMetadataRequest + (*GetAssetMetadataResponse)(nil), // 7: tari.rpc.GetAssetMetadataResponse + (*ListAssetRegistrationsRequest)(nil), // 8: tari.rpc.ListAssetRegistrationsRequest + (*ListAssetRegistrationsResponse)(nil), // 9: tari.rpc.ListAssetRegistrationsResponse + (*GetTokensRequest)(nil), // 10: tari.rpc.GetTokensRequest + (*GetTokensResponse)(nil), // 11: tari.rpc.GetTokensResponse + (*SubmitBlockResponse)(nil), // 12: tari.rpc.SubmitBlockResponse + (*BlockBlobRequest)(nil), // 13: tari.rpc.BlockBlobRequest + (*TipInfoResponse)(nil), // 14: tari.rpc.TipInfoResponse + (*NewBlockTemplateResponse)(nil), // 15: tari.rpc.NewBlockTemplateResponse + (*NewBlockTemplateRequest)(nil), // 16: tari.rpc.NewBlockTemplateRequest + (*GetNewBlockTemplateWithCoinbasesRequest)(nil), // 17: tari.rpc.GetNewBlockTemplateWithCoinbasesRequest + (*GetNewBlockWithCoinbasesRequest)(nil), // 18: tari.rpc.GetNewBlockWithCoinbasesRequest + (*NewBlockCoinbase)(nil), // 19: tari.rpc.NewBlockCoinbase + (*NetworkDifficultyResponse)(nil), // 20: tari.rpc.NetworkDifficultyResponse + (*ValueAtHeightResponse)(nil), // 21: tari.rpc.ValueAtHeightResponse + (*IntegerValue)(nil), // 22: tari.rpc.IntegerValue + (*StringValue)(nil), // 23: tari.rpc.StringValue + (*BlockGroupRequest)(nil), // 24: tari.rpc.BlockGroupRequest + (*BlockGroupResponse)(nil), // 25: tari.rpc.BlockGroupResponse + (*HeightRequest)(nil), // 26: tari.rpc.HeightRequest + (*BlockTimingResponse)(nil), // 27: tari.rpc.BlockTimingResponse + (*GetHeaderByHashRequest)(nil), // 28: tari.rpc.GetHeaderByHashRequest + (*BlockHeaderResponse)(nil), // 29: tari.rpc.BlockHeaderResponse + (*ListHeadersRequest)(nil), // 30: tari.rpc.ListHeadersRequest + (*GetBlocksRequest)(nil), // 31: tari.rpc.GetBlocksRequest + (*GetBlocksResponse)(nil), // 32: tari.rpc.GetBlocksResponse + (*MetaData)(nil), // 33: tari.rpc.MetaData + (*SyncInfoResponse)(nil), // 34: tari.rpc.SyncInfoResponse + (*SyncProgressResponse)(nil), // 35: tari.rpc.SyncProgressResponse + (*GetNewBlockResult)(nil), // 36: tari.rpc.GetNewBlockResult + (*GetNewBlockBlobResult)(nil), // 37: tari.rpc.GetNewBlockBlobResult + (*MinerData)(nil), // 38: tari.rpc.MinerData + (*SearchKernelsRequest)(nil), // 39: tari.rpc.SearchKernelsRequest + (*SearchUtxosRequest)(nil), // 40: tari.rpc.SearchUtxosRequest + (*FetchMatchingUtxosRequest)(nil), // 41: tari.rpc.FetchMatchingUtxosRequest + (*FetchMatchingUtxosResponse)(nil), // 42: tari.rpc.FetchMatchingUtxosResponse + (*GetPeersResponse)(nil), // 43: tari.rpc.GetPeersResponse + (*GetPeersRequest)(nil), // 44: tari.rpc.GetPeersRequest + (*SubmitTransactionRequest)(nil), // 45: tari.rpc.SubmitTransactionRequest + (*SubmitTransactionResponse)(nil), // 46: tari.rpc.SubmitTransactionResponse + (*GetMempoolTransactionsRequest)(nil), // 47: tari.rpc.GetMempoolTransactionsRequest + (*GetMempoolTransactionsResponse)(nil), // 48: tari.rpc.GetMempoolTransactionsResponse + (*TransactionStateRequest)(nil), // 49: tari.rpc.TransactionStateRequest + (*TransactionStateResponse)(nil), // 50: tari.rpc.TransactionStateResponse + (*MempoolStatsResponse)(nil), // 51: tari.rpc.MempoolStatsResponse + (*GetActiveValidatorNodesRequest)(nil), // 52: tari.rpc.GetActiveValidatorNodesRequest + (*GetActiveValidatorNodesResponse)(nil), // 53: tari.rpc.GetActiveValidatorNodesResponse + (*GetShardKeyRequest)(nil), // 54: tari.rpc.GetShardKeyRequest + (*GetShardKeyResponse)(nil), // 55: tari.rpc.GetShardKeyResponse + (*GetTemplateRegistrationsRequest)(nil), // 56: tari.rpc.GetTemplateRegistrationsRequest + (*GetTemplateRegistrationResponse)(nil), // 57: tari.rpc.GetTemplateRegistrationResponse + (*BlockInfo)(nil), // 58: tari.rpc.BlockInfo + (*GetSideChainUtxosRequest)(nil), // 59: tari.rpc.GetSideChainUtxosRequest + (*GetSideChainUtxosResponse)(nil), // 60: tari.rpc.GetSideChainUtxosResponse + (*GetNetworkStateRequest)(nil), // 61: tari.rpc.GetNetworkStateRequest + (*GetNetworkStateResponse)(nil), // 62: tari.rpc.GetNetworkStateResponse + (*LivenessResult)(nil), // 63: tari.rpc.LivenessResult + (*SearchPaymentReferencesRequest)(nil), // 64: tari.rpc.SearchPaymentReferencesRequest + (*PaymentReferenceResponse)(nil), // 65: tari.rpc.PaymentReferenceResponse + (*transaction.OutputFeatures)(nil), // 66: tari.rpc.OutputFeatures + (*block.NewBlockTemplate)(nil), // 67: tari.rpc.NewBlockTemplate + (*block.PowAlgo)(nil), // 68: tari.rpc.PowAlgo + (*block.BlockHeader)(nil), // 69: tari.rpc.BlockHeader + (*block.HistoricalBlock)(nil), // 70: tari.rpc.HistoricalBlock + (*block.Block)(nil), // 71: tari.rpc.Block + (*types.Signature)(nil), // 72: tari.rpc.Signature + (*transaction.TransactionOutput)(nil), // 73: tari.rpc.TransactionOutput + (*net_work.Peer)(nil), // 74: tari.rpc.Peer + (*transaction.Transaction)(nil), // 75: tari.rpc.Transaction + (*sidechain_types.TemplateRegistration)(nil), // 76: tari.rpc.TemplateRegistration + (*types.BlockHeight)(nil), // 77: tari.rpc.BlockHeight + (*types.Empty)(nil), // 78: tari.rpc.Empty + (*types.ConsensusConstants)(nil), // 79: tari.rpc.ConsensusConstants + (*net_work.SoftwareUpdate)(nil), // 80: tari.rpc.SoftwareUpdate + (*net_work.NodeIdentity)(nil), // 81: tari.rpc.NodeIdentity + (*net_work.NetworkStatusResponse)(nil), // 82: tari.rpc.NetworkStatusResponse + (*net_work.ListConnectedPeersResponse)(nil), // 83: tari.rpc.ListConnectedPeersResponse +} +var file_base_node_proto_depIdxs = []int32{ + 66, // 0: tari.rpc.GetAssetMetadataResponse.features:type_name -> tari.rpc.OutputFeatures + 66, // 1: tari.rpc.ListAssetRegistrationsResponse.features:type_name -> tari.rpc.OutputFeatures + 66, // 2: tari.rpc.GetTokensResponse.features:type_name -> tari.rpc.OutputFeatures + 33, // 3: tari.rpc.TipInfoResponse.metadata:type_name -> tari.rpc.MetaData + 0, // 4: tari.rpc.TipInfoResponse.base_node_state:type_name -> tari.rpc.BaseNodeState + 67, // 5: tari.rpc.NewBlockTemplateResponse.new_block_template:type_name -> tari.rpc.NewBlockTemplate + 38, // 6: tari.rpc.NewBlockTemplateResponse.miner_data:type_name -> tari.rpc.MinerData + 68, // 7: tari.rpc.NewBlockTemplateRequest.algo:type_name -> tari.rpc.PowAlgo + 68, // 8: tari.rpc.GetNewBlockTemplateWithCoinbasesRequest.algo:type_name -> tari.rpc.PowAlgo + 19, // 9: tari.rpc.GetNewBlockTemplateWithCoinbasesRequest.coinbases:type_name -> tari.rpc.NewBlockCoinbase + 67, // 10: tari.rpc.GetNewBlockWithCoinbasesRequest.new_template:type_name -> tari.rpc.NewBlockTemplate + 19, // 11: tari.rpc.GetNewBlockWithCoinbasesRequest.coinbases:type_name -> tari.rpc.NewBlockCoinbase + 1, // 12: tari.rpc.BlockGroupRequest.calc_type:type_name -> tari.rpc.CalcType + 1, // 13: tari.rpc.BlockGroupResponse.calc_type:type_name -> tari.rpc.CalcType + 69, // 14: tari.rpc.BlockHeaderResponse.header:type_name -> tari.rpc.BlockHeader + 2, // 15: tari.rpc.ListHeadersRequest.sorting:type_name -> tari.rpc.Sorting + 70, // 16: tari.rpc.GetBlocksResponse.blocks:type_name -> tari.rpc.HistoricalBlock + 3, // 17: tari.rpc.SyncProgressResponse.state:type_name -> tari.rpc.SyncState + 71, // 18: tari.rpc.GetNewBlockResult.block:type_name -> tari.rpc.Block + 38, // 19: tari.rpc.GetNewBlockResult.miner_data:type_name -> tari.rpc.MinerData + 68, // 20: tari.rpc.MinerData.algo:type_name -> tari.rpc.PowAlgo + 72, // 21: tari.rpc.SearchKernelsRequest.signatures:type_name -> tari.rpc.Signature + 73, // 22: tari.rpc.FetchMatchingUtxosResponse.output:type_name -> tari.rpc.TransactionOutput + 74, // 23: tari.rpc.GetPeersResponse.peer:type_name -> tari.rpc.Peer + 75, // 24: tari.rpc.SubmitTransactionRequest.transaction:type_name -> tari.rpc.Transaction + 4, // 25: tari.rpc.SubmitTransactionResponse.result:type_name -> tari.rpc.SubmitTransactionResult + 75, // 26: tari.rpc.GetMempoolTransactionsResponse.transaction:type_name -> tari.rpc.Transaction + 72, // 27: tari.rpc.TransactionStateRequest.excess_sig:type_name -> tari.rpc.Signature + 5, // 28: tari.rpc.TransactionStateResponse.result:type_name -> tari.rpc.TransactionLocation + 76, // 29: tari.rpc.GetTemplateRegistrationResponse.registration:type_name -> tari.rpc.TemplateRegistration + 58, // 30: tari.rpc.GetSideChainUtxosResponse.block_info:type_name -> tari.rpc.BlockInfo + 73, // 31: tari.rpc.GetSideChainUtxosResponse.outputs:type_name -> tari.rpc.TransactionOutput + 33, // 32: tari.rpc.GetNetworkStateResponse.metadata:type_name -> tari.rpc.MetaData + 0, // 33: tari.rpc.GetNetworkStateResponse.base_node_state:type_name -> tari.rpc.BaseNodeState + 63, // 34: tari.rpc.GetNetworkStateResponse.liveness_results:type_name -> tari.rpc.LivenessResult + 30, // 35: tari.rpc.BaseNode.ListHeaders:input_type -> tari.rpc.ListHeadersRequest + 28, // 36: tari.rpc.BaseNode.GetHeaderByHash:input_type -> tari.rpc.GetHeaderByHashRequest + 31, // 37: tari.rpc.BaseNode.GetBlocks:input_type -> tari.rpc.GetBlocksRequest + 26, // 38: tari.rpc.BaseNode.GetBlockTiming:input_type -> tari.rpc.HeightRequest + 77, // 39: tari.rpc.BaseNode.GetConstants:input_type -> tari.rpc.BlockHeight + 24, // 40: tari.rpc.BaseNode.GetBlockSize:input_type -> tari.rpc.BlockGroupRequest + 24, // 41: tari.rpc.BaseNode.GetBlockFees:input_type -> tari.rpc.BlockGroupRequest + 78, // 42: tari.rpc.BaseNode.GetVersion:input_type -> tari.rpc.Empty + 78, // 43: tari.rpc.BaseNode.CheckForUpdates:input_type -> tari.rpc.Empty + 31, // 44: tari.rpc.BaseNode.GetTokensInCirculation:input_type -> tari.rpc.GetBlocksRequest + 26, // 45: tari.rpc.BaseNode.GetNetworkDifficulty:input_type -> tari.rpc.HeightRequest + 16, // 46: tari.rpc.BaseNode.GetNewBlockTemplate:input_type -> tari.rpc.NewBlockTemplateRequest + 67, // 47: tari.rpc.BaseNode.GetNewBlock:input_type -> tari.rpc.NewBlockTemplate + 18, // 48: tari.rpc.BaseNode.GetNewBlockWithCoinbases:input_type -> tari.rpc.GetNewBlockWithCoinbasesRequest + 17, // 49: tari.rpc.BaseNode.GetNewBlockTemplateWithCoinbases:input_type -> tari.rpc.GetNewBlockTemplateWithCoinbasesRequest + 67, // 50: tari.rpc.BaseNode.GetNewBlockBlob:input_type -> tari.rpc.NewBlockTemplate + 71, // 51: tari.rpc.BaseNode.SubmitBlock:input_type -> tari.rpc.Block + 13, // 52: tari.rpc.BaseNode.SubmitBlockBlob:input_type -> tari.rpc.BlockBlobRequest + 45, // 53: tari.rpc.BaseNode.SubmitTransaction:input_type -> tari.rpc.SubmitTransactionRequest + 78, // 54: tari.rpc.BaseNode.GetSyncInfo:input_type -> tari.rpc.Empty + 78, // 55: tari.rpc.BaseNode.GetSyncProgress:input_type -> tari.rpc.Empty + 78, // 56: tari.rpc.BaseNode.GetTipInfo:input_type -> tari.rpc.Empty + 39, // 57: tari.rpc.BaseNode.SearchKernels:input_type -> tari.rpc.SearchKernelsRequest + 40, // 58: tari.rpc.BaseNode.SearchUtxos:input_type -> tari.rpc.SearchUtxosRequest + 41, // 59: tari.rpc.BaseNode.FetchMatchingUtxos:input_type -> tari.rpc.FetchMatchingUtxosRequest + 44, // 60: tari.rpc.BaseNode.GetPeers:input_type -> tari.rpc.GetPeersRequest + 47, // 61: tari.rpc.BaseNode.GetMempoolTransactions:input_type -> tari.rpc.GetMempoolTransactionsRequest + 49, // 62: tari.rpc.BaseNode.TransactionState:input_type -> tari.rpc.TransactionStateRequest + 78, // 63: tari.rpc.BaseNode.Identify:input_type -> tari.rpc.Empty + 78, // 64: tari.rpc.BaseNode.GetNetworkStatus:input_type -> tari.rpc.Empty + 78, // 65: tari.rpc.BaseNode.ListConnectedPeers:input_type -> tari.rpc.Empty + 78, // 66: tari.rpc.BaseNode.GetMempoolStats:input_type -> tari.rpc.Empty + 52, // 67: tari.rpc.BaseNode.GetActiveValidatorNodes:input_type -> tari.rpc.GetActiveValidatorNodesRequest + 54, // 68: tari.rpc.BaseNode.GetShardKey:input_type -> tari.rpc.GetShardKeyRequest + 56, // 69: tari.rpc.BaseNode.GetTemplateRegistrations:input_type -> tari.rpc.GetTemplateRegistrationsRequest + 59, // 70: tari.rpc.BaseNode.GetSideChainUtxos:input_type -> tari.rpc.GetSideChainUtxosRequest + 61, // 71: tari.rpc.BaseNode.GetNetworkState:input_type -> tari.rpc.GetNetworkStateRequest + 64, // 72: tari.rpc.BaseNode.SearchPaymentReferences:input_type -> tari.rpc.SearchPaymentReferencesRequest + 29, // 73: tari.rpc.BaseNode.ListHeaders:output_type -> tari.rpc.BlockHeaderResponse + 29, // 74: tari.rpc.BaseNode.GetHeaderByHash:output_type -> tari.rpc.BlockHeaderResponse + 70, // 75: tari.rpc.BaseNode.GetBlocks:output_type -> tari.rpc.HistoricalBlock + 27, // 76: tari.rpc.BaseNode.GetBlockTiming:output_type -> tari.rpc.BlockTimingResponse + 79, // 77: tari.rpc.BaseNode.GetConstants:output_type -> tari.rpc.ConsensusConstants + 25, // 78: tari.rpc.BaseNode.GetBlockSize:output_type -> tari.rpc.BlockGroupResponse + 25, // 79: tari.rpc.BaseNode.GetBlockFees:output_type -> tari.rpc.BlockGroupResponse + 23, // 80: tari.rpc.BaseNode.GetVersion:output_type -> tari.rpc.StringValue + 80, // 81: tari.rpc.BaseNode.CheckForUpdates:output_type -> tari.rpc.SoftwareUpdate + 21, // 82: tari.rpc.BaseNode.GetTokensInCirculation:output_type -> tari.rpc.ValueAtHeightResponse + 20, // 83: tari.rpc.BaseNode.GetNetworkDifficulty:output_type -> tari.rpc.NetworkDifficultyResponse + 15, // 84: tari.rpc.BaseNode.GetNewBlockTemplate:output_type -> tari.rpc.NewBlockTemplateResponse + 36, // 85: tari.rpc.BaseNode.GetNewBlock:output_type -> tari.rpc.GetNewBlockResult + 36, // 86: tari.rpc.BaseNode.GetNewBlockWithCoinbases:output_type -> tari.rpc.GetNewBlockResult + 36, // 87: tari.rpc.BaseNode.GetNewBlockTemplateWithCoinbases:output_type -> tari.rpc.GetNewBlockResult + 37, // 88: tari.rpc.BaseNode.GetNewBlockBlob:output_type -> tari.rpc.GetNewBlockBlobResult + 12, // 89: tari.rpc.BaseNode.SubmitBlock:output_type -> tari.rpc.SubmitBlockResponse + 12, // 90: tari.rpc.BaseNode.SubmitBlockBlob:output_type -> tari.rpc.SubmitBlockResponse + 46, // 91: tari.rpc.BaseNode.SubmitTransaction:output_type -> tari.rpc.SubmitTransactionResponse + 34, // 92: tari.rpc.BaseNode.GetSyncInfo:output_type -> tari.rpc.SyncInfoResponse + 35, // 93: tari.rpc.BaseNode.GetSyncProgress:output_type -> tari.rpc.SyncProgressResponse + 14, // 94: tari.rpc.BaseNode.GetTipInfo:output_type -> tari.rpc.TipInfoResponse + 70, // 95: tari.rpc.BaseNode.SearchKernels:output_type -> tari.rpc.HistoricalBlock + 70, // 96: tari.rpc.BaseNode.SearchUtxos:output_type -> tari.rpc.HistoricalBlock + 42, // 97: tari.rpc.BaseNode.FetchMatchingUtxos:output_type -> tari.rpc.FetchMatchingUtxosResponse + 43, // 98: tari.rpc.BaseNode.GetPeers:output_type -> tari.rpc.GetPeersResponse + 48, // 99: tari.rpc.BaseNode.GetMempoolTransactions:output_type -> tari.rpc.GetMempoolTransactionsResponse + 50, // 100: tari.rpc.BaseNode.TransactionState:output_type -> tari.rpc.TransactionStateResponse + 81, // 101: tari.rpc.BaseNode.Identify:output_type -> tari.rpc.NodeIdentity + 82, // 102: tari.rpc.BaseNode.GetNetworkStatus:output_type -> tari.rpc.NetworkStatusResponse + 83, // 103: tari.rpc.BaseNode.ListConnectedPeers:output_type -> tari.rpc.ListConnectedPeersResponse + 51, // 104: tari.rpc.BaseNode.GetMempoolStats:output_type -> tari.rpc.MempoolStatsResponse + 53, // 105: tari.rpc.BaseNode.GetActiveValidatorNodes:output_type -> tari.rpc.GetActiveValidatorNodesResponse + 55, // 106: tari.rpc.BaseNode.GetShardKey:output_type -> tari.rpc.GetShardKeyResponse + 57, // 107: tari.rpc.BaseNode.GetTemplateRegistrations:output_type -> tari.rpc.GetTemplateRegistrationResponse + 60, // 108: tari.rpc.BaseNode.GetSideChainUtxos:output_type -> tari.rpc.GetSideChainUtxosResponse + 62, // 109: tari.rpc.BaseNode.GetNetworkState:output_type -> tari.rpc.GetNetworkStateResponse + 65, // 110: tari.rpc.BaseNode.SearchPaymentReferences:output_type -> tari.rpc.PaymentReferenceResponse + 73, // [73:111] is the sub-list for method output_type + 35, // [35:73] is the sub-list for method input_type + 35, // [35:35] is the sub-list for extension type_name + 35, // [35:35] is the sub-list for extension extendee + 0, // [0:35] is the sub-list for field type_name +} + +func init() { file_base_node_proto_init() } +func file_base_node_proto_init() { + if File_base_node_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_base_node_proto_rawDesc), len(file_base_node_proto_rawDesc)), + NumEnums: 6, + NumMessages: 60, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_base_node_proto_goTypes, + DependencyIndexes: file_base_node_proto_depIdxs, + EnumInfos: file_base_node_proto_enumTypes, + MessageInfos: file_base_node_proto_msgTypes, + }.Build() + File_base_node_proto = out.File + file_base_node_proto_goTypes = nil + file_base_node_proto_depIdxs = nil +} diff --git a/internal/server/proxy/proto/base_node.proto b/internal/server/proxy/proto/base_node.proto new file mode 100644 index 0000000..26ea595 --- /dev/null +++ b/internal/server/proxy/proto/base_node.proto @@ -0,0 +1,600 @@ +// Copyright 2020. The Tari Project +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +// following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the +// following disclaimer in the documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote +// products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +syntax = "proto3"; + +import "types.proto"; +import "transaction.proto"; +import "block.proto"; +import "network.proto"; +import "sidechain_types.proto"; + +package tari.rpc; + +// The gRPC interface for interacting with the base node. +service BaseNode { + // Lists headers in the current best chain + rpc ListHeaders(ListHeadersRequest) returns (stream BlockHeaderResponse); + // Get header by hash + rpc GetHeaderByHash(GetHeaderByHashRequest) returns (BlockHeaderResponse); + // Returns blocks in the current best chain. Currently only supports querying by height + rpc GetBlocks(GetBlocksRequest) returns (stream HistoricalBlock); + // Returns the block timing for the chain heights + rpc GetBlockTiming(HeightRequest) returns (BlockTimingResponse); + // Returns the network Constants + rpc GetConstants(BlockHeight) returns (ConsensusConstants); + // Returns Block Sizes + rpc GetBlockSize (BlockGroupRequest) returns (BlockGroupResponse); + // Returns Block Fees + rpc GetBlockFees (BlockGroupRequest) returns (BlockGroupResponse); + // Get Version + rpc GetVersion(Empty) returns (StringValue); + // Check for new updates + rpc CheckForUpdates(Empty) returns (SoftwareUpdate); + // Get coins in circulation + rpc GetTokensInCirculation(GetBlocksRequest) returns (stream ValueAtHeightResponse); + // Get network difficulties + rpc GetNetworkDifficulty(HeightRequest) returns (stream NetworkDifficultyResponse); + // Get the block template + rpc GetNewBlockTemplate(NewBlockTemplateRequest) returns (NewBlockTemplateResponse); + // Construct a new block from a provided template + rpc GetNewBlock(NewBlockTemplate) returns (GetNewBlockResult); + // Construct a new block from a provided template + rpc GetNewBlockWithCoinbases(GetNewBlockWithCoinbasesRequest) returns (GetNewBlockResult); + // Construct a new block from a provided template + rpc GetNewBlockTemplateWithCoinbases(GetNewBlockTemplateWithCoinbasesRequest) returns (GetNewBlockResult); + // Construct a new block and header blob from a provided template + rpc GetNewBlockBlob(NewBlockTemplate) returns (GetNewBlockBlobResult); + // Submit a new block for propagation + rpc SubmitBlock(Block) returns (SubmitBlockResponse); + // Submit a new mined block blob for propagation + rpc SubmitBlockBlob(BlockBlobRequest) returns (SubmitBlockResponse); + // Submit a transaction for propagation + rpc SubmitTransaction(SubmitTransactionRequest) returns (SubmitTransactionResponse); + // Get the base node sync information + rpc GetSyncInfo(Empty) returns (SyncInfoResponse); + // Get the base node sync information + rpc GetSyncProgress(Empty) returns (SyncProgressResponse); + // Get the base node tip information + rpc GetTipInfo(Empty) returns (TipInfoResponse); + // Search for blocks containing the specified kernels + rpc SearchKernels(SearchKernelsRequest) returns (stream HistoricalBlock); + // Search for blocks containing the specified commitments + rpc SearchUtxos(SearchUtxosRequest) returns (stream HistoricalBlock); + // Fetch any utxos that exist in the main chain + rpc FetchMatchingUtxos(FetchMatchingUtxosRequest) returns (stream FetchMatchingUtxosResponse); + // get all peers from the base node + rpc GetPeers(GetPeersRequest) returns (stream GetPeersResponse); + rpc GetMempoolTransactions(GetMempoolTransactionsRequest) returns (stream GetMempoolTransactionsResponse); + rpc TransactionState(TransactionStateRequest) returns (TransactionStateResponse); + // This returns the node's network identity + rpc Identify (Empty) returns (NodeIdentity); + // Get Base Node network connectivity status + rpc GetNetworkStatus(Empty) returns (NetworkStatusResponse); + // List currently connected peers + rpc ListConnectedPeers(Empty) returns (ListConnectedPeersResponse); + // Get mempool stats + rpc GetMempoolStats(Empty) returns (MempoolStatsResponse); + // Get VNs + rpc GetActiveValidatorNodes(GetActiveValidatorNodesRequest) returns (stream GetActiveValidatorNodesResponse); + rpc GetShardKey(GetShardKeyRequest) returns (GetShardKeyResponse); + // Get templates + rpc GetTemplateRegistrations(GetTemplateRegistrationsRequest) returns (stream GetTemplateRegistrationResponse); + rpc GetSideChainUtxos(GetSideChainUtxosRequest) returns (stream GetSideChainUtxosResponse); + rpc GetNetworkState(GetNetworkStateRequest) returns (GetNetworkStateResponse); + // PayRef (Payment Reference) lookup for block explorers and external services + rpc SearchPaymentReferences(SearchPaymentReferencesRequest) returns (stream PaymentReferenceResponse); +} + +message GetAssetMetadataRequest { + bytes asset_public_key = 1; +} + +message GetAssetMetadataResponse { + string name = 2; + string description =3; + string image = 4; + bytes owner_commitment = 5; + OutputFeatures features = 6; + uint64 mined_height = 7; + bytes mined_in_block = 8; +} + +message ListAssetRegistrationsRequest { + uint64 offset = 2; + uint64 count = 3; +} + +message ListAssetRegistrationsResponse { + bytes asset_public_key = 1; + bytes unique_id = 2; + bytes owner_commitment = 3; + uint64 mined_height = 4; + bytes mined_in_block = 5; + OutputFeatures features = 6; + bytes script = 7; +} + +message GetTokensRequest { + bytes asset_public_key = 1; + // Optionally get a set of specific unique_ids + repeated bytes unique_ids = 2; +} + +message GetTokensResponse { + bytes unique_id = 1; + bytes asset_public_key = 2; + bytes owner_commitment = 3; + bytes mined_in_block = 4; + uint64 mined_height = 5; + OutputFeatures features = 6; + bytes script = 7; +} + +message SubmitBlockResponse { + bytes block_hash = 1; +} + +message BlockBlobRequest{ + bytes header_blob = 1; + bytes body_blob = 2; +} + +/// return type of GetTipInfo +message TipInfoResponse { + MetaData metadata = 1; + bool initial_sync_achieved = 2; + BaseNodeState base_node_state = 3; + bool failed_checkpoints = 4; +} + +enum BaseNodeState{ + START_UP = 0; + HEADER_SYNC = 1; + HORIZON_SYNC = 2; + CONNECTING = 3; + BLOCK_SYNC = 4; + LISTENING = 5; + SYNC_FAILED = 6; +} + +/// return type of GetNewBlockTemplate +message NewBlockTemplateResponse { + NewBlockTemplate new_block_template = 1; + bool initial_sync_achieved = 3; + MinerData miner_data = 4; +} + +/// return type of NewBlockTemplateRequest +message NewBlockTemplateRequest{ + PowAlgo algo = 1; + //This field should be moved to optional once optional keyword is standard + uint64 max_weight = 2; +} + +/// return type of NewBlockTemplateRequest +message GetNewBlockTemplateWithCoinbasesRequest{ + PowAlgo algo = 1; + //This field should be moved to optional once optional keyword is standard + uint64 max_weight = 2; + repeated NewBlockCoinbase coinbases = 3; +} + +/// request type of GetNewBlockWithCoinbasesRequest +message GetNewBlockWithCoinbasesRequest{ + NewBlockTemplate new_template = 1; + repeated NewBlockCoinbase coinbases = 2; +} + +message NewBlockCoinbase{ + string address = 1; + uint64 value = 2; + bool stealth_payment= 3; + bool revealed_value_proof= 4; + bytes coinbase_extra =5; +} + +// Network difficulty response +message NetworkDifficultyResponse { + uint64 difficulty = 1; + uint64 estimated_hash_rate = 2; + uint64 height = 3; + uint64 timestamp = 4; + uint64 pow_algo = 5; + uint64 sha3x_estimated_hash_rate = 6; + uint64 monero_randomx_estimated_hash_rate = 7; + uint64 tari_randomx_estimated_hash_rate = 10; + uint64 num_coinbases = 8; + repeated bytes coinbase_extras = 9; +} + +// A generic single value response for a specific height +message ValueAtHeightResponse { + // uint64 circulating_supply = 1; // No longer used + // uint64 spendable_supply = 2; // No longer used + uint64 height = 3; + uint64 mined_rewards = 4; + uint64 spendable_rewards = 5; + uint64 spendable_pre_mine = 6; + uint64 total_spendable = 7; +} + +// A generic uint value +message IntegerValue { + uint64 value = 1; +} + +// A generic String value +message StringValue { + string value = 1; +} + +/// GetBlockSize / GetBlockFees Request +/// Either the starting and ending heights OR the from_tip param must be specified +message BlockGroupRequest { + // The height from the chain tip (optional) + uint64 from_tip = 1; + // The starting height (optional) + uint64 start_height = 2; + // The ending height (optional) + uint64 end_height = 3; + /// The type of calculation required (optional) + /// Defaults to median + /// median, mean, quartile, quantile + CalcType calc_type = 4; +} + +/// GetBlockSize / GetBlockFees Response +message BlockGroupResponse { + repeated double value = 1; + CalcType calc_type = 2; +} + +enum CalcType { + MEAN = 0; + MEDIAN = 1; + QUANTILE = 2; + QUARTILE = 3; +} + +// The request used for querying a function that requires a height, either between 2 points or from the chain tip +// If start_height and end_height are set and > 0, they take precedence, otherwise from_tip is used +message HeightRequest { + // The height from the chain tip (optional) + uint64 from_tip = 1; + // The starting height (optional) + uint64 start_height = 2; + // The ending height (optional) + uint64 end_height = 3; +} + +// The return type of the rpc GetBlockTiming +message BlockTimingResponse { + uint64 max = 1; + uint64 min = 2; + double avg = 3; +} + +// Request that returns a header based by hash +message GetHeaderByHashRequest { + // The hash of the block header + bytes hash = 1; +} + + +message BlockHeaderResponse { + // The block header + BlockHeader header = 1; + // The number of blocks from the tip of this block (a.k.a depth) + uint64 confirmations = 2; + // The block reward i.e mining reward + fees + uint64 reward = 3; + // Achieved difficulty + uint64 difficulty = 4; + // The number of transactions contained in the block + uint32 num_transactions = 5; +} + +// The request used for querying headers from the base node. The parameters `from_height` and `num_headers` can be used +// to page through the current best chain. +message ListHeadersRequest { + // The height to start at. Depending on sorting, will either default to use the tip or genesis block, for `SORTING_DESC` + // and `SORTING_ASC` respectively, if a value is not provided. The first header returned will be at this height + // followed by `num_headers` - 1 headers in the direction specified by `sorting`. If greater than the current tip, + // the current tip will be used. + uint64 from_height = 1; + // The number of headers to return. If not specified, it will default to 10 + uint64 num_headers = 2; + // The ordering to return the headers in. If not specified will default to SORTING_DESC. Note that if `from_height` + // is not specified or is 0, if `sorting` is SORTING_DESC, the tip will be used as `from_height`, otherwise the + // block at height 0 will be used. + Sorting sorting = 3; +} + +// The request used for querying blocks in the base node's current best chain. Currently only querying by height is +// available. Multiple blocks may be queried.e.g. [189092,100023,122424]. The order in which they are returned is not +// guaranteed. +message GetBlocksRequest { + repeated uint64 heights = 1; +} + +// The return type of the rpc GetBlocks. Blocks are not guaranteed to be returned in the order requested. +message GetBlocksResponse { + repeated HistoricalBlock blocks = 1; +} + +enum Sorting { + SORTING_DESC = 0; + SORTING_ASC = 1; +} + +message MetaData { + // The current chain height, or the block number of the longest valid chain, or `None` if there is no chain + uint64 best_block_height = 1; + // The block hash of the current tip of the longest valid chain, or `None` for an empty chain + bytes best_block_hash = 2; + // The current geometric mean of the pow of the chain tip, or `None` if there is no chain + bytes accumulated_difficulty = 5; + // This is the min height this node can provide complete blocks for. A 0 here means this node is archival and can provide complete blocks for every height. + uint64 pruned_height = 6; + uint64 timestamp = 7; +} + +message SyncInfoResponse { + uint64 tip_height = 1; + uint64 local_height = 2; + repeated bytes peer_node_id = 3; +} + +message SyncProgressResponse { + uint64 tip_height = 1; + uint64 local_height = 2; + SyncState state = 3; + string short_desc = 4; + uint64 initial_connected_peers = 5; +} + +enum SyncState { + STARTUP = 0; + HEADER_STARTING = 1; + HEADER = 2; + BLOCK_STARTING = 3; + BLOCK = 4; + DONE = 5; +} + +// This is the message that is returned for a miner after it asks for a new block. +message GetNewBlockResult{ + // This is the header hash of the completed block + bytes block_hash = 1; + // This is the completed block + Block block = 2; + bytes merge_mining_hash =3; + bytes tari_unique_id =4; + MinerData miner_data = 5; + bytes vm_key = 6; +} + +// This is the message that is returned for a miner after it asks for a new block. +message GetNewBlockBlobResult{ + // This is the header hash of the completed block + bytes block_hash = 1; + // This is the completed block's header + bytes header = 2; + // This is the completed block's body + bytes block_body = 3; + bytes merge_mining_hash =4; + bytes utxo_mr = 5; + bytes tari_unique_id =6; +} + +// This is mining data for the miner asking for a new block +message MinerData{ + PowAlgo algo = 1; + uint64 target_difficulty = 2; + uint64 reward = 3; +// bytes merge_mining_hash =4; + uint64 total_fees = 5; +} + +// This is the request type for the Search Kernels rpc +message SearchKernelsRequest{ + repeated Signature signatures = 1; +} + +// This is the request type for the Search Utxo rpc +message SearchUtxosRequest{ + repeated bytes commitments = 1; +} + +message FetchMatchingUtxosRequest { + repeated bytes hashes = 1; +} + +message FetchMatchingUtxosResponse { + TransactionOutput output = 1; +} + +// This is the request type of the get all peers rpc call +message GetPeersResponse{ + Peer peer = 1; +} + +message GetPeersRequest{} + +message SubmitTransactionRequest { + Transaction transaction = 1; +} + +message SubmitTransactionResponse { + SubmitTransactionResult result =1; +} + +enum SubmitTransactionResult { + NONE = 0; + ACCEPTED = 1; + NOT_PROCESSABLE_AT_THIS_TIME = 2; + ALREADY_MINED = 3; + REJECTED = 4; + +} + +message GetMempoolTransactionsRequest { + +} + +message GetMempoolTransactionsResponse { + Transaction transaction = 1; +} + +message TransactionStateRequest { + Signature excess_sig = 1; +} + +message TransactionStateResponse { + TransactionLocation result =1; +} + +enum TransactionLocation { + UNKNOWN = 0; + MEMPOOL = 1; + MINED = 2; + NOT_STORED = 3; +} + +message MempoolStatsResponse { + uint64 unconfirmed_txs = 2; + uint64 reorg_txs = 3; + uint64 unconfirmed_weight = 4; +} + +message GetActiveValidatorNodesRequest { + uint64 height = 1; +} + +message GetActiveValidatorNodesResponse { + bytes shard_key = 1; + bytes public_key = 2; +} + +message GetShardKeyRequest { + uint64 height = 1; + bytes public_key = 2; +} + +message GetShardKeyResponse { + bytes shard_key = 1; + bool found = 2; +} + +message GetTemplateRegistrationsRequest { + bytes start_hash = 1; + uint64 count = 2; +} + +message GetTemplateRegistrationResponse { + bytes utxo_hash = 1; + TemplateRegistration registration = 2; +} + +message BlockInfo { + uint64 height = 1; + bytes hash = 2; + bytes next_block_hash = 3; +} + +message GetSideChainUtxosRequest { + bytes start_hash = 1; + uint64 count = 2; +} + +message GetSideChainUtxosResponse { + BlockInfo block_info = 1; + repeated TransactionOutput outputs = 2; +} + +message GetNetworkStateRequest { +} + +message GetNetworkStateResponse { + // metadata + MetaData metadata = 1; + // has the base node synced + bool initial_sync_achieved = 2; + //current state of the base node + BaseNodeState base_node_state = 3; + // do we have failed checkpoints + bool failed_checkpoints = 4; + // The block reward of the next tip + uint64 reward = 5; + // estimate sha3x hash rate + uint64 sha3x_estimated_hash_rate = 6; + // estimate randomx hash rate + uint64 monero_randomx_estimated_hash_rate = 7; + uint64 tari_randomx_estimated_hash_rate = 10; + // number of connections + uint64 num_connections = 8; + //liveness results + repeated LivenessResult liveness_results = 9; +} + +message LivenessResult{ + // node id + bytes peer_node_id = 1; + // time to discover + uint64 discover_latency = 2; + // Dial latency + uint64 ping_latency = 3; +} + +// PayRef (Payment Reference) search and lookup messages + +// Request to search for outputs by payment reference +message SearchPaymentReferencesRequest { + // Payment reference as hex string (64 characters) + repeated string payment_reference_hex = 1; + repeated bytes payment_reference_bytes = 2; + // Optional: include spent outputs in results + bool include_spent = 3; +} + +// Response containing payment reference match +message PaymentReferenceResponse { + // The payment reference that was found + string payment_reference_hex = 1; + // Block height where the output was mined + uint64 block_height = 2; + // Block hash where the output was mined + bytes block_hash = 3; + // Timestamp when the output was mined + uint64 mined_timestamp = 4; + // Output commitment (32 bytes) + bytes commitment = 5; + // Whether this output has been spent + bool is_spent = 6; + // Height where output was spent (if spent) + uint64 spent_height = 7; + // Block hash where output was spent (if spent) + bytes spent_block_hash = 8; + // Transaction output amount will be 0 for non set a + uint64 min_value_promise = 9; +} + diff --git a/internal/server/proxy/proto/base_node_grpc.pb.go b/internal/server/proxy/proto/base_node_grpc.pb.go new file mode 100644 index 0000000..d6c8865 --- /dev/null +++ b/internal/server/proxy/proto/base_node_grpc.pb.go @@ -0,0 +1,1663 @@ +// Copyright 2020. The Tari Project +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +// following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the +// following disclaimer in the documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote +// products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v3.6.1 +// source: base_node.proto + +package base_node + +import ( + context "context" + block "pool/internal/server/proxy/proto/block" + net_work "pool/internal/server/proxy/proto/net_work" + types "pool/internal/server/proxy/proto/types" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + BaseNode_ListHeaders_FullMethodName = "/tari.rpc.BaseNode/ListHeaders" + BaseNode_GetHeaderByHash_FullMethodName = "/tari.rpc.BaseNode/GetHeaderByHash" + BaseNode_GetBlocks_FullMethodName = "/tari.rpc.BaseNode/GetBlocks" + BaseNode_GetBlockTiming_FullMethodName = "/tari.rpc.BaseNode/GetBlockTiming" + BaseNode_GetConstants_FullMethodName = "/tari.rpc.BaseNode/GetConstants" + BaseNode_GetBlockSize_FullMethodName = "/tari.rpc.BaseNode/GetBlockSize" + BaseNode_GetBlockFees_FullMethodName = "/tari.rpc.BaseNode/GetBlockFees" + BaseNode_GetVersion_FullMethodName = "/tari.rpc.BaseNode/GetVersion" + BaseNode_CheckForUpdates_FullMethodName = "/tari.rpc.BaseNode/CheckForUpdates" + BaseNode_GetTokensInCirculation_FullMethodName = "/tari.rpc.BaseNode/GetTokensInCirculation" + BaseNode_GetNetworkDifficulty_FullMethodName = "/tari.rpc.BaseNode/GetNetworkDifficulty" + BaseNode_GetNewBlockTemplate_FullMethodName = "/tari.rpc.BaseNode/GetNewBlockTemplate" + BaseNode_GetNewBlock_FullMethodName = "/tari.rpc.BaseNode/GetNewBlock" + BaseNode_GetNewBlockWithCoinbases_FullMethodName = "/tari.rpc.BaseNode/GetNewBlockWithCoinbases" + BaseNode_GetNewBlockTemplateWithCoinbases_FullMethodName = "/tari.rpc.BaseNode/GetNewBlockTemplateWithCoinbases" + BaseNode_GetNewBlockBlob_FullMethodName = "/tari.rpc.BaseNode/GetNewBlockBlob" + BaseNode_SubmitBlock_FullMethodName = "/tari.rpc.BaseNode/SubmitBlock" + BaseNode_SubmitBlockBlob_FullMethodName = "/tari.rpc.BaseNode/SubmitBlockBlob" + BaseNode_SubmitTransaction_FullMethodName = "/tari.rpc.BaseNode/SubmitTransaction" + BaseNode_GetSyncInfo_FullMethodName = "/tari.rpc.BaseNode/GetSyncInfo" + BaseNode_GetSyncProgress_FullMethodName = "/tari.rpc.BaseNode/GetSyncProgress" + BaseNode_GetTipInfo_FullMethodName = "/tari.rpc.BaseNode/GetTipInfo" + BaseNode_SearchKernels_FullMethodName = "/tari.rpc.BaseNode/SearchKernels" + BaseNode_SearchUtxos_FullMethodName = "/tari.rpc.BaseNode/SearchUtxos" + BaseNode_FetchMatchingUtxos_FullMethodName = "/tari.rpc.BaseNode/FetchMatchingUtxos" + BaseNode_GetPeers_FullMethodName = "/tari.rpc.BaseNode/GetPeers" + BaseNode_GetMempoolTransactions_FullMethodName = "/tari.rpc.BaseNode/GetMempoolTransactions" + BaseNode_TransactionState_FullMethodName = "/tari.rpc.BaseNode/TransactionState" + BaseNode_Identify_FullMethodName = "/tari.rpc.BaseNode/Identify" + BaseNode_GetNetworkStatus_FullMethodName = "/tari.rpc.BaseNode/GetNetworkStatus" + BaseNode_ListConnectedPeers_FullMethodName = "/tari.rpc.BaseNode/ListConnectedPeers" + BaseNode_GetMempoolStats_FullMethodName = "/tari.rpc.BaseNode/GetMempoolStats" + BaseNode_GetActiveValidatorNodes_FullMethodName = "/tari.rpc.BaseNode/GetActiveValidatorNodes" + BaseNode_GetShardKey_FullMethodName = "/tari.rpc.BaseNode/GetShardKey" + BaseNode_GetTemplateRegistrations_FullMethodName = "/tari.rpc.BaseNode/GetTemplateRegistrations" + BaseNode_GetSideChainUtxos_FullMethodName = "/tari.rpc.BaseNode/GetSideChainUtxos" + BaseNode_GetNetworkState_FullMethodName = "/tari.rpc.BaseNode/GetNetworkState" + BaseNode_SearchPaymentReferences_FullMethodName = "/tari.rpc.BaseNode/SearchPaymentReferences" +) + +// BaseNodeClient is the client API for BaseNode service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// The gRPC interface for interacting with the base node. +type BaseNodeClient interface { + // Lists headers in the current best chain + ListHeaders(ctx context.Context, in *ListHeadersRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[BlockHeaderResponse], error) + // Get header by hash + GetHeaderByHash(ctx context.Context, in *GetHeaderByHashRequest, opts ...grpc.CallOption) (*BlockHeaderResponse, error) + // Returns blocks in the current best chain. Currently only supports querying by height + GetBlocks(ctx context.Context, in *GetBlocksRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[block.HistoricalBlock], error) + // Returns the block timing for the chain heights + GetBlockTiming(ctx context.Context, in *HeightRequest, opts ...grpc.CallOption) (*BlockTimingResponse, error) + // Returns the network Constants + GetConstants(ctx context.Context, in *types.BlockHeight, opts ...grpc.CallOption) (*types.ConsensusConstants, error) + // Returns Block Sizes + GetBlockSize(ctx context.Context, in *BlockGroupRequest, opts ...grpc.CallOption) (*BlockGroupResponse, error) + // Returns Block Fees + GetBlockFees(ctx context.Context, in *BlockGroupRequest, opts ...grpc.CallOption) (*BlockGroupResponse, error) + // Get Version + GetVersion(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*StringValue, error) + // Check for new updates + CheckForUpdates(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*net_work.SoftwareUpdate, error) + // Get coins in circulation + GetTokensInCirculation(ctx context.Context, in *GetBlocksRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ValueAtHeightResponse], error) + // Get network difficulties + GetNetworkDifficulty(ctx context.Context, in *HeightRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[NetworkDifficultyResponse], error) + // Get the block template + GetNewBlockTemplate(ctx context.Context, in *NewBlockTemplateRequest, opts ...grpc.CallOption) (*NewBlockTemplateResponse, error) + // Construct a new block from a provided template + GetNewBlock(ctx context.Context, in *block.NewBlockTemplate, opts ...grpc.CallOption) (*GetNewBlockResult, error) + // Construct a new block from a provided template + GetNewBlockWithCoinbases(ctx context.Context, in *GetNewBlockWithCoinbasesRequest, opts ...grpc.CallOption) (*GetNewBlockResult, error) + // Construct a new block from a provided template + GetNewBlockTemplateWithCoinbases(ctx context.Context, in *GetNewBlockTemplateWithCoinbasesRequest, opts ...grpc.CallOption) (*GetNewBlockResult, error) + // Construct a new block and header blob from a provided template + GetNewBlockBlob(ctx context.Context, in *block.NewBlockTemplate, opts ...grpc.CallOption) (*GetNewBlockBlobResult, error) + // Submit a new block for propagation + SubmitBlock(ctx context.Context, in *block.Block, opts ...grpc.CallOption) (*SubmitBlockResponse, error) + // Submit a new mined block blob for propagation + SubmitBlockBlob(ctx context.Context, in *BlockBlobRequest, opts ...grpc.CallOption) (*SubmitBlockResponse, error) + // Submit a transaction for propagation + SubmitTransaction(ctx context.Context, in *SubmitTransactionRequest, opts ...grpc.CallOption) (*SubmitTransactionResponse, error) + // Get the base node sync information + GetSyncInfo(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*SyncInfoResponse, error) + // Get the base node sync information + GetSyncProgress(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*SyncProgressResponse, error) + // Get the base node tip information + GetTipInfo(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*TipInfoResponse, error) + // Search for blocks containing the specified kernels + SearchKernels(ctx context.Context, in *SearchKernelsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[block.HistoricalBlock], error) + // Search for blocks containing the specified commitments + SearchUtxos(ctx context.Context, in *SearchUtxosRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[block.HistoricalBlock], error) + // Fetch any utxos that exist in the main chain + FetchMatchingUtxos(ctx context.Context, in *FetchMatchingUtxosRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[FetchMatchingUtxosResponse], error) + // get all peers from the base node + GetPeers(ctx context.Context, in *GetPeersRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetPeersResponse], error) + GetMempoolTransactions(ctx context.Context, in *GetMempoolTransactionsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetMempoolTransactionsResponse], error) + TransactionState(ctx context.Context, in *TransactionStateRequest, opts ...grpc.CallOption) (*TransactionStateResponse, error) + // This returns the node's network identity + Identify(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*net_work.NodeIdentity, error) + // Get Base Node network connectivity status + GetNetworkStatus(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*net_work.NetworkStatusResponse, error) + // List currently connected peers + ListConnectedPeers(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*net_work.ListConnectedPeersResponse, error) + // Get mempool stats + GetMempoolStats(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*MempoolStatsResponse, error) + // Get VNs + GetActiveValidatorNodes(ctx context.Context, in *GetActiveValidatorNodesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetActiveValidatorNodesResponse], error) + GetShardKey(ctx context.Context, in *GetShardKeyRequest, opts ...grpc.CallOption) (*GetShardKeyResponse, error) + // Get templates + GetTemplateRegistrations(ctx context.Context, in *GetTemplateRegistrationsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetTemplateRegistrationResponse], error) + GetSideChainUtxos(ctx context.Context, in *GetSideChainUtxosRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetSideChainUtxosResponse], error) + GetNetworkState(ctx context.Context, in *GetNetworkStateRequest, opts ...grpc.CallOption) (*GetNetworkStateResponse, error) + // PayRef (Payment Reference) lookup for block explorers and external services + SearchPaymentReferences(ctx context.Context, in *SearchPaymentReferencesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[PaymentReferenceResponse], error) +} + +type baseNodeClient struct { + cc grpc.ClientConnInterface +} + +func NewBaseNodeClient(cc grpc.ClientConnInterface) BaseNodeClient { + return &baseNodeClient{cc} +} + +func (c *baseNodeClient) ListHeaders(ctx context.Context, in *ListHeadersRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[BlockHeaderResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &BaseNode_ServiceDesc.Streams[0], BaseNode_ListHeaders_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[ListHeadersRequest, BlockHeaderResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_ListHeadersClient = grpc.ServerStreamingClient[BlockHeaderResponse] + +func (c *baseNodeClient) GetHeaderByHash(ctx context.Context, in *GetHeaderByHashRequest, opts ...grpc.CallOption) (*BlockHeaderResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BlockHeaderResponse) + err := c.cc.Invoke(ctx, BaseNode_GetHeaderByHash_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) GetBlocks(ctx context.Context, in *GetBlocksRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[block.HistoricalBlock], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &BaseNode_ServiceDesc.Streams[1], BaseNode_GetBlocks_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[GetBlocksRequest, block.HistoricalBlock]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_GetBlocksClient = grpc.ServerStreamingClient[block.HistoricalBlock] + +func (c *baseNodeClient) GetBlockTiming(ctx context.Context, in *HeightRequest, opts ...grpc.CallOption) (*BlockTimingResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BlockTimingResponse) + err := c.cc.Invoke(ctx, BaseNode_GetBlockTiming_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) GetConstants(ctx context.Context, in *types.BlockHeight, opts ...grpc.CallOption) (*types.ConsensusConstants, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(types.ConsensusConstants) + err := c.cc.Invoke(ctx, BaseNode_GetConstants_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) GetBlockSize(ctx context.Context, in *BlockGroupRequest, opts ...grpc.CallOption) (*BlockGroupResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BlockGroupResponse) + err := c.cc.Invoke(ctx, BaseNode_GetBlockSize_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) GetBlockFees(ctx context.Context, in *BlockGroupRequest, opts ...grpc.CallOption) (*BlockGroupResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BlockGroupResponse) + err := c.cc.Invoke(ctx, BaseNode_GetBlockFees_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) GetVersion(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*StringValue, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(StringValue) + err := c.cc.Invoke(ctx, BaseNode_GetVersion_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) CheckForUpdates(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*net_work.SoftwareUpdate, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(net_work.SoftwareUpdate) + err := c.cc.Invoke(ctx, BaseNode_CheckForUpdates_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) GetTokensInCirculation(ctx context.Context, in *GetBlocksRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ValueAtHeightResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &BaseNode_ServiceDesc.Streams[2], BaseNode_GetTokensInCirculation_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[GetBlocksRequest, ValueAtHeightResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_GetTokensInCirculationClient = grpc.ServerStreamingClient[ValueAtHeightResponse] + +func (c *baseNodeClient) GetNetworkDifficulty(ctx context.Context, in *HeightRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[NetworkDifficultyResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &BaseNode_ServiceDesc.Streams[3], BaseNode_GetNetworkDifficulty_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[HeightRequest, NetworkDifficultyResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_GetNetworkDifficultyClient = grpc.ServerStreamingClient[NetworkDifficultyResponse] + +func (c *baseNodeClient) GetNewBlockTemplate(ctx context.Context, in *NewBlockTemplateRequest, opts ...grpc.CallOption) (*NewBlockTemplateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(NewBlockTemplateResponse) + err := c.cc.Invoke(ctx, BaseNode_GetNewBlockTemplate_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) GetNewBlock(ctx context.Context, in *block.NewBlockTemplate, opts ...grpc.CallOption) (*GetNewBlockResult, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetNewBlockResult) + err := c.cc.Invoke(ctx, BaseNode_GetNewBlock_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) GetNewBlockWithCoinbases(ctx context.Context, in *GetNewBlockWithCoinbasesRequest, opts ...grpc.CallOption) (*GetNewBlockResult, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetNewBlockResult) + err := c.cc.Invoke(ctx, BaseNode_GetNewBlockWithCoinbases_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) GetNewBlockTemplateWithCoinbases(ctx context.Context, in *GetNewBlockTemplateWithCoinbasesRequest, opts ...grpc.CallOption) (*GetNewBlockResult, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetNewBlockResult) + err := c.cc.Invoke(ctx, BaseNode_GetNewBlockTemplateWithCoinbases_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) GetNewBlockBlob(ctx context.Context, in *block.NewBlockTemplate, opts ...grpc.CallOption) (*GetNewBlockBlobResult, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetNewBlockBlobResult) + err := c.cc.Invoke(ctx, BaseNode_GetNewBlockBlob_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) SubmitBlock(ctx context.Context, in *block.Block, opts ...grpc.CallOption) (*SubmitBlockResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SubmitBlockResponse) + err := c.cc.Invoke(ctx, BaseNode_SubmitBlock_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) SubmitBlockBlob(ctx context.Context, in *BlockBlobRequest, opts ...grpc.CallOption) (*SubmitBlockResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SubmitBlockResponse) + err := c.cc.Invoke(ctx, BaseNode_SubmitBlockBlob_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) SubmitTransaction(ctx context.Context, in *SubmitTransactionRequest, opts ...grpc.CallOption) (*SubmitTransactionResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SubmitTransactionResponse) + err := c.cc.Invoke(ctx, BaseNode_SubmitTransaction_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) GetSyncInfo(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*SyncInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SyncInfoResponse) + err := c.cc.Invoke(ctx, BaseNode_GetSyncInfo_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) GetSyncProgress(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*SyncProgressResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SyncProgressResponse) + err := c.cc.Invoke(ctx, BaseNode_GetSyncProgress_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) GetTipInfo(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*TipInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TipInfoResponse) + err := c.cc.Invoke(ctx, BaseNode_GetTipInfo_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) SearchKernels(ctx context.Context, in *SearchKernelsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[block.HistoricalBlock], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &BaseNode_ServiceDesc.Streams[4], BaseNode_SearchKernels_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[SearchKernelsRequest, block.HistoricalBlock]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_SearchKernelsClient = grpc.ServerStreamingClient[block.HistoricalBlock] + +func (c *baseNodeClient) SearchUtxos(ctx context.Context, in *SearchUtxosRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[block.HistoricalBlock], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &BaseNode_ServiceDesc.Streams[5], BaseNode_SearchUtxos_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[SearchUtxosRequest, block.HistoricalBlock]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_SearchUtxosClient = grpc.ServerStreamingClient[block.HistoricalBlock] + +func (c *baseNodeClient) FetchMatchingUtxos(ctx context.Context, in *FetchMatchingUtxosRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[FetchMatchingUtxosResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &BaseNode_ServiceDesc.Streams[6], BaseNode_FetchMatchingUtxos_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[FetchMatchingUtxosRequest, FetchMatchingUtxosResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_FetchMatchingUtxosClient = grpc.ServerStreamingClient[FetchMatchingUtxosResponse] + +func (c *baseNodeClient) GetPeers(ctx context.Context, in *GetPeersRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetPeersResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &BaseNode_ServiceDesc.Streams[7], BaseNode_GetPeers_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[GetPeersRequest, GetPeersResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_GetPeersClient = grpc.ServerStreamingClient[GetPeersResponse] + +func (c *baseNodeClient) GetMempoolTransactions(ctx context.Context, in *GetMempoolTransactionsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetMempoolTransactionsResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &BaseNode_ServiceDesc.Streams[8], BaseNode_GetMempoolTransactions_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[GetMempoolTransactionsRequest, GetMempoolTransactionsResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_GetMempoolTransactionsClient = grpc.ServerStreamingClient[GetMempoolTransactionsResponse] + +func (c *baseNodeClient) TransactionState(ctx context.Context, in *TransactionStateRequest, opts ...grpc.CallOption) (*TransactionStateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TransactionStateResponse) + err := c.cc.Invoke(ctx, BaseNode_TransactionState_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) Identify(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*net_work.NodeIdentity, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(net_work.NodeIdentity) + err := c.cc.Invoke(ctx, BaseNode_Identify_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) GetNetworkStatus(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*net_work.NetworkStatusResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(net_work.NetworkStatusResponse) + err := c.cc.Invoke(ctx, BaseNode_GetNetworkStatus_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) ListConnectedPeers(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*net_work.ListConnectedPeersResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(net_work.ListConnectedPeersResponse) + err := c.cc.Invoke(ctx, BaseNode_ListConnectedPeers_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) GetMempoolStats(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*MempoolStatsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MempoolStatsResponse) + err := c.cc.Invoke(ctx, BaseNode_GetMempoolStats_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) GetActiveValidatorNodes(ctx context.Context, in *GetActiveValidatorNodesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetActiveValidatorNodesResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &BaseNode_ServiceDesc.Streams[9], BaseNode_GetActiveValidatorNodes_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[GetActiveValidatorNodesRequest, GetActiveValidatorNodesResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_GetActiveValidatorNodesClient = grpc.ServerStreamingClient[GetActiveValidatorNodesResponse] + +func (c *baseNodeClient) GetShardKey(ctx context.Context, in *GetShardKeyRequest, opts ...grpc.CallOption) (*GetShardKeyResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetShardKeyResponse) + err := c.cc.Invoke(ctx, BaseNode_GetShardKey_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) GetTemplateRegistrations(ctx context.Context, in *GetTemplateRegistrationsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetTemplateRegistrationResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &BaseNode_ServiceDesc.Streams[10], BaseNode_GetTemplateRegistrations_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[GetTemplateRegistrationsRequest, GetTemplateRegistrationResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_GetTemplateRegistrationsClient = grpc.ServerStreamingClient[GetTemplateRegistrationResponse] + +func (c *baseNodeClient) GetSideChainUtxos(ctx context.Context, in *GetSideChainUtxosRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GetSideChainUtxosResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &BaseNode_ServiceDesc.Streams[11], BaseNode_GetSideChainUtxos_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[GetSideChainUtxosRequest, GetSideChainUtxosResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_GetSideChainUtxosClient = grpc.ServerStreamingClient[GetSideChainUtxosResponse] + +func (c *baseNodeClient) GetNetworkState(ctx context.Context, in *GetNetworkStateRequest, opts ...grpc.CallOption) (*GetNetworkStateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetNetworkStateResponse) + err := c.cc.Invoke(ctx, BaseNode_GetNetworkState_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *baseNodeClient) SearchPaymentReferences(ctx context.Context, in *SearchPaymentReferencesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[PaymentReferenceResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &BaseNode_ServiceDesc.Streams[12], BaseNode_SearchPaymentReferences_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[SearchPaymentReferencesRequest, PaymentReferenceResponse]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_SearchPaymentReferencesClient = grpc.ServerStreamingClient[PaymentReferenceResponse] + +// BaseNodeServer is the server API for BaseNode service. +// All implementations must embed UnimplementedBaseNodeServer +// for forward compatibility. +// +// The gRPC interface for interacting with the base node. +type BaseNodeServer interface { + // Lists headers in the current best chain + ListHeaders(*ListHeadersRequest, grpc.ServerStreamingServer[BlockHeaderResponse]) error + // Get header by hash + GetHeaderByHash(context.Context, *GetHeaderByHashRequest) (*BlockHeaderResponse, error) + // Returns blocks in the current best chain. Currently only supports querying by height + GetBlocks(*GetBlocksRequest, grpc.ServerStreamingServer[block.HistoricalBlock]) error + // Returns the block timing for the chain heights + GetBlockTiming(context.Context, *HeightRequest) (*BlockTimingResponse, error) + // Returns the network Constants + GetConstants(context.Context, *types.BlockHeight) (*types.ConsensusConstants, error) + // Returns Block Sizes + GetBlockSize(context.Context, *BlockGroupRequest) (*BlockGroupResponse, error) + // Returns Block Fees + GetBlockFees(context.Context, *BlockGroupRequest) (*BlockGroupResponse, error) + // Get Version + GetVersion(context.Context, *types.Empty) (*StringValue, error) + // Check for new updates + CheckForUpdates(context.Context, *types.Empty) (*net_work.SoftwareUpdate, error) + // Get coins in circulation + GetTokensInCirculation(*GetBlocksRequest, grpc.ServerStreamingServer[ValueAtHeightResponse]) error + // Get network difficulties + GetNetworkDifficulty(*HeightRequest, grpc.ServerStreamingServer[NetworkDifficultyResponse]) error + // Get the block template + GetNewBlockTemplate(context.Context, *NewBlockTemplateRequest) (*NewBlockTemplateResponse, error) + // Construct a new block from a provided template + GetNewBlock(context.Context, *block.NewBlockTemplate) (*GetNewBlockResult, error) + // Construct a new block from a provided template + GetNewBlockWithCoinbases(context.Context, *GetNewBlockWithCoinbasesRequest) (*GetNewBlockResult, error) + // Construct a new block from a provided template + GetNewBlockTemplateWithCoinbases(context.Context, *GetNewBlockTemplateWithCoinbasesRequest) (*GetNewBlockResult, error) + // Construct a new block and header blob from a provided template + GetNewBlockBlob(context.Context, *block.NewBlockTemplate) (*GetNewBlockBlobResult, error) + // Submit a new block for propagation + SubmitBlock(context.Context, *block.Block) (*SubmitBlockResponse, error) + // Submit a new mined block blob for propagation + SubmitBlockBlob(context.Context, *BlockBlobRequest) (*SubmitBlockResponse, error) + // Submit a transaction for propagation + SubmitTransaction(context.Context, *SubmitTransactionRequest) (*SubmitTransactionResponse, error) + // Get the base node sync information + GetSyncInfo(context.Context, *types.Empty) (*SyncInfoResponse, error) + // Get the base node sync information + GetSyncProgress(context.Context, *types.Empty) (*SyncProgressResponse, error) + // Get the base node tip information + GetTipInfo(context.Context, *types.Empty) (*TipInfoResponse, error) + // Search for blocks containing the specified kernels + SearchKernels(*SearchKernelsRequest, grpc.ServerStreamingServer[block.HistoricalBlock]) error + // Search for blocks containing the specified commitments + SearchUtxos(*SearchUtxosRequest, grpc.ServerStreamingServer[block.HistoricalBlock]) error + // Fetch any utxos that exist in the main chain + FetchMatchingUtxos(*FetchMatchingUtxosRequest, grpc.ServerStreamingServer[FetchMatchingUtxosResponse]) error + // get all peers from the base node + GetPeers(*GetPeersRequest, grpc.ServerStreamingServer[GetPeersResponse]) error + GetMempoolTransactions(*GetMempoolTransactionsRequest, grpc.ServerStreamingServer[GetMempoolTransactionsResponse]) error + TransactionState(context.Context, *TransactionStateRequest) (*TransactionStateResponse, error) + // This returns the node's network identity + Identify(context.Context, *types.Empty) (*net_work.NodeIdentity, error) + // Get Base Node network connectivity status + GetNetworkStatus(context.Context, *types.Empty) (*net_work.NetworkStatusResponse, error) + // List currently connected peers + ListConnectedPeers(context.Context, *types.Empty) (*net_work.ListConnectedPeersResponse, error) + // Get mempool stats + GetMempoolStats(context.Context, *types.Empty) (*MempoolStatsResponse, error) + // Get VNs + GetActiveValidatorNodes(*GetActiveValidatorNodesRequest, grpc.ServerStreamingServer[GetActiveValidatorNodesResponse]) error + GetShardKey(context.Context, *GetShardKeyRequest) (*GetShardKeyResponse, error) + // Get templates + GetTemplateRegistrations(*GetTemplateRegistrationsRequest, grpc.ServerStreamingServer[GetTemplateRegistrationResponse]) error + GetSideChainUtxos(*GetSideChainUtxosRequest, grpc.ServerStreamingServer[GetSideChainUtxosResponse]) error + GetNetworkState(context.Context, *GetNetworkStateRequest) (*GetNetworkStateResponse, error) + // PayRef (Payment Reference) lookup for block explorers and external services + SearchPaymentReferences(*SearchPaymentReferencesRequest, grpc.ServerStreamingServer[PaymentReferenceResponse]) error + mustEmbedUnimplementedBaseNodeServer() +} + +// UnimplementedBaseNodeServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedBaseNodeServer struct{} + +func (UnimplementedBaseNodeServer) ListHeaders(*ListHeadersRequest, grpc.ServerStreamingServer[BlockHeaderResponse]) error { + return status.Errorf(codes.Unimplemented, "method ListHeaders not implemented") +} +func (UnimplementedBaseNodeServer) GetHeaderByHash(context.Context, *GetHeaderByHashRequest) (*BlockHeaderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetHeaderByHash not implemented") +} +func (UnimplementedBaseNodeServer) GetBlocks(*GetBlocksRequest, grpc.ServerStreamingServer[block.HistoricalBlock]) error { + return status.Errorf(codes.Unimplemented, "method GetBlocks not implemented") +} +func (UnimplementedBaseNodeServer) GetBlockTiming(context.Context, *HeightRequest) (*BlockTimingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBlockTiming not implemented") +} +func (UnimplementedBaseNodeServer) GetConstants(context.Context, *types.BlockHeight) (*types.ConsensusConstants, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetConstants not implemented") +} +func (UnimplementedBaseNodeServer) GetBlockSize(context.Context, *BlockGroupRequest) (*BlockGroupResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBlockSize not implemented") +} +func (UnimplementedBaseNodeServer) GetBlockFees(context.Context, *BlockGroupRequest) (*BlockGroupResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBlockFees not implemented") +} +func (UnimplementedBaseNodeServer) GetVersion(context.Context, *types.Empty) (*StringValue, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetVersion not implemented") +} +func (UnimplementedBaseNodeServer) CheckForUpdates(context.Context, *types.Empty) (*net_work.SoftwareUpdate, error) { + return nil, status.Errorf(codes.Unimplemented, "method CheckForUpdates not implemented") +} +func (UnimplementedBaseNodeServer) GetTokensInCirculation(*GetBlocksRequest, grpc.ServerStreamingServer[ValueAtHeightResponse]) error { + return status.Errorf(codes.Unimplemented, "method GetTokensInCirculation not implemented") +} +func (UnimplementedBaseNodeServer) GetNetworkDifficulty(*HeightRequest, grpc.ServerStreamingServer[NetworkDifficultyResponse]) error { + return status.Errorf(codes.Unimplemented, "method GetNetworkDifficulty not implemented") +} +func (UnimplementedBaseNodeServer) GetNewBlockTemplate(context.Context, *NewBlockTemplateRequest) (*NewBlockTemplateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNewBlockTemplate not implemented") +} +func (UnimplementedBaseNodeServer) GetNewBlock(context.Context, *block.NewBlockTemplate) (*GetNewBlockResult, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNewBlock not implemented") +} +func (UnimplementedBaseNodeServer) GetNewBlockWithCoinbases(context.Context, *GetNewBlockWithCoinbasesRequest) (*GetNewBlockResult, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNewBlockWithCoinbases not implemented") +} +func (UnimplementedBaseNodeServer) GetNewBlockTemplateWithCoinbases(context.Context, *GetNewBlockTemplateWithCoinbasesRequest) (*GetNewBlockResult, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNewBlockTemplateWithCoinbases not implemented") +} +func (UnimplementedBaseNodeServer) GetNewBlockBlob(context.Context, *block.NewBlockTemplate) (*GetNewBlockBlobResult, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNewBlockBlob not implemented") +} +func (UnimplementedBaseNodeServer) SubmitBlock(context.Context, *block.Block) (*SubmitBlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitBlock not implemented") +} +func (UnimplementedBaseNodeServer) SubmitBlockBlob(context.Context, *BlockBlobRequest) (*SubmitBlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitBlockBlob not implemented") +} +func (UnimplementedBaseNodeServer) SubmitTransaction(context.Context, *SubmitTransactionRequest) (*SubmitTransactionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitTransaction not implemented") +} +func (UnimplementedBaseNodeServer) GetSyncInfo(context.Context, *types.Empty) (*SyncInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSyncInfo not implemented") +} +func (UnimplementedBaseNodeServer) GetSyncProgress(context.Context, *types.Empty) (*SyncProgressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSyncProgress not implemented") +} +func (UnimplementedBaseNodeServer) GetTipInfo(context.Context, *types.Empty) (*TipInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTipInfo not implemented") +} +func (UnimplementedBaseNodeServer) SearchKernels(*SearchKernelsRequest, grpc.ServerStreamingServer[block.HistoricalBlock]) error { + return status.Errorf(codes.Unimplemented, "method SearchKernels not implemented") +} +func (UnimplementedBaseNodeServer) SearchUtxos(*SearchUtxosRequest, grpc.ServerStreamingServer[block.HistoricalBlock]) error { + return status.Errorf(codes.Unimplemented, "method SearchUtxos not implemented") +} +func (UnimplementedBaseNodeServer) FetchMatchingUtxos(*FetchMatchingUtxosRequest, grpc.ServerStreamingServer[FetchMatchingUtxosResponse]) error { + return status.Errorf(codes.Unimplemented, "method FetchMatchingUtxos not implemented") +} +func (UnimplementedBaseNodeServer) GetPeers(*GetPeersRequest, grpc.ServerStreamingServer[GetPeersResponse]) error { + return status.Errorf(codes.Unimplemented, "method GetPeers not implemented") +} +func (UnimplementedBaseNodeServer) GetMempoolTransactions(*GetMempoolTransactionsRequest, grpc.ServerStreamingServer[GetMempoolTransactionsResponse]) error { + return status.Errorf(codes.Unimplemented, "method GetMempoolTransactions not implemented") +} +func (UnimplementedBaseNodeServer) TransactionState(context.Context, *TransactionStateRequest) (*TransactionStateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TransactionState not implemented") +} +func (UnimplementedBaseNodeServer) Identify(context.Context, *types.Empty) (*net_work.NodeIdentity, error) { + return nil, status.Errorf(codes.Unimplemented, "method Identify not implemented") +} +func (UnimplementedBaseNodeServer) GetNetworkStatus(context.Context, *types.Empty) (*net_work.NetworkStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNetworkStatus not implemented") +} +func (UnimplementedBaseNodeServer) ListConnectedPeers(context.Context, *types.Empty) (*net_work.ListConnectedPeersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListConnectedPeers not implemented") +} +func (UnimplementedBaseNodeServer) GetMempoolStats(context.Context, *types.Empty) (*MempoolStatsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMempoolStats not implemented") +} +func (UnimplementedBaseNodeServer) GetActiveValidatorNodes(*GetActiveValidatorNodesRequest, grpc.ServerStreamingServer[GetActiveValidatorNodesResponse]) error { + return status.Errorf(codes.Unimplemented, "method GetActiveValidatorNodes not implemented") +} +func (UnimplementedBaseNodeServer) GetShardKey(context.Context, *GetShardKeyRequest) (*GetShardKeyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetShardKey not implemented") +} +func (UnimplementedBaseNodeServer) GetTemplateRegistrations(*GetTemplateRegistrationsRequest, grpc.ServerStreamingServer[GetTemplateRegistrationResponse]) error { + return status.Errorf(codes.Unimplemented, "method GetTemplateRegistrations not implemented") +} +func (UnimplementedBaseNodeServer) GetSideChainUtxos(*GetSideChainUtxosRequest, grpc.ServerStreamingServer[GetSideChainUtxosResponse]) error { + return status.Errorf(codes.Unimplemented, "method GetSideChainUtxos not implemented") +} +func (UnimplementedBaseNodeServer) GetNetworkState(context.Context, *GetNetworkStateRequest) (*GetNetworkStateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNetworkState not implemented") +} +func (UnimplementedBaseNodeServer) SearchPaymentReferences(*SearchPaymentReferencesRequest, grpc.ServerStreamingServer[PaymentReferenceResponse]) error { + return status.Errorf(codes.Unimplemented, "method SearchPaymentReferences not implemented") +} +func (UnimplementedBaseNodeServer) mustEmbedUnimplementedBaseNodeServer() {} +func (UnimplementedBaseNodeServer) testEmbeddedByValue() {} + +// UnsafeBaseNodeServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to BaseNodeServer will +// result in compilation errors. +type UnsafeBaseNodeServer interface { + mustEmbedUnimplementedBaseNodeServer() +} + +func RegisterBaseNodeServer(s grpc.ServiceRegistrar, srv BaseNodeServer) { + // If the following call pancis, it indicates UnimplementedBaseNodeServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&BaseNode_ServiceDesc, srv) +} + +func _BaseNode_ListHeaders_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ListHeadersRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BaseNodeServer).ListHeaders(m, &grpc.GenericServerStream[ListHeadersRequest, BlockHeaderResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_ListHeadersServer = grpc.ServerStreamingServer[BlockHeaderResponse] + +func _BaseNode_GetHeaderByHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetHeaderByHashRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).GetHeaderByHash(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_GetHeaderByHash_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).GetHeaderByHash(ctx, req.(*GetHeaderByHashRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_GetBlocks_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetBlocksRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BaseNodeServer).GetBlocks(m, &grpc.GenericServerStream[GetBlocksRequest, block.HistoricalBlock]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_GetBlocksServer = grpc.ServerStreamingServer[block.HistoricalBlock] + +func _BaseNode_GetBlockTiming_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HeightRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).GetBlockTiming(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_GetBlockTiming_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).GetBlockTiming(ctx, req.(*HeightRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_GetConstants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.BlockHeight) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).GetConstants(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_GetConstants_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).GetConstants(ctx, req.(*types.BlockHeight)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_GetBlockSize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockGroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).GetBlockSize(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_GetBlockSize_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).GetBlockSize(ctx, req.(*BlockGroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_GetBlockFees_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockGroupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).GetBlockFees(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_GetBlockFees_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).GetBlockFees(ctx, req.(*BlockGroupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).GetVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_GetVersion_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).GetVersion(ctx, req.(*types.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_CheckForUpdates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).CheckForUpdates(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_CheckForUpdates_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).CheckForUpdates(ctx, req.(*types.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_GetTokensInCirculation_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetBlocksRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BaseNodeServer).GetTokensInCirculation(m, &grpc.GenericServerStream[GetBlocksRequest, ValueAtHeightResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_GetTokensInCirculationServer = grpc.ServerStreamingServer[ValueAtHeightResponse] + +func _BaseNode_GetNetworkDifficulty_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(HeightRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BaseNodeServer).GetNetworkDifficulty(m, &grpc.GenericServerStream[HeightRequest, NetworkDifficultyResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_GetNetworkDifficultyServer = grpc.ServerStreamingServer[NetworkDifficultyResponse] + +func _BaseNode_GetNewBlockTemplate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NewBlockTemplateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).GetNewBlockTemplate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_GetNewBlockTemplate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).GetNewBlockTemplate(ctx, req.(*NewBlockTemplateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_GetNewBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(block.NewBlockTemplate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).GetNewBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_GetNewBlock_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).GetNewBlock(ctx, req.(*block.NewBlockTemplate)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_GetNewBlockWithCoinbases_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetNewBlockWithCoinbasesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).GetNewBlockWithCoinbases(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_GetNewBlockWithCoinbases_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).GetNewBlockWithCoinbases(ctx, req.(*GetNewBlockWithCoinbasesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_GetNewBlockTemplateWithCoinbases_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetNewBlockTemplateWithCoinbasesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).GetNewBlockTemplateWithCoinbases(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_GetNewBlockTemplateWithCoinbases_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).GetNewBlockTemplateWithCoinbases(ctx, req.(*GetNewBlockTemplateWithCoinbasesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_GetNewBlockBlob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(block.NewBlockTemplate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).GetNewBlockBlob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_GetNewBlockBlob_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).GetNewBlockBlob(ctx, req.(*block.NewBlockTemplate)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_SubmitBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(block.Block) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).SubmitBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_SubmitBlock_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).SubmitBlock(ctx, req.(*block.Block)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_SubmitBlockBlob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockBlobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).SubmitBlockBlob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_SubmitBlockBlob_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).SubmitBlockBlob(ctx, req.(*BlockBlobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_SubmitTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SubmitTransactionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).SubmitTransaction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_SubmitTransaction_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).SubmitTransaction(ctx, req.(*SubmitTransactionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_GetSyncInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).GetSyncInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_GetSyncInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).GetSyncInfo(ctx, req.(*types.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_GetSyncProgress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).GetSyncProgress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_GetSyncProgress_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).GetSyncProgress(ctx, req.(*types.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_GetTipInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).GetTipInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_GetTipInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).GetTipInfo(ctx, req.(*types.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_SearchKernels_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SearchKernelsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BaseNodeServer).SearchKernels(m, &grpc.GenericServerStream[SearchKernelsRequest, block.HistoricalBlock]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_SearchKernelsServer = grpc.ServerStreamingServer[block.HistoricalBlock] + +func _BaseNode_SearchUtxos_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SearchUtxosRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BaseNodeServer).SearchUtxos(m, &grpc.GenericServerStream[SearchUtxosRequest, block.HistoricalBlock]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_SearchUtxosServer = grpc.ServerStreamingServer[block.HistoricalBlock] + +func _BaseNode_FetchMatchingUtxos_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(FetchMatchingUtxosRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BaseNodeServer).FetchMatchingUtxos(m, &grpc.GenericServerStream[FetchMatchingUtxosRequest, FetchMatchingUtxosResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_FetchMatchingUtxosServer = grpc.ServerStreamingServer[FetchMatchingUtxosResponse] + +func _BaseNode_GetPeers_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetPeersRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BaseNodeServer).GetPeers(m, &grpc.GenericServerStream[GetPeersRequest, GetPeersResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_GetPeersServer = grpc.ServerStreamingServer[GetPeersResponse] + +func _BaseNode_GetMempoolTransactions_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetMempoolTransactionsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BaseNodeServer).GetMempoolTransactions(m, &grpc.GenericServerStream[GetMempoolTransactionsRequest, GetMempoolTransactionsResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_GetMempoolTransactionsServer = grpc.ServerStreamingServer[GetMempoolTransactionsResponse] + +func _BaseNode_TransactionState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TransactionStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).TransactionState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_TransactionState_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).TransactionState(ctx, req.(*TransactionStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_Identify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).Identify(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_Identify_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).Identify(ctx, req.(*types.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_GetNetworkStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).GetNetworkStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_GetNetworkStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).GetNetworkStatus(ctx, req.(*types.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_ListConnectedPeers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).ListConnectedPeers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_ListConnectedPeers_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).ListConnectedPeers(ctx, req.(*types.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_GetMempoolStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).GetMempoolStats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_GetMempoolStats_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).GetMempoolStats(ctx, req.(*types.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_GetActiveValidatorNodes_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetActiveValidatorNodesRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BaseNodeServer).GetActiveValidatorNodes(m, &grpc.GenericServerStream[GetActiveValidatorNodesRequest, GetActiveValidatorNodesResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_GetActiveValidatorNodesServer = grpc.ServerStreamingServer[GetActiveValidatorNodesResponse] + +func _BaseNode_GetShardKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetShardKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).GetShardKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_GetShardKey_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).GetShardKey(ctx, req.(*GetShardKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_GetTemplateRegistrations_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetTemplateRegistrationsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BaseNodeServer).GetTemplateRegistrations(m, &grpc.GenericServerStream[GetTemplateRegistrationsRequest, GetTemplateRegistrationResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_GetTemplateRegistrationsServer = grpc.ServerStreamingServer[GetTemplateRegistrationResponse] + +func _BaseNode_GetSideChainUtxos_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetSideChainUtxosRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BaseNodeServer).GetSideChainUtxos(m, &grpc.GenericServerStream[GetSideChainUtxosRequest, GetSideChainUtxosResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_GetSideChainUtxosServer = grpc.ServerStreamingServer[GetSideChainUtxosResponse] + +func _BaseNode_GetNetworkState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetNetworkStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BaseNodeServer).GetNetworkState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BaseNode_GetNetworkState_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BaseNodeServer).GetNetworkState(ctx, req.(*GetNetworkStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BaseNode_SearchPaymentReferences_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SearchPaymentReferencesRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BaseNodeServer).SearchPaymentReferences(m, &grpc.GenericServerStream[SearchPaymentReferencesRequest, PaymentReferenceResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BaseNode_SearchPaymentReferencesServer = grpc.ServerStreamingServer[PaymentReferenceResponse] + +// BaseNode_ServiceDesc is the grpc.ServiceDesc for BaseNode service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var BaseNode_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "tari.rpc.BaseNode", + HandlerType: (*BaseNodeServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetHeaderByHash", + Handler: _BaseNode_GetHeaderByHash_Handler, + }, + { + MethodName: "GetBlockTiming", + Handler: _BaseNode_GetBlockTiming_Handler, + }, + { + MethodName: "GetConstants", + Handler: _BaseNode_GetConstants_Handler, + }, + { + MethodName: "GetBlockSize", + Handler: _BaseNode_GetBlockSize_Handler, + }, + { + MethodName: "GetBlockFees", + Handler: _BaseNode_GetBlockFees_Handler, + }, + { + MethodName: "GetVersion", + Handler: _BaseNode_GetVersion_Handler, + }, + { + MethodName: "CheckForUpdates", + Handler: _BaseNode_CheckForUpdates_Handler, + }, + { + MethodName: "GetNewBlockTemplate", + Handler: _BaseNode_GetNewBlockTemplate_Handler, + }, + { + MethodName: "GetNewBlock", + Handler: _BaseNode_GetNewBlock_Handler, + }, + { + MethodName: "GetNewBlockWithCoinbases", + Handler: _BaseNode_GetNewBlockWithCoinbases_Handler, + }, + { + MethodName: "GetNewBlockTemplateWithCoinbases", + Handler: _BaseNode_GetNewBlockTemplateWithCoinbases_Handler, + }, + { + MethodName: "GetNewBlockBlob", + Handler: _BaseNode_GetNewBlockBlob_Handler, + }, + { + MethodName: "SubmitBlock", + Handler: _BaseNode_SubmitBlock_Handler, + }, + { + MethodName: "SubmitBlockBlob", + Handler: _BaseNode_SubmitBlockBlob_Handler, + }, + { + MethodName: "SubmitTransaction", + Handler: _BaseNode_SubmitTransaction_Handler, + }, + { + MethodName: "GetSyncInfo", + Handler: _BaseNode_GetSyncInfo_Handler, + }, + { + MethodName: "GetSyncProgress", + Handler: _BaseNode_GetSyncProgress_Handler, + }, + { + MethodName: "GetTipInfo", + Handler: _BaseNode_GetTipInfo_Handler, + }, + { + MethodName: "TransactionState", + Handler: _BaseNode_TransactionState_Handler, + }, + { + MethodName: "Identify", + Handler: _BaseNode_Identify_Handler, + }, + { + MethodName: "GetNetworkStatus", + Handler: _BaseNode_GetNetworkStatus_Handler, + }, + { + MethodName: "ListConnectedPeers", + Handler: _BaseNode_ListConnectedPeers_Handler, + }, + { + MethodName: "GetMempoolStats", + Handler: _BaseNode_GetMempoolStats_Handler, + }, + { + MethodName: "GetShardKey", + Handler: _BaseNode_GetShardKey_Handler, + }, + { + MethodName: "GetNetworkState", + Handler: _BaseNode_GetNetworkState_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "ListHeaders", + Handler: _BaseNode_ListHeaders_Handler, + ServerStreams: true, + }, + { + StreamName: "GetBlocks", + Handler: _BaseNode_GetBlocks_Handler, + ServerStreams: true, + }, + { + StreamName: "GetTokensInCirculation", + Handler: _BaseNode_GetTokensInCirculation_Handler, + ServerStreams: true, + }, + { + StreamName: "GetNetworkDifficulty", + Handler: _BaseNode_GetNetworkDifficulty_Handler, + ServerStreams: true, + }, + { + StreamName: "SearchKernels", + Handler: _BaseNode_SearchKernels_Handler, + ServerStreams: true, + }, + { + StreamName: "SearchUtxos", + Handler: _BaseNode_SearchUtxos_Handler, + ServerStreams: true, + }, + { + StreamName: "FetchMatchingUtxos", + Handler: _BaseNode_FetchMatchingUtxos_Handler, + ServerStreams: true, + }, + { + StreamName: "GetPeers", + Handler: _BaseNode_GetPeers_Handler, + ServerStreams: true, + }, + { + StreamName: "GetMempoolTransactions", + Handler: _BaseNode_GetMempoolTransactions_Handler, + ServerStreams: true, + }, + { + StreamName: "GetActiveValidatorNodes", + Handler: _BaseNode_GetActiveValidatorNodes_Handler, + ServerStreams: true, + }, + { + StreamName: "GetTemplateRegistrations", + Handler: _BaseNode_GetTemplateRegistrations_Handler, + ServerStreams: true, + }, + { + StreamName: "GetSideChainUtxos", + Handler: _BaseNode_GetSideChainUtxos_Handler, + ServerStreams: true, + }, + { + StreamName: "SearchPaymentReferences", + Handler: _BaseNode_SearchPaymentReferences_Handler, + ServerStreams: true, + }, + }, + Metadata: "base_node.proto", +} diff --git a/internal/server/proxy/proto/block.proto b/internal/server/proxy/proto/block.proto new file mode 100644 index 0000000..3bdf9ce --- /dev/null +++ b/internal/server/proxy/proto/block.proto @@ -0,0 +1,143 @@ +// Copyright 2020. The Tari Project +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +// following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the +// following disclaimer in the documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote +// products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +syntax = "proto3"; + +package tari.rpc; +option go_package = "./pool"; +import "transaction.proto"; + +// The BlockHeader contains all the metadata for the block, including proof of work, a link to the previous block +// and the transaction kernels. +message BlockHeader { + // The hash of the block + bytes hash = 1; + // Version of the block + uint32 version = 2; + // Height of this block since the genesis block (height 0) + uint64 height = 3; + // Hash of the block previous to this in the chain. + bytes prev_hash = 4; + // Timestamp at which the block was built. + uint64 timestamp = 5; + // This is the UTXO merkle root of the outputs in the blockchain + bytes output_mr = 6; + // This is the merkle root of all outputs in this block + bytes block_output_mr = 7; + // This is the MMR root of the kernels + bytes kernel_mr = 8; + // This is the Merkle root of the inputs in this block + bytes input_mr = 9; + // Total accumulated sum of kernel offsets since genesis block. We can derive the kernel offset sum for *this* + // block from the total kernel offset of the previous block header. + bytes total_kernel_offset = 10; + // Nonce increment used to mine this block. + uint64 nonce = 11; + // Proof of work metadata + ProofOfWork pow = 12; + // Kernel MMR size + uint64 kernel_mmr_size = 13; + // Output MMR size + uint64 output_mmr_size = 14; + // Sum of script offsets for all kernels in this block. + bytes total_script_offset = 15; + // Merkle root of validator nodes + bytes validator_node_mr = 16; + // Validator size + uint64 validator_node_size = 17; +} + +// The proof of work data structure that is included in the block header. +message ProofOfWork { + // The algorithm used to mine this block + // 0 = Monero + // 1 = Sha3X + uint64 pow_algo = 1; + // Supplemental proof of work data. For example for Sha3x, this would be empty (only the block header is + // required), but for Monero merge mining we need the Monero block header and RandomX seed hash. + bytes pow_data = 4; +} + +//This is used to request the which pow algo should be used with the block template +message PowAlgo { + // The permitted pow algorithms + enum PowAlgos { + POW_ALGOS_RANDOMXM = 0; // Accessible as `grpc::pow_algo::PowAlgos::RandomxM` + POW_ALGOS_SHA3X = 1; // Accessible as `grpc::pow_algo::PowAlgos::Sha3x` + POW_ALGOS_RANDOMXT = 2; // Accessible as `grpc::pow_algo::PowAlgos::RandomxT` + } + // The pow algo to use + PowAlgos pow_algo = 1; +} + + +// A Minotari block. Blocks are linked together into a blockchain. +message Block { + // The BlockHeader contains all the metadata for the block, including proof of work, a link to the previous block + // and the transaction kernels. + BlockHeader header = 1; + // The components of the block or transaction. The same struct can be used for either, since in Mimblewimble, + // blocks consist of inputs, outputs and kernels, rather than transactions. + AggregateBody body = 2; +} + +// The representation of a historical block in the blockchain. It is essentially identical to a protocol-defined +// block but contains some extra metadata that clients such as Block Explorers will find interesting. +message HistoricalBlock { + // The number of blocks that have been mined since this block, including this one. The current tip will have one + // confirmation. + uint64 confirmations = 1; + // The underlying block + Block block = 2; +} + + +// The NewBlockHeaderTemplate is used for the construction of a new mine-able block. It contains all the metadata for the block that the Base Node is able to complete on behalf of a Miner. +message NewBlockHeaderTemplate { + // Version of the block + uint32 version = 1; + // Height of this block since the genesis block (height 0) + uint64 height = 2; + // Hash of the block previous to this in the chain. + bytes prev_hash = 3; + // Total accumulated sum of kernel offsets since genesis block. We can derive the kernel offset sum for *this* + // block from the total kernel offset of the previous block header. + bytes total_kernel_offset = 4; + // Proof of work metadata + ProofOfWork pow = 5; + // Sum of script offsets for all kernels in this block. + bytes total_script_offset = 7; + BlockHeader block_header = 8; +} + +// The new block template is used constructing a new partial block, allowing a miner to added the coinbase utxo and as a final step the Base node to add the MMR roots to the header. +message NewBlockTemplate { + // The NewBlockHeaderTemplate is used for the construction of a new mineable block. It contains all the metadata for + // the block that the Base Node is able to complete on behalf of a Miner. + NewBlockHeaderTemplate header = 1; + // This flag indicates if the inputs, outputs and kernels have been sorted internally, that is, the sort() method + // has been called. This may be false even if all components are sorted. + AggregateBody body = 2; + // Sometimes the mempool has not synced to the latest tip, this flag indicates if the mempool is out of sync. + // In most cases the next call to get_new_block_template will return a block with the mempool in sync. + bool is_mempool_in_sync = 3; +} + diff --git a/internal/server/proxy/proto/block/block.pb.go b/internal/server/proxy/proto/block/block.pb.go new file mode 100644 index 0000000..7792406 --- /dev/null +++ b/internal/server/proxy/proto/block/block.pb.go @@ -0,0 +1,784 @@ +// Copyright 2020. The Tari Project +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +// following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the +// following disclaimer in the documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote +// products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v3.6.1 +// source: block.proto + +package block + +import ( + transaction "pool/internal/server/proxy/proto/transaction" + reflect "reflect" + sync "sync" + unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// The permitted pow algorithms +type PowAlgo_PowAlgos int32 + +const ( + PowAlgo_POW_ALGOS_RANDOMXM PowAlgo_PowAlgos = 0 // Accessible as `grpc::pow_algo::PowAlgos::RandomxM` + PowAlgo_POW_ALGOS_SHA3X PowAlgo_PowAlgos = 1 // Accessible as `grpc::pow_algo::PowAlgos::Sha3x` + PowAlgo_POW_ALGOS_RANDOMXT PowAlgo_PowAlgos = 2 // Accessible as `grpc::pow_algo::PowAlgos::RandomxT` +) + +// Enum value maps for PowAlgo_PowAlgos. +var ( + PowAlgo_PowAlgos_name = map[int32]string{ + 0: "POW_ALGOS_RANDOMXM", + 1: "POW_ALGOS_SHA3X", + 2: "POW_ALGOS_RANDOMXT", + } + PowAlgo_PowAlgos_value = map[string]int32{ + "POW_ALGOS_RANDOMXM": 0, + "POW_ALGOS_SHA3X": 1, + "POW_ALGOS_RANDOMXT": 2, + } +) + +func (x PowAlgo_PowAlgos) Enum() *PowAlgo_PowAlgos { + p := new(PowAlgo_PowAlgos) + *p = x + return p +} + +func (x PowAlgo_PowAlgos) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PowAlgo_PowAlgos) Descriptor() protoreflect.EnumDescriptor { + return file_block_proto_enumTypes[0].Descriptor() +} + +func (PowAlgo_PowAlgos) Type() protoreflect.EnumType { + return &file_block_proto_enumTypes[0] +} + +func (x PowAlgo_PowAlgos) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PowAlgo_PowAlgos.Descriptor instead. +func (PowAlgo_PowAlgos) EnumDescriptor() ([]byte, []int) { + return file_block_proto_rawDescGZIP(), []int{2, 0} +} + +// The BlockHeader contains all the metadata for the block, including proof of work, a link to the previous block +// and the transaction kernels. +type BlockHeader struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The hash of the block + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + // Version of the block + Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + // Height of this block since the genesis block (height 0) + Height uint64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + // Hash of the block previous to this in the chain. + PrevHash []byte `protobuf:"bytes,4,opt,name=prev_hash,json=prevHash,proto3" json:"prev_hash,omitempty"` + // Timestamp at which the block was built. + Timestamp uint64 `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // This is the UTXO merkle root of the outputs in the blockchain + OutputMr []byte `protobuf:"bytes,6,opt,name=output_mr,json=outputMr,proto3" json:"output_mr,omitempty"` + // This is the merkle root of all outputs in this block + BlockOutputMr []byte `protobuf:"bytes,7,opt,name=block_output_mr,json=blockOutputMr,proto3" json:"block_output_mr,omitempty"` + // This is the MMR root of the kernels + KernelMr []byte `protobuf:"bytes,8,opt,name=kernel_mr,json=kernelMr,proto3" json:"kernel_mr,omitempty"` + // This is the Merkle root of the inputs in this block + InputMr []byte `protobuf:"bytes,9,opt,name=input_mr,json=inputMr,proto3" json:"input_mr,omitempty"` + // Total accumulated sum of kernel offsets since genesis block. We can derive the kernel offset sum for *this* + // block from the total kernel offset of the previous block header. + TotalKernelOffset []byte `protobuf:"bytes,10,opt,name=total_kernel_offset,json=totalKernelOffset,proto3" json:"total_kernel_offset,omitempty"` + // Nonce increment used to mine this block. + Nonce uint64 `protobuf:"varint,11,opt,name=nonce,proto3" json:"nonce,omitempty"` + // Proof of work metadata + Pow *ProofOfWork `protobuf:"bytes,12,opt,name=pow,proto3" json:"pow,omitempty"` + // Kernel MMR size + KernelMmrSize uint64 `protobuf:"varint,13,opt,name=kernel_mmr_size,json=kernelMmrSize,proto3" json:"kernel_mmr_size,omitempty"` + // Output MMR size + OutputMmrSize uint64 `protobuf:"varint,14,opt,name=output_mmr_size,json=outputMmrSize,proto3" json:"output_mmr_size,omitempty"` + // Sum of script offsets for all kernels in this block. + TotalScriptOffset []byte `protobuf:"bytes,15,opt,name=total_script_offset,json=totalScriptOffset,proto3" json:"total_script_offset,omitempty"` + // Merkle root of validator nodes + ValidatorNodeMr []byte `protobuf:"bytes,16,opt,name=validator_node_mr,json=validatorNodeMr,proto3" json:"validator_node_mr,omitempty"` + // Validator size + ValidatorNodeSize uint64 `protobuf:"varint,17,opt,name=validator_node_size,json=validatorNodeSize,proto3" json:"validator_node_size,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BlockHeader) Reset() { + *x = BlockHeader{} + mi := &file_block_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlockHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockHeader) ProtoMessage() {} + +func (x *BlockHeader) ProtoReflect() protoreflect.Message { + mi := &file_block_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockHeader.ProtoReflect.Descriptor instead. +func (*BlockHeader) Descriptor() ([]byte, []int) { + return file_block_proto_rawDescGZIP(), []int{0} +} + +func (x *BlockHeader) GetHash() []byte { + if x != nil { + return x.Hash + } + return nil +} + +func (x *BlockHeader) GetVersion() uint32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *BlockHeader) GetHeight() uint64 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *BlockHeader) GetPrevHash() []byte { + if x != nil { + return x.PrevHash + } + return nil +} + +func (x *BlockHeader) GetTimestamp() uint64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *BlockHeader) GetOutputMr() []byte { + if x != nil { + return x.OutputMr + } + return nil +} + +func (x *BlockHeader) GetBlockOutputMr() []byte { + if x != nil { + return x.BlockOutputMr + } + return nil +} + +func (x *BlockHeader) GetKernelMr() []byte { + if x != nil { + return x.KernelMr + } + return nil +} + +func (x *BlockHeader) GetInputMr() []byte { + if x != nil { + return x.InputMr + } + return nil +} + +func (x *BlockHeader) GetTotalKernelOffset() []byte { + if x != nil { + return x.TotalKernelOffset + } + return nil +} + +func (x *BlockHeader) GetNonce() uint64 { + if x != nil { + return x.Nonce + } + return 0 +} + +func (x *BlockHeader) GetPow() *ProofOfWork { + if x != nil { + return x.Pow + } + return nil +} + +func (x *BlockHeader) GetKernelMmrSize() uint64 { + if x != nil { + return x.KernelMmrSize + } + return 0 +} + +func (x *BlockHeader) GetOutputMmrSize() uint64 { + if x != nil { + return x.OutputMmrSize + } + return 0 +} + +func (x *BlockHeader) GetTotalScriptOffset() []byte { + if x != nil { + return x.TotalScriptOffset + } + return nil +} + +func (x *BlockHeader) GetValidatorNodeMr() []byte { + if x != nil { + return x.ValidatorNodeMr + } + return nil +} + +func (x *BlockHeader) GetValidatorNodeSize() uint64 { + if x != nil { + return x.ValidatorNodeSize + } + return 0 +} + +// The proof of work data structure that is included in the block header. +type ProofOfWork struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The algorithm used to mine this block + // + // 0 = Monero + // 1 = Sha3X + PowAlgo uint64 `protobuf:"varint,1,opt,name=pow_algo,json=powAlgo,proto3" json:"pow_algo,omitempty"` + // Supplemental proof of work data. For example for Sha3x, this would be empty (only the block header is + // required), but for Monero merge mining we need the Monero block header and RandomX seed hash. + PowData []byte `protobuf:"bytes,4,opt,name=pow_data,json=powData,proto3" json:"pow_data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProofOfWork) Reset() { + *x = ProofOfWork{} + mi := &file_block_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProofOfWork) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProofOfWork) ProtoMessage() {} + +func (x *ProofOfWork) ProtoReflect() protoreflect.Message { + mi := &file_block_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProofOfWork.ProtoReflect.Descriptor instead. +func (*ProofOfWork) Descriptor() ([]byte, []int) { + return file_block_proto_rawDescGZIP(), []int{1} +} + +func (x *ProofOfWork) GetPowAlgo() uint64 { + if x != nil { + return x.PowAlgo + } + return 0 +} + +func (x *ProofOfWork) GetPowData() []byte { + if x != nil { + return x.PowData + } + return nil +} + +// This is used to request the which pow algo should be used with the block template +type PowAlgo struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The pow algo to use + PowAlgo PowAlgo_PowAlgos `protobuf:"varint,1,opt,name=pow_algo,json=powAlgo,proto3,enum=tari.rpc.PowAlgo_PowAlgos" json:"pow_algo,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PowAlgo) Reset() { + *x = PowAlgo{} + mi := &file_block_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PowAlgo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PowAlgo) ProtoMessage() {} + +func (x *PowAlgo) ProtoReflect() protoreflect.Message { + mi := &file_block_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PowAlgo.ProtoReflect.Descriptor instead. +func (*PowAlgo) Descriptor() ([]byte, []int) { + return file_block_proto_rawDescGZIP(), []int{2} +} + +func (x *PowAlgo) GetPowAlgo() PowAlgo_PowAlgos { + if x != nil { + return x.PowAlgo + } + return PowAlgo_POW_ALGOS_RANDOMXM +} + +// A Minotari block. Blocks are linked together into a blockchain. +type Block struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The BlockHeader contains all the metadata for the block, including proof of work, a link to the previous block + // and the transaction kernels. + Header *BlockHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // The components of the block or transaction. The same struct can be used for either, since in Mimblewimble, + // blocks consist of inputs, outputs and kernels, rather than transactions. + Body *transaction.AggregateBody `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Block) Reset() { + *x = Block{} + mi := &file_block_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Block) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Block) ProtoMessage() {} + +func (x *Block) ProtoReflect() protoreflect.Message { + mi := &file_block_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Block.ProtoReflect.Descriptor instead. +func (*Block) Descriptor() ([]byte, []int) { + return file_block_proto_rawDescGZIP(), []int{3} +} + +func (x *Block) GetHeader() *BlockHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *Block) GetBody() *transaction.AggregateBody { + if x != nil { + return x.Body + } + return nil +} + +// The representation of a historical block in the blockchain. It is essentially identical to a protocol-defined +// block but contains some extra metadata that clients such as Block Explorers will find interesting. +type HistoricalBlock struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The number of blocks that have been mined since this block, including this one. The current tip will have one + // confirmation. + Confirmations uint64 `protobuf:"varint,1,opt,name=confirmations,proto3" json:"confirmations,omitempty"` + // The underlying block + Block *Block `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HistoricalBlock) Reset() { + *x = HistoricalBlock{} + mi := &file_block_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *HistoricalBlock) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HistoricalBlock) ProtoMessage() {} + +func (x *HistoricalBlock) ProtoReflect() protoreflect.Message { + mi := &file_block_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HistoricalBlock.ProtoReflect.Descriptor instead. +func (*HistoricalBlock) Descriptor() ([]byte, []int) { + return file_block_proto_rawDescGZIP(), []int{4} +} + +func (x *HistoricalBlock) GetConfirmations() uint64 { + if x != nil { + return x.Confirmations + } + return 0 +} + +func (x *HistoricalBlock) GetBlock() *Block { + if x != nil { + return x.Block + } + return nil +} + +// The NewBlockHeaderTemplate is used for the construction of a new mine-able block. It contains all the metadata for the block that the Base Node is able to complete on behalf of a Miner. +type NewBlockHeaderTemplate struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Version of the block + Version uint32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + // Height of this block since the genesis block (height 0) + Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + // Hash of the block previous to this in the chain. + PrevHash []byte `protobuf:"bytes,3,opt,name=prev_hash,json=prevHash,proto3" json:"prev_hash,omitempty"` + // Total accumulated sum of kernel offsets since genesis block. We can derive the kernel offset sum for *this* + // block from the total kernel offset of the previous block header. + TotalKernelOffset []byte `protobuf:"bytes,4,opt,name=total_kernel_offset,json=totalKernelOffset,proto3" json:"total_kernel_offset,omitempty"` + // Proof of work metadata + Pow *ProofOfWork `protobuf:"bytes,5,opt,name=pow,proto3" json:"pow,omitempty"` + // Sum of script offsets for all kernels in this block. + TotalScriptOffset []byte `protobuf:"bytes,7,opt,name=total_script_offset,json=totalScriptOffset,proto3" json:"total_script_offset,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache + BlockHeader *BlockHeader `protobuf:"bytes,8,opt,name=block_header,json=blockHeader,proto3" json:"block_header,omitempty"` +} + +func (x *NewBlockHeaderTemplate) Reset() { + *x = NewBlockHeaderTemplate{} + mi := &file_block_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *NewBlockHeaderTemplate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NewBlockHeaderTemplate) ProtoMessage() {} + +func (x *NewBlockHeaderTemplate) ProtoReflect() protoreflect.Message { + mi := &file_block_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NewBlockHeaderTemplate.ProtoReflect.Descriptor instead. +func (*NewBlockHeaderTemplate) Descriptor() ([]byte, []int) { + return file_block_proto_rawDescGZIP(), []int{5} +} + +func (x *NewBlockHeaderTemplate) GetVersion() uint32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *NewBlockHeaderTemplate) GetHeight() uint64 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *NewBlockHeaderTemplate) GetPrevHash() []byte { + if x != nil { + return x.PrevHash + } + return nil +} + +func (x *NewBlockHeaderTemplate) GetTotalKernelOffset() []byte { + if x != nil { + return x.TotalKernelOffset + } + return nil +} + +func (x *NewBlockHeaderTemplate) GetPow() *ProofOfWork { + if x != nil { + return x.Pow + } + return nil +} + +func (x *NewBlockHeaderTemplate) GetTotalScriptOffset() []byte { + if x != nil { + return x.TotalScriptOffset + } + return nil +} + +// The new block template is used constructing a new partial block, allowing a miner to added the coinbase utxo and as a final step the Base node to add the MMR roots to the header. +type NewBlockTemplate struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The NewBlockHeaderTemplate is used for the construction of a new mineable block. It contains all the metadata for + // the block that the Base Node is able to complete on behalf of a Miner. + Header *NewBlockHeaderTemplate `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // This flag indicates if the inputs, outputs and kernels have been sorted internally, that is, the sort() method + // has been called. This may be false even if all components are sorted. + Body *transaction.AggregateBody `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` + // Sometimes the mempool has not synced to the latest tip, this flag indicates if the mempool is out of sync. + // In most cases the next call to get_new_block_template will return a block with the mempool in sync. + IsMempoolInSync bool `protobuf:"varint,3,opt,name=is_mempool_in_sync,json=isMempoolInSync,proto3" json:"is_mempool_in_sync,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NewBlockTemplate) Reset() { + *x = NewBlockTemplate{} + mi := &file_block_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *NewBlockTemplate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NewBlockTemplate) ProtoMessage() {} + +func (x *NewBlockTemplate) ProtoReflect() protoreflect.Message { + mi := &file_block_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NewBlockTemplate.ProtoReflect.Descriptor instead. +func (*NewBlockTemplate) Descriptor() ([]byte, []int) { + return file_block_proto_rawDescGZIP(), []int{6} +} + +func (x *NewBlockTemplate) GetHeader() *NewBlockHeaderTemplate { + if x != nil { + return x.Header + } + return nil +} + +func (x *NewBlockTemplate) GetBody() *transaction.AggregateBody { + if x != nil { + return x.Body + } + return nil +} + +func (x *NewBlockTemplate) GetIsMempoolInSync() bool { + if x != nil { + return x.IsMempoolInSync + } + return false +} + +var File_block_proto protoreflect.FileDescriptor + +const file_block_proto_rawDesc = "" + + "\n" + + "\vblock.proto\x12\btari.rpc\x1a\x11transaction.proto\"\xd6\x04\n" + + "\vBlockHeader\x12\x12\n" + + "\x04hash\x18\x01 \x01(\fR\x04hash\x12\x18\n" + + "\aversion\x18\x02 \x01(\rR\aversion\x12\x16\n" + + "\x06height\x18\x03 \x01(\x04R\x06height\x12\x1b\n" + + "\tprev_hash\x18\x04 \x01(\fR\bprevHash\x12\x1c\n" + + "\ttimestamp\x18\x05 \x01(\x04R\ttimestamp\x12\x1b\n" + + "\toutput_mr\x18\x06 \x01(\fR\boutputMr\x12&\n" + + "\x0fblock_output_mr\x18\a \x01(\fR\rblockOutputMr\x12\x1b\n" + + "\tkernel_mr\x18\b \x01(\fR\bkernelMr\x12\x19\n" + + "\binput_mr\x18\t \x01(\fR\ainputMr\x12.\n" + + "\x13total_kernel_offset\x18\n" + + " \x01(\fR\x11totalKernelOffset\x12\x14\n" + + "\x05nonce\x18\v \x01(\x04R\x05nonce\x12'\n" + + "\x03pow\x18\f \x01(\v2\x15.tari.rpc.ProofOfWorkR\x03pow\x12&\n" + + "\x0fkernel_mmr_size\x18\r \x01(\x04R\rkernelMmrSize\x12&\n" + + "\x0foutput_mmr_size\x18\x0e \x01(\x04R\routputMmrSize\x12.\n" + + "\x13total_script_offset\x18\x0f \x01(\fR\x11totalScriptOffset\x12*\n" + + "\x11validator_node_mr\x18\x10 \x01(\fR\x0fvalidatorNodeMr\x12.\n" + + "\x13validator_node_size\x18\x11 \x01(\x04R\x11validatorNodeSize\"C\n" + + "\vProofOfWork\x12\x19\n" + + "\bpow_algo\x18\x01 \x01(\x04R\apowAlgo\x12\x19\n" + + "\bpow_data\x18\x04 \x01(\fR\apowData\"\x91\x01\n" + + "\aPowAlgo\x125\n" + + "\bpow_algo\x18\x01 \x01(\x0e2\x1a.tari.rpc.PowAlgo.PowAlgosR\apowAlgo\"O\n" + + "\bPowAlgos\x12\x16\n" + + "\x12POW_ALGOS_RANDOMXM\x10\x00\x12\x13\n" + + "\x0fPOW_ALGOS_SHA3X\x10\x01\x12\x16\n" + + "\x12POW_ALGOS_RANDOMXT\x10\x02\"c\n" + + "\x05Block\x12-\n" + + "\x06header\x18\x01 \x01(\v2\x15.tari.rpc.BlockHeaderR\x06header\x12+\n" + + "\x04body\x18\x02 \x01(\v2\x17.tari.rpc.AggregateBodyR\x04body\"^\n" + + "\x0fHistoricalBlock\x12$\n" + + "\rconfirmations\x18\x01 \x01(\x04R\rconfirmations\x12%\n" + + "\x05block\x18\x02 \x01(\v2\x0f.tari.rpc.BlockR\x05block\"\xf0\x01\n" + + "\x16NewBlockHeaderTemplate\x12\x18\n" + + "\aversion\x18\x01 \x01(\rR\aversion\x12\x16\n" + + "\x06height\x18\x02 \x01(\x04R\x06height\x12\x1b\n" + + "\tprev_hash\x18\x03 \x01(\fR\bprevHash\x12.\n" + + "\x13total_kernel_offset\x18\x04 \x01(\fR\x11totalKernelOffset\x12'\n" + + "\x03pow\x18\x05 \x01(\v2\x15.tari.rpc.ProofOfWorkR\x03pow\x12.\n" + + "\x13total_script_offset\x18\a \x01(\fR\x11totalScriptOffset\"\xa6\x01\n" + + "\x10NewBlockTemplate\x128\n" + + "\x06header\x18\x01 \x01(\v2 .tari.rpc.NewBlockHeaderTemplateR\x06header\x12+\n" + + "\x04body\x18\x02 \x01(\v2\x17.tari.rpc.AggregateBodyR\x04body\x12+\n" + + "\x12is_mempool_in_sync\x18\x03 \x01(\bR\x0fisMempoolInSyncB$Z\"pool/internal/gbt/tari/block;blockb\x06proto3" + +var ( + file_block_proto_rawDescOnce sync.Once + file_block_proto_rawDescData []byte +) + +func file_block_proto_rawDescGZIP() []byte { + file_block_proto_rawDescOnce.Do(func() { + file_block_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_block_proto_rawDesc), len(file_block_proto_rawDesc))) + }) + return file_block_proto_rawDescData +} + +var file_block_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_block_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_block_proto_goTypes = []any{ + (PowAlgo_PowAlgos)(0), // 0: tari.rpc.PowAlgo.PowAlgos + (*BlockHeader)(nil), // 1: tari.rpc.BlockHeader + (*ProofOfWork)(nil), // 2: tari.rpc.ProofOfWork + (*PowAlgo)(nil), // 3: tari.rpc.PowAlgo + (*Block)(nil), // 4: tari.rpc.Block + (*HistoricalBlock)(nil), // 5: tari.rpc.HistoricalBlock + (*NewBlockHeaderTemplate)(nil), // 6: tari.rpc.NewBlockHeaderTemplate + (*NewBlockTemplate)(nil), // 7: tari.rpc.NewBlockTemplate + (*transaction.AggregateBody)(nil), // 8: tari.rpc.AggregateBody +} +var file_block_proto_depIdxs = []int32{ + 2, // 0: tari.rpc.BlockHeader.pow:type_name -> tari.rpc.ProofOfWork + 0, // 1: tari.rpc.PowAlgo.pow_algo:type_name -> tari.rpc.PowAlgo.PowAlgos + 1, // 2: tari.rpc.Block.header:type_name -> tari.rpc.BlockHeader + 8, // 3: tari.rpc.Block.body:type_name -> tari.rpc.AggregateBody + 4, // 4: tari.rpc.HistoricalBlock.block:type_name -> tari.rpc.Block + 2, // 5: tari.rpc.NewBlockHeaderTemplate.pow:type_name -> tari.rpc.ProofOfWork + 6, // 6: tari.rpc.NewBlockTemplate.header:type_name -> tari.rpc.NewBlockHeaderTemplate + 8, // 7: tari.rpc.NewBlockTemplate.body:type_name -> tari.rpc.AggregateBody + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_block_proto_init() } +func file_block_proto_init() { + if File_block_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_block_proto_rawDesc), len(file_block_proto_rawDesc)), + NumEnums: 1, + NumMessages: 7, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_block_proto_goTypes, + DependencyIndexes: file_block_proto_depIdxs, + EnumInfos: file_block_proto_enumTypes, + MessageInfos: file_block_proto_msgTypes, + }.Build() + File_block_proto = out.File + file_block_proto_goTypes = nil + file_block_proto_depIdxs = nil +} diff --git a/internal/server/proxy/proto/net_work/network.pb.go b/internal/server/proxy/proto/net_work/network.pb.go new file mode 100644 index 0000000..fae006c --- /dev/null +++ b/internal/server/proxy/proto/net_work/network.pb.go @@ -0,0 +1,790 @@ +// Copyright 2020. The Tari Project +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +// following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the +// following disclaimer in the documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote +// products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v3.6.1 +// source: network.proto + +package net_work + +import ( + _ "github.com/golang/protobuf/ptypes/timestamp" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ConnectivityStatus int32 + +const ( + ConnectivityStatus_Initializing ConnectivityStatus = 0 + ConnectivityStatus_Online ConnectivityStatus = 1 + ConnectivityStatus_Degraded ConnectivityStatus = 2 + ConnectivityStatus_Offline ConnectivityStatus = 3 +) + +// Enum value maps for ConnectivityStatus. +var ( + ConnectivityStatus_name = map[int32]string{ + 0: "Initializing", + 1: "Online", + 2: "Degraded", + 3: "Offline", + } + ConnectivityStatus_value = map[string]int32{ + "Initializing": 0, + "Online": 1, + "Degraded": 2, + "Offline": 3, + } +) + +func (x ConnectivityStatus) Enum() *ConnectivityStatus { + p := new(ConnectivityStatus) + *p = x + return p +} + +func (x ConnectivityStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ConnectivityStatus) Descriptor() protoreflect.EnumDescriptor { + return file_network_proto_enumTypes[0].Descriptor() +} + +func (ConnectivityStatus) Type() protoreflect.EnumType { + return &file_network_proto_enumTypes[0] +} + +func (x ConnectivityStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ConnectivityStatus.Descriptor instead. +func (ConnectivityStatus) EnumDescriptor() ([]byte, []int) { + return file_network_proto_rawDescGZIP(), []int{0} +} + +type NodeIdentity struct { + state protoimpl.MessageState `protogen:"open.v1"` + PublicKey []byte `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + PublicAddresses []string `protobuf:"bytes,2,rep,name=public_addresses,json=publicAddresses,proto3" json:"public_addresses,omitempty"` + NodeId []byte `protobuf:"bytes,3,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NodeIdentity) Reset() { + *x = NodeIdentity{} + mi := &file_network_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *NodeIdentity) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodeIdentity) ProtoMessage() {} + +func (x *NodeIdentity) ProtoReflect() protoreflect.Message { + mi := &file_network_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NodeIdentity.ProtoReflect.Descriptor instead. +func (*NodeIdentity) Descriptor() ([]byte, []int) { + return file_network_proto_rawDescGZIP(), []int{0} +} + +func (x *NodeIdentity) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +func (x *NodeIdentity) GetPublicAddresses() []string { + if x != nil { + return x.PublicAddresses + } + return nil +} + +func (x *NodeIdentity) GetNodeId() []byte { + if x != nil { + return x.NodeId + } + return nil +} + +type Peer struct { + state protoimpl.MessageState `protogen:"open.v1"` + // / Public key of the peer + PublicKey []byte `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + // / NodeId of the peer + NodeId []byte `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` + // / Peer's addresses + Addresses []*Address `protobuf:"bytes,3,rep,name=addresses,proto3" json:"addresses,omitempty"` + // / Last connection attempt to peer + LastConnection uint64 `protobuf:"varint,4,opt,name=last_connection,json=lastConnection,proto3" json:"last_connection,omitempty"` + // / Flags for the peer. + Flags uint32 `protobuf:"varint,5,opt,name=flags,proto3" json:"flags,omitempty"` + BannedUntil uint64 `protobuf:"varint,6,opt,name=banned_until,json=bannedUntil,proto3" json:"banned_until,omitempty"` + BannedReason string `protobuf:"bytes,7,opt,name=banned_reason,json=bannedReason,proto3" json:"banned_reason,omitempty"` + OfflineAt uint64 `protobuf:"varint,8,opt,name=offline_at,json=offlineAt,proto3" json:"offline_at,omitempty"` + // / Features supported by the peer + Features uint32 `protobuf:"varint,9,opt,name=features,proto3" json:"features,omitempty"` + // / used as information for more efficient protocol negotiation. + SupportedProtocols [][]byte `protobuf:"bytes,11,rep,name=supported_protocols,json=supportedProtocols,proto3" json:"supported_protocols,omitempty"` + // / User agent advertised by the peer + UserAgent string `protobuf:"bytes,12,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Peer) Reset() { + *x = Peer{} + mi := &file_network_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Peer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Peer) ProtoMessage() {} + +func (x *Peer) ProtoReflect() protoreflect.Message { + mi := &file_network_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Peer.ProtoReflect.Descriptor instead. +func (*Peer) Descriptor() ([]byte, []int) { + return file_network_proto_rawDescGZIP(), []int{1} +} + +func (x *Peer) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +func (x *Peer) GetNodeId() []byte { + if x != nil { + return x.NodeId + } + return nil +} + +func (x *Peer) GetAddresses() []*Address { + if x != nil { + return x.Addresses + } + return nil +} + +func (x *Peer) GetLastConnection() uint64 { + if x != nil { + return x.LastConnection + } + return 0 +} + +func (x *Peer) GetFlags() uint32 { + if x != nil { + return x.Flags + } + return 0 +} + +func (x *Peer) GetBannedUntil() uint64 { + if x != nil { + return x.BannedUntil + } + return 0 +} + +func (x *Peer) GetBannedReason() string { + if x != nil { + return x.BannedReason + } + return "" +} + +func (x *Peer) GetOfflineAt() uint64 { + if x != nil { + return x.OfflineAt + } + return 0 +} + +func (x *Peer) GetFeatures() uint32 { + if x != nil { + return x.Features + } + return 0 +} + +func (x *Peer) GetSupportedProtocols() [][]byte { + if x != nil { + return x.SupportedProtocols + } + return nil +} + +func (x *Peer) GetUserAgent() string { + if x != nil { + return x.UserAgent + } + return "" +} + +type NetworkStatusResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status ConnectivityStatus `protobuf:"varint,1,opt,name=status,proto3,enum=tari.rpc.ConnectivityStatus" json:"status,omitempty"` + AvgLatencyMs uint32 `protobuf:"varint,2,opt,name=avg_latency_ms,json=avgLatencyMs,proto3" json:"avg_latency_ms,omitempty"` + NumNodeConnections uint32 `protobuf:"varint,3,opt,name=num_node_connections,json=numNodeConnections,proto3" json:"num_node_connections,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *NetworkStatusResponse) Reset() { + *x = NetworkStatusResponse{} + mi := &file_network_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *NetworkStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NetworkStatusResponse) ProtoMessage() {} + +func (x *NetworkStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_network_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NetworkStatusResponse.ProtoReflect.Descriptor instead. +func (*NetworkStatusResponse) Descriptor() ([]byte, []int) { + return file_network_proto_rawDescGZIP(), []int{2} +} + +func (x *NetworkStatusResponse) GetStatus() ConnectivityStatus { + if x != nil { + return x.Status + } + return ConnectivityStatus_Initializing +} + +func (x *NetworkStatusResponse) GetAvgLatencyMs() uint32 { + if x != nil { + return x.AvgLatencyMs + } + return 0 +} + +func (x *NetworkStatusResponse) GetNumNodeConnections() uint32 { + if x != nil { + return x.NumNodeConnections + } + return 0 +} + +type Address struct { + state protoimpl.MessageState `protogen:"open.v1"` + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + LastSeen string `protobuf:"bytes,2,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"` + ConnectionAttempts uint32 `protobuf:"varint,3,opt,name=connection_attempts,json=connectionAttempts,proto3" json:"connection_attempts,omitempty"` + AvgLatency *AverageLatency `protobuf:"bytes,5,opt,name=avg_latency,json=avgLatency,proto3" json:"avg_latency,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Address) Reset() { + *x = Address{} + mi := &file_network_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Address) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Address) ProtoMessage() {} + +func (x *Address) ProtoReflect() protoreflect.Message { + mi := &file_network_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Address.ProtoReflect.Descriptor instead. +func (*Address) Descriptor() ([]byte, []int) { + return file_network_proto_rawDescGZIP(), []int{3} +} + +func (x *Address) GetAddress() []byte { + if x != nil { + return x.Address + } + return nil +} + +func (x *Address) GetLastSeen() string { + if x != nil { + return x.LastSeen + } + return "" +} + +func (x *Address) GetConnectionAttempts() uint32 { + if x != nil { + return x.ConnectionAttempts + } + return 0 +} + +func (x *Address) GetAvgLatency() *AverageLatency { + if x != nil { + return x.AvgLatency + } + return nil +} + +type AverageLatency struct { + state protoimpl.MessageState `protogen:"open.v1"` + Latency uint64 `protobuf:"varint,1,opt,name=latency,proto3" json:"latency,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AverageLatency) Reset() { + *x = AverageLatency{} + mi := &file_network_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AverageLatency) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AverageLatency) ProtoMessage() {} + +func (x *AverageLatency) ProtoReflect() protoreflect.Message { + mi := &file_network_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AverageLatency.ProtoReflect.Descriptor instead. +func (*AverageLatency) Descriptor() ([]byte, []int) { + return file_network_proto_rawDescGZIP(), []int{4} +} + +func (x *AverageLatency) GetLatency() uint64 { + if x != nil { + return x.Latency + } + return 0 +} + +type ListConnectedPeersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + ConnectedPeers []*Peer `protobuf:"bytes,1,rep,name=connected_peers,json=connectedPeers,proto3" json:"connected_peers,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListConnectedPeersResponse) Reset() { + *x = ListConnectedPeersResponse{} + mi := &file_network_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListConnectedPeersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListConnectedPeersResponse) ProtoMessage() {} + +func (x *ListConnectedPeersResponse) ProtoReflect() protoreflect.Message { + mi := &file_network_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListConnectedPeersResponse.ProtoReflect.Descriptor instead. +func (*ListConnectedPeersResponse) Descriptor() ([]byte, []int) { + return file_network_proto_rawDescGZIP(), []int{5} +} + +func (x *ListConnectedPeersResponse) GetConnectedPeers() []*Peer { + if x != nil { + return x.ConnectedPeers + } + return nil +} + +type SoftwareUpdate struct { + state protoimpl.MessageState `protogen:"open.v1"` + HasUpdate bool `protobuf:"varint,1,opt,name=has_update,json=hasUpdate,proto3" json:"has_update,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Sha string `protobuf:"bytes,3,opt,name=sha,proto3" json:"sha,omitempty"` + DownloadUrl string `protobuf:"bytes,4,opt,name=download_url,json=downloadUrl,proto3" json:"download_url,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SoftwareUpdate) Reset() { + *x = SoftwareUpdate{} + mi := &file_network_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SoftwareUpdate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SoftwareUpdate) ProtoMessage() {} + +func (x *SoftwareUpdate) ProtoReflect() protoreflect.Message { + mi := &file_network_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SoftwareUpdate.ProtoReflect.Descriptor instead. +func (*SoftwareUpdate) Descriptor() ([]byte, []int) { + return file_network_proto_rawDescGZIP(), []int{6} +} + +func (x *SoftwareUpdate) GetHasUpdate() bool { + if x != nil { + return x.HasUpdate + } + return false +} + +func (x *SoftwareUpdate) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *SoftwareUpdate) GetSha() string { + if x != nil { + return x.Sha + } + return "" +} + +func (x *SoftwareUpdate) GetDownloadUrl() string { + if x != nil { + return x.DownloadUrl + } + return "" +} + +type GetIdentityRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetIdentityRequest) Reset() { + *x = GetIdentityRequest{} + mi := &file_network_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetIdentityRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetIdentityRequest) ProtoMessage() {} + +func (x *GetIdentityRequest) ProtoReflect() protoreflect.Message { + mi := &file_network_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetIdentityRequest.ProtoReflect.Descriptor instead. +func (*GetIdentityRequest) Descriptor() ([]byte, []int) { + return file_network_proto_rawDescGZIP(), []int{7} +} + +type GetIdentityResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + PublicKey []byte `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + PublicAddress string `protobuf:"bytes,2,opt,name=public_address,json=publicAddress,proto3" json:"public_address,omitempty"` + NodeId []byte `protobuf:"bytes,3,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetIdentityResponse) Reset() { + *x = GetIdentityResponse{} + mi := &file_network_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetIdentityResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetIdentityResponse) ProtoMessage() {} + +func (x *GetIdentityResponse) ProtoReflect() protoreflect.Message { + mi := &file_network_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetIdentityResponse.ProtoReflect.Descriptor instead. +func (*GetIdentityResponse) Descriptor() ([]byte, []int) { + return file_network_proto_rawDescGZIP(), []int{8} +} + +func (x *GetIdentityResponse) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +func (x *GetIdentityResponse) GetPublicAddress() string { + if x != nil { + return x.PublicAddress + } + return "" +} + +func (x *GetIdentityResponse) GetNodeId() []byte { + if x != nil { + return x.NodeId + } + return nil +} + +var File_network_proto protoreflect.FileDescriptor + +const file_network_proto_rawDesc = "" + + "\n" + + "\rnetwork.proto\x12\btari.rpc\x1a\x1fgoogle/protobuf/timestamp.proto\"q\n" + + "\fNodeIdentity\x12\x1d\n" + + "\n" + + "public_key\x18\x01 \x01(\fR\tpublicKey\x12)\n" + + "\x10public_addresses\x18\x02 \x03(\tR\x0fpublicAddresses\x12\x17\n" + + "\anode_id\x18\x03 \x01(\fR\x06nodeId\"\x81\x03\n" + + "\x04Peer\x12\x1d\n" + + "\n" + + "public_key\x18\x01 \x01(\fR\tpublicKey\x12\x17\n" + + "\anode_id\x18\x02 \x01(\fR\x06nodeId\x12/\n" + + "\taddresses\x18\x03 \x03(\v2\x11.tari.rpc.AddressR\taddresses\x12'\n" + + "\x0flast_connection\x18\x04 \x01(\x04R\x0elastConnection\x12\x14\n" + + "\x05flags\x18\x05 \x01(\rR\x05flags\x12!\n" + + "\fbanned_until\x18\x06 \x01(\x04R\vbannedUntil\x12#\n" + + "\rbanned_reason\x18\a \x01(\tR\fbannedReason\x12\x1d\n" + + "\n" + + "offline_at\x18\b \x01(\x04R\tofflineAt\x12\x1a\n" + + "\bfeatures\x18\t \x01(\rR\bfeatures\x12/\n" + + "\x13supported_protocols\x18\v \x03(\fR\x12supportedProtocols\x12\x1d\n" + + "\n" + + "user_agent\x18\f \x01(\tR\tuserAgent\"\xa5\x01\n" + + "\x15NetworkStatusResponse\x124\n" + + "\x06status\x18\x01 \x01(\x0e2\x1c.tari.rpc.ConnectivityStatusR\x06status\x12$\n" + + "\x0eavg_latency_ms\x18\x02 \x01(\rR\favgLatencyMs\x120\n" + + "\x14num_node_connections\x18\x03 \x01(\rR\x12numNodeConnections\"\xac\x01\n" + + "\aAddress\x12\x18\n" + + "\aaddress\x18\x01 \x01(\fR\aaddress\x12\x1b\n" + + "\tlast_seen\x18\x02 \x01(\tR\blastSeen\x12/\n" + + "\x13connection_attempts\x18\x03 \x01(\rR\x12connectionAttempts\x129\n" + + "\vavg_latency\x18\x05 \x01(\v2\x18.tari.rpc.AverageLatencyR\n" + + "avgLatency\"*\n" + + "\x0eAverageLatency\x12\x18\n" + + "\alatency\x18\x01 \x01(\x04R\alatency\"U\n" + + "\x1aListConnectedPeersResponse\x127\n" + + "\x0fconnected_peers\x18\x01 \x03(\v2\x0e.tari.rpc.PeerR\x0econnectedPeers\"~\n" + + "\x0eSoftwareUpdate\x12\x1d\n" + + "\n" + + "has_update\x18\x01 \x01(\bR\thasUpdate\x12\x18\n" + + "\aversion\x18\x02 \x01(\tR\aversion\x12\x10\n" + + "\x03sha\x18\x03 \x01(\tR\x03sha\x12!\n" + + "\fdownload_url\x18\x04 \x01(\tR\vdownloadUrl\"\x14\n" + + "\x12GetIdentityRequest\"t\n" + + "\x13GetIdentityResponse\x12\x1d\n" + + "\n" + + "public_key\x18\x01 \x01(\fR\tpublicKey\x12%\n" + + "\x0epublic_address\x18\x02 \x01(\tR\rpublicAddress\x12\x17\n" + + "\anode_id\x18\x03 \x01(\fR\x06nodeId*M\n" + + "\x12ConnectivityStatus\x12\x10\n" + + "\fInitializing\x10\x00\x12\n" + + "\n" + + "\x06Online\x10\x01\x12\f\n" + + "\bDegraded\x10\x02\x12\v\n" + + "\aOffline\x10\x03B*Z(pool/internal/gbt/tari/net_work;net_workb\x06proto3" + +var ( + file_network_proto_rawDescOnce sync.Once + file_network_proto_rawDescData []byte +) + +func file_network_proto_rawDescGZIP() []byte { + file_network_proto_rawDescOnce.Do(func() { + file_network_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_network_proto_rawDesc), len(file_network_proto_rawDesc))) + }) + return file_network_proto_rawDescData +} + +var file_network_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_network_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_network_proto_goTypes = []any{ + (ConnectivityStatus)(0), // 0: tari.rpc.ConnectivityStatus + (*NodeIdentity)(nil), // 1: tari.rpc.NodeIdentity + (*Peer)(nil), // 2: tari.rpc.Peer + (*NetworkStatusResponse)(nil), // 3: tari.rpc.NetworkStatusResponse + (*Address)(nil), // 4: tari.rpc.Address + (*AverageLatency)(nil), // 5: tari.rpc.AverageLatency + (*ListConnectedPeersResponse)(nil), // 6: tari.rpc.ListConnectedPeersResponse + (*SoftwareUpdate)(nil), // 7: tari.rpc.SoftwareUpdate + (*GetIdentityRequest)(nil), // 8: tari.rpc.GetIdentityRequest + (*GetIdentityResponse)(nil), // 9: tari.rpc.GetIdentityResponse +} +var file_network_proto_depIdxs = []int32{ + 4, // 0: tari.rpc.Peer.addresses:type_name -> tari.rpc.Address + 0, // 1: tari.rpc.NetworkStatusResponse.status:type_name -> tari.rpc.ConnectivityStatus + 5, // 2: tari.rpc.Address.avg_latency:type_name -> tari.rpc.AverageLatency + 2, // 3: tari.rpc.ListConnectedPeersResponse.connected_peers:type_name -> tari.rpc.Peer + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_network_proto_init() } +func file_network_proto_init() { + if File_network_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_network_proto_rawDesc), len(file_network_proto_rawDesc)), + NumEnums: 1, + NumMessages: 9, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_network_proto_goTypes, + DependencyIndexes: file_network_proto_depIdxs, + EnumInfos: file_network_proto_enumTypes, + MessageInfos: file_network_proto_msgTypes, + }.Build() + File_network_proto = out.File + file_network_proto_goTypes = nil + file_network_proto_depIdxs = nil +} diff --git a/internal/server/proxy/proto/network.proto b/internal/server/proxy/proto/network.proto new file mode 100644 index 0000000..fba0614 --- /dev/null +++ b/internal/server/proxy/proto/network.proto @@ -0,0 +1,97 @@ +// Copyright 2020. The Tari Project +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +// following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the +// following disclaimer in the documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote +// products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +syntax = "proto3"; + +package tari.rpc; + +import "google/protobuf/timestamp.proto"; + +message NodeIdentity { + bytes public_key = 1; + repeated string public_addresses = 2; + bytes node_id = 3; +} + +message Peer { + /// Public key of the peer + bytes public_key =1; + /// NodeId of the peer + bytes node_id =2; + /// Peer's addresses + repeated Address addresses = 3; + /// Last connection attempt to peer + uint64 last_connection = 4; + /// Flags for the peer. + uint32 flags = 5; + uint64 banned_until= 6; + string banned_reason= 7; + uint64 offline_at = 8; + /// Features supported by the peer + uint32 features = 9; + /// used as information for more efficient protocol negotiation. + repeated bytes supported_protocols = 11; + /// User agent advertised by the peer + string user_agent = 12; +} + +enum ConnectivityStatus { + Initializing = 0; + Online = 1; + Degraded = 2; + Offline = 3; +} + +message NetworkStatusResponse { + ConnectivityStatus status = 1; + uint32 avg_latency_ms = 2; + uint32 num_node_connections = 3; +} + +message Address{ + bytes address =1; + string last_seen = 2; + uint32 connection_attempts = 3; + AverageLatency avg_latency = 5; +} + +message AverageLatency { + uint64 latency = 1; +} + +message ListConnectedPeersResponse { + repeated Peer connected_peers = 1; +} + +message SoftwareUpdate { + bool has_update = 1; + string version = 2; + string sha = 3; + string download_url = 4; +} + +message GetIdentityRequest { } + +message GetIdentityResponse { + bytes public_key = 1; + string public_address = 2; + bytes node_id = 3; +} diff --git a/internal/server/proxy/proto/p2pool.proto b/internal/server/proxy/proto/p2pool.proto new file mode 100644 index 0000000..bb5fd37 --- /dev/null +++ b/internal/server/proxy/proto/p2pool.proto @@ -0,0 +1,61 @@ +// Copyright 2024. The Tari Project +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +// following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the +// following disclaimer in the documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote +// products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +syntax = "proto3"; + +package tari.rpc; + +import "base_node.proto"; +import "block.proto"; + +service ShaP2Pool { + rpc GetTipInfo(GetTipInfoRequest) returns(GetTipInfoResponse); + rpc GetNewBlock(GetNewBlockRequest) returns(GetNewBlockResponse); + rpc SubmitBlock(SubmitBlockRequest) returns(tari.rpc.SubmitBlockResponse); +} + +message GetTipInfoRequest { +} + +message GetTipInfoResponse { + uint64 node_height = 1; + bytes node_tip_hash = 2; + uint64 p2pool_rx_height = 3; + bytes p2pool_rx_tip_hash = 4; + uint64 p2pool_sha_height = 5; + bytes p2pool_sha_tip_hash = 6; +} + +message GetNewBlockRequest { + tari.rpc.PowAlgo pow = 1; + string coinbase_extra = 2; + string wallet_payment_address = 3; +} + +message GetNewBlockResponse { + tari.rpc.GetNewBlockResult block = 1; + uint64 target_difficulty = 2; +} + +message SubmitBlockRequest { + tari.rpc.Block block = 1; + string wallet_payment_address = 2; +} \ No newline at end of file diff --git a/internal/server/proxy/proto/sidechain_types.proto b/internal/server/proxy/proto/sidechain_types.proto new file mode 100644 index 0000000..184a321 --- /dev/null +++ b/internal/server/proxy/proto/sidechain_types.proto @@ -0,0 +1,77 @@ +// Copyright 2020. The Tari Project +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +// following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the +// following disclaimer in the documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote +// products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +syntax = "proto3"; + +package tari.rpc; + +import "types.proto"; + +message SideChainFeature { + oneof side_chain_feature { + ValidatorNodeRegistration validator_node_registration = 1; + TemplateRegistration template_registration = 2; + ConfidentialOutputData confidential_output = 3; + } +} + +message ValidatorNodeRegistration { + bytes public_key = 1; + Signature signature = 2; +} + +message TemplateRegistration { + bytes author_public_key = 1; + Signature author_signature = 2; + string template_name = 3; + uint32 template_version = 4; + TemplateType template_type = 5; + BuildInfo build_info = 6; + bytes binary_sha = 7; + string binary_url = 8; +} + +message ConfidentialOutputData { + bytes claim_public_key = 1; +} + +message TemplateType { + oneof template_type { + WasmInfo wasm = 1; + FlowInfo flow = 2; + ManifestInfo manifest = 3; + } +} + +message WasmInfo { + uint32 abi_version = 1; +} + +message FlowInfo { +} + +message ManifestInfo { +} + +message BuildInfo { + string repo_url = 1; + bytes commit_hash = 2; +} diff --git a/internal/server/proxy/proto/sidechain_types/sidechain_types.pb.go b/internal/server/proxy/proto/sidechain_types/sidechain_types.pb.go new file mode 100644 index 0000000..08c627f --- /dev/null +++ b/internal/server/proxy/proto/sidechain_types/sidechain_types.pb.go @@ -0,0 +1,727 @@ +// Copyright 2020. The Tari Project +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +// following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the +// following disclaimer in the documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote +// products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v3.6.1 +// source: sidechain_types.proto + +package sidechain_types + +import ( + types "pool/internal/server/proxy/proto/types" + reflect "reflect" + sync "sync" + unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type SideChainFeature struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to SideChainFeature: + // + // *SideChainFeature_ValidatorNodeRegistration + // *SideChainFeature_TemplateRegistration + // *SideChainFeature_ConfidentialOutput + SideChainFeature isSideChainFeature_SideChainFeature `protobuf_oneof:"side_chain_feature"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SideChainFeature) Reset() { + *x = SideChainFeature{} + mi := &file_sidechain_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SideChainFeature) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SideChainFeature) ProtoMessage() {} + +func (x *SideChainFeature) ProtoReflect() protoreflect.Message { + mi := &file_sidechain_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SideChainFeature.ProtoReflect.Descriptor instead. +func (*SideChainFeature) Descriptor() ([]byte, []int) { + return file_sidechain_types_proto_rawDescGZIP(), []int{0} +} + +func (x *SideChainFeature) GetSideChainFeature() isSideChainFeature_SideChainFeature { + if x != nil { + return x.SideChainFeature + } + return nil +} + +func (x *SideChainFeature) GetValidatorNodeRegistration() *ValidatorNodeRegistration { + if x != nil { + if x, ok := x.SideChainFeature.(*SideChainFeature_ValidatorNodeRegistration); ok { + return x.ValidatorNodeRegistration + } + } + return nil +} + +func (x *SideChainFeature) GetTemplateRegistration() *TemplateRegistration { + if x != nil { + if x, ok := x.SideChainFeature.(*SideChainFeature_TemplateRegistration); ok { + return x.TemplateRegistration + } + } + return nil +} + +func (x *SideChainFeature) GetConfidentialOutput() *ConfidentialOutputData { + if x != nil { + if x, ok := x.SideChainFeature.(*SideChainFeature_ConfidentialOutput); ok { + return x.ConfidentialOutput + } + } + return nil +} + +type isSideChainFeature_SideChainFeature interface { + isSideChainFeature_SideChainFeature() +} + +type SideChainFeature_ValidatorNodeRegistration struct { + ValidatorNodeRegistration *ValidatorNodeRegistration `protobuf:"bytes,1,opt,name=validator_node_registration,json=validatorNodeRegistration,proto3,oneof"` +} + +type SideChainFeature_TemplateRegistration struct { + TemplateRegistration *TemplateRegistration `protobuf:"bytes,2,opt,name=template_registration,json=templateRegistration,proto3,oneof"` +} + +type SideChainFeature_ConfidentialOutput struct { + ConfidentialOutput *ConfidentialOutputData `protobuf:"bytes,3,opt,name=confidential_output,json=confidentialOutput,proto3,oneof"` +} + +func (*SideChainFeature_ValidatorNodeRegistration) isSideChainFeature_SideChainFeature() {} + +func (*SideChainFeature_TemplateRegistration) isSideChainFeature_SideChainFeature() {} + +func (*SideChainFeature_ConfidentialOutput) isSideChainFeature_SideChainFeature() {} + +type ValidatorNodeRegistration struct { + state protoimpl.MessageState `protogen:"open.v1"` + PublicKey []byte `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + Signature *types.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ValidatorNodeRegistration) Reset() { + *x = ValidatorNodeRegistration{} + mi := &file_sidechain_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ValidatorNodeRegistration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidatorNodeRegistration) ProtoMessage() {} + +func (x *ValidatorNodeRegistration) ProtoReflect() protoreflect.Message { + mi := &file_sidechain_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidatorNodeRegistration.ProtoReflect.Descriptor instead. +func (*ValidatorNodeRegistration) Descriptor() ([]byte, []int) { + return file_sidechain_types_proto_rawDescGZIP(), []int{1} +} + +func (x *ValidatorNodeRegistration) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +func (x *ValidatorNodeRegistration) GetSignature() *types.Signature { + if x != nil { + return x.Signature + } + return nil +} + +type TemplateRegistration struct { + state protoimpl.MessageState `protogen:"open.v1"` + AuthorPublicKey []byte `protobuf:"bytes,1,opt,name=author_public_key,json=authorPublicKey,proto3" json:"author_public_key,omitempty"` + AuthorSignature *types.Signature `protobuf:"bytes,2,opt,name=author_signature,json=authorSignature,proto3" json:"author_signature,omitempty"` + TemplateName string `protobuf:"bytes,3,opt,name=template_name,json=templateName,proto3" json:"template_name,omitempty"` + TemplateVersion uint32 `protobuf:"varint,4,opt,name=template_version,json=templateVersion,proto3" json:"template_version,omitempty"` + TemplateType *TemplateType `protobuf:"bytes,5,opt,name=template_type,json=templateType,proto3" json:"template_type,omitempty"` + BuildInfo *BuildInfo `protobuf:"bytes,6,opt,name=build_info,json=buildInfo,proto3" json:"build_info,omitempty"` + BinarySha []byte `protobuf:"bytes,7,opt,name=binary_sha,json=binarySha,proto3" json:"binary_sha,omitempty"` + BinaryUrl string `protobuf:"bytes,8,opt,name=binary_url,json=binaryUrl,proto3" json:"binary_url,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TemplateRegistration) Reset() { + *x = TemplateRegistration{} + mi := &file_sidechain_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TemplateRegistration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TemplateRegistration) ProtoMessage() {} + +func (x *TemplateRegistration) ProtoReflect() protoreflect.Message { + mi := &file_sidechain_types_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TemplateRegistration.ProtoReflect.Descriptor instead. +func (*TemplateRegistration) Descriptor() ([]byte, []int) { + return file_sidechain_types_proto_rawDescGZIP(), []int{2} +} + +func (x *TemplateRegistration) GetAuthorPublicKey() []byte { + if x != nil { + return x.AuthorPublicKey + } + return nil +} + +func (x *TemplateRegistration) GetAuthorSignature() *types.Signature { + if x != nil { + return x.AuthorSignature + } + return nil +} + +func (x *TemplateRegistration) GetTemplateName() string { + if x != nil { + return x.TemplateName + } + return "" +} + +func (x *TemplateRegistration) GetTemplateVersion() uint32 { + if x != nil { + return x.TemplateVersion + } + return 0 +} + +func (x *TemplateRegistration) GetTemplateType() *TemplateType { + if x != nil { + return x.TemplateType + } + return nil +} + +func (x *TemplateRegistration) GetBuildInfo() *BuildInfo { + if x != nil { + return x.BuildInfo + } + return nil +} + +func (x *TemplateRegistration) GetBinarySha() []byte { + if x != nil { + return x.BinarySha + } + return nil +} + +func (x *TemplateRegistration) GetBinaryUrl() string { + if x != nil { + return x.BinaryUrl + } + return "" +} + +type ConfidentialOutputData struct { + state protoimpl.MessageState `protogen:"open.v1"` + ClaimPublicKey []byte `protobuf:"bytes,1,opt,name=claim_public_key,json=claimPublicKey,proto3" json:"claim_public_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ConfidentialOutputData) Reset() { + *x = ConfidentialOutputData{} + mi := &file_sidechain_types_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ConfidentialOutputData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfidentialOutputData) ProtoMessage() {} + +func (x *ConfidentialOutputData) ProtoReflect() protoreflect.Message { + mi := &file_sidechain_types_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfidentialOutputData.ProtoReflect.Descriptor instead. +func (*ConfidentialOutputData) Descriptor() ([]byte, []int) { + return file_sidechain_types_proto_rawDescGZIP(), []int{3} +} + +func (x *ConfidentialOutputData) GetClaimPublicKey() []byte { + if x != nil { + return x.ClaimPublicKey + } + return nil +} + +type TemplateType struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to TemplateType: + // + // *TemplateType_Wasm + // *TemplateType_Flow + // *TemplateType_Manifest + TemplateType isTemplateType_TemplateType `protobuf_oneof:"template_type"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TemplateType) Reset() { + *x = TemplateType{} + mi := &file_sidechain_types_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TemplateType) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TemplateType) ProtoMessage() {} + +func (x *TemplateType) ProtoReflect() protoreflect.Message { + mi := &file_sidechain_types_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TemplateType.ProtoReflect.Descriptor instead. +func (*TemplateType) Descriptor() ([]byte, []int) { + return file_sidechain_types_proto_rawDescGZIP(), []int{4} +} + +func (x *TemplateType) GetTemplateType() isTemplateType_TemplateType { + if x != nil { + return x.TemplateType + } + return nil +} + +func (x *TemplateType) GetWasm() *WasmInfo { + if x != nil { + if x, ok := x.TemplateType.(*TemplateType_Wasm); ok { + return x.Wasm + } + } + return nil +} + +func (x *TemplateType) GetFlow() *FlowInfo { + if x != nil { + if x, ok := x.TemplateType.(*TemplateType_Flow); ok { + return x.Flow + } + } + return nil +} + +func (x *TemplateType) GetManifest() *ManifestInfo { + if x != nil { + if x, ok := x.TemplateType.(*TemplateType_Manifest); ok { + return x.Manifest + } + } + return nil +} + +type isTemplateType_TemplateType interface { + isTemplateType_TemplateType() +} + +type TemplateType_Wasm struct { + Wasm *WasmInfo `protobuf:"bytes,1,opt,name=wasm,proto3,oneof"` +} + +type TemplateType_Flow struct { + Flow *FlowInfo `protobuf:"bytes,2,opt,name=flow,proto3,oneof"` +} + +type TemplateType_Manifest struct { + Manifest *ManifestInfo `protobuf:"bytes,3,opt,name=manifest,proto3,oneof"` +} + +func (*TemplateType_Wasm) isTemplateType_TemplateType() {} + +func (*TemplateType_Flow) isTemplateType_TemplateType() {} + +func (*TemplateType_Manifest) isTemplateType_TemplateType() {} + +type WasmInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + AbiVersion uint32 `protobuf:"varint,1,opt,name=abi_version,json=abiVersion,proto3" json:"abi_version,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WasmInfo) Reset() { + *x = WasmInfo{} + mi := &file_sidechain_types_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WasmInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WasmInfo) ProtoMessage() {} + +func (x *WasmInfo) ProtoReflect() protoreflect.Message { + mi := &file_sidechain_types_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WasmInfo.ProtoReflect.Descriptor instead. +func (*WasmInfo) Descriptor() ([]byte, []int) { + return file_sidechain_types_proto_rawDescGZIP(), []int{5} +} + +func (x *WasmInfo) GetAbiVersion() uint32 { + if x != nil { + return x.AbiVersion + } + return 0 +} + +type FlowInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FlowInfo) Reset() { + *x = FlowInfo{} + mi := &file_sidechain_types_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FlowInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlowInfo) ProtoMessage() {} + +func (x *FlowInfo) ProtoReflect() protoreflect.Message { + mi := &file_sidechain_types_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FlowInfo.ProtoReflect.Descriptor instead. +func (*FlowInfo) Descriptor() ([]byte, []int) { + return file_sidechain_types_proto_rawDescGZIP(), []int{6} +} + +type ManifestInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ManifestInfo) Reset() { + *x = ManifestInfo{} + mi := &file_sidechain_types_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ManifestInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ManifestInfo) ProtoMessage() {} + +func (x *ManifestInfo) ProtoReflect() protoreflect.Message { + mi := &file_sidechain_types_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ManifestInfo.ProtoReflect.Descriptor instead. +func (*ManifestInfo) Descriptor() ([]byte, []int) { + return file_sidechain_types_proto_rawDescGZIP(), []int{7} +} + +type BuildInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + RepoUrl string `protobuf:"bytes,1,opt,name=repo_url,json=repoUrl,proto3" json:"repo_url,omitempty"` + CommitHash []byte `protobuf:"bytes,2,opt,name=commit_hash,json=commitHash,proto3" json:"commit_hash,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BuildInfo) Reset() { + *x = BuildInfo{} + mi := &file_sidechain_types_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BuildInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BuildInfo) ProtoMessage() {} + +func (x *BuildInfo) ProtoReflect() protoreflect.Message { + mi := &file_sidechain_types_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BuildInfo.ProtoReflect.Descriptor instead. +func (*BuildInfo) Descriptor() ([]byte, []int) { + return file_sidechain_types_proto_rawDescGZIP(), []int{8} +} + +func (x *BuildInfo) GetRepoUrl() string { + if x != nil { + return x.RepoUrl + } + return "" +} + +func (x *BuildInfo) GetCommitHash() []byte { + if x != nil { + return x.CommitHash + } + return nil +} + +var File_sidechain_types_proto protoreflect.FileDescriptor + +const file_sidechain_types_proto_rawDesc = "" + + "\n" + + "\x15sidechain_types.proto\x12\btari.rpc\x1a\vtypes.proto\"\xbb\x02\n" + + "\x10SideChainFeature\x12e\n" + + "\x1bvalidator_node_registration\x18\x01 \x01(\v2#.tari.rpc.ValidatorNodeRegistrationH\x00R\x19validatorNodeRegistration\x12U\n" + + "\x15template_registration\x18\x02 \x01(\v2\x1e.tari.rpc.TemplateRegistrationH\x00R\x14templateRegistration\x12S\n" + + "\x13confidential_output\x18\x03 \x01(\v2 .tari.rpc.ConfidentialOutputDataH\x00R\x12confidentialOutputB\x14\n" + + "\x12side_chain_feature\"m\n" + + "\x19ValidatorNodeRegistration\x12\x1d\n" + + "\n" + + "public_key\x18\x01 \x01(\fR\tpublicKey\x121\n" + + "\tsignature\x18\x02 \x01(\v2\x13.tari.rpc.SignatureR\tsignature\"\x81\x03\n" + + "\x14TemplateRegistration\x12*\n" + + "\x11author_public_key\x18\x01 \x01(\fR\x0fauthorPublicKey\x12>\n" + + "\x10author_signature\x18\x02 \x01(\v2\x13.tari.rpc.SignatureR\x0fauthorSignature\x12#\n" + + "\rtemplate_name\x18\x03 \x01(\tR\ftemplateName\x12)\n" + + "\x10template_version\x18\x04 \x01(\rR\x0ftemplateVersion\x12;\n" + + "\rtemplate_type\x18\x05 \x01(\v2\x16.tari.rpc.TemplateTypeR\ftemplateType\x122\n" + + "\n" + + "build_info\x18\x06 \x01(\v2\x13.tari.rpc.BuildInfoR\tbuildInfo\x12\x1d\n" + + "\n" + + "binary_sha\x18\a \x01(\fR\tbinarySha\x12\x1d\n" + + "\n" + + "binary_url\x18\b \x01(\tR\tbinaryUrl\"B\n" + + "\x16ConfidentialOutputData\x12(\n" + + "\x10claim_public_key\x18\x01 \x01(\fR\x0eclaimPublicKey\"\xa9\x01\n" + + "\fTemplateType\x12(\n" + + "\x04wasm\x18\x01 \x01(\v2\x12.tari.rpc.WasmInfoH\x00R\x04wasm\x12(\n" + + "\x04flow\x18\x02 \x01(\v2\x12.tari.rpc.FlowInfoH\x00R\x04flow\x124\n" + + "\bmanifest\x18\x03 \x01(\v2\x16.tari.rpc.ManifestInfoH\x00R\bmanifestB\x0f\n" + + "\rtemplate_type\"+\n" + + "\bWasmInfo\x12\x1f\n" + + "\vabi_version\x18\x01 \x01(\rR\n" + + "abiVersion\"\n" + + "\n" + + "\bFlowInfo\"\x0e\n" + + "\fManifestInfo\"G\n" + + "\tBuildInfo\x12\x19\n" + + "\brepo_url\x18\x01 \x01(\tR\arepoUrl\x12\x1f\n" + + "\vcommit_hash\x18\x02 \x01(\fR\n" + + "commitHashB8Z6pool/internal/gbt/tari/sidechain_types;sidechain_typesb\x06proto3" + +var ( + file_sidechain_types_proto_rawDescOnce sync.Once + file_sidechain_types_proto_rawDescData []byte +) + +func file_sidechain_types_proto_rawDescGZIP() []byte { + file_sidechain_types_proto_rawDescOnce.Do(func() { + file_sidechain_types_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_sidechain_types_proto_rawDesc), len(file_sidechain_types_proto_rawDesc))) + }) + return file_sidechain_types_proto_rawDescData +} + +var file_sidechain_types_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_sidechain_types_proto_goTypes = []any{ + (*SideChainFeature)(nil), // 0: tari.rpc.SideChainFeature + (*ValidatorNodeRegistration)(nil), // 1: tari.rpc.ValidatorNodeRegistration + (*TemplateRegistration)(nil), // 2: tari.rpc.TemplateRegistration + (*ConfidentialOutputData)(nil), // 3: tari.rpc.ConfidentialOutputData + (*TemplateType)(nil), // 4: tari.rpc.TemplateType + (*WasmInfo)(nil), // 5: tari.rpc.WasmInfo + (*FlowInfo)(nil), // 6: tari.rpc.FlowInfo + (*ManifestInfo)(nil), // 7: tari.rpc.ManifestInfo + (*BuildInfo)(nil), // 8: tari.rpc.BuildInfo + (*types.Signature)(nil), // 9: tari.rpc.Signature +} +var file_sidechain_types_proto_depIdxs = []int32{ + 1, // 0: tari.rpc.SideChainFeature.validator_node_registration:type_name -> tari.rpc.ValidatorNodeRegistration + 2, // 1: tari.rpc.SideChainFeature.template_registration:type_name -> tari.rpc.TemplateRegistration + 3, // 2: tari.rpc.SideChainFeature.confidential_output:type_name -> tari.rpc.ConfidentialOutputData + 9, // 3: tari.rpc.ValidatorNodeRegistration.signature:type_name -> tari.rpc.Signature + 9, // 4: tari.rpc.TemplateRegistration.author_signature:type_name -> tari.rpc.Signature + 4, // 5: tari.rpc.TemplateRegistration.template_type:type_name -> tari.rpc.TemplateType + 8, // 6: tari.rpc.TemplateRegistration.build_info:type_name -> tari.rpc.BuildInfo + 5, // 7: tari.rpc.TemplateType.wasm:type_name -> tari.rpc.WasmInfo + 6, // 8: tari.rpc.TemplateType.flow:type_name -> tari.rpc.FlowInfo + 7, // 9: tari.rpc.TemplateType.manifest:type_name -> tari.rpc.ManifestInfo + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_sidechain_types_proto_init() } +func file_sidechain_types_proto_init() { + if File_sidechain_types_proto != nil { + return + } + file_sidechain_types_proto_msgTypes[0].OneofWrappers = []any{ + (*SideChainFeature_ValidatorNodeRegistration)(nil), + (*SideChainFeature_TemplateRegistration)(nil), + (*SideChainFeature_ConfidentialOutput)(nil), + } + file_sidechain_types_proto_msgTypes[4].OneofWrappers = []any{ + (*TemplateType_Wasm)(nil), + (*TemplateType_Flow)(nil), + (*TemplateType_Manifest)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_sidechain_types_proto_rawDesc), len(file_sidechain_types_proto_rawDesc)), + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_sidechain_types_proto_goTypes, + DependencyIndexes: file_sidechain_types_proto_depIdxs, + MessageInfos: file_sidechain_types_proto_msgTypes, + }.Build() + File_sidechain_types_proto = out.File + file_sidechain_types_proto_goTypes = nil + file_sidechain_types_proto_depIdxs = nil +} diff --git a/internal/server/proxy/proto/transaction.proto b/internal/server/proxy/proto/transaction.proto new file mode 100644 index 0000000..0e8ab2c --- /dev/null +++ b/internal/server/proxy/proto/transaction.proto @@ -0,0 +1,188 @@ +// Copyright 2020. The Tari Project +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +// following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the +// following disclaimer in the documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote +// products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +syntax = "proto3"; + +package tari.rpc; + +import "types.proto"; +import "sidechain_types.proto"; + +// The transaction kernel tracks the excess for a given transaction. For an explanation of what the excess is, and +// why it is necessary, refer to the +// [Mimblewimble TLU post](https://tlu.tarilabs.com/protocols/mimblewimble-1/sources/PITCHME.link.html?highlight=mimblewimble#mimblewimble). +// The kernel also tracks other transaction metadata, such as the lock height for the transaction (i.e. the earliest +// this transaction can be mined) and the transaction fee, in cleartext. +message TransactionKernel { + // Options for a kernel's structure or use + uint32 features = 1; + /// Fee originally included in the transaction this proof is for (in MicroMinotari) + uint64 fee = 2; + // This kernel is not valid earlier than lock_height blocks + // The max lock_height of all *inputs* to this transaction + uint64 lock_height = 3; + // Remainder of the sum of all transaction commitments. If the transaction + // is well formed, amounts components should sum to zero and the excess + // is hence a valid public key. + bytes excess = 6; + // The signature proving the excess is a valid public key, which signs + // the transaction fee. + Signature excess_sig = 7; + // The hash of the kernel, as it appears in the MMR + bytes hash = 8; + // Version + uint32 version = 9; + // Optional burned commitment + bytes burn_commitment = 10; +} + +// A transaction input. +// +// Primarily a reference to an output being spent by the transaction. +message TransactionInput { + // The features of the output being spent. We will check maturity for all outputs. + OutputFeatures features = 1; + // The commitment referencing the output being spent. + bytes commitment = 2; + // Hash of the input, as it appears in the MMR + bytes hash = 3; + // The serialised script + bytes script = 4; + // The script input data, if any + bytes input_data = 5; + // A signature with k_s, signing the script, input data, and mined height + ComAndPubSignature script_signature = 7; + // The offset public key, K_O + bytes sender_offset_public_key = 8; + // The hash of the output this input is spending + bytes output_hash = 9; + // Covenant + bytes covenant = 10; + // Version + uint32 version = 11; + // The encrypted data + bytes encrypted_data = 12; + // The minimum value of the commitment that is proven by the range proof (in MicroMinotari) + uint64 minimum_value_promise = 13; + // The metadata signature for output this input is spending + ComAndPubSignature metadata_signature = 14; + // The rangeproof hash for output this input is spending + bytes rangeproof_hash = 15; +} + +// Output for a transaction, defining the new ownership of coins that are being transferred. The commitment is a +// blinded value for the output while the range proof guarantees the commitment includes a positive value without +// overflow and the ownership of the private key. +message TransactionOutput { + // Options for an output's structure or use + OutputFeatures features = 1; + // The homomorphic commitment representing the output amount + bytes commitment = 2; + // A proof that the commitment is in the right range + RangeProof range_proof = 3; + // The hash of the output, as it appears in the MMR + bytes hash = 4; + // Tari script serialised script + bytes script = 5; + // Tari script offset public key, K_O + bytes sender_offset_public_key = 6; + // Metadata signature with the homomorphic commitment private values (amount and blinding factor) and the sender + // offset private key + ComAndPubSignature metadata_signature = 7; + // Covenant + bytes covenant = 8; + // Version + uint32 version = 9; + // Encrypted Pedersen commitment openings (value and mask) for the output + bytes encrypted_data = 10; + // The minimum value of the commitment that is proven by the range proof (in MicroMinotari) + uint64 minimum_value_promise = 11; + // Payment reference (PayRef) - 32-byte Blake2b hash of (block_hash || output_hash) + // This provides a unique, deterministic reference for the output that can be used + // for payment verification without revealing wallet ownership + bytes payment_reference = 12; +} + +// Options for UTXOs +message OutputFeatures { + // Version + uint32 version = 1; + // The type of output, eg Coinbase, all of which have different consensus rules + uint32 output_type = 2; + // The maturity of the specific UTXO. This is the min lock height at which an UTXO can be spend. Coinbase UTXO + // require a min maturity of the Coinbase_lock_height, this should be checked on receiving new blocks. + uint64 maturity = 3; + // Additional arbitrary info in coinbase transactions supplied by miners + bytes coinbase_extra = 4; + // Features that are specific to a side chain + SideChainFeature sidechain_feature = 5; + // The type of range proof used in the output + uint32 range_proof_type = 6; +} + +// The components of the block or transaction. The same struct can be used for either, since in Mimblewimble, +// cut-through means that blocks and transactions have the same structure. The inputs, outputs and kernels should +// be sorted by their Blake2b-256bit digest hash +message AggregateBody { + // List of inputs spent by the transaction. + repeated TransactionInput inputs = 1; + // List of outputs the transaction produces. + repeated TransactionOutput outputs = 2; + // Kernels contain the excesses and their signatures for transaction + repeated TransactionKernel kernels = 3; +} + +// A transaction which consists of a kernel offset and an aggregate body made up of inputs, outputs and kernels. +message Transaction { + bytes offset = 1; + AggregateBody body = 2; + bytes script_offset = 3; +} + +message UnblindedOutput { + // Value of the output + uint64 value = 1; + // Spending key of the output + bytes spending_key = 2; + // Options for an output's structure or use + OutputFeatures features = 3; + // Tari script serialised script + bytes script = 4; + // Tari script input data for spending + bytes input_data = 5; + // Tari script private key + bytes script_private_key = 7; + // Tari script offset pubkey, K_O + bytes sender_offset_public_key = 8; + // UTXO signature with the script offset private key, k_O + ComAndPubSignature metadata_signature = 9; + // The minimum height the script allows this output to be spent + uint64 script_lock_height = 10; + // Covenant + bytes covenant = 11; + // Encrypted data + bytes encrypted_data = 12; + // The minimum value of the commitment that is proven by the range proof (in MicroMinotari) + uint64 minimum_value_promise = 13; + // The range proof + RangeProof range_proof = 14; +} + diff --git a/internal/server/proxy/proto/transaction/transaction.pb.go b/internal/server/proxy/proto/transaction/transaction.pb.go new file mode 100644 index 0000000..16665ee --- /dev/null +++ b/internal/server/proxy/proto/transaction/transaction.pb.go @@ -0,0 +1,1012 @@ +// Copyright 2020. The Tari Project +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +// following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the +// following disclaimer in the documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote +// products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v3.6.1 +// source: transaction.proto + +package transaction + +import ( + sidechain_types "pool/internal/server/proxy/proto/sidechain_types" + types "pool/internal/server/proxy/proto/types" + reflect "reflect" + sync "sync" + unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// The transaction kernel tracks the excess for a given transaction. For an explanation of what the excess is, and +// why it is necessary, refer to the +// [Mimblewimble TLU post](https://tlu.tarilabs.com/protocols/mimblewimble-1/sources/PITCHME.link.html?highlight=mimblewimble#mimblewimble). +// The kernel also tracks other transaction metadata, such as the lock height for the transaction (i.e. the earliest +// this transaction can be mined) and the transaction fee, in cleartext. +type TransactionKernel struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Options for a kernel's structure or use + Features uint32 `protobuf:"varint,1,opt,name=features,proto3" json:"features,omitempty"` + // / Fee originally included in the transaction this proof is for (in MicroMinotari) + Fee uint64 `protobuf:"varint,2,opt,name=fee,proto3" json:"fee,omitempty"` + // This kernel is not valid earlier than lock_height blocks + // The max lock_height of all *inputs* to this transaction + LockHeight uint64 `protobuf:"varint,3,opt,name=lock_height,json=lockHeight,proto3" json:"lock_height,omitempty"` + // Remainder of the sum of all transaction commitments. If the transaction + // is well formed, amounts components should sum to zero and the excess + // is hence a valid public key. + Excess []byte `protobuf:"bytes,6,opt,name=excess,proto3" json:"excess,omitempty"` + // The signature proving the excess is a valid public key, which signs + // the transaction fee. + ExcessSig *types.Signature `protobuf:"bytes,7,opt,name=excess_sig,json=excessSig,proto3" json:"excess_sig,omitempty"` + // The hash of the kernel, as it appears in the MMR + Hash []byte `protobuf:"bytes,8,opt,name=hash,proto3" json:"hash,omitempty"` + // Version + Version uint32 `protobuf:"varint,9,opt,name=version,proto3" json:"version,omitempty"` + // Optional burned commitment + BurnCommitment []byte `protobuf:"bytes,10,opt,name=burn_commitment,json=burnCommitment,proto3" json:"burn_commitment,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TransactionKernel) Reset() { + *x = TransactionKernel{} + mi := &file_transaction_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TransactionKernel) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransactionKernel) ProtoMessage() {} + +func (x *TransactionKernel) ProtoReflect() protoreflect.Message { + mi := &file_transaction_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransactionKernel.ProtoReflect.Descriptor instead. +func (*TransactionKernel) Descriptor() ([]byte, []int) { + return file_transaction_proto_rawDescGZIP(), []int{0} +} + +func (x *TransactionKernel) GetFeatures() uint32 { + if x != nil { + return x.Features + } + return 0 +} + +func (x *TransactionKernel) GetFee() uint64 { + if x != nil { + return x.Fee + } + return 0 +} + +func (x *TransactionKernel) GetLockHeight() uint64 { + if x != nil { + return x.LockHeight + } + return 0 +} + +func (x *TransactionKernel) GetExcess() []byte { + if x != nil { + return x.Excess + } + return nil +} + +func (x *TransactionKernel) GetExcessSig() *types.Signature { + if x != nil { + return x.ExcessSig + } + return nil +} + +func (x *TransactionKernel) GetHash() []byte { + if x != nil { + return x.Hash + } + return nil +} + +func (x *TransactionKernel) GetVersion() uint32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *TransactionKernel) GetBurnCommitment() []byte { + if x != nil { + return x.BurnCommitment + } + return nil +} + +// A transaction input. +// +// Primarily a reference to an output being spent by the transaction. +type TransactionInput struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The features of the output being spent. We will check maturity for all outputs. + Features *OutputFeatures `protobuf:"bytes,1,opt,name=features,proto3" json:"features,omitempty"` + // The commitment referencing the output being spent. + Commitment []byte `protobuf:"bytes,2,opt,name=commitment,proto3" json:"commitment,omitempty"` + // Hash of the input, as it appears in the MMR + Hash []byte `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty"` + // The serialised script + Script []byte `protobuf:"bytes,4,opt,name=script,proto3" json:"script,omitempty"` + // The script input data, if any + InputData []byte `protobuf:"bytes,5,opt,name=input_data,json=inputData,proto3" json:"input_data,omitempty"` + // A signature with k_s, signing the script, input data, and mined height + ScriptSignature *types.ComAndPubSignature `protobuf:"bytes,7,opt,name=script_signature,json=scriptSignature,proto3" json:"script_signature,omitempty"` + // The offset public key, K_O + SenderOffsetPublicKey []byte `protobuf:"bytes,8,opt,name=sender_offset_public_key,json=senderOffsetPublicKey,proto3" json:"sender_offset_public_key,omitempty"` + // The hash of the output this input is spending + OutputHash []byte `protobuf:"bytes,9,opt,name=output_hash,json=outputHash,proto3" json:"output_hash,omitempty"` + // Covenant + Covenant []byte `protobuf:"bytes,10,opt,name=covenant,proto3" json:"covenant,omitempty"` + // Version + Version uint32 `protobuf:"varint,11,opt,name=version,proto3" json:"version,omitempty"` + // The encrypted data + EncryptedData []byte `protobuf:"bytes,12,opt,name=encrypted_data,json=encryptedData,proto3" json:"encrypted_data,omitempty"` + // The minimum value of the commitment that is proven by the range proof (in MicroMinotari) + MinimumValuePromise uint64 `protobuf:"varint,13,opt,name=minimum_value_promise,json=minimumValuePromise,proto3" json:"minimum_value_promise,omitempty"` + // The metadata signature for output this input is spending + MetadataSignature *types.ComAndPubSignature `protobuf:"bytes,14,opt,name=metadata_signature,json=metadataSignature,proto3" json:"metadata_signature,omitempty"` + // The rangeproof hash for output this input is spending + RangeproofHash []byte `protobuf:"bytes,15,opt,name=rangeproof_hash,json=rangeproofHash,proto3" json:"rangeproof_hash,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TransactionInput) Reset() { + *x = TransactionInput{} + mi := &file_transaction_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TransactionInput) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransactionInput) ProtoMessage() {} + +func (x *TransactionInput) ProtoReflect() protoreflect.Message { + mi := &file_transaction_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransactionInput.ProtoReflect.Descriptor instead. +func (*TransactionInput) Descriptor() ([]byte, []int) { + return file_transaction_proto_rawDescGZIP(), []int{1} +} + +func (x *TransactionInput) GetFeatures() *OutputFeatures { + if x != nil { + return x.Features + } + return nil +} + +func (x *TransactionInput) GetCommitment() []byte { + if x != nil { + return x.Commitment + } + return nil +} + +func (x *TransactionInput) GetHash() []byte { + if x != nil { + return x.Hash + } + return nil +} + +func (x *TransactionInput) GetScript() []byte { + if x != nil { + return x.Script + } + return nil +} + +func (x *TransactionInput) GetInputData() []byte { + if x != nil { + return x.InputData + } + return nil +} + +func (x *TransactionInput) GetScriptSignature() *types.ComAndPubSignature { + if x != nil { + return x.ScriptSignature + } + return nil +} + +func (x *TransactionInput) GetSenderOffsetPublicKey() []byte { + if x != nil { + return x.SenderOffsetPublicKey + } + return nil +} + +func (x *TransactionInput) GetOutputHash() []byte { + if x != nil { + return x.OutputHash + } + return nil +} + +func (x *TransactionInput) GetCovenant() []byte { + if x != nil { + return x.Covenant + } + return nil +} + +func (x *TransactionInput) GetVersion() uint32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *TransactionInput) GetEncryptedData() []byte { + if x != nil { + return x.EncryptedData + } + return nil +} + +func (x *TransactionInput) GetMinimumValuePromise() uint64 { + if x != nil { + return x.MinimumValuePromise + } + return 0 +} + +func (x *TransactionInput) GetMetadataSignature() *types.ComAndPubSignature { + if x != nil { + return x.MetadataSignature + } + return nil +} + +func (x *TransactionInput) GetRangeproofHash() []byte { + if x != nil { + return x.RangeproofHash + } + return nil +} + +// Output for a transaction, defining the new ownership of coins that are being transferred. The commitment is a +// blinded value for the output while the range proof guarantees the commitment includes a positive value without +// overflow and the ownership of the private key. +type TransactionOutput struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Options for an output's structure or use + Features *OutputFeatures `protobuf:"bytes,1,opt,name=features,proto3" json:"features,omitempty"` + // The homomorphic commitment representing the output amount + Commitment []byte `protobuf:"bytes,2,opt,name=commitment,proto3" json:"commitment,omitempty"` + // A proof that the commitment is in the right range + RangeProof *types.RangeProof `protobuf:"bytes,3,opt,name=range_proof,json=rangeProof,proto3" json:"range_proof,omitempty"` + // The hash of the output, as it appears in the MMR + Hash []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` + // Tari script serialised script + Script []byte `protobuf:"bytes,5,opt,name=script,proto3" json:"script,omitempty"` + // Tari script offset public key, K_O + SenderOffsetPublicKey []byte `protobuf:"bytes,6,opt,name=sender_offset_public_key,json=senderOffsetPublicKey,proto3" json:"sender_offset_public_key,omitempty"` + // Metadata signature with the homomorphic commitment private values (amount and blinding factor) and the sender + // offset private key + MetadataSignature *types.ComAndPubSignature `protobuf:"bytes,7,opt,name=metadata_signature,json=metadataSignature,proto3" json:"metadata_signature,omitempty"` + // Covenant + Covenant []byte `protobuf:"bytes,8,opt,name=covenant,proto3" json:"covenant,omitempty"` + // Version + Version uint32 `protobuf:"varint,9,opt,name=version,proto3" json:"version,omitempty"` + // Encrypted Pedersen commitment openings (value and mask) for the output + EncryptedData []byte `protobuf:"bytes,10,opt,name=encrypted_data,json=encryptedData,proto3" json:"encrypted_data,omitempty"` + // The minimum value of the commitment that is proven by the range proof (in MicroMinotari) + MinimumValuePromise uint64 `protobuf:"varint,11,opt,name=minimum_value_promise,json=minimumValuePromise,proto3" json:"minimum_value_promise,omitempty"` + // Payment reference (PayRef) - 32-byte Blake2b hash of (block_hash || output_hash) + // This provides a unique, deterministic reference for the output that can be used + // for payment verification without revealing wallet ownership + PaymentReference []byte `protobuf:"bytes,12,opt,name=payment_reference,json=paymentReference,proto3" json:"payment_reference,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TransactionOutput) Reset() { + *x = TransactionOutput{} + mi := &file_transaction_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TransactionOutput) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransactionOutput) ProtoMessage() {} + +func (x *TransactionOutput) ProtoReflect() protoreflect.Message { + mi := &file_transaction_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransactionOutput.ProtoReflect.Descriptor instead. +func (*TransactionOutput) Descriptor() ([]byte, []int) { + return file_transaction_proto_rawDescGZIP(), []int{2} +} + +func (x *TransactionOutput) GetFeatures() *OutputFeatures { + if x != nil { + return x.Features + } + return nil +} + +func (x *TransactionOutput) GetCommitment() []byte { + if x != nil { + return x.Commitment + } + return nil +} + +func (x *TransactionOutput) GetRangeProof() *types.RangeProof { + if x != nil { + return x.RangeProof + } + return nil +} + +func (x *TransactionOutput) GetHash() []byte { + if x != nil { + return x.Hash + } + return nil +} + +func (x *TransactionOutput) GetScript() []byte { + if x != nil { + return x.Script + } + return nil +} + +func (x *TransactionOutput) GetSenderOffsetPublicKey() []byte { + if x != nil { + return x.SenderOffsetPublicKey + } + return nil +} + +func (x *TransactionOutput) GetMetadataSignature() *types.ComAndPubSignature { + if x != nil { + return x.MetadataSignature + } + return nil +} + +func (x *TransactionOutput) GetCovenant() []byte { + if x != nil { + return x.Covenant + } + return nil +} + +func (x *TransactionOutput) GetVersion() uint32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *TransactionOutput) GetEncryptedData() []byte { + if x != nil { + return x.EncryptedData + } + return nil +} + +func (x *TransactionOutput) GetMinimumValuePromise() uint64 { + if x != nil { + return x.MinimumValuePromise + } + return 0 +} + +func (x *TransactionOutput) GetPaymentReference() []byte { + if x != nil { + return x.PaymentReference + } + return nil +} + +// Options for UTXOs +type OutputFeatures struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Version + Version uint32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + // The type of output, eg Coinbase, all of which have different consensus rules + OutputType uint32 `protobuf:"varint,2,opt,name=output_type,json=outputType,proto3" json:"output_type,omitempty"` + // The maturity of the specific UTXO. This is the min lock height at which an UTXO can be spend. Coinbase UTXO + // require a min maturity of the Coinbase_lock_height, this should be checked on receiving new blocks. + Maturity uint64 `protobuf:"varint,3,opt,name=maturity,proto3" json:"maturity,omitempty"` + // Additional arbitrary info in coinbase transactions supplied by miners + CoinbaseExtra []byte `protobuf:"bytes,4,opt,name=coinbase_extra,json=coinbaseExtra,proto3" json:"coinbase_extra,omitempty"` + // Features that are specific to a side chain + SidechainFeature *sidechain_types.SideChainFeature `protobuf:"bytes,5,opt,name=sidechain_feature,json=sidechainFeature,proto3" json:"sidechain_feature,omitempty"` + // The type of range proof used in the output + RangeProofType uint32 `protobuf:"varint,6,opt,name=range_proof_type,json=rangeProofType,proto3" json:"range_proof_type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OutputFeatures) Reset() { + *x = OutputFeatures{} + mi := &file_transaction_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OutputFeatures) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OutputFeatures) ProtoMessage() {} + +func (x *OutputFeatures) ProtoReflect() protoreflect.Message { + mi := &file_transaction_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OutputFeatures.ProtoReflect.Descriptor instead. +func (*OutputFeatures) Descriptor() ([]byte, []int) { + return file_transaction_proto_rawDescGZIP(), []int{3} +} + +func (x *OutputFeatures) GetVersion() uint32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *OutputFeatures) GetOutputType() uint32 { + if x != nil { + return x.OutputType + } + return 0 +} + +func (x *OutputFeatures) GetMaturity() uint64 { + if x != nil { + return x.Maturity + } + return 0 +} + +func (x *OutputFeatures) GetCoinbaseExtra() []byte { + if x != nil { + return x.CoinbaseExtra + } + return nil +} + +func (x *OutputFeatures) GetSidechainFeature() *sidechain_types.SideChainFeature { + if x != nil { + return x.SidechainFeature + } + return nil +} + +func (x *OutputFeatures) GetRangeProofType() uint32 { + if x != nil { + return x.RangeProofType + } + return 0 +} + +// The components of the block or transaction. The same struct can be used for either, since in Mimblewimble, +// cut-through means that blocks and transactions have the same structure. The inputs, outputs and kernels should +// be sorted by their Blake2b-256bit digest hash +type AggregateBody struct { + state protoimpl.MessageState `protogen:"open.v1"` + // List of inputs spent by the transaction. + Inputs []*TransactionInput `protobuf:"bytes,1,rep,name=inputs,proto3" json:"inputs,omitempty"` + // List of outputs the transaction produces. + Outputs []*TransactionOutput `protobuf:"bytes,2,rep,name=outputs,proto3" json:"outputs,omitempty"` + // Kernels contain the excesses and their signatures for transaction + Kernels []*TransactionKernel `protobuf:"bytes,3,rep,name=kernels,proto3" json:"kernels,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AggregateBody) Reset() { + *x = AggregateBody{} + mi := &file_transaction_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AggregateBody) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AggregateBody) ProtoMessage() {} + +func (x *AggregateBody) ProtoReflect() protoreflect.Message { + mi := &file_transaction_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AggregateBody.ProtoReflect.Descriptor instead. +func (*AggregateBody) Descriptor() ([]byte, []int) { + return file_transaction_proto_rawDescGZIP(), []int{4} +} + +func (x *AggregateBody) GetInputs() []*TransactionInput { + if x != nil { + return x.Inputs + } + return nil +} + +func (x *AggregateBody) GetOutputs() []*TransactionOutput { + if x != nil { + return x.Outputs + } + return nil +} + +func (x *AggregateBody) GetKernels() []*TransactionKernel { + if x != nil { + return x.Kernels + } + return nil +} + +// A transaction which consists of a kernel offset and an aggregate body made up of inputs, outputs and kernels. +type Transaction struct { + state protoimpl.MessageState `protogen:"open.v1"` + Offset []byte `protobuf:"bytes,1,opt,name=offset,proto3" json:"offset,omitempty"` + Body *AggregateBody `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` + ScriptOffset []byte `protobuf:"bytes,3,opt,name=script_offset,json=scriptOffset,proto3" json:"script_offset,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Transaction) Reset() { + *x = Transaction{} + mi := &file_transaction_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Transaction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Transaction) ProtoMessage() {} + +func (x *Transaction) ProtoReflect() protoreflect.Message { + mi := &file_transaction_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Transaction.ProtoReflect.Descriptor instead. +func (*Transaction) Descriptor() ([]byte, []int) { + return file_transaction_proto_rawDescGZIP(), []int{5} +} + +func (x *Transaction) GetOffset() []byte { + if x != nil { + return x.Offset + } + return nil +} + +func (x *Transaction) GetBody() *AggregateBody { + if x != nil { + return x.Body + } + return nil +} + +func (x *Transaction) GetScriptOffset() []byte { + if x != nil { + return x.ScriptOffset + } + return nil +} + +type UnblindedOutput struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Value of the output + Value uint64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` + // Spending key of the output + SpendingKey []byte `protobuf:"bytes,2,opt,name=spending_key,json=spendingKey,proto3" json:"spending_key,omitempty"` + // Options for an output's structure or use + Features *OutputFeatures `protobuf:"bytes,3,opt,name=features,proto3" json:"features,omitempty"` + // Tari script serialised script + Script []byte `protobuf:"bytes,4,opt,name=script,proto3" json:"script,omitempty"` + // Tari script input data for spending + InputData []byte `protobuf:"bytes,5,opt,name=input_data,json=inputData,proto3" json:"input_data,omitempty"` + // Tari script private key + ScriptPrivateKey []byte `protobuf:"bytes,7,opt,name=script_private_key,json=scriptPrivateKey,proto3" json:"script_private_key,omitempty"` + // Tari script offset pubkey, K_O + SenderOffsetPublicKey []byte `protobuf:"bytes,8,opt,name=sender_offset_public_key,json=senderOffsetPublicKey,proto3" json:"sender_offset_public_key,omitempty"` + // UTXO signature with the script offset private key, k_O + MetadataSignature *types.ComAndPubSignature `protobuf:"bytes,9,opt,name=metadata_signature,json=metadataSignature,proto3" json:"metadata_signature,omitempty"` + // The minimum height the script allows this output to be spent + ScriptLockHeight uint64 `protobuf:"varint,10,opt,name=script_lock_height,json=scriptLockHeight,proto3" json:"script_lock_height,omitempty"` + // Covenant + Covenant []byte `protobuf:"bytes,11,opt,name=covenant,proto3" json:"covenant,omitempty"` + // Encrypted data + EncryptedData []byte `protobuf:"bytes,12,opt,name=encrypted_data,json=encryptedData,proto3" json:"encrypted_data,omitempty"` + // The minimum value of the commitment that is proven by the range proof (in MicroMinotari) + MinimumValuePromise uint64 `protobuf:"varint,13,opt,name=minimum_value_promise,json=minimumValuePromise,proto3" json:"minimum_value_promise,omitempty"` + // The range proof + RangeProof *types.RangeProof `protobuf:"bytes,14,opt,name=range_proof,json=rangeProof,proto3" json:"range_proof,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UnblindedOutput) Reset() { + *x = UnblindedOutput{} + mi := &file_transaction_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UnblindedOutput) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnblindedOutput) ProtoMessage() {} + +func (x *UnblindedOutput) ProtoReflect() protoreflect.Message { + mi := &file_transaction_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnblindedOutput.ProtoReflect.Descriptor instead. +func (*UnblindedOutput) Descriptor() ([]byte, []int) { + return file_transaction_proto_rawDescGZIP(), []int{6} +} + +func (x *UnblindedOutput) GetValue() uint64 { + if x != nil { + return x.Value + } + return 0 +} + +func (x *UnblindedOutput) GetSpendingKey() []byte { + if x != nil { + return x.SpendingKey + } + return nil +} + +func (x *UnblindedOutput) GetFeatures() *OutputFeatures { + if x != nil { + return x.Features + } + return nil +} + +func (x *UnblindedOutput) GetScript() []byte { + if x != nil { + return x.Script + } + return nil +} + +func (x *UnblindedOutput) GetInputData() []byte { + if x != nil { + return x.InputData + } + return nil +} + +func (x *UnblindedOutput) GetScriptPrivateKey() []byte { + if x != nil { + return x.ScriptPrivateKey + } + return nil +} + +func (x *UnblindedOutput) GetSenderOffsetPublicKey() []byte { + if x != nil { + return x.SenderOffsetPublicKey + } + return nil +} + +func (x *UnblindedOutput) GetMetadataSignature() *types.ComAndPubSignature { + if x != nil { + return x.MetadataSignature + } + return nil +} + +func (x *UnblindedOutput) GetScriptLockHeight() uint64 { + if x != nil { + return x.ScriptLockHeight + } + return 0 +} + +func (x *UnblindedOutput) GetCovenant() []byte { + if x != nil { + return x.Covenant + } + return nil +} + +func (x *UnblindedOutput) GetEncryptedData() []byte { + if x != nil { + return x.EncryptedData + } + return nil +} + +func (x *UnblindedOutput) GetMinimumValuePromise() uint64 { + if x != nil { + return x.MinimumValuePromise + } + return 0 +} + +func (x *UnblindedOutput) GetRangeProof() *types.RangeProof { + if x != nil { + return x.RangeProof + } + return nil +} + +var File_transaction_proto protoreflect.FileDescriptor + +const file_transaction_proto_rawDesc = "" + + "\n" + + "\x11transaction.proto\x12\btari.rpc\x1a\vtypes.proto\x1a\x15sidechain_types.proto\"\x85\x02\n" + + "\x11TransactionKernel\x12\x1a\n" + + "\bfeatures\x18\x01 \x01(\rR\bfeatures\x12\x10\n" + + "\x03fee\x18\x02 \x01(\x04R\x03fee\x12\x1f\n" + + "\vlock_height\x18\x03 \x01(\x04R\n" + + "lockHeight\x12\x16\n" + + "\x06excess\x18\x06 \x01(\fR\x06excess\x122\n" + + "\n" + + "excess_sig\x18\a \x01(\v2\x13.tari.rpc.SignatureR\texcessSig\x12\x12\n" + + "\x04hash\x18\b \x01(\fR\x04hash\x12\x18\n" + + "\aversion\x18\t \x01(\rR\aversion\x12'\n" + + "\x0fburn_commitment\x18\n" + + " \x01(\fR\x0eburnCommitment\"\xdd\x04\n" + + "\x10TransactionInput\x124\n" + + "\bfeatures\x18\x01 \x01(\v2\x18.tari.rpc.OutputFeaturesR\bfeatures\x12\x1e\n" + + "\n" + + "commitment\x18\x02 \x01(\fR\n" + + "commitment\x12\x12\n" + + "\x04hash\x18\x03 \x01(\fR\x04hash\x12\x16\n" + + "\x06script\x18\x04 \x01(\fR\x06script\x12\x1d\n" + + "\n" + + "input_data\x18\x05 \x01(\fR\tinputData\x12G\n" + + "\x10script_signature\x18\a \x01(\v2\x1c.tari.rpc.ComAndPubSignatureR\x0fscriptSignature\x127\n" + + "\x18sender_offset_public_key\x18\b \x01(\fR\x15senderOffsetPublicKey\x12\x1f\n" + + "\voutput_hash\x18\t \x01(\fR\n" + + "outputHash\x12\x1a\n" + + "\bcovenant\x18\n" + + " \x01(\fR\bcovenant\x12\x18\n" + + "\aversion\x18\v \x01(\rR\aversion\x12%\n" + + "\x0eencrypted_data\x18\f \x01(\fR\rencryptedData\x122\n" + + "\x15minimum_value_promise\x18\r \x01(\x04R\x13minimumValuePromise\x12K\n" + + "\x12metadata_signature\x18\x0e \x01(\v2\x1c.tari.rpc.ComAndPubSignatureR\x11metadataSignature\x12'\n" + + "\x0frangeproof_hash\x18\x0f \x01(\fR\x0erangeproofHash\"\x90\x04\n" + + "\x11TransactionOutput\x124\n" + + "\bfeatures\x18\x01 \x01(\v2\x18.tari.rpc.OutputFeaturesR\bfeatures\x12\x1e\n" + + "\n" + + "commitment\x18\x02 \x01(\fR\n" + + "commitment\x125\n" + + "\vrange_proof\x18\x03 \x01(\v2\x14.tari.rpc.RangeProofR\n" + + "rangeProof\x12\x12\n" + + "\x04hash\x18\x04 \x01(\fR\x04hash\x12\x16\n" + + "\x06script\x18\x05 \x01(\fR\x06script\x127\n" + + "\x18sender_offset_public_key\x18\x06 \x01(\fR\x15senderOffsetPublicKey\x12K\n" + + "\x12metadata_signature\x18\a \x01(\v2\x1c.tari.rpc.ComAndPubSignatureR\x11metadataSignature\x12\x1a\n" + + "\bcovenant\x18\b \x01(\fR\bcovenant\x12\x18\n" + + "\aversion\x18\t \x01(\rR\aversion\x12%\n" + + "\x0eencrypted_data\x18\n" + + " \x01(\fR\rencryptedData\x122\n" + + "\x15minimum_value_promise\x18\v \x01(\x04R\x13minimumValuePromise\x12+\n" + + "\x11payment_reference\x18\f \x01(\fR\x10paymentReference\"\x81\x02\n" + + "\x0eOutputFeatures\x12\x18\n" + + "\aversion\x18\x01 \x01(\rR\aversion\x12\x1f\n" + + "\voutput_type\x18\x02 \x01(\rR\n" + + "outputType\x12\x1a\n" + + "\bmaturity\x18\x03 \x01(\x04R\bmaturity\x12%\n" + + "\x0ecoinbase_extra\x18\x04 \x01(\fR\rcoinbaseExtra\x12G\n" + + "\x11sidechain_feature\x18\x05 \x01(\v2\x1a.tari.rpc.SideChainFeatureR\x10sidechainFeature\x12(\n" + + "\x10range_proof_type\x18\x06 \x01(\rR\x0erangeProofType\"\xb1\x01\n" + + "\rAggregateBody\x122\n" + + "\x06inputs\x18\x01 \x03(\v2\x1a.tari.rpc.TransactionInputR\x06inputs\x125\n" + + "\aoutputs\x18\x02 \x03(\v2\x1b.tari.rpc.TransactionOutputR\aoutputs\x125\n" + + "\akernels\x18\x03 \x03(\v2\x1b.tari.rpc.TransactionKernelR\akernels\"w\n" + + "\vTransaction\x12\x16\n" + + "\x06offset\x18\x01 \x01(\fR\x06offset\x12+\n" + + "\x04body\x18\x02 \x01(\v2\x17.tari.rpc.AggregateBodyR\x04body\x12#\n" + + "\rscript_offset\x18\x03 \x01(\fR\fscriptOffset\"\xc7\x04\n" + + "\x0fUnblindedOutput\x12\x14\n" + + "\x05value\x18\x01 \x01(\x04R\x05value\x12!\n" + + "\fspending_key\x18\x02 \x01(\fR\vspendingKey\x124\n" + + "\bfeatures\x18\x03 \x01(\v2\x18.tari.rpc.OutputFeaturesR\bfeatures\x12\x16\n" + + "\x06script\x18\x04 \x01(\fR\x06script\x12\x1d\n" + + "\n" + + "input_data\x18\x05 \x01(\fR\tinputData\x12,\n" + + "\x12script_private_key\x18\a \x01(\fR\x10scriptPrivateKey\x127\n" + + "\x18sender_offset_public_key\x18\b \x01(\fR\x15senderOffsetPublicKey\x12K\n" + + "\x12metadata_signature\x18\t \x01(\v2\x1c.tari.rpc.ComAndPubSignatureR\x11metadataSignature\x12,\n" + + "\x12script_lock_height\x18\n" + + " \x01(\x04R\x10scriptLockHeight\x12\x1a\n" + + "\bcovenant\x18\v \x01(\fR\bcovenant\x12%\n" + + "\x0eencrypted_data\x18\f \x01(\fR\rencryptedData\x122\n" + + "\x15minimum_value_promise\x18\r \x01(\x04R\x13minimumValuePromise\x125\n" + + "\vrange_proof\x18\x0e \x01(\v2\x14.tari.rpc.RangeProofR\n" + + "rangeProofB0Z.pool/internal/gbt/tari/transaction;transactionb\x06proto3" + +var ( + file_transaction_proto_rawDescOnce sync.Once + file_transaction_proto_rawDescData []byte +) + +func file_transaction_proto_rawDescGZIP() []byte { + file_transaction_proto_rawDescOnce.Do(func() { + file_transaction_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_transaction_proto_rawDesc), len(file_transaction_proto_rawDesc))) + }) + return file_transaction_proto_rawDescData +} + +var file_transaction_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_transaction_proto_goTypes = []any{ + (*TransactionKernel)(nil), // 0: tari.rpc.TransactionKernel + (*TransactionInput)(nil), // 1: tari.rpc.TransactionInput + (*TransactionOutput)(nil), // 2: tari.rpc.TransactionOutput + (*OutputFeatures)(nil), // 3: tari.rpc.OutputFeatures + (*AggregateBody)(nil), // 4: tari.rpc.AggregateBody + (*Transaction)(nil), // 5: tari.rpc.Transaction + (*UnblindedOutput)(nil), // 6: tari.rpc.UnblindedOutput + (*types.Signature)(nil), // 7: tari.rpc.Signature + (*types.ComAndPubSignature)(nil), // 8: tari.rpc.ComAndPubSignature + (*types.RangeProof)(nil), // 9: tari.rpc.RangeProof + (*sidechain_types.SideChainFeature)(nil), // 10: tari.rpc.SideChainFeature +} +var file_transaction_proto_depIdxs = []int32{ + 7, // 0: tari.rpc.TransactionKernel.excess_sig:type_name -> tari.rpc.Signature + 3, // 1: tari.rpc.TransactionInput.features:type_name -> tari.rpc.OutputFeatures + 8, // 2: tari.rpc.TransactionInput.script_signature:type_name -> tari.rpc.ComAndPubSignature + 8, // 3: tari.rpc.TransactionInput.metadata_signature:type_name -> tari.rpc.ComAndPubSignature + 3, // 4: tari.rpc.TransactionOutput.features:type_name -> tari.rpc.OutputFeatures + 9, // 5: tari.rpc.TransactionOutput.range_proof:type_name -> tari.rpc.RangeProof + 8, // 6: tari.rpc.TransactionOutput.metadata_signature:type_name -> tari.rpc.ComAndPubSignature + 10, // 7: tari.rpc.OutputFeatures.sidechain_feature:type_name -> tari.rpc.SideChainFeature + 1, // 8: tari.rpc.AggregateBody.inputs:type_name -> tari.rpc.TransactionInput + 2, // 9: tari.rpc.AggregateBody.outputs:type_name -> tari.rpc.TransactionOutput + 0, // 10: tari.rpc.AggregateBody.kernels:type_name -> tari.rpc.TransactionKernel + 4, // 11: tari.rpc.Transaction.body:type_name -> tari.rpc.AggregateBody + 3, // 12: tari.rpc.UnblindedOutput.features:type_name -> tari.rpc.OutputFeatures + 8, // 13: tari.rpc.UnblindedOutput.metadata_signature:type_name -> tari.rpc.ComAndPubSignature + 9, // 14: tari.rpc.UnblindedOutput.range_proof:type_name -> tari.rpc.RangeProof + 15, // [15:15] is the sub-list for method output_type + 15, // [15:15] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name +} + +func init() { file_transaction_proto_init() } +func file_transaction_proto_init() { + if File_transaction_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_transaction_proto_rawDesc), len(file_transaction_proto_rawDesc)), + NumEnums: 0, + NumMessages: 7, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_transaction_proto_goTypes, + DependencyIndexes: file_transaction_proto_depIdxs, + MessageInfos: file_transaction_proto_msgTypes, + }.Build() + File_transaction_proto = out.File + file_transaction_proto_goTypes = nil + file_transaction_proto_depIdxs = nil +} diff --git a/internal/server/proxy/proto/types.proto b/internal/server/proxy/proto/types.proto new file mode 100644 index 0000000..d25b5ad --- /dev/null +++ b/internal/server/proxy/proto/types.proto @@ -0,0 +1,147 @@ +// Copyright 2020. The Tari Project +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +// following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the +// following disclaimer in the documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote +// products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +syntax = "proto3"; + +package tari.rpc; + +/// An unsigned range interface to more accurately represent Rust native Range's +message Range { + uint64 min = 1; + uint64 max = 2; +} + +/// An Empty placeholder for endpoints without request parameters +message Empty {} + +/// Define an interface for block height +message BlockHeight { + uint64 block_height = 1; +} + +// Define the explicit Signature implementation for the Minotari base layer. A different signature scheme can be +// employed by redefining this type. +message Signature { + bytes public_nonce = 1; + bytes signature = 2; +} + +// Define the explicit ComAndPubSignature implementation for the Minotari base layer. A different signature scheme can be +// employed by redefining this type. +message ComAndPubSignature { + bytes ephemeral_commitment = 1; + bytes ephemeral_pubkey = 2; + bytes u_a = 3; + bytes u_x = 4; + bytes u_y = 5; +} + +// Define the explicit CommitmentSignature implementation for the Minotari base layer. A different signature scheme can be +// employed by redefining this type +message CommitmentSignature { + bytes public_nonce = 1; + bytes u = 2; + bytes v = 3; +} + +/// PoW Algorithm constants +message PowAlgorithmConstants { + uint64 min_difficulty = 2; + uint64 max_difficulty = 3; + uint64 target_time = 4; +} + +/// Weight params +message WeightParams { + uint64 kernel_weight = 1; + uint64 input_weight = 2; + uint64 output_weight = 3; + uint64 features_and_scripts_bytes_per_gram = 4; +} + +/// Output version +message OutputsVersion { + Range outputs = 1; + Range features = 2; +} + +/// Output types +enum OutputType { + STANDARD = 0; + COINBASE = 1; + BURN = 2; + VALIDATOR_NODE_REGISTRATION = 3; + CODE_TEMPLATE_REGISTRATION = 4; +} + +/// Range proof types +enum RangeProofType { + BULLETPROOF_PLUS = 0; + REVEALED_VALUE = 1; +} + +message PermittedRangeProofs { + OutputType output_type = 1; + repeated RangeProofType range_proof_types = 2; +} + +/// Range proof +message RangeProof { + bytes proof_bytes = 1; +} + +/// Consensus Constants response +message ConsensusConstants { + uint64 coinbase_min_maturity = 1; + uint32 blockchain_version = 2; + uint64 future_time_limit = 3; + uint64 difficulty_block_window = 5; + uint64 max_block_transaction_weight = 7; + uint64 pow_algo_count = 8; + uint64 median_timestamp_count = 9; + uint64 emission_initial = 10; + repeated uint64 emission_decay = 11; + uint64 emission_tail = 12 [deprecated=true]; + uint64 min_sha3x_pow_difficulty = 13; + uint64 block_weight_inputs = 14; + uint64 block_weight_outputs = 15; + uint64 block_weight_kernels = 16; + uint64 pre_mine_value = 17; + uint64 max_script_byte_size = 18; + uint64 validator_node_validity_period = 19; + uint64 effective_from_height = 20; + Range valid_blockchain_version_range = 21; + uint64 max_randomx_seed_height = 22; + map proof_of_work = 23; + WeightParams transaction_weight = 24; + Range input_version_range = 26; + OutputsVersion output_version_range = 27; + Range kernel_version_range = 28; + repeated OutputType permitted_output_types = 29; + uint64 epoch_length = 30; + uint64 validator_node_registration_min_deposit_amount = 31; + uint64 validator_node_registration_min_lock_height = 32; + uint64 validator_node_registration_shuffle_interval_epoch = 33; + repeated PermittedRangeProofs permitted_range_proof_types = 34; + uint64 inflation_bips = 35; + uint64 tail_epoch_length = 36; + uint64 max_block_coinbase_count = 37; +} diff --git a/internal/server/proxy/proto/types/types.pb.go b/internal/server/proxy/proto/types/types.pb.go new file mode 100644 index 0000000..bbba83f --- /dev/null +++ b/internal/server/proxy/proto/types/types.pb.go @@ -0,0 +1,1239 @@ +// Copyright 2020. The Tari Project +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +// following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the +// following disclaimer in the documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote +// products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v3.6.1 +// source: types.proto + +package types + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// / Output types +type OutputType int32 + +const ( + OutputType_STANDARD OutputType = 0 + OutputType_COINBASE OutputType = 1 + OutputType_BURN OutputType = 2 + OutputType_VALIDATOR_NODE_REGISTRATION OutputType = 3 + OutputType_CODE_TEMPLATE_REGISTRATION OutputType = 4 +) + +// Enum value maps for OutputType. +var ( + OutputType_name = map[int32]string{ + 0: "STANDARD", + 1: "COINBASE", + 2: "BURN", + 3: "VALIDATOR_NODE_REGISTRATION", + 4: "CODE_TEMPLATE_REGISTRATION", + } + OutputType_value = map[string]int32{ + "STANDARD": 0, + "COINBASE": 1, + "BURN": 2, + "VALIDATOR_NODE_REGISTRATION": 3, + "CODE_TEMPLATE_REGISTRATION": 4, + } +) + +func (x OutputType) Enum() *OutputType { + p := new(OutputType) + *p = x + return p +} + +func (x OutputType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OutputType) Descriptor() protoreflect.EnumDescriptor { + return file_types_proto_enumTypes[0].Descriptor() +} + +func (OutputType) Type() protoreflect.EnumType { + return &file_types_proto_enumTypes[0] +} + +func (x OutputType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use OutputType.Descriptor instead. +func (OutputType) EnumDescriptor() ([]byte, []int) { + return file_types_proto_rawDescGZIP(), []int{0} +} + +// / Range proof types +type RangeProofType int32 + +const ( + RangeProofType_BULLETPROOF_PLUS RangeProofType = 0 + RangeProofType_REVEALED_VALUE RangeProofType = 1 +) + +// Enum value maps for RangeProofType. +var ( + RangeProofType_name = map[int32]string{ + 0: "BULLETPROOF_PLUS", + 1: "REVEALED_VALUE", + } + RangeProofType_value = map[string]int32{ + "BULLETPROOF_PLUS": 0, + "REVEALED_VALUE": 1, + } +) + +func (x RangeProofType) Enum() *RangeProofType { + p := new(RangeProofType) + *p = x + return p +} + +func (x RangeProofType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RangeProofType) Descriptor() protoreflect.EnumDescriptor { + return file_types_proto_enumTypes[1].Descriptor() +} + +func (RangeProofType) Type() protoreflect.EnumType { + return &file_types_proto_enumTypes[1] +} + +func (x RangeProofType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RangeProofType.Descriptor instead. +func (RangeProofType) EnumDescriptor() ([]byte, []int) { + return file_types_proto_rawDescGZIP(), []int{1} +} + +// / An unsigned range interface to more accurately represent Rust native Range's +type Range struct { + state protoimpl.MessageState `protogen:"open.v1"` + Min uint64 `protobuf:"varint,1,opt,name=min,proto3" json:"min,omitempty"` + Max uint64 `protobuf:"varint,2,opt,name=max,proto3" json:"max,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Range) Reset() { + *x = Range{} + mi := &file_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Range) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Range) ProtoMessage() {} + +func (x *Range) ProtoReflect() protoreflect.Message { + mi := &file_types_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Range.ProtoReflect.Descriptor instead. +func (*Range) Descriptor() ([]byte, []int) { + return file_types_proto_rawDescGZIP(), []int{0} +} + +func (x *Range) GetMin() uint64 { + if x != nil { + return x.Min + } + return 0 +} + +func (x *Range) GetMax() uint64 { + if x != nil { + return x.Max + } + return 0 +} + +// / An Empty placeholder for endpoints without request parameters +type Empty struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Empty) Reset() { + *x = Empty{} + mi := &file_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Empty) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Empty) ProtoMessage() {} + +func (x *Empty) ProtoReflect() protoreflect.Message { + mi := &file_types_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Empty.ProtoReflect.Descriptor instead. +func (*Empty) Descriptor() ([]byte, []int) { + return file_types_proto_rawDescGZIP(), []int{1} +} + +// / Define an interface for block height +type BlockHeight struct { + state protoimpl.MessageState `protogen:"open.v1"` + BlockHeight uint64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BlockHeight) Reset() { + *x = BlockHeight{} + mi := &file_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlockHeight) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockHeight) ProtoMessage() {} + +func (x *BlockHeight) ProtoReflect() protoreflect.Message { + mi := &file_types_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockHeight.ProtoReflect.Descriptor instead. +func (*BlockHeight) Descriptor() ([]byte, []int) { + return file_types_proto_rawDescGZIP(), []int{2} +} + +func (x *BlockHeight) GetBlockHeight() uint64 { + if x != nil { + return x.BlockHeight + } + return 0 +} + +// Define the explicit Signature implementation for the Minotari base layer. A different signature scheme can be +// employed by redefining this type. +type Signature struct { + state protoimpl.MessageState `protogen:"open.v1"` + PublicNonce []byte `protobuf:"bytes,1,opt,name=public_nonce,json=publicNonce,proto3" json:"public_nonce,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Signature) Reset() { + *x = Signature{} + mi := &file_types_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Signature) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Signature) ProtoMessage() {} + +func (x *Signature) ProtoReflect() protoreflect.Message { + mi := &file_types_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Signature.ProtoReflect.Descriptor instead. +func (*Signature) Descriptor() ([]byte, []int) { + return file_types_proto_rawDescGZIP(), []int{3} +} + +func (x *Signature) GetPublicNonce() []byte { + if x != nil { + return x.PublicNonce + } + return nil +} + +func (x *Signature) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +// Define the explicit ComAndPubSignature implementation for the Minotari base layer. A different signature scheme can be +// employed by redefining this type. +type ComAndPubSignature struct { + state protoimpl.MessageState `protogen:"open.v1"` + EphemeralCommitment []byte `protobuf:"bytes,1,opt,name=ephemeral_commitment,json=ephemeralCommitment,proto3" json:"ephemeral_commitment,omitempty"` + EphemeralPubkey []byte `protobuf:"bytes,2,opt,name=ephemeral_pubkey,json=ephemeralPubkey,proto3" json:"ephemeral_pubkey,omitempty"` + UA []byte `protobuf:"bytes,3,opt,name=u_a,json=uA,proto3" json:"u_a,omitempty"` + UX []byte `protobuf:"bytes,4,opt,name=u_x,json=uX,proto3" json:"u_x,omitempty"` + UY []byte `protobuf:"bytes,5,opt,name=u_y,json=uY,proto3" json:"u_y,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ComAndPubSignature) Reset() { + *x = ComAndPubSignature{} + mi := &file_types_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ComAndPubSignature) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ComAndPubSignature) ProtoMessage() {} + +func (x *ComAndPubSignature) ProtoReflect() protoreflect.Message { + mi := &file_types_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ComAndPubSignature.ProtoReflect.Descriptor instead. +func (*ComAndPubSignature) Descriptor() ([]byte, []int) { + return file_types_proto_rawDescGZIP(), []int{4} +} + +func (x *ComAndPubSignature) GetEphemeralCommitment() []byte { + if x != nil { + return x.EphemeralCommitment + } + return nil +} + +func (x *ComAndPubSignature) GetEphemeralPubkey() []byte { + if x != nil { + return x.EphemeralPubkey + } + return nil +} + +func (x *ComAndPubSignature) GetUA() []byte { + if x != nil { + return x.UA + } + return nil +} + +func (x *ComAndPubSignature) GetUX() []byte { + if x != nil { + return x.UX + } + return nil +} + +func (x *ComAndPubSignature) GetUY() []byte { + if x != nil { + return x.UY + } + return nil +} + +// Define the explicit CommitmentSignature implementation for the Minotari base layer. A different signature scheme can be +// employed by redefining this type +type CommitmentSignature struct { + state protoimpl.MessageState `protogen:"open.v1"` + PublicNonce []byte `protobuf:"bytes,1,opt,name=public_nonce,json=publicNonce,proto3" json:"public_nonce,omitempty"` + U []byte `protobuf:"bytes,2,opt,name=u,proto3" json:"u,omitempty"` + V []byte `protobuf:"bytes,3,opt,name=v,proto3" json:"v,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CommitmentSignature) Reset() { + *x = CommitmentSignature{} + mi := &file_types_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CommitmentSignature) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommitmentSignature) ProtoMessage() {} + +func (x *CommitmentSignature) ProtoReflect() protoreflect.Message { + mi := &file_types_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommitmentSignature.ProtoReflect.Descriptor instead. +func (*CommitmentSignature) Descriptor() ([]byte, []int) { + return file_types_proto_rawDescGZIP(), []int{5} +} + +func (x *CommitmentSignature) GetPublicNonce() []byte { + if x != nil { + return x.PublicNonce + } + return nil +} + +func (x *CommitmentSignature) GetU() []byte { + if x != nil { + return x.U + } + return nil +} + +func (x *CommitmentSignature) GetV() []byte { + if x != nil { + return x.V + } + return nil +} + +// / PoW Algorithm constants +type PowAlgorithmConstants struct { + state protoimpl.MessageState `protogen:"open.v1"` + MinDifficulty uint64 `protobuf:"varint,2,opt,name=min_difficulty,json=minDifficulty,proto3" json:"min_difficulty,omitempty"` + MaxDifficulty uint64 `protobuf:"varint,3,opt,name=max_difficulty,json=maxDifficulty,proto3" json:"max_difficulty,omitempty"` + TargetTime uint64 `protobuf:"varint,4,opt,name=target_time,json=targetTime,proto3" json:"target_time,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PowAlgorithmConstants) Reset() { + *x = PowAlgorithmConstants{} + mi := &file_types_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PowAlgorithmConstants) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PowAlgorithmConstants) ProtoMessage() {} + +func (x *PowAlgorithmConstants) ProtoReflect() protoreflect.Message { + mi := &file_types_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PowAlgorithmConstants.ProtoReflect.Descriptor instead. +func (*PowAlgorithmConstants) Descriptor() ([]byte, []int) { + return file_types_proto_rawDescGZIP(), []int{6} +} + +func (x *PowAlgorithmConstants) GetMinDifficulty() uint64 { + if x != nil { + return x.MinDifficulty + } + return 0 +} + +func (x *PowAlgorithmConstants) GetMaxDifficulty() uint64 { + if x != nil { + return x.MaxDifficulty + } + return 0 +} + +func (x *PowAlgorithmConstants) GetTargetTime() uint64 { + if x != nil { + return x.TargetTime + } + return 0 +} + +// / Weight params +type WeightParams struct { + state protoimpl.MessageState `protogen:"open.v1"` + KernelWeight uint64 `protobuf:"varint,1,opt,name=kernel_weight,json=kernelWeight,proto3" json:"kernel_weight,omitempty"` + InputWeight uint64 `protobuf:"varint,2,opt,name=input_weight,json=inputWeight,proto3" json:"input_weight,omitempty"` + OutputWeight uint64 `protobuf:"varint,3,opt,name=output_weight,json=outputWeight,proto3" json:"output_weight,omitempty"` + FeaturesAndScriptsBytesPerGram uint64 `protobuf:"varint,4,opt,name=features_and_scripts_bytes_per_gram,json=featuresAndScriptsBytesPerGram,proto3" json:"features_and_scripts_bytes_per_gram,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WeightParams) Reset() { + *x = WeightParams{} + mi := &file_types_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WeightParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WeightParams) ProtoMessage() {} + +func (x *WeightParams) ProtoReflect() protoreflect.Message { + mi := &file_types_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WeightParams.ProtoReflect.Descriptor instead. +func (*WeightParams) Descriptor() ([]byte, []int) { + return file_types_proto_rawDescGZIP(), []int{7} +} + +func (x *WeightParams) GetKernelWeight() uint64 { + if x != nil { + return x.KernelWeight + } + return 0 +} + +func (x *WeightParams) GetInputWeight() uint64 { + if x != nil { + return x.InputWeight + } + return 0 +} + +func (x *WeightParams) GetOutputWeight() uint64 { + if x != nil { + return x.OutputWeight + } + return 0 +} + +func (x *WeightParams) GetFeaturesAndScriptsBytesPerGram() uint64 { + if x != nil { + return x.FeaturesAndScriptsBytesPerGram + } + return 0 +} + +// / Output version +type OutputsVersion struct { + state protoimpl.MessageState `protogen:"open.v1"` + Outputs *Range `protobuf:"bytes,1,opt,name=outputs,proto3" json:"outputs,omitempty"` + Features *Range `protobuf:"bytes,2,opt,name=features,proto3" json:"features,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OutputsVersion) Reset() { + *x = OutputsVersion{} + mi := &file_types_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OutputsVersion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OutputsVersion) ProtoMessage() {} + +func (x *OutputsVersion) ProtoReflect() protoreflect.Message { + mi := &file_types_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OutputsVersion.ProtoReflect.Descriptor instead. +func (*OutputsVersion) Descriptor() ([]byte, []int) { + return file_types_proto_rawDescGZIP(), []int{8} +} + +func (x *OutputsVersion) GetOutputs() *Range { + if x != nil { + return x.Outputs + } + return nil +} + +func (x *OutputsVersion) GetFeatures() *Range { + if x != nil { + return x.Features + } + return nil +} + +type PermittedRangeProofs struct { + state protoimpl.MessageState `protogen:"open.v1"` + OutputType OutputType `protobuf:"varint,1,opt,name=output_type,json=outputType,proto3,enum=tari.rpc.OutputType" json:"output_type,omitempty"` + RangeProofTypes []RangeProofType `protobuf:"varint,2,rep,packed,name=range_proof_types,json=rangeProofTypes,proto3,enum=tari.rpc.RangeProofType" json:"range_proof_types,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PermittedRangeProofs) Reset() { + *x = PermittedRangeProofs{} + mi := &file_types_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PermittedRangeProofs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PermittedRangeProofs) ProtoMessage() {} + +func (x *PermittedRangeProofs) ProtoReflect() protoreflect.Message { + mi := &file_types_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PermittedRangeProofs.ProtoReflect.Descriptor instead. +func (*PermittedRangeProofs) Descriptor() ([]byte, []int) { + return file_types_proto_rawDescGZIP(), []int{9} +} + +func (x *PermittedRangeProofs) GetOutputType() OutputType { + if x != nil { + return x.OutputType + } + return OutputType_STANDARD +} + +func (x *PermittedRangeProofs) GetRangeProofTypes() []RangeProofType { + if x != nil { + return x.RangeProofTypes + } + return nil +} + +// / Range proof +type RangeProof struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProofBytes []byte `protobuf:"bytes,1,opt,name=proof_bytes,json=proofBytes,proto3" json:"proof_bytes,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RangeProof) Reset() { + *x = RangeProof{} + mi := &file_types_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RangeProof) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RangeProof) ProtoMessage() {} + +func (x *RangeProof) ProtoReflect() protoreflect.Message { + mi := &file_types_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RangeProof.ProtoReflect.Descriptor instead. +func (*RangeProof) Descriptor() ([]byte, []int) { + return file_types_proto_rawDescGZIP(), []int{10} +} + +func (x *RangeProof) GetProofBytes() []byte { + if x != nil { + return x.ProofBytes + } + return nil +} + +// / Consensus Constants response +type ConsensusConstants struct { + state protoimpl.MessageState `protogen:"open.v1"` + CoinbaseMinMaturity uint64 `protobuf:"varint,1,opt,name=coinbase_min_maturity,json=coinbaseMinMaturity,proto3" json:"coinbase_min_maturity,omitempty"` + BlockchainVersion uint32 `protobuf:"varint,2,opt,name=blockchain_version,json=blockchainVersion,proto3" json:"blockchain_version,omitempty"` + FutureTimeLimit uint64 `protobuf:"varint,3,opt,name=future_time_limit,json=futureTimeLimit,proto3" json:"future_time_limit,omitempty"` + DifficultyBlockWindow uint64 `protobuf:"varint,5,opt,name=difficulty_block_window,json=difficultyBlockWindow,proto3" json:"difficulty_block_window,omitempty"` + MaxBlockTransactionWeight uint64 `protobuf:"varint,7,opt,name=max_block_transaction_weight,json=maxBlockTransactionWeight,proto3" json:"max_block_transaction_weight,omitempty"` + PowAlgoCount uint64 `protobuf:"varint,8,opt,name=pow_algo_count,json=powAlgoCount,proto3" json:"pow_algo_count,omitempty"` + MedianTimestampCount uint64 `protobuf:"varint,9,opt,name=median_timestamp_count,json=medianTimestampCount,proto3" json:"median_timestamp_count,omitempty"` + EmissionInitial uint64 `protobuf:"varint,10,opt,name=emission_initial,json=emissionInitial,proto3" json:"emission_initial,omitempty"` + EmissionDecay []uint64 `protobuf:"varint,11,rep,packed,name=emission_decay,json=emissionDecay,proto3" json:"emission_decay,omitempty"` + // Deprecated: Marked as deprecated in types.proto. + EmissionTail uint64 `protobuf:"varint,12,opt,name=emission_tail,json=emissionTail,proto3" json:"emission_tail,omitempty"` + MinSha3XPowDifficulty uint64 `protobuf:"varint,13,opt,name=min_sha3x_pow_difficulty,json=minSha3xPowDifficulty,proto3" json:"min_sha3x_pow_difficulty,omitempty"` + BlockWeightInputs uint64 `protobuf:"varint,14,opt,name=block_weight_inputs,json=blockWeightInputs,proto3" json:"block_weight_inputs,omitempty"` + BlockWeightOutputs uint64 `protobuf:"varint,15,opt,name=block_weight_outputs,json=blockWeightOutputs,proto3" json:"block_weight_outputs,omitempty"` + BlockWeightKernels uint64 `protobuf:"varint,16,opt,name=block_weight_kernels,json=blockWeightKernels,proto3" json:"block_weight_kernels,omitempty"` + PreMineValue uint64 `protobuf:"varint,17,opt,name=pre_mine_value,json=preMineValue,proto3" json:"pre_mine_value,omitempty"` + MaxScriptByteSize uint64 `protobuf:"varint,18,opt,name=max_script_byte_size,json=maxScriptByteSize,proto3" json:"max_script_byte_size,omitempty"` + ValidatorNodeValidityPeriod uint64 `protobuf:"varint,19,opt,name=validator_node_validity_period,json=validatorNodeValidityPeriod,proto3" json:"validator_node_validity_period,omitempty"` + EffectiveFromHeight uint64 `protobuf:"varint,20,opt,name=effective_from_height,json=effectiveFromHeight,proto3" json:"effective_from_height,omitempty"` + ValidBlockchainVersionRange *Range `protobuf:"bytes,21,opt,name=valid_blockchain_version_range,json=validBlockchainVersionRange,proto3" json:"valid_blockchain_version_range,omitempty"` + MaxRandomxSeedHeight uint64 `protobuf:"varint,22,opt,name=max_randomx_seed_height,json=maxRandomxSeedHeight,proto3" json:"max_randomx_seed_height,omitempty"` + ProofOfWork map[uint32]*PowAlgorithmConstants `protobuf:"bytes,23,rep,name=proof_of_work,json=proofOfWork,proto3" json:"proof_of_work,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + TransactionWeight *WeightParams `protobuf:"bytes,24,opt,name=transaction_weight,json=transactionWeight,proto3" json:"transaction_weight,omitempty"` + InputVersionRange *Range `protobuf:"bytes,26,opt,name=input_version_range,json=inputVersionRange,proto3" json:"input_version_range,omitempty"` + OutputVersionRange *OutputsVersion `protobuf:"bytes,27,opt,name=output_version_range,json=outputVersionRange,proto3" json:"output_version_range,omitempty"` + KernelVersionRange *Range `protobuf:"bytes,28,opt,name=kernel_version_range,json=kernelVersionRange,proto3" json:"kernel_version_range,omitempty"` + PermittedOutputTypes []OutputType `protobuf:"varint,29,rep,packed,name=permitted_output_types,json=permittedOutputTypes,proto3,enum=tari.rpc.OutputType" json:"permitted_output_types,omitempty"` + EpochLength uint64 `protobuf:"varint,30,opt,name=epoch_length,json=epochLength,proto3" json:"epoch_length,omitempty"` + ValidatorNodeRegistrationMinDepositAmount uint64 `protobuf:"varint,31,opt,name=validator_node_registration_min_deposit_amount,json=validatorNodeRegistrationMinDepositAmount,proto3" json:"validator_node_registration_min_deposit_amount,omitempty"` + ValidatorNodeRegistrationMinLockHeight uint64 `protobuf:"varint,32,opt,name=validator_node_registration_min_lock_height,json=validatorNodeRegistrationMinLockHeight,proto3" json:"validator_node_registration_min_lock_height,omitempty"` + ValidatorNodeRegistrationShuffleIntervalEpoch uint64 `protobuf:"varint,33,opt,name=validator_node_registration_shuffle_interval_epoch,json=validatorNodeRegistrationShuffleIntervalEpoch,proto3" json:"validator_node_registration_shuffle_interval_epoch,omitempty"` + PermittedRangeProofTypes []*PermittedRangeProofs `protobuf:"bytes,34,rep,name=permitted_range_proof_types,json=permittedRangeProofTypes,proto3" json:"permitted_range_proof_types,omitempty"` + InflationBips uint64 `protobuf:"varint,35,opt,name=inflation_bips,json=inflationBips,proto3" json:"inflation_bips,omitempty"` + TailEpochLength uint64 `protobuf:"varint,36,opt,name=tail_epoch_length,json=tailEpochLength,proto3" json:"tail_epoch_length,omitempty"` + MaxBlockCoinbaseCount uint64 `protobuf:"varint,37,opt,name=max_block_coinbase_count,json=maxBlockCoinbaseCount,proto3" json:"max_block_coinbase_count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ConsensusConstants) Reset() { + *x = ConsensusConstants{} + mi := &file_types_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ConsensusConstants) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConsensusConstants) ProtoMessage() {} + +func (x *ConsensusConstants) ProtoReflect() protoreflect.Message { + mi := &file_types_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConsensusConstants.ProtoReflect.Descriptor instead. +func (*ConsensusConstants) Descriptor() ([]byte, []int) { + return file_types_proto_rawDescGZIP(), []int{11} +} + +func (x *ConsensusConstants) GetCoinbaseMinMaturity() uint64 { + if x != nil { + return x.CoinbaseMinMaturity + } + return 0 +} + +func (x *ConsensusConstants) GetBlockchainVersion() uint32 { + if x != nil { + return x.BlockchainVersion + } + return 0 +} + +func (x *ConsensusConstants) GetFutureTimeLimit() uint64 { + if x != nil { + return x.FutureTimeLimit + } + return 0 +} + +func (x *ConsensusConstants) GetDifficultyBlockWindow() uint64 { + if x != nil { + return x.DifficultyBlockWindow + } + return 0 +} + +func (x *ConsensusConstants) GetMaxBlockTransactionWeight() uint64 { + if x != nil { + return x.MaxBlockTransactionWeight + } + return 0 +} + +func (x *ConsensusConstants) GetPowAlgoCount() uint64 { + if x != nil { + return x.PowAlgoCount + } + return 0 +} + +func (x *ConsensusConstants) GetMedianTimestampCount() uint64 { + if x != nil { + return x.MedianTimestampCount + } + return 0 +} + +func (x *ConsensusConstants) GetEmissionInitial() uint64 { + if x != nil { + return x.EmissionInitial + } + return 0 +} + +func (x *ConsensusConstants) GetEmissionDecay() []uint64 { + if x != nil { + return x.EmissionDecay + } + return nil +} + +// Deprecated: Marked as deprecated in types.proto. +func (x *ConsensusConstants) GetEmissionTail() uint64 { + if x != nil { + return x.EmissionTail + } + return 0 +} + +func (x *ConsensusConstants) GetMinSha3XPowDifficulty() uint64 { + if x != nil { + return x.MinSha3XPowDifficulty + } + return 0 +} + +func (x *ConsensusConstants) GetBlockWeightInputs() uint64 { + if x != nil { + return x.BlockWeightInputs + } + return 0 +} + +func (x *ConsensusConstants) GetBlockWeightOutputs() uint64 { + if x != nil { + return x.BlockWeightOutputs + } + return 0 +} + +func (x *ConsensusConstants) GetBlockWeightKernels() uint64 { + if x != nil { + return x.BlockWeightKernels + } + return 0 +} + +func (x *ConsensusConstants) GetPreMineValue() uint64 { + if x != nil { + return x.PreMineValue + } + return 0 +} + +func (x *ConsensusConstants) GetMaxScriptByteSize() uint64 { + if x != nil { + return x.MaxScriptByteSize + } + return 0 +} + +func (x *ConsensusConstants) GetValidatorNodeValidityPeriod() uint64 { + if x != nil { + return x.ValidatorNodeValidityPeriod + } + return 0 +} + +func (x *ConsensusConstants) GetEffectiveFromHeight() uint64 { + if x != nil { + return x.EffectiveFromHeight + } + return 0 +} + +func (x *ConsensusConstants) GetValidBlockchainVersionRange() *Range { + if x != nil { + return x.ValidBlockchainVersionRange + } + return nil +} + +func (x *ConsensusConstants) GetMaxRandomxSeedHeight() uint64 { + if x != nil { + return x.MaxRandomxSeedHeight + } + return 0 +} + +func (x *ConsensusConstants) GetProofOfWork() map[uint32]*PowAlgorithmConstants { + if x != nil { + return x.ProofOfWork + } + return nil +} + +func (x *ConsensusConstants) GetTransactionWeight() *WeightParams { + if x != nil { + return x.TransactionWeight + } + return nil +} + +func (x *ConsensusConstants) GetInputVersionRange() *Range { + if x != nil { + return x.InputVersionRange + } + return nil +} + +func (x *ConsensusConstants) GetOutputVersionRange() *OutputsVersion { + if x != nil { + return x.OutputVersionRange + } + return nil +} + +func (x *ConsensusConstants) GetKernelVersionRange() *Range { + if x != nil { + return x.KernelVersionRange + } + return nil +} + +func (x *ConsensusConstants) GetPermittedOutputTypes() []OutputType { + if x != nil { + return x.PermittedOutputTypes + } + return nil +} + +func (x *ConsensusConstants) GetEpochLength() uint64 { + if x != nil { + return x.EpochLength + } + return 0 +} + +func (x *ConsensusConstants) GetValidatorNodeRegistrationMinDepositAmount() uint64 { + if x != nil { + return x.ValidatorNodeRegistrationMinDepositAmount + } + return 0 +} + +func (x *ConsensusConstants) GetValidatorNodeRegistrationMinLockHeight() uint64 { + if x != nil { + return x.ValidatorNodeRegistrationMinLockHeight + } + return 0 +} + +func (x *ConsensusConstants) GetValidatorNodeRegistrationShuffleIntervalEpoch() uint64 { + if x != nil { + return x.ValidatorNodeRegistrationShuffleIntervalEpoch + } + return 0 +} + +func (x *ConsensusConstants) GetPermittedRangeProofTypes() []*PermittedRangeProofs { + if x != nil { + return x.PermittedRangeProofTypes + } + return nil +} + +func (x *ConsensusConstants) GetInflationBips() uint64 { + if x != nil { + return x.InflationBips + } + return 0 +} + +func (x *ConsensusConstants) GetTailEpochLength() uint64 { + if x != nil { + return x.TailEpochLength + } + return 0 +} + +func (x *ConsensusConstants) GetMaxBlockCoinbaseCount() uint64 { + if x != nil { + return x.MaxBlockCoinbaseCount + } + return 0 +} + +var File_types_proto protoreflect.FileDescriptor + +const file_types_proto_rawDesc = "" + + "\n" + + "\vtypes.proto\x12\btari.rpc\"+\n" + + "\x05Range\x12\x10\n" + + "\x03min\x18\x01 \x01(\x04R\x03min\x12\x10\n" + + "\x03max\x18\x02 \x01(\x04R\x03max\"\a\n" + + "\x05Empty\"0\n" + + "\vBlockHeight\x12!\n" + + "\fblock_height\x18\x01 \x01(\x04R\vblockHeight\"L\n" + + "\tSignature\x12!\n" + + "\fpublic_nonce\x18\x01 \x01(\fR\vpublicNonce\x12\x1c\n" + + "\tsignature\x18\x02 \x01(\fR\tsignature\"\xa5\x01\n" + + "\x12ComAndPubSignature\x121\n" + + "\x14ephemeral_commitment\x18\x01 \x01(\fR\x13ephemeralCommitment\x12)\n" + + "\x10ephemeral_pubkey\x18\x02 \x01(\fR\x0fephemeralPubkey\x12\x0f\n" + + "\x03u_a\x18\x03 \x01(\fR\x02uA\x12\x0f\n" + + "\x03u_x\x18\x04 \x01(\fR\x02uX\x12\x0f\n" + + "\x03u_y\x18\x05 \x01(\fR\x02uY\"T\n" + + "\x13CommitmentSignature\x12!\n" + + "\fpublic_nonce\x18\x01 \x01(\fR\vpublicNonce\x12\f\n" + + "\x01u\x18\x02 \x01(\fR\x01u\x12\f\n" + + "\x01v\x18\x03 \x01(\fR\x01v\"\x86\x01\n" + + "\x15PowAlgorithmConstants\x12%\n" + + "\x0emin_difficulty\x18\x02 \x01(\x04R\rminDifficulty\x12%\n" + + "\x0emax_difficulty\x18\x03 \x01(\x04R\rmaxDifficulty\x12\x1f\n" + + "\vtarget_time\x18\x04 \x01(\x04R\n" + + "targetTime\"\xc8\x01\n" + + "\fWeightParams\x12#\n" + + "\rkernel_weight\x18\x01 \x01(\x04R\fkernelWeight\x12!\n" + + "\finput_weight\x18\x02 \x01(\x04R\vinputWeight\x12#\n" + + "\routput_weight\x18\x03 \x01(\x04R\foutputWeight\x12K\n" + + "#features_and_scripts_bytes_per_gram\x18\x04 \x01(\x04R\x1efeaturesAndScriptsBytesPerGram\"h\n" + + "\x0eOutputsVersion\x12)\n" + + "\aoutputs\x18\x01 \x01(\v2\x0f.tari.rpc.RangeR\aoutputs\x12+\n" + + "\bfeatures\x18\x02 \x01(\v2\x0f.tari.rpc.RangeR\bfeatures\"\x93\x01\n" + + "\x14PermittedRangeProofs\x125\n" + + "\voutput_type\x18\x01 \x01(\x0e2\x14.tari.rpc.OutputTypeR\n" + + "outputType\x12D\n" + + "\x11range_proof_types\x18\x02 \x03(\x0e2\x18.tari.rpc.RangeProofTypeR\x0frangeProofTypes\"-\n" + + "\n" + + "RangeProof\x12\x1f\n" + + "\vproof_bytes\x18\x01 \x01(\fR\n" + + "proofBytes\"\xed\x10\n" + + "\x12ConsensusConstants\x122\n" + + "\x15coinbase_min_maturity\x18\x01 \x01(\x04R\x13coinbaseMinMaturity\x12-\n" + + "\x12blockchain_version\x18\x02 \x01(\rR\x11blockchainVersion\x12*\n" + + "\x11future_time_limit\x18\x03 \x01(\x04R\x0ffutureTimeLimit\x126\n" + + "\x17difficulty_block_window\x18\x05 \x01(\x04R\x15difficultyBlockWindow\x12?\n" + + "\x1cmax_block_transaction_weight\x18\a \x01(\x04R\x19maxBlockTransactionWeight\x12$\n" + + "\x0epow_algo_count\x18\b \x01(\x04R\fpowAlgoCount\x124\n" + + "\x16median_timestamp_count\x18\t \x01(\x04R\x14medianTimestampCount\x12)\n" + + "\x10emission_initial\x18\n" + + " \x01(\x04R\x0femissionInitial\x12%\n" + + "\x0eemission_decay\x18\v \x03(\x04R\remissionDecay\x12'\n" + + "\remission_tail\x18\f \x01(\x04B\x02\x18\x01R\femissionTail\x127\n" + + "\x18min_sha3x_pow_difficulty\x18\r \x01(\x04R\x15minSha3xPowDifficulty\x12.\n" + + "\x13block_weight_inputs\x18\x0e \x01(\x04R\x11blockWeightInputs\x120\n" + + "\x14block_weight_outputs\x18\x0f \x01(\x04R\x12blockWeightOutputs\x120\n" + + "\x14block_weight_kernels\x18\x10 \x01(\x04R\x12blockWeightKernels\x12$\n" + + "\x0epre_mine_value\x18\x11 \x01(\x04R\fpreMineValue\x12/\n" + + "\x14max_script_byte_size\x18\x12 \x01(\x04R\x11maxScriptByteSize\x12C\n" + + "\x1evalidator_node_validity_period\x18\x13 \x01(\x04R\x1bvalidatorNodeValidityPeriod\x122\n" + + "\x15effective_from_height\x18\x14 \x01(\x04R\x13effectiveFromHeight\x12T\n" + + "\x1evalid_blockchain_version_range\x18\x15 \x01(\v2\x0f.tari.rpc.RangeR\x1bvalidBlockchainVersionRange\x125\n" + + "\x17max_randomx_seed_height\x18\x16 \x01(\x04R\x14maxRandomxSeedHeight\x12Q\n" + + "\rproof_of_work\x18\x17 \x03(\v2-.tari.rpc.ConsensusConstants.ProofOfWorkEntryR\vproofOfWork\x12E\n" + + "\x12transaction_weight\x18\x18 \x01(\v2\x16.tari.rpc.WeightParamsR\x11transactionWeight\x12?\n" + + "\x13input_version_range\x18\x1a \x01(\v2\x0f.tari.rpc.RangeR\x11inputVersionRange\x12J\n" + + "\x14output_version_range\x18\x1b \x01(\v2\x18.tari.rpc.OutputsVersionR\x12outputVersionRange\x12A\n" + + "\x14kernel_version_range\x18\x1c \x01(\v2\x0f.tari.rpc.RangeR\x12kernelVersionRange\x12J\n" + + "\x16permitted_output_types\x18\x1d \x03(\x0e2\x14.tari.rpc.OutputTypeR\x14permittedOutputTypes\x12!\n" + + "\fepoch_length\x18\x1e \x01(\x04R\vepochLength\x12a\n" + + ".validator_node_registration_min_deposit_amount\x18\x1f \x01(\x04R)validatorNodeRegistrationMinDepositAmount\x12[\n" + + "+validator_node_registration_min_lock_height\x18 \x01(\x04R&validatorNodeRegistrationMinLockHeight\x12i\n" + + "2validator_node_registration_shuffle_interval_epoch\x18! \x01(\x04R-validatorNodeRegistrationShuffleIntervalEpoch\x12]\n" + + "\x1bpermitted_range_proof_types\x18\" \x03(\v2\x1e.tari.rpc.PermittedRangeProofsR\x18permittedRangeProofTypes\x12%\n" + + "\x0einflation_bips\x18# \x01(\x04R\rinflationBips\x12*\n" + + "\x11tail_epoch_length\x18$ \x01(\x04R\x0ftailEpochLength\x127\n" + + "\x18max_block_coinbase_count\x18% \x01(\x04R\x15maxBlockCoinbaseCount\x1a_\n" + + "\x10ProofOfWorkEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\rR\x03key\x125\n" + + "\x05value\x18\x02 \x01(\v2\x1f.tari.rpc.PowAlgorithmConstantsR\x05value:\x028\x01*s\n" + + "\n" + + "OutputType\x12\f\n" + + "\bSTANDARD\x10\x00\x12\f\n" + + "\bCOINBASE\x10\x01\x12\b\n" + + "\x04BURN\x10\x02\x12\x1f\n" + + "\x1bVALIDATOR_NODE_REGISTRATION\x10\x03\x12\x1e\n" + + "\x1aCODE_TEMPLATE_REGISTRATION\x10\x04*:\n" + + "\x0eRangeProofType\x12\x14\n" + + "\x10BULLETPROOF_PLUS\x10\x00\x12\x12\n" + + "\x0eREVEALED_VALUE\x10\x01B$Z\"pool/internal/gbt/tari/types;typesb\x06proto3" + +var ( + file_types_proto_rawDescOnce sync.Once + file_types_proto_rawDescData []byte +) + +func file_types_proto_rawDescGZIP() []byte { + file_types_proto_rawDescOnce.Do(func() { + file_types_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_types_proto_rawDesc), len(file_types_proto_rawDesc))) + }) + return file_types_proto_rawDescData +} + +var file_types_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_types_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_types_proto_goTypes = []any{ + (OutputType)(0), // 0: tari.rpc.OutputType + (RangeProofType)(0), // 1: tari.rpc.RangeProofType + (*Range)(nil), // 2: tari.rpc.Range + (*Empty)(nil), // 3: tari.rpc.Empty + (*BlockHeight)(nil), // 4: tari.rpc.BlockHeight + (*Signature)(nil), // 5: tari.rpc.Signature + (*ComAndPubSignature)(nil), // 6: tari.rpc.ComAndPubSignature + (*CommitmentSignature)(nil), // 7: tari.rpc.CommitmentSignature + (*PowAlgorithmConstants)(nil), // 8: tari.rpc.PowAlgorithmConstants + (*WeightParams)(nil), // 9: tari.rpc.WeightParams + (*OutputsVersion)(nil), // 10: tari.rpc.OutputsVersion + (*PermittedRangeProofs)(nil), // 11: tari.rpc.PermittedRangeProofs + (*RangeProof)(nil), // 12: tari.rpc.RangeProof + (*ConsensusConstants)(nil), // 13: tari.rpc.ConsensusConstants + nil, // 14: tari.rpc.ConsensusConstants.ProofOfWorkEntry +} +var file_types_proto_depIdxs = []int32{ + 2, // 0: tari.rpc.OutputsVersion.outputs:type_name -> tari.rpc.Range + 2, // 1: tari.rpc.OutputsVersion.features:type_name -> tari.rpc.Range + 0, // 2: tari.rpc.PermittedRangeProofs.output_type:type_name -> tari.rpc.OutputType + 1, // 3: tari.rpc.PermittedRangeProofs.range_proof_types:type_name -> tari.rpc.RangeProofType + 2, // 4: tari.rpc.ConsensusConstants.valid_blockchain_version_range:type_name -> tari.rpc.Range + 14, // 5: tari.rpc.ConsensusConstants.proof_of_work:type_name -> tari.rpc.ConsensusConstants.ProofOfWorkEntry + 9, // 6: tari.rpc.ConsensusConstants.transaction_weight:type_name -> tari.rpc.WeightParams + 2, // 7: tari.rpc.ConsensusConstants.input_version_range:type_name -> tari.rpc.Range + 10, // 8: tari.rpc.ConsensusConstants.output_version_range:type_name -> tari.rpc.OutputsVersion + 2, // 9: tari.rpc.ConsensusConstants.kernel_version_range:type_name -> tari.rpc.Range + 0, // 10: tari.rpc.ConsensusConstants.permitted_output_types:type_name -> tari.rpc.OutputType + 11, // 11: tari.rpc.ConsensusConstants.permitted_range_proof_types:type_name -> tari.rpc.PermittedRangeProofs + 8, // 12: tari.rpc.ConsensusConstants.ProofOfWorkEntry.value:type_name -> tari.rpc.PowAlgorithmConstants + 13, // [13:13] is the sub-list for method output_type + 13, // [13:13] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name +} + +func init() { file_types_proto_init() } +func file_types_proto_init() { + if File_types_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_types_proto_rawDesc), len(file_types_proto_rawDesc)), + NumEnums: 2, + NumMessages: 13, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_types_proto_goTypes, + DependencyIndexes: file_types_proto_depIdxs, + EnumInfos: file_types_proto_enumTypes, + MessageInfos: file_types_proto_msgTypes, + }.Build() + File_types_proto = out.File + file_types_proto_goTypes = nil + file_types_proto_depIdxs = nil +} diff --git a/internal/server/proxy/proto/validator_node.proto b/internal/server/proxy/proto/validator_node.proto new file mode 100644 index 0000000..9b8d73e --- /dev/null +++ b/internal/server/proxy/proto/validator_node.proto @@ -0,0 +1,132 @@ +// Copyright 2021. The Tari Project +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +// following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the +// following disclaimer in the documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote +// products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +syntax = "proto3"; + +import "types.proto"; +import "network.proto"; +import "transaction.proto"; + +package tari.rpc; + +service ValidatorNode { + rpc GetIdentity(GetIdentityRequest) returns (GetIdentityResponse); + rpc GetMetadata(GetMetadataRequest) returns (GetMetadataResponse); + rpc GetTokenData(GetTokenDataRequest) returns (GetTokenDataResponse); +// rpc ExecuteInstruction(ExecuteInstructionRequest) returns (ExecuteInstructionResponse); + rpc InvokeReadMethod(InvokeReadMethodRequest) returns (InvokeReadMethodResponse); + rpc InvokeMethod(InvokeMethodRequest) returns (InvokeMethodResponse); + rpc GetConstitutionRequests(GetConstitutionRequestsRequest) returns (stream TransactionOutput); + rpc PublishContractAcceptance(PublishContractAcceptanceRequest) returns (PublishContractAcceptanceResponse); + rpc PublishContractUpdateProposalAcceptance(PublishContractUpdateProposalAcceptanceRequest) returns (PublishContractUpdateProposalAcceptanceResponse); +} + +message GetConstitutionRequestsRequest { + // empty +} + +message GetMetadataRequest { + // empty +} + +message PublishContractAcceptanceRequest { + bytes contract_id = 1; +} + +message PublishContractAcceptanceResponse { + string status = 1; + uint64 tx_id = 2; +} + +message PublishContractUpdateProposalAcceptanceRequest { + bytes contract_id = 1; + uint64 proposal_id = 2; +} + +message PublishContractUpdateProposalAcceptanceResponse { + string status = 1; + uint64 tx_id = 2; +} + +message GetMetadataResponse { + repeated SidechainMetadata sidechains = 1; +} + +message SidechainMetadata { + bytes asset_public_key =1; + uint64 committed_height = 2; + bytes committed_hash = 3; +} + +message GetTokenDataRequest { + bytes asset_pub_key = 1; + bytes unique_id = 2; +} + +message GetTokenDataResponse { + +} + +//message ExecuteInstructionRequest{ +// bytes asset_public_key = 1; +// uint32 template_id = 2; +// string method = 3; +// bytes args = 4; +//// bytes token_id = 5; +//// bytes signature = 6; +//} +// +//message ExecuteInstructionResponse { +// string status = 1; +// optional bytes result = 2; +//} + +message InvokeReadMethodRequest{ + bytes contract_id = 1; + uint32 template_id = 2; + string method = 3; + bytes args = 4; + bytes sender = 5; +} + +message InvokeReadMethodResponse { + bytes result = 1; + Authority authority = 2; +} + +message Authority { + bytes node_public_key =1; + bytes signature = 2; + bytes proxied_by = 3; +} + +message InvokeMethodRequest { + bytes contract_id = 1; + uint32 template_id = 2; + string method = 3; + bytes args = 4; + bytes sender = 5; +} + +message InvokeMethodResponse { + string status = 1; + bytes result = 2; +} diff --git a/internal/server/proxy/proto/wallet.proto b/internal/server/proxy/proto/wallet.proto new file mode 100644 index 0000000..5ec6d35 --- /dev/null +++ b/internal/server/proxy/proto/wallet.proto @@ -0,0 +1,1582 @@ +// Copyright 2020. The Tari Project +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +// following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the +// following disclaimer in the documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote +// products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +syntax = "proto3"; + +package tari.rpc; + +import "google/protobuf/timestamp.proto"; +import "types.proto"; +import "transaction.proto"; +import "sidechain_types.proto"; +import "network.proto"; + +// The gRPC interface for interacting with the wallet. +service Wallet { + // Returns the current version of the running wallet service. + // + // This method retrieves the semantic version of the wallet software as defined in the Cargo.toml file (e.g., "1.2.3"). Useful for diagnostics and compatibility checks. + // + // Example usage (JavaScript gRPC client): + // ```javascript + // const response = await client.getVersion({}); + // console.log(response.version); // e.g., "1.2.3" + // ``` + // + // Example response: + // ```json + // { + // "version": "1.2.3" + // } + // ``` + + rpc GetVersion (GetVersionRequest) returns (GetVersionResponse); + + // Returns the current operational state of the wallet. + // + // This RPC provides an overview of the wallet's internal status, including: + // - The latest blockchain height scanned by the wallet + // - The current balance (available, pending incoming/outgoing) + // - Network connectivity status with the base node + // + // This is commonly used by UI clients or backend systems to confirm the wallet is healthy, + // synchronized, and connected to the Tari network. + // + // Example usage (JavaScript): + // ```javascript + // const response = await client.getState({}); + // console.log(response.scanned_height); // e.g., 1523493 + // console.log(response.balance.available_balance); // e.g., 1234567890 + // console.log(response.network.status); // e.g., "Online" + // ``` + // + // Example response: + // ```json + // { + // "scanned_height": 1523493, + // "balance": { + // "available_balance": 1234567890, + // "pending_incoming_balance": 100000000, + // "pending_outgoing_balance": 0 + // }, + // "network": { + // "status": "Online", + // "avg_latency_ms": 28, + // "num_node_connections": 8 + // } + // } + // ``` + rpc GetState (GetStateRequest) returns (GetStateResponse); + + // This RPC returns a lightweight response indicating whether the wallet is connected to the network, attempting to connect, or currently offline. This is useful for UIs or clients to determine if network interactions like transactions or syncs are possible. + // + // Example usage (JavaScript): + // ```javascript + // const response = await client.checkConnectivity({}); + // console.log(response.status); // e.g., 1 (Online) + // ``` + // + // Example response: + // ```json + // { + // "status": "Online" + // } + // ``` + rpc CheckConnectivity(GetConnectivityRequest) returns (CheckConnectivityResponse); + + // Check for new updates + rpc CheckForUpdates (Empty) returns (SoftwareUpdate); + + // The `Identify` RPC call returns the identity information of the wallet node. + // This includes: + // - **Public Key**: The wallet's cryptographic public key. + // - **Public Address**: The wallet's public address used to receive funds. + // - **Node ID**: The unique identifier of the wallet node in the network. + // + // Example usage (JavaScript): + // ```javascript + // // Call the Identify RPC method + // client.Identify({}, (error, response) => { + // if (error) { + // console.error('Error:', error); + // } else { + // console.log('Identity Response:', response); + // } + // }); + // ``` + // + // **Sample JSON Response:** + // + // ```json + // { + // "public_key": "0x04b2c5f3fe65bb1c3cde019e34f3eab1234598c820dca43bbf4d5686a980ddc69e0d4b180d85990d0a5e4aee46e0a6ad9283f0a41783992a70c548e53e47321fa", + // "public_address": "14HVCEeZC2RGE4SDn3yGwqzXepJ2LDqXva7kb4fherYMQR9dF7341T3TjMZobB1a6xouGvS5SXwEvXKwK3zLz2rgReh", + // "node_id": "0x1234abcd5678efgh9012ijkl3456mnop" + // } + // ``` + rpc Identify (GetIdentityRequest) returns (GetIdentityResponse); + + // This RPC returns two types of wallet addresses: interactive and one-sided addresses. + // It provides these addresses in byte format as part of the response. + // - **Interactive Address**: This is a type of address used for interaction and communication with the wallet. + // - **One-Sided Address**: This is another address type, typically used in scenarios where a one-way interaction or transaction is needed. + // + // Example usage (JavaScript): + // // Call the GetAddress RPC method + // client.GetAddress({}, (error, response) => { + // if (error) { + // console.error('Error:', error); + // } else { + // console.log('Address Response:', response); + // } + // }); + // ``` + // + // **Sample JSON Response:** + // // ```json + // { + // "interactive_address": "0x14b27bde3f7d9c9d7455f16b056a3c439c663af93356f56e16d2b2c79e6995c44c9c6c7c", + // "one_sided_address": "0x12b35ddcb2270a72d7b327abc7cd4f607a492c6e13e72e65c34742069e48bd3bc462df63" + // } + // ``` + rpc GetAddress (Empty) returns (GetAddressResponse); + + // This RPC returns addresses generated for a specific payment ID. It provides both the interactive + // and one-sided addresses for the given payment ID, along with their respective representations in + // base58 and emoji formats. + // + // Example usage (JavaScript): + // + // ```javascript + // // Prepare the payment ID for the request + // const paymentId = Buffer.from('your_payment_id_here', 'hex'); + // const request = { payment_id: paymentId }; + // + // // Call the GetPaymentIdAddress RPC method + // client.GetPaymentIdAddress(request, (error, response) => { + // if (error) { + // console.error('Error:', error); + // } else { + // console.log('Payment ID Address Response:', response); + // } + // }); + // ``` + // + // **Sample JSON Response:** + // + // ```json + //{ + // "interactive_address": "0411aabbccddeeff00112233445566778899aabbccddeeff0011223344556677", + // "one_sided_address": "02ff8899aabbccddeeff00112233445566778899aabbccddeeff001122334455", + // "interactive_address_base58": "14HVCEeZC2RGE4SDn3yG.....6xouGvS5SXwEvXKwK3zLz2rgReh", + // "one_sided_address_base58": "12HVCEeZC2RGE4SDn3yGwqz.....obB1a6xouGvS5SXwEvXKwK3zLz2rgReL", + // "interactive_address_emoji": "🐢🌊💤🔌🚑🐛🏦⚽🍓🐭🚁🎢🔪🥐👛🍞.....🍐🍟💵🎉🍯🎁🎾🎼💻💄🍳🍐🤔🥝🍫👅🚀🐬🎭", + // "one_sided_address_emoji": "🐢📟💤🔌🚑🐛🏦⚽🍓🐭🚁🎢🔪🥐👛🍞📜.....🍐🍟💵🎉🍯🎁🎾🎼💻💄🍳🍐🤔🥝🍫👅🚀🐬🎭" + //} + //``` + // + rpc GetPaymentIdAddress (GetPaymentIdAddressRequest) returns (GetCompleteAddressResponse); + + // This RPC call that retrieves the current wallet's interactive and one-sided addresses in multiple formats and returns them in a structured response. + // The response includes: + // - Raw binary + // - Base58-encoded (human-readable) + // - Emoji-encoded (for fun and friendliness) + // + // Example usage (JavaScript with gRPC): + // + // ```js + // const client = new WalletClient('localhost:50051', grpc.credentials.createInsecure()); + // client.getCompleteAddress({}, (err, response) => { + // if (err) console.error(err); + // else console.log(response); + // }); + // ``` + // + // Sample response: + // ```json + // { + // "interactive_address": "0411aabbccddeeff00112233445566778899aabbccddeeff0011223344556677", + // "one_sided_address": "02ff8899aabbccddeeff00112233445566778899aabbccddeeff001122334455", + // "interactive_address_base58": "14HVCEeZC2RGE4SDn3yG.....6xouGvS5SXwEvXKwK3zLz2rgReh", + // "one_sided_address_base58": "12HVCEeZC2RGE4SDn3yGwqz.....obB1a6xouGvS5SXwEvXKwK3zLz2rgReL", + // "interactive_address_emoji": "🐢🌊💤🔌🚑🐛🏦⚽🍓🐭🚁🎢🔪🥐👛🍞.....🍐🍟💵🎉🍯🎁🎾🎼💻💄🍳🍐🤔🥝🍫👅🚀🐬🎭", + // "one_sided_address_emoji": "🐢📟💤🔌🚑🐛🏦⚽🍓🐭🚁🎢🔪🥐👛🍞📜.....🍐🍟💵🎉🍯🎁🎾🎼💻💄🍳🍐🤔🥝🍫👅🚀🐬🎭" + // } + // ``` + rpc GetCompleteAddress (Empty) returns (GetCompleteAddressResponse); + + // This call supports standard interactive transactions (Mimblewimble), + // one-sided transactions, and one-sided-to-stealth-address transactions. + // Each recipient must include a valid Tari address, amount, fee, and payment type. + // + // ### Example JavaScript gRPC client usage: + // + // ```javascript + // const recipient = new PaymentRecipient(); + // recipient.setAddress("14HVCEeZ..."); + // recipient.setAmount(1000000); // 1 T + // recipient.setFeePerGram(25); + // recipient.setPaymentType(PaymentType.ONE_SIDED); + // recipient.setPaymentId(Buffer.from("abc123", "utf-8")); + // + // const request = new TransferRequest(); + // request.setRecipientsList([recipient]); + // + // client.transfer(request, (err, response) => { + // if (err) console.error(err); + // else console.log(response.toObject()); + // }); + // ``` + // + // ### Sample JSON Response: + // + // ```json + // { + // "results": [ + // { + // "address": "14HVCEeZ...", + // "transaction_id": 12345, + // "is_success": true, + // "failure_message": "" + // } + // ] + // } + rpc Transfer (TransferRequest) returns (TransferResponse); + + // Returns the transaction details for the given transaction IDs. + // + // The GetTransactionInfo RPC retrieves detailed information about specific transactions based on their IDs. + // The response includes details such as transaction status, direction, amount, fee, and more. + // + // ### Request Parameters: + // + // - `transaction_ids` (required): + // - **Type**: `repeated uint64` + // - **Description**: A list of transaction IDs to query. + // - **Restrictions**: + // - Must contain at least one ID. + // - All IDs must be valid unsigned 64-bit integers. + // - Duplicates will be ignored; only the first occurrence is processed. + // - If a transaction ID is not found, it will be returned with a `status` of `NOT_FOUND`. + // + // ### Example JavaScript gRPC client usage: + // + // ```javascript + // const request = { transaction_ids: [12345, 67890] }; + // client.getTransactionInfo(request, (err, response) => { + // if (err) console.error(err); + // else console.log(response.transactions); + // }); + // ``` + // + // ### Sample JSON Response: + // + // ```json + // { + // "transactions": [ + // { + // "tx_id": 12345, + // "source_address": "0x1234abcd...", + // "dest_address": "0x5678efgh...", + // "status": "TRANSACTION_STATUS_MINED_CONFIRMED", + // "direction": "TRANSACTION_DIRECTION_OUTBOUND", + // "amount": 1000000, + // "fee": 25, + // "is_cancelled": false, + // "excess_sig": "0xabcdef...", + // "timestamp": 1681234567, + // "payment_id": "0xdeadbeef...", + // "mined_in_block_height": 1523493 + // } + // ] + // } + rpc GetTransactionInfo (GetTransactionInfoRequest) returns (GetTransactionInfoResponse); + + // Streams completed transactions for a given user payment ID. + // + // The `GetCompletedTransactions` call retrieves all completed wallet transactions, + // optionally filtered by a specific `payment_id` and/or block hash. The response is streamed back to the client + // one transaction at a time, with each transaction including details such as status, direction, + // amount, fees, and associated metadata. + // + // ### Request Parameters: + // + // - `payment_id` (optional): + // - **Type**: `UserPaymentId` (a flexible ID object) + // - **Description**: Allows filtering the completed transactions by a specific payment ID. + // - **Accepted Formats** (must provide **only one**): + // - `u256`: a 32-byte hexadecimal string. + // - `utf8_string`: a UTF-8 string. + // - `user_bytes`: raw bytes. + // - **Restrictions**: + // - Exactly **one format must be set**. Providing more than one or none results in an error. + // - If no `payment_id` is provided, all completed transactions will be returned. + // + // - `block_hash` (optional): + // - **Type**: `string` + // - **Description**: A specific block hash to filter transactions by. + // - **Accepted Formats** + // - Hexadecimal string representing the block hash. + // - **Restrictions**: + // - If provided, the transactions will be filtered to only those included in the specified block. + // + // - `block_height` (optional): + // - **Type**: `uint64` + // - **Description**: A specific block height to filter transactions by. + // - **Restrictions**: + // - If provided, the transactions will be filtered to only those included in the specified height. + + // + // ### Example JavaScript gRPC client usage: + // + // ```javascript + // const request = { + // payment_id: { + // utf8_string: "invoice-001" + // } + // }; + // const call = client.getCompletedTransactions(request); + // call.on('data', (response) => { + // console.log(response.transaction); + // }); + // call.on('error', console.error); + // call.on('end', () => console.log("Stream ended")); + // ``` + // + // ### Sample Streamed JSON Response: + // + // ```json + // { + // "transaction": { + // "tx_id": 12345, + // "source_address": "0x1234abcd...", + // "dest_address": "0x5678efgh...", + // "status": "TRANSACTION_STATUS_MINED_CONFIRMED", + // "direction": "TRANSACTION_DIRECTION_INBOUND", + // "amount": 500000, + // "fee": 20, + // "is_cancelled": false, + // "excess_sig": "0xabcdef...", + // "timestamp": 1681234567, + // "payment_id": "0xdeadbeef...", + // "mined_in_block_height": 1523493 + // } + // } + // ``` + rpc GetCompletedTransactions (GetCompletedTransactionsRequest) returns (stream GetCompletedTransactionsResponse); + + // Returns all transactions that were mined at a specific block height. + // + // The `GetBlockHeightTransactions` call retrieves all wallet transactions that were mined + // at the specified block height. The response includes all transactions in a single response, + // with each transaction including details such as status, direction, amount, + // fees, and associated metadata. + // + // ### Request Parameters: + // + // - `block_height` (required): + // - **Type**: `uint64` + // - **Description**: The specific block height to fetch transactions for. + // - **Restrictions**: + // - Must be a valid block height (greater than 0). + // - If the block height is beyond the current chain height, no transactions will be returned. + // + // ### Example JavaScript gRPC client usage: + // + // ```javascript + // const request = { + // block_height: 1523493 + // }; + // const response = await client.getBlockHeightTransactions(request); + // console.log(response.transactions); + // ``` + // + // ### Sample JSON Response: + // + // ```json + // { + // "transactions": [ + // { + // "tx_id": 12345, + // "source_address": "0x1234abcd...", + // "dest_address": "0x5678efgh...", + // "status": "TRANSACTION_STATUS_MINED_CONFIRMED", + // "direction": "TRANSACTION_DIRECTION_INBOUND", + // "amount": 500000, + // "fee": 20, + // "is_cancelled": false, + // "excess_sig": "0xabcdef...", + // "timestamp": 1681234567, + // "payment_id": "0xdeadbeef...", + // "mined_in_block_height": 1523493 + // } + // ] + // } + // ``` + rpc GetBlockHeightTransactions (GetBlockHeightTransactionsRequest) returns (GetBlockHeightTransactionsResponse); + + // Returns all PayRefs (payment references) for a specific transaction. + // + // The `GetTransactionPayRefs` call retrieves all PayRefs associated with the specified + // transaction ID. PayRefs are cryptographic references generated from output hashes + // that allow recipients to verify payments without revealing sensitive transaction details. + // + // ### Request Parameters: + // + // - `transaction_id` (required): + // - **Type**: `uint64` + // - **Description**: The transaction ID to retrieve PayRefs for. + // - **Restrictions**: + // - Must be a valid transaction ID that exists in the wallet. + // - If the transaction ID is invalid or not found, an error will be returned. + // + // ### Example JavaScript gRPC client usage: + // + // ```javascript + // const request = { + // transaction_id: 12345 + // }; + // const response = await client.getTransactionPayRefs(request); + // console.log("PayRefs:", response.payment_references.map(ref => Buffer.from(ref).toString('hex'))); + // ``` + // + // ### Sample JSON Response: + // + // ```json + // { + // "payment_references": [ + // "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", + // "0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321" + // ] + // } + // ``` + rpc GetTransactionPayRefs (GetTransactionPayRefsRequest) returns (GetTransactionPayRefsResponse); + + + // Returns the wallet balance details. + // + // The `GetBalance` call retrieves the current balance status of the wallet, + // optionally filtered by a specific `payment_id`. The response includes detailed + // breakdowns of available, pending incoming/outgoing, and timelocked balances. + // + // ### Request Parameters: + // + // - `payment_id` (optional): + // - **Type**: `UserPaymentId` (one of several formats). + // - **Description**: An optional filter to retrieve the balance associated with a specific payment ID. + // - **Accepted Formats** (must provide **only one**): + // - `u256`: a 32-byte hexadecimal identifier. + // - `utf8_string`: a human-readable string ID. + // - `user_bytes`: raw binary bytes. + // - **Restrictions**: + // - Only one format must be provided at a time. + // - If multiple or no formats are provided within `payment_id`, the request will return an error. + // - If `payment_id` is omitted, the total wallet balance is returned. + // + // ### Example JavaScript gRPC client usage: + // + // ```javascript + // const request = { + // payment_id: { + // utf8_string: "invoice-002" + // } + // }; + // client.getBalance(request, (err, response) => { + // if (err) console.error(err); + // else console.log("Balance:", response); + // }); + // ``` + // + // ### Sample JSON Response: + // + // ```json + // { + // "available_balance": 950000, + // "pending_incoming_balance": 200000, + // "pending_outgoing_balance": 50000, + // "timelocked_balance": 100000 + // } + // ``` + rpc GetBalance (GetBalanceRequest) returns (GetBalanceResponse); + + // Returns the total value of unspent outputs in the wallet. + // + // The `GetUnspentAmounts` call retrieves the sum of all unspent output amounts + // currently held by the wallet. These are outputs that have not yet been spent or time-locked, + // and are available for future transactions. + // + // ### Request Parameters: + // + // - *(none)* + // - This method uses an empty request body (`google.protobuf.Empty`). + // - No filters or arguments are required. + // + // ### Example JavaScript gRPC client usage: + // + // ```javascript + // client.getUnspentAmounts({}, (err, response) => { + // if (err) console.error(err); + // else console.log("Total unspent amount:", response.amount); + // }); + // ``` + // + // ### Sample JSON Response: + // + // ```json + // { + // "amount": 1250000 + // } + // ``` + rpc GetUnspentAmounts (Empty) returns (GetUnspentAmountsResponse); + + // Creates a transaction that splits funds into multiple smaller outputs. + // + // The `CoinSplit` call initiates a transaction that divides wallet funds into several equal-sized outputs. + // This is useful for preparing a wallet for many small transactions (e.g., for micropayments or batching). + // The resulting transaction is broadcast and can be tracked via its transaction ID. + // + // ### Request Parameters: + // + // - `amount_per_split` (required): + // - **Type**: `uint64` + // - **Description**: The value of each individual output in the split. + // - **Restrictions**: Must be greater than zero. + // + // - `split_count` (required): + // - **Type**: `uint64` + // - **Description**: The number of outputs to create. + // - **Restrictions**: Must be greater than zero and within practical system limits. + // + // - `fee_per_gram` (required): + // - **Type**: `uint64` + // - **Description**: The transaction fee rate (per gram of weight). + // - **Restrictions**: Should be set high enough to ensure confirmation. + // + // - `lock_height` (optional): + // - **Type**: `uint64` + // - **Description**: The earliest block height at which the transaction becomes valid. + // - **Restrictions**: Defaults to 0 if not specified. + // + // - `payment_id` (optional): + // - **Type**: `bytes` + // - **Description**: A user-defined identifier for tracking or referencing the transaction. + // - **Restrictions**: Optional; can be left empty. + // + // ### Example JavaScript gRPC client usage: + // + // ```javascript + // const request = { + // amount_per_split: 100000, + // split_count: 5, + // fee_per_gram: 25, + // lock_height: 0, + // payment_id: new Uint8Array([]) + // }; + // client.coinSplit(request, (err, response) => { + // if (err) console.error(err); + // else console.log("Created CoinSplit Tx ID:", response.tx_id); + // }); + // ``` + // + // ### Sample JSON Response: + // + // ```json + // { + // "tx_id": 987654321 + // } + // ``` + rpc CoinSplit (CoinSplitRequest) returns (CoinSplitResponse); + + // Imports UTXOs into the wallet as spendable outputs. + // + // The `ImportUtxos` call allows you to manually insert one or more previously received UTXOs + // into the wallet, marking them as spendable without needing rewindable metadata. + // Each UTXO is associated with a transaction ID in the response. + // + // ### Request Parameters: + // + // - `outputs` (required): + // - **Type**: `repeated UnblindedOutput` + // - **Description**: A list of unblinded outputs to import into the wallet. + // - **Restrictions**: + // - Each output must be valid and convertible to an internal UTXO format. + // - The list must contain at least one item. + // + // - `payment_id` (optional): + // - **Type**: `bytes` + // - **Description**: An optional user-defined identifier to associate with the imported outputs. + // - **Restrictions**: + // - Can be left empty if not needed. + // - Must be a valid byte string if provided. + // + // ### Example JavaScript gRPC client usage: + // + // ```javascript + // const request = { + // outputs: [/* array of unblinded outputs */], + // payment_id: new Uint8Array([]) + // }; + // client.importUtxos(request, (err, response) => { + // if (err) console.error(err); + // else console.log("Imported Tx IDs:", response.tx_ids); + // }); + // ``` + // + // ### Sample JSON Response: + // + // ```json + // { + // "tx_ids": [101, 102, 103] + // } + // ``` + rpc ImportUtxos (ImportUtxosRequest) returns (ImportUtxosResponse); + + // Returns the wallet's current network connectivity status. + // + // The `GetNetworkStatus` call provides a snapshot of the wallet's connection to the Tari network, + // including whether it is online, the number of active peer connections, and the average latency + // to the configured base node. + // + // ### Request Parameters: + // + // - *(none)* + // - This method uses an empty request body (`google.protobuf.Empty`). + // - No filters or arguments are required. + // + // ### Example JavaScript gRPC client usage: + // + // ```javascript + // client.getNetworkStatus({}, (err, response) => { + // if (err) console.error(err); + // else console.log("Network Status:", response); + // }); + // ``` + // + // ### Sample JSON Response: + // + // ```json + // { + // "status": "ONLINE", + // "avg_latency_ms": 142, + // "num_node_connections": 8 + // } + // ``` + // + // ### Status Field Values: + // + // The `status` field indicates the current network connectivity of the wallet. Possible values are: + // + // - `ONLINE`: + // - The wallet is fully connected to the network and functioning normally. + // - The node has enough active peer connections to operate efficiently. + // + // - `DEGRADED`: + // - The wallet is connected to some peers but not enough to maintain full functionality. + // - This could indicate issues with network connectivity, such as intermittent disconnections or insufficient peers, leading to reduced performance or reliability. + // + // - `OFFLINE`: + // - The wallet is not connected to any peers. + // - This status means the wallet is unable to communicate with the network and cannot perform any network-related operations. + // + rpc GetNetworkStatus(Empty) returns (NetworkStatusResponse); + + // Returns a list of peers currently connected to the wallet. + // + // The `ListConnectedPeers` call retrieves information about peers that the wallet is currently + // connected to. This includes details such as peer addresses, connection status, supported protocols, + // and other metadata relevant to the connection. + // + // ### Request Parameters: + // + // - *(none)* + // - This method uses an empty request body (`google.protobuf.Empty`). + // - No filters or arguments are required. + // + // ### Response Fields: + // + // - **connected_peers**: List of peers currently connected to the wallet. + // - **public_key**: The peer's public key (bytes). + // - **node_id**: The unique node ID of the peer (bytes). + // - **addresses**: List of the peer's addresses (repeated Address). + // - **last_connection**: The timestamp of the last connection attempt (uint64). + // - **flags**: Flags associated with the peer (uint32). + // - **banned_until**: The timestamp until which the peer is banned (uint64, 0 if not banned). + // - **banned_reason**: The reason for banning the peer (string, empty if not banned). + // - **offline_at**: The timestamp indicating when the peer went offline (uint64, 0 if online). + // - **features**: The features supported by the peer (uint32). + // - **supported_protocols**: List of supported protocols by the peer (repeated bytes). + // - **user_agent**: The user agent advertised by the peer (string). + // + // ### Example JavaScript gRPC client usage: + // + // ```javascript + // client.listConnectedPeers({}, (err, response) => { + // if (err) console.error(err); + // else console.log("Connected Peers:", response); + // }); + // ``` + // + // ### Sample JSON Response: + // + // ```json + // { + // "connected_peers": [ + // { + // "public_key": "0x1234abcd...", + // "node_id": "0x5678efgh...", + // "addresses": [ + // "127.0.0.1:18080", + // "192.168.1.2:18080" + // ], + // "last_connection": 1625493123, + // "flags": 1, + // "banned_until": 0, + // "banned_reason": "", + // "offline_at": 0, + // "features": 10, + // "supported_protocols": [ + // "protocol_v1", + // "protocol_v2" + // ], + // "user_agent": "TariBaseNode/1.0.0" + // } + // ] + // } + // ``` + rpc ListConnectedPeers(Empty) returns (ListConnectedPeersResponse); + + // Cancels a specific transaction by its ID. + // + // The `CancelTransaction` call allows a transaction to be cancelled by its unique transaction ID (TxId). + // If the cancellation is successful, the response will indicate success. Otherwise, the response will + // contain a failure message with the reason for the failure. + // + // ### Request Parameters: + // + // - **tx_id**: The unique identifier for the transaction to be cancelled (uint64). + // + // ### Response Fields: + // + // - **is_success**: A boolean indicating whether the cancellation was successful (bool). + // - `true` if the cancellation was successful, `false` if not. + // - **failure_message**: A string that provides the reason for the failure, if applicable (string). + // - This field will be empty if the cancellation was successful. + // + // ### Example JavaScript gRPC client usage: + // + // ```javascript + // const request = { tx_id: 12345 }; + // client.cancelTransaction(request, (err, response) => { + // if (err) console.error(err); + // else console.log(response); + // }); + // ``` + // + // ### Sample JSON Response: + // + // ```json + // { + // "is_success": true, + // "failure_message": "" + // } + // ``` + rpc CancelTransaction (CancelTransactionRequest) returns (CancelTransactionResponse); + + // Will trigger a complete revalidation of all wallet outputs. + rpc RevalidateAllTransactions (RevalidateRequest) returns (RevalidateResponse); + + // Will trigger a validation of all wallet outputs. + rpc ValidateAllTransactions (ValidateRequest) returns (ValidateResponse); + + // Sends a XTR SHA Atomic Swap transaction. + // + // The `SendShaAtomicSwapTransaction` call is used to initiate an Atomic Swap + // transaction using SHA. It allows the sender to send a payment to the recipient + // in exchange for an atomic swap, with SHA used as the secret for the swap. + // The method accepts the recipient's information and initiates the transaction. + // + // ### Request Parameters: + // - **recipient** (required): A PaymentRecipient object containing the recipient's address, + // the amount to be swapped, the fee per gram, and the payment ID to identify the transaction. + // + // ### Response Fields: + // - **transaction_id**: The ID of the transaction. + // - **pre_image**: The SHA pre-image of the atomic swap. + // - **output_hash**: The hash of the output associated with the transaction. + // - **is_success**: Indicates whether the transaction was successful (true) or failed (false). + // - **failure_message**: Provides an error message if the transaction failed. + // + // ### Example JavaScript gRPC client usage: + // ```javascript + // const request = { + // recipient: { + // address: "t1abc12345", + // amount: 1000000, + // fee_per_gram: 10, + // payment_id: "0xdeadbeef" + // } + // }; + // client.sendShaAtomicSwapTransaction(request, (err, response) => { + // if (err) console.error(err); + // else console.log(response); + // }); + // ``` + // + // ### Sample JSON Response: + // ```json + // { + // "transaction_id": 123456789, + // "pre_image": "0xabcdef1234567890", + // "output_hash": "0x123456abcdef7890", + // "is_success": true, + // "failure_message": "" + // } + rpc SendShaAtomicSwapTransaction(SendShaAtomicSwapRequest) returns (SendShaAtomicSwapResponse); + + // Creates a burn transaction for burning a specified amount of Tari currency. + // + // The `CreateBurnTransaction` call facilitates burning a certain amount of Tari + // by initiating a burn transaction. It allows the user to specify the amount to burn, + // along with a fee per gram and optionally a payment ID and claim public key. + // + // ### Request Parameters: + // - **amount** (required): The amount of Tari to be burned. + // - **fee_per_gram** (required): The fee per gram for the transaction. + // - **claim_public_key** (optional): The public key to claim ownership of the burned coins. + // - **payment_id** (optional): A unique identifier for the payment associated with the burn transaction. + // + // ### Response Fields: + // - **transaction_id**: The ID of the burn transaction. + // - **is_success**: Indicates whether the burn transaction was successfully created. + // - **failure_message**: Provides an error message if the transaction creation failed. + // - **commitment**: The commitment associated with the burn transaction. + // - **ownership_proof**: A proof of ownership for the burned coins. + // - **range_proof**: The range proof associated with the burned coins. + // - **reciprocal_claim_public_key**: The public key of the reciprocal claim for the burn. + // + // ### Example JavaScript gRPC client usage: + // ```javascript + // const request = { + // amount: 1000000, + // fee_per_gram: 10, + // claim_public_key: "0xabcdef1234567890", + // payment_id: "0xdeadbeef" + // }; + // client.createBurnTransaction(request, (err, response) => { + // if (err) console.error(err); + // else console.log(response); + // }); + // ``` + // + // ### Sample JSON Response: + // ```json + // { + // "transaction_id": 123456789, + // "is_success": true, + // "failure_message": "", + // "commitment": "0xcommitmenthash", + // "ownership_proof": "0xownershipproof", + // "range_proof": "0xrangeproof", + // "reciprocal_claim_public_key": "0xreciprocalpublickey" + // } + rpc CreateBurnTransaction(CreateBurnTransactionRequest) returns (CreateBurnTransactionResponse); + + // Claims a SHA Atomic Swap transaction using a pre-image and output hash. + // + // The `ClaimShaAtomicSwapTransaction` call allows the user to unlock and claim funds from + // a hash-time-locked contract (HTLC) by supplying the correct pre-image that matches a + // previously committed SHA-256 hash. This pre-image proves the user's knowledge of the + // secret required to spend the output. + // + // ### Request Parameters: + // - **output** (required): The hex-encoded output hash (SHA-256 digest) that was locked in the atomic swap. + // - **pre_image** (required): The hex-encoded original pre-image (raw bytes, *not* hashed) which, when hashed with SHA-256, must match the `output` hash. + // - **fee_per_gram** (required): The transaction fee per gram, specified as an unsigned integer. + // + // ### Input Validation: + // - `output` must be a valid hex-encoded SHA-256 hash (64 hex characters). + // - `pre_image` must be a valid hex string representing the original secret (any byte length, commonly 32 bytes). + // - `fee_per_gram` must be a non-zero `uint64`; a fee of `0` may be rejected or deprioritized by the network. + // + // ### Response Fields: + // - **results**: A `TransferResult` object containing transaction ID, success status, and an error message if applicable. + // + // ### Example JavaScript gRPC client usage: + // ```javascript + // const request = { + // output: "3e1f89af...e923", // SHA-256 hash of the expected pre-image + // pre_image: "6a1b2c...eaf1", // raw pre-image (not hashed) + // fee_per_gram: 10 + // }; + // client.claimShaAtomicSwapTransaction(request, (err, response) => { + // if (err) console.error(err); + // else console.log(response.results); + // }); + // ``` + // + // ### Sample JSON Response: + // ```json + // { + // "results": { + // "address": "", + // "transaction_id": 789654, + // "is_success": true, + // "failure_message": "" + // } + // } + rpc ClaimShaAtomicSwapTransaction(ClaimShaAtomicSwapRequest) returns (ClaimShaAtomicSwapResponse); + + // Claims an HTLC refund transaction after the timelock period has passed. + // + // The `ClaimHtlcRefundTransaction` call enables the original sender of a Hash Time-Locked Contract (HTLC) + // to reclaim the locked funds if the recipient has not claimed them in time using the correct pre-image. + // This is possible only after the output's timelock has expired. + // + // ### Request Parameters: + // - **output_hash** (required): Hex-encoded SHA-256 hash of the HTLC output being refunded. + // - **fee_per_gram** (required): Transaction fee per gram, specified as a `uint64`. + // + // ### Input Validation: + // - `output_hash` must be a valid 64-character hex string representing the hash of the HTLC output. + // - `fee_per_gram` must be a non-zero `uint64` value. + // + // ### Response Fields: + // - **results**: A `TransferResult` object including transaction ID, success status, and failure reason if any. + // + // ### Example JavaScript gRPC client usage: + // ```javascript + // const request = { + // output_hash: "aabbccddeeff0011...99", + // fee_per_gram: 20 + // }; + // client.claimHtlcRefundTransaction(request, (err, response) => { + // if (err) console.error(err); + // else console.log(response.results); + // }); + // ``` + // + // ### Sample JSON Response: + // ```json + // { + // "results": { + // "address": "", + // "transaction_id": 889977, + // "is_success": true, + // "failure_message": "" + // } + // } + rpc ClaimHtlcRefundTransaction(ClaimHtlcRefundRequest) returns (ClaimHtlcRefundResponse); + + // Creates a transaction with a template registration output + rpc CreateTemplateRegistration(CreateTemplateRegistrationRequest) returns (CreateTemplateRegistrationResponse); + + // The SetBaseNode call configures the base node peer for the wallet. + // + // This RPC sets the public key and network address of the base node peer that the wallet should communicate with. + // + // ### Request Fields: + // - `public_key_hex` (string): The public key of the base node, provided as a hex string. + // - `net_address` (string): The multiaddress of the base node (e.g., `/ip4/127.0.0.1/tcp/18141`). + // + // ### Example JavaScript gRPC client usage: + // + // ```javascript + // const request = { + // public_key_hex: "0281bdfc...", + // net_address: "/ip4/127.0.0.1/tcp/18141" + // }; + // client.setBaseNode(request, (err, response) => { + // if (err) console.error(err); + // else console.log("Base node set successfully"); + // }); + // ``` + // + // ### Sample JSON Request: + // ```json + // { + // "public_key_hex": "0281bdfc...", + // "net_address": "/ip4/127.0.0.1/tcp/18141" + // } + // ``` + // + // ### Sample JSON Response: + // ```json + // {} + // ``` + rpc SetBaseNode(SetBaseNodeRequest) returns (SetBaseNodeResponse); + + // Streams real-time wallet transaction events to the client. + // + // The `StreamTransactionEvents` RPC provides a continuous stream of transaction events as they occur within the wallet. + // This allows clients to react to changes in transaction status such as received, sent, mined, or cancelled transactions, + // making it ideal for real-time UI updates or external monitoring. + // + // ### Request Parameters: + // - _(none)_ – This RPC does not take any parameters. + // + // ### Response Stream: + // - Each message in the response stream is a `TransactionEventResponse` containing: + // - **transaction**: A `TransactionEvent` object representing the latest event related to a wallet transaction. + // + // ### `TransactionEvent` Fields: + // - **event** (string): Human-readable event type. Examples include: `"Received"`, `"Mined"`, `"Cancelled"`, `"Sent"`. + // - **tx_id** (string): Transaction identifier. + // - **source_address** (bytes): Sender address, if applicable. + // - **dest_address** (bytes): Recipient address, if applicable. + // - **status** (string): Current status of the transaction. E.g., `"Completed"`, `"Pending"`, `"Cancelled"`. + // - **direction** (string): `"Inbound"` or `"Outbound"`. + // - **amount** (uint64): Transaction amount in microTari. + // - **payment_id** (bytes): Payment ID associated with the transaction. + // + + // ### Example JavaScript gRPC client usage: + // ```javascript + // const call = client.streamTransactionEvents({}); + // + // call.on("data", (response) => { + // console.log("Transaction Event:", response.transaction); + // }); + // + // call.on("end", () => { + // console.log("Stream ended."); + // }); + // + // call.on("error", (err) => { + // console.error("Stream error:", err); + // }); + // ``` + // + // ### Sample JSON Streamed Response: + // ```json + // { + // "transaction": { + // "event": "Mined", + // "tx_id": "103248", + // "source_address": "0xabc123...", + // "dest_address": "0xdef456...", + // "status": "Completed", + // "direction": "Outbound", + // "amount": 100000000, + // "payment_id": "0xdeadbeef..." + // } + // } + // ``` + rpc StreamTransactionEvents(TransactionEventRequest) returns (stream TransactionEventResponse); + + rpc RegisterValidatorNode(RegisterValidatorNodeRequest) returns (RegisterValidatorNodeResponse); + + rpc ImportTransactions(ImportTransactionsRequest) returns (ImportTransactionsResponse); + + // Get all completed transactions including cancelled ones, sorted by timestamp and paginated + rpc GetAllCompletedTransactions(GetAllCompletedTransactionsRequest) returns (GetAllCompletedTransactionsResponse); + + // Gets transaction information by payment reference (PayRef) + // + // The `GetPaymentByReference` call retrieves transaction information using a 32-byte payment reference hash. + // PayRefs are generated as Blake2b_256(block_hash || output_hash) and provide a stable way to look up + // transactions even after outputs are spent. + // + // ### Request Parameters: + // + // - `payment_reference` (required): + // - **Type**: `bytes` (32 bytes) + // - **Description**: The payment reference hash to look up + // - **Restrictions**: Must be exactly 32 bytes representing a valid PayRef + // + // ### Example JavaScript gRPC client usage: + // + // ```javascript + // const payref = Buffer.from('a1b2c3d4e5f6789012345678901234567890123456789012345678901234567890', 'hex'); + // const request = { payment_reference: payref }; + // client.getPaymentByReference(request, (err, response) => { + // if (err) console.error(err); + // else console.log('Transaction found:', response.transaction); + // }); + // ``` + // + // ### Sample JSON Response: + // + // ```json + // { + // "transaction": { + // "tx_id": 12345, + // "source_address": "0x1234abcd...", + // "dest_address": "0x5678efgh...", + // "status": "TRANSACTION_STATUS_MINED_CONFIRMED", + // "direction": "TRANSACTION_DIRECTION_INBOUND", + // "amount": 1000000, + // "fee": 20, + // "is_cancelled": false, + // "excess_sig": "0xabcdef...", + // "timestamp": 1681234567, + // "payment_id": "0xdeadbeef...", + // "mined_in_block_height": 150000 + // } + // } + // ``` + rpc GetPaymentByReference(GetPaymentByReferenceRequest) returns (GetPaymentByReferenceResponse); +} + + +message GetVersionRequest {} + + +message GetVersionResponse { + string version = 1; +} + +message GetAddressResponse { + bytes interactive_address = 1; + bytes one_sided_address = 2; +} + +message GetPaymentIdAddressRequest { + bytes payment_id = 1; +} +// Response message containing all formats of wallet addresses. +message GetCompleteAddressResponse { + // Binary form of the interactive address. + bytes interactive_address = 1; + // Binary form of the one-sided address. + bytes one_sided_address = 2; + // Base58-encoded version of the interactive address. + string interactive_address_base58 = 3; + // Base58-encoded version of the one-sided address. + string one_sided_address_base58 = 4; + // Emoji-encoded version of the interactive address. + string interactive_address_emoji = 5; + // Emoji-encoded version of the one-sided address. + string one_sided_address_emoji = 6; +} + +// A request to send funds to one or more recipients. +message TransferRequest { + repeated PaymentRecipient recipients = 1; +} + +message SendShaAtomicSwapRequest { + PaymentRecipient recipient = 1; +} + +message CreateBurnTransactionRequest{ + uint64 amount = 1; + uint64 fee_per_gram = 2; + bytes claim_public_key = 4; + bytes payment_id = 5; +} + +// A recipient for a transfer, including address, amount, fee, and optional payment ID. +message PaymentRecipient { + // Base58 Tari address of the recipient. + string address = 1; + // Amount to send in microTari (1 T = 1_000_000 µT). + uint64 amount = 2; + // Fee rate per gram. + uint64 fee_per_gram = 3; + enum PaymentType { + // Default Mimblewimble-style transaction. + STANDARD_MIMBLEWIMBLE = 0 [deprecated = true] ; + // One-sided transaction (receiver not required to participate). + ONE_SIDED = 1 [deprecated = true] ; + // One-sided stealth address (adds privacy by hiding destination). + ONE_SIDED_TO_STEALTH_ADDRESS = 2; + } + // The type of payment to perform. + PaymentType payment_type = 5; + // raw payment id + bytes raw_payment_id = 6; + // Optional user encrypted payment ID for reference (max 256 bytes). + UserPaymentId user_payment_id = 7; +} + +message TransferResponse { + repeated TransferResult results = 1; +} + +message SendShaAtomicSwapResponse { + uint64 transaction_id = 1; + string pre_image = 2; + string output_hash = 3; + bool is_success = 4; + string failure_message = 5; +} + +message CreateBurnTransactionResponse{ + uint64 transaction_id = 1; + bool is_success = 2; + string failure_message = 3; + bytes commitment = 4; + CommitmentSignature ownership_proof = 5; + bytes range_proof = 6; + bytes reciprocal_claim_public_key = 7; +} + +message TransferResult { + string address = 1; + uint64 transaction_id = 2; + bool is_success = 3; + string failure_message = 4; + TransactionInfo transaction_info = 5; +} + +message ClaimShaAtomicSwapRequest{ + string output = 1; + string pre_image = 2; + uint64 fee_per_gram = 3; +} + +message ClaimShaAtomicSwapResponse { + TransferResult results = 1; +} + +message ClaimHtlcRefundRequest{ + string output_hash = 1; + uint64 fee_per_gram = 2; +} + +message ClaimHtlcRefundResponse { + TransferResult results = 1; +} + +message GetTransactionInfoRequest { + repeated uint64 transaction_ids = 1; +} + +message GetTransactionInfoResponse { + repeated TransactionInfo transactions = 1; +} + +message TransactionInfo { + uint64 tx_id = 1; + bytes source_address = 2; + bytes dest_address = 3; + TransactionStatus status = 4; + TransactionDirection direction = 5; + uint64 amount = 6; + uint64 fee = 7; + bool is_cancelled = 8; + bytes excess_sig = 9; + uint64 timestamp = 10; + bytes raw_payment_id = 12; + uint64 mined_in_block_height = 13; + bytes user_payment_id = 14; + repeated bytes input_commitments = 15; + repeated bytes output_commitments = 16; + repeated bytes payment_references_sent = 17; + repeated bytes payment_references_received = 18; + repeated bytes payment_references_change = 19; +} + +enum TransactionDirection { + TRANSACTION_DIRECTION_UNKNOWN = 0; + TRANSACTION_DIRECTION_INBOUND = 1; + TRANSACTION_DIRECTION_OUTBOUND = 2; +} + +enum TransactionStatus { + // This transaction has been completed between the parties but has not been broadcast to the base layer network. + TRANSACTION_STATUS_COMPLETED = 0; + // This transaction has been broadcast to the base layer network and is currently in one or more base node mempools. + TRANSACTION_STATUS_BROADCAST = 1; + // This transaction has been mined and included in a block. + TRANSACTION_STATUS_MINED_UNCONFIRMED = 2; + // This transaction was generated as part of importing a spendable UTXO + TRANSACTION_STATUS_IMPORTED = 3; + // This transaction is still being negotiated by the parties + TRANSACTION_STATUS_PENDING = 4; + // This is a created Coinbase Transaction + TRANSACTION_STATUS_COINBASE = 5; + // This transaction is mined and confirmed at the current base node's height + TRANSACTION_STATUS_MINED_CONFIRMED = 6; + // The transaction was rejected by the mempool + TRANSACTION_STATUS_REJECTED = 7; + // This is faux transaction mainly for one-sided transaction outputs or wallet recovery outputs have been found + TRANSACTION_STATUS_ONE_SIDED_UNCONFIRMED = 8; + // All Imported and FauxUnconfirmed transactions will end up with this status when the outputs have been confirmed + TRANSACTION_STATUS_ONE_SIDED_CONFIRMED = 9; + // This transaction is still being queued for sending + TRANSACTION_STATUS_QUEUED = 10; + // The transaction was not found by the wallet its in transaction database + TRANSACTION_STATUS_NOT_FOUND = 11; + // This is Coinbase transaction that is detected from chain + TRANSACTION_STATUS_COINBASE_UNCONFIRMED = 12; + // This is Coinbase transaction that is detected from chain + TRANSACTION_STATUS_COINBASE_CONFIRMED = 13; + // This is Coinbase transaction that is not currently detected as mined + TRANSACTION_STATUS_COINBASE_NOT_IN_BLOCK_CHAIN = 14; +} + +message GetCompletedTransactionsRequest { + UserPaymentId payment_id = 1; + BlockHashHex block_hash = 2; + BlockHeight block_height = 3; +} + +message BlockHashHex { + string hash = 1; +} + +message GetCompletedTransactionsResponse { + TransactionInfo transaction = 1; +} + + +// Request message for GetBalance RPC. +message GetBalanceRequest { + // Optional: A user-defined payment ID to filter balance data. + // Must provide only one of the following fields: u256, utf8_string, or user_bytes. + UserPaymentId payment_id = 1; +} + +message UserPaymentId { + bytes u256 = 1; + string utf8_string = 2; + bytes user_bytes = 3; +} + +message GetStateRequest {} + +message GetBalanceResponse { + uint64 available_balance = 1; + uint64 pending_incoming_balance = 2; + uint64 pending_outgoing_balance = 3; + uint64 timelocked_balance = 4; +} + +// Response message for GetState +message GetStateResponse { + // The blockchain height (in blocks) that the wallet has scanned up to + uint64 scanned_height = 1; + // Current wallet balance information (available, pending), based on the GetBalanceResponse + GetBalanceResponse balance = 2; + // Status of the wallet's connection to the base node, based on the NetworkStatusResponse + NetworkStatusResponse network = 3; +} + +// Response message for GetUnspentAmounts RPC. +message GetUnspentAmountsResponse { + // Total value of all unspent outputs, in the smallest unit (e.g., microTari). + repeated uint64 amount = 1; +} + +// Request message for the CoinSplit RPC. +message CoinSplitRequest { + // The value of each output to create. + uint64 amount_per_split = 1; + // The number of outputs to create in total. + uint64 split_count = 2; + // Fee rate per weight unit (gram). + uint64 fee_per_gram = 3; + // Block height when the transaction becomes valid. + uint64 lock_height = 5; + // Optional identifier for referencing the transaction. + bytes payment_id = 6; +} + +// Response message containing the transaction ID of the coin split. +message CoinSplitResponse { + // The unique ID of the transaction created. + uint64 tx_id = 1; +} + +// Request message for importing UTXOs into the wallet. +message ImportUtxosRequest { + // List of unblinded outputs to be imported as UTXOs. + repeated UnblindedOutput outputs = 1; + + // Optional payment ID to tag the imported outputs. + bytes payment_id = 2; +} + +// Response message containing transaction IDs for the imported outputs. +message ImportUtxosResponse { + // Transaction IDs corresponding to the imported UTXOs. + repeated uint64 tx_ids = 1; +} + +message CreateTemplateRegistrationRequest { + TemplateRegistration template_registration = 1; + uint64 fee_per_gram = 2; +} + +message CreateTemplateRegistrationResponse { + uint64 tx_id = 1; + bytes template_address = 2; +} + +// Request message for the CancelTransaction RPC. +message CancelTransactionRequest { + // The transaction ID to be cancelled. + uint64 tx_id = 1; +} + +// Response message for the CancelTransaction RPC. +message CancelTransactionResponse { + // Indicates whether the cancellation was successful. + bool is_success = 1; + + // The failure message if the cancellation was not successful. + string failure_message = 2; +} + +message RevalidateRequest{} + +message RevalidateResponse{} + +message ValidateRequest{} + +message ValidateResponse{} + +message SetBaseNodeRequest { + string public_key_hex = 1; + string net_address = 2; +} + +message SetBaseNodeResponse{} + +// Empty request for CheckConnectivity +message GetConnectivityRequest{} + +// Response indicating the wallet's connectivity status +message CheckConnectivityResponse{ + // Describes the wallet's network connection state + enum OnlineStatus { + // The wallet is attempting to connect to peers + Connecting = 0; + // The wallet is successfully connected to peers + Online = 1; + // The wallet is not connected to any peers + Offline = 2; + } + // The current connectivity state of the wallet + OnlineStatus status = 1; +} + +message TransactionEventRequest{ + +} + +message TransactionEvent { + string event = 1; + string tx_id = 2; + bytes source_address = 3; + bytes dest_address = 4; + string status = 5; + string direction = 6; + uint64 amount = 7; + bytes payment_id = 9; +} + +message TransactionEventResponse { + TransactionEvent transaction = 1; +} + +message RegisterValidatorNodeRequest { + bytes validator_node_public_key = 1; + Signature validator_node_signature = 2; + uint64 fee_per_gram = 3; + bytes payment_id = 5; +} + +message RegisterValidatorNodeResponse { + uint64 transaction_id = 1; + bool is_success = 2; + string failure_message = 3; +} + +message ImportTransactionsRequest { + string txs = 1; +} + +message ImportTransactionsResponse { + repeated uint64 tx_ids = 1; +} + +message GetAllCompletedTransactionsRequest { + uint64 offset = 1; + uint64 limit = 2; + uint64 status_bitflag = 3; +} + +message GetAllCompletedTransactionsResponse { + repeated TransactionInfo transactions = 1; +} + +// Request message for getting transactions at a specific block height +message GetBlockHeightTransactionsRequest { + // The block height to fetch transactions for + uint64 block_height = 1; +} + +message GetBlockHeightTransactionsResponse { + // List of transactions mined at the specified block height + repeated TransactionInfo transactions = 1; +} + +// PayRef (Payment Reference) related messages and enums + +// Request message for GetTransactionPayRefs RPC. +message GetTransactionPayRefsRequest { + // The transaction ID to retrieve PayRefs for. + uint64 transaction_id = 1; +} + +// Response message for GetTransactionPayRefs RPC. +message GetTransactionPayRefsResponse { + // List of PayRefs (32-byte payment references) for the transaction. + repeated bytes payment_references = 1; +} + + +// Response message for GetTransactionsWithPayRefs RPC. +message GetTransactionsWithPayRefsResponse { + // The transaction information. + TransactionInfo transaction = 1; + // List of PayRefs associated with this transaction. + repeated bytes payment_references = 2; + // Number of unique recipients for this transaction. + uint64 recipient_count = 3; +} + +// Request message for getting payment details by payment reference +message GetPaymentByReferenceRequest { + // The 32-byte payment reference hash to look up + bytes payment_reference = 1; +} + +// Response message containing transaction information for a payment reference +message GetPaymentByReferenceResponse { + // The transaction information if PayRef is found (optional). + // Returns full transaction details + TransactionInfo transaction = 1; +} + + +// Enum for payment direction +enum PaymentDirection { + // Unknown or unspecified direction + PAYMENT_DIRECTION_UNKNOWN = 0; + // Payment received by this wallet + PAYMENT_DIRECTION_INBOUND = 1; + // Payment sent from this wallet + PAYMENT_DIRECTION_OUTBOUND = 2; +} diff --git a/internal/server/proxy/randomxT.go b/internal/server/proxy/randomxT.go new file mode 100644 index 0000000..87d1ed0 --- /dev/null +++ b/internal/server/proxy/randomxT.go @@ -0,0 +1,165 @@ +package proxy + +import ( + "context" + "crypto/rand" + "encoding/hex" + "fmt" + pb "pool/internal/server/proxy/proto" + block "pool/internal/server/proxy/proto/block" + transaction "pool/internal/server/proxy/proto/transaction" + "sync" + + "google.golang.org/grpc" +) + +// BaseNode客户端示例 +type BaseNodeClient struct { + conn *grpc.ClientConn + client pb.BaseNodeClient + ctx context.Context +} + +type NewBlockTemplateResponse struct { + NewBlockTemplate *block.NewBlockTemplate `json:"new_block_template"` + InitialSyncAchieved bool `json:"initial_sync_achieved"` + MinerData *pb.MinerData `json:"miner_data"` +} + +type NewBlockTemplate struct { + Header *block.BlockHeader `json:"header"` + Body *transaction.AggregateBody `json:"body"` +} + +// 创建BaseNode客户端 +func NewBaseNodeClient(address string) (*BaseNodeClient, error) { + conn, err := grpc.Dial(address, grpc.WithInsecure()) + if err != nil { + return nil, fmt.Errorf("failed to connect to base node: %v", err) + } + ctx := context.Background() + return &BaseNodeClient{ + conn: conn, + client: pb.NewBaseNodeClient(conn), + ctx: ctx, + }, nil +} + +type RandomxTJob struct { + JobID string `json:"job_id"` + SeedHash string `json:"seed_hash"` + Height uint64 `json:"height"` + MiningHash string `json:"mining_hash"` + Blob string `json:"blob"` // hash_blob + Difficulty uint64 `json:"diffculty"` + Header string `json:"header"` + Body string `json:"body"` +} + +type MoneroNotify_params_msg struct { + Id string `json:"id"` + JobId string `json:"job_id"` + SeedHash string `json:"seed_hash"` + Blob string `json:"blob"` + Height uint32 `json:"height"` + Target string `json:"target"` + NextSeedHash string `json:"next_seed_hash"` + Algo string `json:"algo"` +} + +type Monero_msg struct { + Jsonrpc string `json:"jsonrpc"` + Method string `json:"method"` + Params MoneroNotify_params_msg `json:"params"` +} + +type MoneroAuthorize_reply struct { + ID float64 `json:"id"` + Jsonrpc string `json:"jsonrpc"` + Error interface{} `json:"error"` + Result MoneroJob `json:"result"` +} + +type MoneroJob struct { + Id string `json:"id"` + Job MoneroNotify_params_msg `json:"job"` + Status string `json:"status"` +} + +func randomxJobId() string { + // 生成4个字节 + bytes := make([]byte, 4) + _, err := rand.Read(bytes) + if err != nil { + panic(err) + } + + // 转成 hex 字符串 + hexStr := hex.EncodeToString(bytes) + return hexStr +} + +var jobs sync.Map + +func (c *BaseNodeClient) get_randomxt_data() { + getblocktemplateReq := &pb.NewBlockTemplateRequest{ + Algo: &block.PowAlgo{ + PowAlgo: block.PowAlgo_POW_ALGOS_RANDOMXT, // 使用 SHA3X 算法 + }, + MaxWeight: 0x00ff, // 设置最大权重 + } + blocktemplate, err := c.client.GetNewBlockTemplate(c.ctx, getblocktemplateReq) + if err != nil { + fmt.Println("get block template failed:", err) + return + } + synced := blocktemplate.InitialSyncAchieved + if !synced { + fmt.Println("chain doesn`t synced!") + return + } + diff := blocktemplate.MinerData.TargetDifficulty + template := blocktemplate.NewBlockTemplate + + newblock, err := c.client.GetNewBlock(c.ctx, template) + if err != nil { + fmt.Println("get new block failed:", err) + return + } + height := newblock.Block.Header.Height + newblockblob, err := c.client.GetNewBlockBlob(c.ctx, template) + if err != nil { + fmt.Println("get new block blob failed:", err) + return + } + + mining_hash_byte, vm_key_byte := newblock.BlockHash, newblock.VmKey + header_byte, body_byte := newblockblob.Header, newblockblob.BlockBody + // 构造tari-ranomdxt hashing_blob + // 3字节前导0 + 32字节mining_hash + 8字节nonce + 1字节pow_algo + 32字节pow_data + pilotZero := make([]byte, 3) + pow_algo := []byte{0x20} + pow_data := make([]byte, 32) + initNonce := make([]byte, 8) + + hashing_blob := make([]byte, 76) + copy(hashing_blob[0:3], pilotZero) // 3字节 + copy(hashing_blob[3:35], mining_hash_byte) // 32字节 + copy(hashing_blob[35:43], initNonce) // 8字节 + copy(hashing_blob[43:44], pow_algo) // 1字节 + copy(hashing_blob[44:76], pow_data) // 32字节 + + jobId := randomxJobId() + + var job RandomxTJob + job.MiningHash = hex.EncodeToString(mining_hash_byte) + job.Blob = hex.EncodeToString(hashing_blob) + job.Header = hex.EncodeToString(header_byte) + job.Body = hex.EncodeToString(body_byte) + job.Height = height + job.Difficulty = diff + job.SeedHash = hex.EncodeToString(vm_key_byte) + job.JobID = jobId + + jobs.LoadOrStore(jobId, job) +} diff --git a/internal/server/randomxT/randomxT.go b/internal/server/randomxT/randomxT.go index e189435..ea3c156 100644 --- a/internal/server/randomxT/randomxT.go +++ b/internal/server/randomxT/randomxT.go @@ -26,49 +26,56 @@ import ( "go.uber.org/zap" ) -const SERVER_SHA3X_VERSION string = "sha3x v0.1a" +const SERVER_RANDOMXT_VERSION string = "randomxt v0.1a" -type Sha3xBlockHeader struct { - Nonce [8]byte - Header [32]byte - Algo byte +type RandomxTBlockHeader struct { + Zero [3]byte + Nonce [8]byte + Header [32]byte + Algo byte + PowData [32]byte } -func Sha3xBlockHeaderToBytes(h Sha3xBlockHeader) []byte { - out := make([]byte, 8+32+1) - for i := 0; i < 8; i++ { - out[i] = h.Nonce[i] +func RandomxTBlockHeaderToBytes(miningHash string) []byte { + miningHashBytes, err := hex.DecodeString(miningHash) + if err != nil || len(miningHashBytes) != 32 { + return nil } - for i := 0; i < 32; i++ { - out[8+i] = h.Header[i] - } - out[8+32] = h.Algo + out := make([]byte, 76) + copy(out[0:3], []byte{0x00, 0x00, 0x00}) + copy(out[3:35], miningHashBytes) + // nonce 8 字节默认全 0,无需手动赋值 + out[43] = 0x02 + // 最后 32 字节也默认全 0,无需赋值 return out } -type ServerSha3xContext struct { +type ServerRandomxContext struct { ServerCtx *coin.ServerContext logg *zap.Logger - Sha3xJob msg.Sha3xStratumJob + RandomxTJob msg.RandomxTStratumJob } var logg *zap.Logger -var ServerSha3xCtx ServerSha3xContext +var ServerSha3xCtx ServerRandomxContext +var vm *RandomXValidator -type Sha3xNotify_params_msg struct { - Algo string `json:"algo"` - Blob string `json:"blob"` - Height uint32 `json:"height"` - Job_id string `json:"job_id"` - Target string `json:"target"` +type RandomxTNotify_params_msg struct { + Algo string `json:"algo"` // "rx/0" + Blob string `json:"blob"` + Height uint32 `json:"height"` + Job_id string `json:"job_id"` + Target string `json:"target"` + SeedHash string `json:"seed_hash"` + Variant string `json:"variant"` // "rx/0" } -type Sha3xNotify_msg struct { - Jsonrpc string `json:"jsonrpc"` - Method string `json:"method"` - Params Sha3xNotify_params_msg `json:"params"` +type RandomxTNotify_msg struct { + Jsonrpc string `json:"jsonrpc"` + Method string `json:"method"` + Params RandomxTNotify_params_msg `json:"params"` } func handle_submit(miner *coin.MinerObj, id float64, miner_user string, job_id string, nonce2 string, ntime string, nonce string) (bool, bool, bool) { @@ -98,7 +105,7 @@ func handle_submit(miner *coin.MinerObj, id float64, miner_user string, job_id s //stratum.UpdateJobs(miner) v, ok := miner.Jobs.Load(job_id) if ok { - job := v.(msg.Sha3xStratumJob) + job := v.(msg.RandomxTStratumJob) if job.Height < miner.CurHeight-1 { ack.Result = false @@ -129,19 +136,25 @@ func handle_submit(miner *coin.MinerObj, id float64, miner_user string, job_id s nb, _ := hex.DecodeString(nonce) - var calc_hash []byte + // var calc_hash []byte - var header Sha3xBlockHeader - for i := 0; i < 8; i++ { - header.Nonce[i] = nb[i] + // var header RandomxTBlockHeader + // for i := 0; i < 8; i++ { + // header.Nonce[i] = nb[i] + // } + // for i := 0; i < 32; i++ { + // header.Header[i] = phb[i] + // } + // header.Algo = 1 + // header := miner.Server.RandomxTJob.Header + submit_item.Header = hex.EncodeToString(phb) + calc_hash, _, err := vm.BuildPowHash(phb, nb) + if err != nil { + ack.Result = false + stratum.Handle_exception(miner, id, stratum.MINER_ERR_UNKNOWN) + miner.ErrOthers = miner.ErrOthers + 1 + return false, false, false } - for i := 0; i < 32; i++ { - header.Header[i] = phb[i] - } - header.Algo = 1 - submit_item.Header = hex.EncodeToString(Sha3xBlockHeaderToBytes(header)) - calc_hash = BuildPowHash(header) - //logg.Debug("[server]", zap.String("hash in", submit_item.Header)) //calc_hash, header := util.BuildBlockHash(&(job), true, Build_PowHash) //logg.Debug("[server]", zap.String("calc_hash", hex.EncodeToString(calc_hash)) /*, zap.String("merkle root", hex.EncodeToString(merkle_root))*/) @@ -455,7 +468,8 @@ func handle_submit(miner *coin.MinerObj, id float64, miner_user string, job_id s return false, false, true } -func Produce_block_submit(miner *coin.MinerObj /*header Sha3xBlockHeader,*/, job *msg.Sha3xStratumJob, PowHash string, SubIdx int64) { +func Produce_block_submit(miner *coin.MinerObj /*header Sha3xBlockHeader,*/, job *msg.RandomxTStratumJob, PowHash string, SubIdx int64) { + var nm msg.BlockSha3xMsg nm.Id = job.Id nm.Header = job.Header @@ -497,7 +511,7 @@ func Produce_block_submit(miner *coin.MinerObj /*header Sha3xBlockHeader,*/, job } if miner.Server.PubCh != nil { //miner.Server.PubCh.SendChan <- [][]byte{[]byte("blksha3x"), []byte(blk)} - err := miner.Server.PubCh.SendMessage([][]byte{[]byte("blksha3x"), []byte(blk)}) + err := miner.Server.PubCh.SendMessage([][]byte{[]byte("blkrandomxt"), []byte(blk)}) if err != nil { miner.Server.PubCh.Destroy() miner.Server.PubCh = nil @@ -509,12 +523,12 @@ func Produce_block_submit(miner *coin.MinerObj /*header Sha3xBlockHeader,*/, job } // server-->miner -func sha3x_parse_miner_notify(miner *coin.MinerObj, msg msg.Sha3xStratumJob) int { +func randomxT_parse_miner_notify(miner *coin.MinerObj, msg msg.RandomxTStratumJob) int { if miner.Sha3xJob.Height != msg.Height { miner.Job.IsClean = true } - miner.Sha3xJob = msg - miner.Sha3xJob.Extranonce1 = miner.Job.Extranonce1 + miner.RandomxTJob = msg + miner.RandomxTJob.Extranonce1 = miner.Job.Extranonce1 miner.Job.Extranonce2_size = msg.Extranonce2_size //miner.Server.Logg.Info("[server]", zap.Int32("miner.Version", miner.Version), zap.Int32("msg.Version", msg.Version)) @@ -524,7 +538,7 @@ func sha3x_parse_miner_notify(miner *coin.MinerObj, msg msg.Sha3xStratumJob) int func Init(server *coin.ServerContext) { ServerSha3xCtx.ServerCtx = server logg = server.Logg - logg.Info("[server]", zap.String("server_sha3x_version", SERVER_SHA3X_VERSION)) + logg.Info("[server]", zap.String("server_version", SERVER_RANDOMXT_VERSION)) coin.Init_diff_db() } @@ -537,8 +551,8 @@ func Stop() { } func InitMiner(miner *coin.MinerObj) { - miner.Sha3xJob = miner.Server.Sha3xJob - miner.Sha3xJob.Extranonce1 = miner.Job.Extranonce1 + miner.RandomxTJob = miner.Server.RandomxTJob + miner.RandomxTJob.Extranonce1 = miner.Job.Extranonce1 server_target := new(big.Int) t_bytes, err := hex.DecodeString(miner.NexaJob.Target) @@ -596,18 +610,18 @@ func Sha3xNotify(miner *coin.MinerObj) { miner.TxLock.Lock() //log.Println("[server]extra1, id", miner.Job.Extranonce1, miner.Job.Job_id, miner.MinerId) - var msg Sha3xNotify_msg + var msg RandomxTNotify_msg idb := make([]byte, 4) binary.BigEndian.PutUint32(idb, miner.JobId) miner.Job.Job_id = hex.EncodeToString(idb) - msg.Params.Algo = "sha3x" + msg.Params.Algo = "rx/0" + msg.Params.Variant = "rx/0" + msg.Params.SeedHash = miner.Server.RandomxTJob.SeedHash msg.Params.Job_id = miner.Job.Job_id - msg.Params.Blob = miner.Sha3xJob.Header - msg.Params.Height = miner.Sha3xJob.Height - //target_s, _ := stratum.ReverseHexStringByByte(miner.Sha3xJob.Target) - //msg.Params.Target = target_s[48:] + msg.Params.Blob = miner.RandomxTJob.Header + msg.Params.Height = miner.RandomxTJob.Height target_new, _ := utility.DiffToTarget(miner.Difficulty) target_str := fmt.Sprintf("%064x", target_new.Bytes()) target_strr, strerr := stratum.ReverseHexStringByByte(target_str) @@ -617,11 +631,11 @@ func Sha3xNotify(miner *coin.MinerObj) { //println("target=", target_str, "r=", target_strr) msg.Params.Target = target_strr[48:] - miner.CurHeight = miner.Sha3xJob.Height + miner.CurHeight = miner.RandomxTJob.Height - miner.Sha3xJob.JobDifficulty = miner.Difficulty + miner.RandomxTJob.JobDifficulty = miner.Difficulty - miner.Jobs.LoadOrStore(miner.Job.Job_id, miner.Sha3xJob) + miner.Jobs.LoadOrStore(miner.Job.Job_id, miner.RandomxTJob) /*var entry coin.JobListEntry entry.Job_id = miner.Job.Job_id @@ -691,8 +705,11 @@ func formatUint64ToHexWithPadding(val uint64) string { return hexStr } +var last_seed_hash string = "" + func HandleJobMsg(server *coin.ServerContext, Msg []byte) { - var result msg.Sha3xStratumJob + vm = &RandomXValidator{} // 初始化vm虚拟机指针,防止出现空指针报错 + var result msg.RandomxTStratumJob server.Logg.Warn("[server]", zap.String("receive", "job")) if err := json.Unmarshal(Msg, &result); err != nil { @@ -701,21 +718,36 @@ func HandleJobMsg(server *coin.ServerContext, Msg []byte) { } result.Target = formatUint64ToHexWithPadding(result.U64target) + if last_seed_hash != result.SeedHash { + seed_hash_byte, err := hex.DecodeString(result.SeedHash) + if err != nil { + server.Logg.Error("[server]", zap.String("DecodeString", err.Error())) + return + } + vm, err = NewRandomXValidator(seed_hash_byte) + if err != nil { + server.Logg.Error("[server]", zap.String("NewRandomXValidator", err.Error())) + return + } + last_seed_hash = result.SeedHash + } //target_new, _ := utility.DiffToTarget((float64)(result.U64target)) //target_str := fmt.Sprintf("%064x", target_new.Bytes()) //result.Target = target_str - server.Sha3xJob = msg.Sha3xStratumJob(result) - logg.Debug("[gbt]", zap.String("Target", server.Sha3xJob.Target)) + server.RandomxTJob = msg.RandomxTStratumJob(result) + blobByte := RandomxTBlockHeaderToBytes(server.RandomxTJob.Header) + server.RandomxTJob.Header = hex.EncodeToString(blobByte) + logg.Debug("[gbt]", zap.String("Target", server.RandomxTJob.Target)) - server.Sha3xJob.Extranonce2_size = 8 + server.RandomxTJob.Extranonce2_size = 8 server.SJob.Extranonce2_size = 8 - logg.Debug("[gbt]", zap.Uint32("Height", server.Sha3xJob.Height), zap.String("Target", server.Sha3xJob.Target), zap.String("Header", server.Sha3xJob.Header) /*, zap.Uint64("Timastamp", server.Sha3xJob.CurTime)*/) - targetb, _ := hex.DecodeString(server.Sha3xJob.Target) - logg.Debug("[gbt]", zap.Uint64("Id", server.Sha3xJob.Id), zap.Float64("network diff", utility.Target2Diff(utility.Reverse(targetb)))) + logg.Debug("[gbt]", zap.Uint32("Height", server.RandomxTJob.Height), zap.String("Target", server.RandomxTJob.Target), zap.String("Header", server.RandomxTJob.Header) /*, zap.Uint64("Timastamp", server.Sha3xJob.CurTime)*/) + targetb, _ := hex.DecodeString(server.RandomxTJob.Target) + logg.Debug("[gbt]", zap.Uint64("Id", server.RandomxTJob.Id), zap.Float64("network diff", utility.Target2Diff(utility.Reverse(targetb)))) - server.NetHight = uint64(server.Sha3xJob.Height) - server.NetTarget = server.Sha3xJob.Target + server.NetHight = uint64(server.RandomxTJob.Height) + server.NetTarget = server.RandomxTJob.Target server.Miners.Range(func(k, v interface{}) bool { if v != nil { m, ok := v.(*(coin.MinerObj)) @@ -724,7 +756,7 @@ func HandleJobMsg(server *coin.ServerContext, Msg []byte) { server.Logg.Info("[server]", zap.String("lock", "start")) m.TxLock.Lock() status := m.Status - cmd := sha3x_parse_miner_notify(m, server.Sha3xJob) + cmd := randomxT_parse_miner_notify(m, server.RandomxTJob) m.TxLock.Unlock() server.Logg.Info("[server]", zap.String("lock", "end")) var need_notify bool = true diff --git a/internal/server/server.go b/internal/server/server.go index 1915a0a..77b2a1f 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -15,16 +15,15 @@ import ( "log" //"math/big" + "math/rand" "net" "os" "os/signal" + "pool/internal/cache" "pool/internal/db" "pool/internal/server/coin" "pool/internal/server/dbif" - "pool/internal/server/sha3x" - - "math/rand" - "pool/internal/cache" + "pool/internal/server/randomxT" "pool/internal/stratum" "pool/internal/utility" @@ -129,20 +128,35 @@ var coinobjs = []coin.CoinObj{ // IsMhsLow: nexa.IsMhsLow, // GetBlockInterval: nexa.GetBlockInterval, // }, + // { + // Coin: "sha3x", + // Init: sha3x.Init, + // Start: sha3x.Start, + // Stop: sha3x.Stop, + // InitMiner: sha3x.InitMiner, + // HandleMinerSubscribe: sha3x.HandleMinerSubscribe, + // HandleMinerAuth: sha3x.HandleMinerAuth, + // HandleMinerSubmit: sha3x.HandleMinerSubmit, + // SetDifficulty: sha3x.SetDifficulty, + // Notify: sha3x.Notify, + // HandleJobMsg: sha3x.HandleJobMsg, + // IsMhsLow: sha3x.IsMhsLow, + // GetBlockInterval: sha3x.GetBlockInterval, + // }, { - Coin: "sha3x", - Init: sha3x.Init, - Start: sha3x.Start, - Stop: sha3x.Stop, - InitMiner: sha3x.InitMiner, - HandleMinerSubscribe: sha3x.HandleMinerSubscribe, - HandleMinerAuth: sha3x.HandleMinerAuth, - HandleMinerSubmit: sha3x.HandleMinerSubmit, - SetDifficulty: sha3x.SetDifficulty, - Notify: sha3x.Notify, - HandleJobMsg: sha3x.HandleJobMsg, - IsMhsLow: sha3x.IsMhsLow, - GetBlockInterval: sha3x.GetBlockInterval, + Coin: "randomxt", + Init: randomxT.Init, + Start: randomxT.Start, + Stop: randomxT.Stop, + InitMiner: randomxT.InitMiner, + HandleMinerSubscribe: randomxT.HandleMinerSubscribe, + HandleMinerAuth: randomxT.HandleMinerAuth, + HandleMinerSubmit: randomxT.HandleMinerSubmit, + SetDifficulty: randomxT.SetDifficulty, + Notify: randomxT.Notify, + HandleJobMsg: randomxT.HandleJobMsg, + IsMhsLow: randomxT.IsMhsLow, + GetBlockInterval: randomxT.GetBlockInterval, }, // { // Coin: "monero", diff --git a/internal/stratum/stratum.go b/internal/stratum/stratum.go index a1a556d..caa02e3 100644 --- a/internal/stratum/stratum.go +++ b/internal/stratum/stratum.go @@ -225,6 +225,27 @@ type MoneroJob struct { Status string `json:"status"` } +type RandomxTAuthorize_reply struct { + ID float64 `json:"id"` + Jsonrpc string `json:"jsonrpc"` + Result RandomxTAuthorize_job_msg `json:"job"` + Error interface{} `json:"error"` +} + +type RandomxTAuthorize_job_msg struct { + ID string `json:"id"` + Job struct { + Algo string `json:"algo"` // "rx/0" + JobId string `json:"job_id"` + Blob string `json:"blob"` + SeedHash string `json:"seed_hash"` + Target string `json:"target"` + Height uint32 `json:"height"` + Variant string `json:"variant"` // "rx/0" + } `json:"job"` + Status string `json:"status"` +} + type KeepAlived_resp struct { ID int `json:"id"` Jsonrpc string `json:"jsonrpc"` @@ -581,7 +602,7 @@ func Handle_authorize(miner *coin.MinerObj, id float64, auth_msg string, DbCtx * if e = json.Unmarshal([]byte(auth_msg), &s); e != nil { miner.Server.Logg.Error("[server]", zap.String("Unmarshal", e.Error())) } - } else if miner.Name == "sha3x" || miner.Name == "monero" { + } else if miner.Name == "sha3x" || miner.Name == "monero" || miner.Name == "randomxt" { if e = json.Unmarshal([]byte(auth_msg), &s_sha3x); e != nil { miner.Server.Logg.Error("[server]", zap.String("Unmarshal", e.Error())) } @@ -753,6 +774,41 @@ func Handle_authorize(miner *coin.MinerObj, id float64, auth_msg string, DbCtx * body_string = string(body) + "\n" // fmt.Println(body_string) err = Conn_tx(miner.Conn, []byte(body_string)) + } else if miner.Name == "randomxt" { + var randomxt_ack RandomxTAuthorize_reply + randomxt_ack.Result.Status = "OK" + idb := make([]byte, 4) + binary.BigEndian.PutUint32(idb, miner.JobId) + miner.Job.Job_id = hex.EncodeToString(idb) + randomxt_ack.ID = id + randomxt_ack.Result.Status = "OK" + randomxt_ack.Result.ID = "1" + randomxt_ack.Result.Job.JobId = miner.Job.Job_id + randomxt_ack.Result.Job.Algo = "rx/0" + randomxt_ack.Result.Job.Blob = miner.RandomxTJob.Header + randomxt_ack.Result.Job.Height = miner.RandomxTJob.Height + randomxt_ack.Result.Job.Variant = "rx/0" + randomxt_ack.Result.Job.SeedHash = miner.RandomxTJob.SeedHash + target_new, _ := utility.MoneroDiffToTarget(miner.Difficulty) + target_str := fmt.Sprintf("%064x", target_new.Bytes()) + target_strr, strerr := ReverseHexStringByByte(target_str) + if strerr != nil { + println("ReverseHexStringByByte", strerr.Error()) + } + randomxt_ack.Result.Job.Target = target_strr[48:] + + body, err := json.Marshal(randomxt_ack) + if err != nil { + miner.Server.Logg.Error("[server]", zap.String("Marshal", err.Error())) + miner.TxLock.Unlock() + return false + } + body_string = string(body) + "\n" + err = Conn_tx(miner.Conn, []byte(body_string)) + if err != nil { + //delete(miner.Server.Miners, miner.MinerId) + //miner.Server.Miners.Delete(miner.MinerId) + } } else { }