Skip to content

Commit 1f57e4f

Browse files
authored
Merge pull request #996 from singnet/artur-rust-proto-bump
[HE Client] Use latest `das-proto` in submodule
2 parents 83b0604 + 3f88c9a commit 1f57e4f

File tree

6 files changed

+18
-14
lines changed

6 files changed

+18
-14
lines changed

3rd_party_slots/rust_metta_bus_client/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

3rd_party_slots/rust_metta_bus_client/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "metta-bus-client"
3-
version = "0.4.0"
3+
version = "0.4.1"
44
edition = "2021"
55

66
[dependencies]
@@ -11,9 +11,9 @@ regex = "1.11.0"
1111
log = "0.4.0"
1212
env_logger = "0.8.4"
1313

14-
hyperon-common = { git = "https://github.com/trueagi-io/hyperon-experimental.git", version = "0.2.8" }
15-
hyperon-atom = { git = "https://github.com/trueagi-io/hyperon-experimental.git", version = "0.2.8" }
16-
hyperon-space = { git = "https://github.com/trueagi-io/hyperon-experimental.git", version = "0.2.8" }
14+
hyperon-common = { git = "https://github.com/trueagi-io/hyperon-experimental.git" }
15+
hyperon-atom = { git = "https://github.com/trueagi-io/hyperon-experimental.git" }
16+
hyperon-space = { git = "https://github.com/trueagi-io/hyperon-experimental.git" }
1717
md5 = "0.8.0"
1818

1919
[build-dependencies]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
fn main() -> Result<(), Box<dyn std::error::Error>> {
2-
tonic_build::compile_protos("proto/atom_space_node.proto")?;
2+
tonic_build::compile_protos("proto/distributed_algorithm_node.proto")?;
33
Ok(())
44
}

3rd_party_slots/rust_metta_bus_client/src/bus_node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use tokio::runtime::Builder;
22
use tonic::{Request, Status};
33

4-
use das_proto::{atom_space_node_client::AtomSpaceNodeClient, MessageData};
4+
use das_proto::{distributed_algorithm_node_client::DistributedAlgorithmNodeClient, MessageData};
55

66
mod das_proto {
77
tonic::include_proto!("dasproto");
@@ -60,7 +60,7 @@ impl BusNode {
6060
runtime.block_on(async move {
6161
let target_addr = format!("http://{target_id}");
6262
log::trace!(target: "das", "BusNode::query(target_addr): {target_addr}");
63-
match AtomSpaceNodeClient::connect(target_addr).await {
63+
match DistributedAlgorithmNodeClient::connect(target_addr).await {
6464
Ok(mut client) => client.execute_message(request).await,
6565
Err(err) => Err(Status::internal(format!("Client failed to connect: {err}"))),
6666
}

3rd_party_slots/rust_metta_bus_client/src/proxy.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use tokio::runtime::Runtime;
77
use tonic::{transport::Server, Request, Response, Status};
88

99
use das_proto::{
10-
atom_space_node_client::AtomSpaceNodeClient,
11-
atom_space_node_server::{AtomSpaceNode, AtomSpaceNodeServer},
10+
distributed_algorithm_node_client::DistributedAlgorithmNodeClient,
11+
distributed_algorithm_node_server::{DistributedAlgorithmNode, DistributedAlgorithmNodeServer},
1212
Ack, Empty, MessageData,
1313
};
1414

@@ -73,7 +73,7 @@ impl ProxyNode {
7373
let peer_id = self.peer_id.clone();
7474
runtime.spawn(async move {
7575
let target_addr = format!("http://{peer_id}");
76-
match AtomSpaceNodeClient::connect(target_addr).await {
76+
match DistributedAlgorithmNodeClient::connect(target_addr).await {
7777
Ok(mut client) => client.execute_message(request).await,
7878
Err(err) => {
7979
log::error!(target: "das", "ProxyNode::to_remote_peer(ERROR): {err:?}");
@@ -201,7 +201,7 @@ impl StarNode {
201201
}
202202

203203
#[tonic::async_trait]
204-
impl AtomSpaceNode for StarNode {
204+
impl DistributedAlgorithmNode for StarNode {
205205
async fn execute_message(
206206
&self, request: Request<MessageData>,
207207
) -> Result<Response<Empty>, Status> {
@@ -225,7 +225,11 @@ impl GrpcServer for StarNode {
225225
async fn start_server(self) -> Result<(), BoxError> {
226226
let addr = self.address;
227227
log::debug!(target: "das", "StarNode::start_server(): Inside gRPC server thread at {:?}", addr);
228-
Server::builder().add_service(AtomSpaceNodeServer::new(self)).serve(addr).await.unwrap();
228+
Server::builder()
229+
.add_service(DistributedAlgorithmNodeServer::new(self))
230+
.serve(addr)
231+
.await
232+
.unwrap();
229233
Ok(())
230234
}
231235
}

0 commit comments

Comments
 (0)