CodeChain Agent: a Handy Tool to Manage CodeChain Nodes

Seung Woo Kim
CodeChain
Published in
3 min readOct 8, 2018

Currently, CodeChain is running on the first testnet, ‘Husky’. Being the first testnet, there were numerous patches in order to improve stability. One of the bugs was that the CodeChain node terminated unexpectedly or a network deadlock occurred while the nodes were synchronizing with one another. When we faced this unexpected problem, it was difficult to pinpoint which exact node had a problem, and consequently, debugging proved to be an arduous task as well. In addition, there were problems when applying patches to a large number of nodes, or checking whether each individual node had matching versions.

In order to solve the problems stated above, we initialized the CodeChain Agent project.

CodeChain Agent

CodeChain Agent was developed with the following requirements in mind:

  1. The state of connections between CodeChain nodes can be checked in a single glance.
  2. Node management, such as turning nodes on and off, updating the nodes, etc, can be executed conveniently.
  3. Observing CodeChain’s log should be a convenient process.
  4. Making a JSON RPC request to each node should be simple.

Network topology

The dashboard page provides a network topology that shows the connections between CodeChain nodes at a glance, allowing one to see the status of the nodes’ connections in real time.

Node management

The node list page allows one to compare the status of each node with the number/hash, of the current best block and the node version.

The detail page of each node allows one to manage each nodes’ states, which enables the turning on or off of a node, or updating of a node to a desired git commit hash or branch. In addition, CPU, disk and memory usage of nodes can be checked in real time.

RPC transmission (currently in development)

The RPC page, which is currently under development, provides the ability to conveniently send a JSON-RPC to the desired node. One can send JSON-RPC requests to multiple nodes at once, and use ‘History’, located on the left side, to re-submit the RPC that one previously sent.

Project structure

CodeChain Agent actually consists of three projects:

  1. The CodeChain Agent that is responsible for retrieving information about each node by attaching itself to a CodeChain node.
  2. The CodeChain Agent Hub that collects data from each CodeChain Agent and communicates with the dashboard.
  3. The CodeChain Dashboard that interacts with the user.

Conclusion

In order to manage a blockchain network without problems, it’s no surprise that tools, such as the Agent, are essential. We are actively developing the functions necessary for network topology and node management. In the future, RPC call and log analysis page will be added and will continue to be developed. The CodeChain Agent, just like all other projects, is open-source and readily available at GitHub, so anyone can install it and participate in the development.

--

--