CITA-Cloud中network微服务的实现,基于zenoh。
docker build -t citacloud/network_zenoh .
$ network -h
network 6.7.0
Rivtower Technologies <contact@rivtower.com>
Usage: network <COMMAND>
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服务。
$ network run -h
run this service
Usage: network run [OPTIONS]
Options:
-c, --config <CONFIG_PATH> Chain config path [default: config.toml]
-h, --help Print help
参数:
-
config微服务配置文件。参见示例
example/config.toml。其中
[network_zenoh]ca_cert为CA根证书。cert为节点证书。priv_key为节点证书对应的私钥。grpc_port为gRPC服务监听的端口号。protocol为zenoh服务协议类型:tls,tcp,quicdomain为域名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_endpointjaeger 采集端地址
$ 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