Your task is to extend the functionality of the Komodo DeFi Framework by adding a new node type called a Metrics Node. This will serve as a foundational piece for further development and integration within our framework.
Please fork the Komodo DeFi Framework repository and create a new branch off the dev branch to work on this task. Metrics Node Development:
- Develop this node based on our existing seed node configuration, ensuring it retains all functionalities of a seed node.
- Introduce a new config parameter, "i_am_metric": true, to denote its additional metric-gathering capabilities.
Data Collection:
For this POC, the Metrics Node should collect data on executed swaps. Specifically, it should prepare hourly candlestick data representing the price graph of a coin in the DeFi Framework. This data should be structured so that GUIs can utilize it flexibly. While hourly data is sufficient for this test, providing data with more detailed granularity, such as every 15 minutes or every 4 hours—similar to other platforms—will be viewed favorably and can enhance your evaluation. Data Handling and Performance:
- You are free to decide on how to handle data storage, processing, and caching. The key evaluation criterion will be how efficiently and quickly the data can be retrieved. The handling and implementation of data retrieval are critical parts of this test, as data should always be available promptly.
Implementation Constraints:
- The implementation of the Metrics Node itself must be native-target only, similar to stats_swaps. However, ensure that the RPC method that requests data from this Metrics Node should work seamlessly across all nodes, whether they are WebAssembly (Wasm) based or native.
RPC Method Addition:
- Implement a new RPC method in the dispatcher to handle requests for the data collected by the Metrics Node.
Support: While I will be off next week, you can reach out to Onur for any queries or guidance. Feel free to ask about specific parts of the code or any other details relevant to your task. Evaluation Aspect: How much you engage with Onur and how independently you navigate this task will also be part of your evaluation.
Completing this task efficiently and within a reasonable time frame is part of the evaluation. Ensure your code is well-documented and includes any necessary tests. Once you have completed the task, submit a pull request to the dev branch of the original repository for review.