# network_zenoh **Repository Path**: cita-cloud/network_zenoh ## Basic Information - **Project Name**: network_zenoh - **Description**: network use zenoh - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-09-04 - **Last Updated**: 2024-02-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # network_zenoh `CITA-Cloud`中[network微服务](https://github.com/cita-cloud/cita_cloud_proto/blob/master/protos/network.proto)的实现,基于[zenoh](https://crates.io/crates/zenoh)。 ## 编译docker镜像 ``` docker build -t citacloud/network_zenoh . ``` ## 使用方法 ``` $ network -h network 6.7.0 Rivtower Technologies Usage: network Commands: run run this service help Print this message or the help of the given subcommand(s) Options: -h, --help Print help -V, --version Print version ``` ### network-run 运行`network`服务。 ``` $ network run -h run this service Usage: network run [OPTIONS] Options: -c, --config Chain config path [default: config.toml] -h, --help Print help ``` 参数: 1. `config` 微服务配置文件。 参见示例`example/config.toml`。 其中`[network_zenoh]` * `ca_cert` 为`CA`根证书。 * `cert` 为节点证书。 * `priv_key` 为节点证书对应的私钥。 * `grpc_port` 为`gRPC`服务监听的端口号。 * `protocol` 为`zenoh`服务协议类型:`tls`, `tcp`, `quic` * `domain` 为域名 * `port` 为`zenoh`服务监听端口 * `peers` 为`zenoh`邻居节点的网络信息,其中`protocol`字段为服务协议类型,`port`字段为端口号,`domain`字段为该邻居节点申请证书时使用的域名。 * `chain_id` 链的唯一标识 * `node_address` 节点地址文件路径 * `validator_address` 共识节点地址文件路径 * `modules` 为同节点的其它微服务网络信息,其中`module_name`字段为模块名称,`port`字段为该微服务的grpc端口号,`hostname`字段为该微服务的网络地址。 * `hot_update_interval` 节点配置热更新间隔时间(以秒为单位) * `health_check_timeout` 健康检查超时时间(以秒为单位) * `rx_buffer_size` 每个链接的接收缓冲区大小(以字节为单位) 其中`[network_zenoh.log_config]`段为微服务日志的配置: * `max_level` 日志等级 * `filter` 日志过滤配置 * `service_name` 服务名称,用作日志文件名与日志采集的服务名称 * `rolling_file_path` 日志文件路径 * `agent_endpoint` jaeger 采集端地址 ``` $ network run -c example/config.toml 2023-02-08T09:38:08.501559Z INFO network: grpc port of network_zenoh: 50000 2023-02-08T09:38:08.502427Z INFO network: start network_zenoh grpc server! 2023-02-08T09:38:08.502463Z INFO network: metrics on 2023-02-08T09:38:08.502533Z INFO cloud_util::metrics: exporting metrics to http://0.0.0.0:60000/metrics 2023-02-08T09:38:08.504638Z INFO zenoh::net::runtime: Using PID: 7A38F110A4661FE3 2023-02-08T09:38:08.514381Z INFO zenoh::net::runtime::orchestrator: zenohd can be reached at quic/127.0.0.1:40000 ``` ## 设计