diff --git a/formica.Dockerfile b/formica.Dockerfile index 7dd96d6..1dd0116 100644 --- a/formica.Dockerfile +++ b/formica.Dockerfile @@ -23,23 +23,19 @@ RUN apt-get update -y \ COPY --from=builder /usr/local/bin/safeup /app/ # Copy the node binary to the /app directory -COPY --from=builder /app/safenode /app/ -RUN /app/safenode --version +COPY --from=builder /app/antnode /app/ +RUN /app/antnode --version # Set any required env variables -# Set default port numbers for node and its RPC API +# Set default port numbers for node and its metrics service ENV NODE_PORT=12000 -# RPC API usage is deprecated -ENV RPC_PORT=13000 ENV METRICS_PORT=14000 -# This can be used to set the rewards address. The rewards address is the address +# This can be used to set the rewards address. This is the address # that will receive the rewards for the node: --rewards-address ENV REWARDS_ADDR_ARG='' EXPOSE $NODE_PORT -# RPC API usage is deprecated -EXPOSE $RPC_PORT EXPOSE $METRICS_PORT # Temporary fix to use nginx since the node metrics server is exposed only at ip 127.0.0.1 @@ -48,9 +44,8 @@ RUN apt-get -y update && apt-get -y install nginx # Run the node CMD ["sh", "-c", \ "echo \"server { listen ${METRICS_PORT}; server_name localhost; location /metrics { proxy_pass http://127.0.0.1:9090/metrics; include /etc/nginx/proxy_params; } }\" > /etc/nginx/sites-available/default \ - && nginx && /app/safenode --home-network \ + && nginx && /app/antnode --home-network \ --port ${NODE_PORT} \ - --rpc 0.0.0.0:${RPC_PORT} \ --metrics-server-port 9090 \ --root-dir /app/node_data \ --log-output-dest /app/node_data/logs \ diff --git a/src/docker_client.rs b/src/docker_client.rs index 7d559ab..d2f6aa7 100644 --- a/src/docker_client.rs +++ b/src/docker_client.rs @@ -287,7 +287,7 @@ impl DockerClient { Cmd: Some(vec![ "sh".to_string(), "-c".to_string(), - "tail -s 7 -f /app/node_data/logs/safenode.log".to_string(), + "tail -s 7 -f /app/node_data/logs/antnode.log".to_string(), ]), Tty: Some(false), }; @@ -357,7 +357,7 @@ impl DockerClient { &self, id: &ContainerId, ) -> Result<(Option, Option), DockerClientError> { - let cmd = "/app/safenode --version | grep -oE 'Autonomi Node v[0-9]+\\.[0-9]+\\.[0-9]+'" + let cmd = "/app/antnode --version | grep -oE 'Autonomi Node v[0-9]+\\.[0-9]+\\.[0-9]+'" .to_string(); let (_, resp_str) = self .exec_in_container(id, cmd, "get node bin version") diff --git a/src/metrics.rs b/src/metrics.rs index 5fb6b1d..dc942c7 100644 --- a/src/metrics.rs +++ b/src/metrics.rs @@ -15,22 +15,22 @@ pub struct NodeMetric { pub type Metrics = HashMap>; // The number of Nanos in the node reward wallet. -pub const METRIC_KEY_BALANCE: &str = "sn_node_current_reward_wallet_balance"; +pub const METRIC_KEY_BALANCE: &str = "ant_node_current_reward_wallet_balance"; // The store cost of the node. -pub const METRIC_KEY_STORE_COST: &str = "sn_networking_store_cost"; +pub const METRIC_KEY_STORE_COST: &str = "ant_networking_store_cost"; // Memory used by the process in MegaBytes. -pub const METRIC_KEY_MEM_USED_MB: &str = "sn_networking_process_memory_used_mb"; +pub const METRIC_KEY_MEM_USED_MB: &str = "ant_networking_process_memory_used_mb"; // The percentage of CPU used by the process. Value is from 0-100. -pub const METRIC_KEY_CPU_USEAGE: &str = "sn_networking_process_cpu_usage_percentage"; +pub const METRIC_KEY_CPU_USEAGE: &str = "ant_networking_process_cpu_usage_percentage"; // The number of records stored locally. -pub const METRIC_KEY_RECORDS: &str = "sn_networking_records_stored"; +pub const METRIC_KEY_RECORDS: &str = "ant_networking_records_stored"; // The number of records that we're responsible for. This is used to calculate the store cost. -pub const METRIC_KEY_RELEVANT_RECORDS: &str = "sn_networking_relevant_records"; +pub const METRIC_KEY_RELEVANT_RECORDS: &str = "ant_networking_relevant_records"; // The number of peers that we are currently connected to. -pub const METRIC_KEY_CONNECTED_PEERS: &str = "sn_networking_connected_peers"; +pub const METRIC_KEY_CONNECTED_PEERS: &str = "ant_networking_connected_peers"; // The total number of peers in our routing table. -pub const METRIC_KEY_PEERS_IN_RT: &str = "sn_networking_peers_in_routing_table"; +pub const METRIC_KEY_PEERS_IN_RT: &str = "ant_networking_peers_in_routing_table"; // Number of peers that have shunned our node. -pub const METRIC_KEY_SHUNNED_COUNT: &str = "sn_networking_shunned_count_total"; +pub const METRIC_KEY_SHUNNED_COUNT: &str = "ant_networking_shunned_count_total"; // The estimated number of nodes in the network calculated by the peers in our RT. -pub const METRIC_KEY_NET_SIZE: &str = "sn_networking_estimated_network_size"; +pub const METRIC_KEY_NET_SIZE: &str = "ant_networking_estimated_network_size";