-
Notifications
You must be signed in to change notification settings - Fork 4
Architecture
Kasparov is an API server for interacting with the Kaspa network. While Kaspa nodes handle communications internal to the Kaspa P2P network, Kasparov handles communications between the Kaspa network and the outside world.
Kasparov was designed as a separate component, with the thought to decouple two distinct sets of operations. A Kaspa node is very good at communicating with other nodes and does that very fast. It was not designed to handle frequent data queries, serve large volumes of data quickly and handle historical data well. Kasparov is able to serve blocks and transactions data quickly and at large volumes, including historical data, by saving the data in a way that allows quick and efficient polling.
Kasparov is comprised of a backend data connection component (kasparovsyncd) and two interface components (kasparovd and rabbitmq). The front facing interface components were separated in order to allow easy scaling of Kasparov by running several instances of them.
- kasparovsyncd communicate with a kaspad full node and maintains a relational database
- kasparovd is a RESTful API for making queries and sending transactions
- rabbitmq is an MQTT broker for receiving notifications
Kasparovsyncd is a backend component that connects to a kaspad node, reads blocks and transactions data from the Kaspa network through the kaspad node, and syncs it to a relational database.
Kasparovsyncd currently uses MySQL, however there is an active issue to allow it to run with PostgreSQL and MariaDB.
Kasparovd is a RESTful API providing endpoints for sending http requests such as querying for blocks, transactions, addresses and for sending transactions to the network.
Kasparovd is a RESTful API providing endpoints for sending http requests, such as querying for blocks, transactions, addresses and for sending transactions. It was designed for applications such as wallets and block explorers. It serves data from a relational database (maintained by kasparovsyncd). It relays transactions to the Kaspa network through a kaspad node, that it connects to. Several kasparovd instances running side by side can scale up Kasparov.
The MQTT broker is a pub/sub message broker, implemented using RabbitMQ, that allows clients to subscribe to topics and receive notifications from the Kaspa network, such as new blocks, transaction updates, and more. Kasparov currently uses RabbitMQ as an MQTT broker, but any broker can work.