codechain-io / codechain-dashboard Goto Github PK
View Code? Open in Web Editor NEWCodeChain network management and monitoring tool
CodeChain network management and monitoring tool
Currently, the server sends an email and slack message only when there is a problem.
So the administrator is hard to know whether the server is alive or the server is silently gone.
Let's make it send a notification daily.
I don't think about the content of the notification, but I want the title of the email is the following format.
[info][{network id}][dashboard-server] is working - {Utc::now().to_rfc3339()}
Current dashboard just reports whether the node is 'Running' or 'Stopped'. Sometimes it isn't sufficient to diagnosis the error.
We should report when the node's best block number is far behind or spurious errors are flooding.
We renamed agent -> dashboard-client and agent-server(agent-hub) -> dashboard-server. The domains are left as un changed. Let's change them.
Also, change the Corgi's URL: agent-server.corgi.codechain.io
Ubuntu automatically updates PostgreSQL for the security. The dashboard server should reconnect when PostgreSQL is restarted. There are two parts that are using PostgreSQL connection. One is db_service
and the other one is remove_network_usage
. db_service
is already using the connection pool but remove_network_usage
is not using the connection pool.
We may use the pg_cron
The agent(dashboard client) recognizes ipc path in the command line argument, but it doesn't understand the ipc path specified in the config file.
#2018-10-11 02:30:51 UTC agent listen INFO agent-hub The client encountered an error:
#2018-10-11 02:30:52 UTC agent listen INFO ws::io Accepted a new tcp connection from 52.78.215.10:39808.
#2018-10-11 02:30:52 UTC agent-107 INFO agent-hub Agent-107 started
#2018-10-11 02:31:14 UTC ERROR iron::iron Error handling:
Request {
url: Url { generic_url: "http://<agent-hub-ip>:5012/log/validator1" }
method: Get
remote_addr: V4(<my local ip>:57714)
local_addr: V4(0.0.0.0:5012)
}
Error was: RPCError Internal error about jsonrpc call : Timeout timed out waiting on channel
Killed
Currently, the agent server only checks total usable disk space. However, if a server has more than one volume, the agent server should send alarms for each volume.
Currently, we are updating the node by compiling the new version of CodeChain in every node. However, the node may not have enough hardware spec for building CodeChain.
It is better to support updating CodeChain by downloading a binary file from the given URL.
We are removing rows in the network_usage table that were inserted more than a week ago to reduce the usage of disk. We use the network usage table to find strange network throughputs. Since we will check the strange network behavior when it appeared, we don't need to save the previous data.
The purpose of the peer_count table is the same as the network_usage table. We need to remove old rows in the peer_count table.
The Agent Hub uses too many threads to running concurrently.
The information this script shows needs to be added on dashboard.
PostgreSQL could be restarted by an automatic security update.
See https://help.ubuntu.com/community/AutomaticSecurityUpdates
We are using spot instances in the network.
Spot instances could be shut down anytime.
The agent should start automatically when the spot instance is started.
Current dashboard server does not support PostgreSQL 12. If you run generate-schema
it fails with the 12 version.
I set the JSON-RPC port to 18080 in the config file, but agent-hub sends ping
s to 8080.
In some cases, the Agent Server is using the NETWORK_ID from agents. Since the NETWORK_ID could be empty, using the NETWORK_ID from environment variable is better.
I tried to install server but generate-schema
failed with the following messages.
Running `target/debug/generate-schema`
#2019-06-05 13:39:13 main INFO agent-hub Create agent_extra table
#2019-06-05 13:39:13 main INFO agent-hub Create logs table
#2019-06-05 13:39:13 main INFO agent-hub Create logs_timestamp index
#2019-06-05 13:39:13 main INFO agent-hub Create logs_target index
#2019-06-05 13:39:13 main INFO agent-hub Create network_usage table
#2019-06-05 13:39:13 main INFO agent-hub Create network_usage_time_index
#2019-06-05 13:39:13 main INFO agent-hub Create materialized views
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(Db(DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState("42P01"), message: "relation \"peer_count\" does not exist", detail: None, hint: None, position: Some(Normal(259)), where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("parse_relation.c"), line: Some(1180), routine: Some("parserOpenTable") }))', src/libcore/result.rs:997:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
I used PostgreSQL 10.8.
psql (PostgreSQL) 10.8 (Ubuntu 10.8-0ubuntu0.18.04.1)
network_usage
table takes too much disk space.
Currently, the client thinks the port of the node is 3485 if there is no argument.
codechain-dashboard/client/src/process/mod.rs
Line 622 in 2f061c2
net_port
RPC.The dashboard just got one connection removed action though there were four connections more.
We could provide a Docker file which set up environments.
We may use Docker Compose.
The cluster may have 1 of the Agent Hub and 2 of Agents.
The Dashboard already has a UI to send JSON RPC call to CodeChain nodes.
We should implement API for the Dashboard.
It is very common to stop and start all nodes after a few modifications.
CodeChain agent tries to find & update the .git
folder in the CodeChain directory, and build a new binary.
However, most of the machines running CodeChain don't have enough performance to build a binary, so it's useless now.
We might need some kind of auto-updating feature for CodeChain agent in the future, but it will be different from the current implementation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.