not approved
Cardano Node API: a multiple protocol query interface
Current Project Status
Unfunded
Amount
Received
₳0
Amount
Requested
₳185,000
Percentage
Received
0.00%
Solution

Develop a Cardano Node API application in Golang to provide data from a Cardano Node over multiple protocols to expose this data easily for consumption by dApp developers.

Problem

The Cardano Node data is provided only locally using a binary protocol over a UNIX socket which is difficult to consume in various diverse use cases.

Feasibility
Value for money
Impact / Alignment

Blink Labs

3 members

Cardano Node API: a multiple protocol query interface

Please describe your proposed solution.

The Cardano Node only exposes its client (Node to Client) data over a local UNIX socket as a measure of security. However, this can make the data difficult to access and consume, especially from remote clients. This data is necessary for tasks such as building transactions or monitoring traffic in the node’s mempool.

The gOuroboros library provides the building blocks for communicating with a Cardano Node as a client in Golang. Our previously funded proposal from Catalyst Fund 9 led to the development of the client side of the protocol.

This proposal intends to leverage this prior work and to build upon it to create a query layer for interfacing with a Cardano node and expose these Ouroboros Node to Client (NtC) queries over multiple HTTP-based protocols. This will allow for consumption in client applications using methods of the developer’s choosing and provide capabilities for varying security scenarios.

Node protocols (Ouroboros NtC):

  • LocalTxSubmission
  • LocalTxMonitor
  • LocalStateQuery

API protocols:

  • REST
  • WebSockets
  • gRPC

This includes the creation of a Go SDK for the UTxORPC project to provide the gRPC functionality.

How does your proposed solution address the challenge and what benefits will this bring to the Cardano ecosystem?

Golang is an extremely popular programming language. GitHub Language Statistics from GitHut 2.0 (code: <https://github.com/madnight/githut>) show that in Q1 2023, the number of pull requests on Golang repositories grew 10.423% and Haskell repositories grew only 0.201% (source: https://madnight.github.io/githut/#/pull_requests/2023/1/Go,Haskell) while the number of repository stars on Golang repositories grew 12.107% and Haskell repositories grew only 0.238% (source: <https://madnight.github.io/githut/#/stars/2023/1/Go,Haskell>). The Golang developer community is over 4x the size of the Haskell developer community, based on the number of Github repos with code for each. Since it’s hard to judge community size, we’re using these numbers as a proxy. We hope to bridge the gap between Golang developers and the Cardano blockchain and attract more developers to Cardano.

Implementing a multi-protocol HTTP-based API will leverage the breadth of existing web technologies for scaling, building, maintaining, and securing HTTP data flows. Creating an API service in Golang allows us to leverage not only our prior work but also the existing code and libraries in the Golang ecosystem. This reduces the time to completion for this project, allows for engaging a larger developer pool for the project, and lowers the barrier for entry into the Cardano ecosystem.

Utilizing UTxORPC for the gRPC interface will ensure interoperability with other Cardano ecosystem projects, such as TxPipe’s Dolos, increasing diversity in the ecosystem while preventing fragmentation due to various implementations.

How do you intend to measure the success of your project?

As our goal is feature completion and open source code, our measure for success will be when the cardano-node-api application supports the desired client queries and can serve them over the desired protocols.

This will be measured by the completion of tasks and milestones within our project board for this project.

Please describe your plans to share the outputs and results of your project?

The cardano-node-api application is open source and developed in public. Each individual piece of work is submitted publicly to the cardano-node-api repository and can be viewed by anyone.

Progress is tracked through GitHub Issues and a GitHub Projects Kanban board (<https://github.com/orgs/blinklabs-io/projects/9>). Our engineering team has weekly meetings on status updates. Discord is used for day to day communication and engaging contributors.

This project is a stepping stone to further work in providing data services using implementations other than the Haskell reference implementation.

What is your capability to deliver your project with high levels of trust and accountability?

Blink Labs has decades of experience delivering open source software. We have a proven track record of delivery and have successfully completed two previous Catalyst Fund 9 proposals. Our work is open source and public for all to view. Our team is highly cohesive and have worked together for years, allowing us to provide accurate time and cost estimates to our work. The cardano-node-api project is in its infancy and could benefit from dedicated resources. Funding allows us to dedicate engineering time to an open source project, rapidly accelerating its development.

What are the main goals for the project and how will you validate if your approach is feasible?

Our goal is for cardano-node-api to become an integral part of a Cardano development stack for Golang developers upon which a Golang ecosystem on Cardano can thrive. To accomplish this goal, we will build the cardano-node-api application functionality to support a diverse capability set, allowing for creation of an entire ecosystem of downstream projects.

We have broken this into 4 deliverable milestones to reach this goal.

  1. Framework and clients
  2. REST / WebSockets API
  3. UTxORPC Go SDK / gRPC API
  4. Ecosystem integration

Blink Labs will create GitHub issues for the individual items of work and will track those items using a project Kanban board on GitHub.

Please provide a detailed breakdown of your project’s milestones and each of the main tasks or activities to reach the milestone plus the expected timeline for the delivery.

The initial project has already been created and is released under the Apache 2.0 license.

GitHub: <https://github.com/blinklabs-io/cardano-node-api>

This application will provide a Golang implementation of a query layer for the Ouroboros network Node to Client mini-protocols which will most closely resemble Ogmios. It will support performing queries against a Cardano Node using HTTP protocols and Ouroboros over TCP to provide data to off-chain applications.

This proposal covers the completion of support for the client side queries for Ouroboros NtC and serving the data over HTTP or TCP in various formats.

Milestone 1 will cover the basics of creating the application and supporting the client side query set. This will include:

  • Initial application framework
  • Container image building and publishing
  • Binary building and publishing
  • Swagger/OpenAPI spec generation
  • LocalTxMonitor client support
  • LocalTxSubmission client support
  • LocalStateQuery client support
  • ChainSync client support

Milestone 2 will cover the creation of the REST API. This will include:

  • Endpoints for LocalTxMonitor via REST
  • Endpoints for LocalTxSubmission via REST
  • Endpoints for LocalStateQuery via REST
  • Endpoints for ChainSync via REST with upgrade to WebSockets

Milestone 3 will cover the creation of the gRPC API. This will include:

  • Validating and testing the UTxORPC spec
  • Coordinating with other UTxORPC stakeholders on implementation
  • Creating a Go SDK for UTxORPC
  • Endpoints for LocalTxMonitor via gRPC
  • Endpoints for LocalTxSubmission via gRPC
  • Endpoints for LocalStateQuery via gRPC
  • Endpoints for ChainSync via gRPC

Milestone 4 will cover ecosystem integration. This will include:

  • Verifying and validating results against the spec
  • Testing against other supported ecosystem services, such as Dolos
  • Creation of client SDKs for the API
  • At least one sample application
  • Documentation on pkg.go.dev
  • Documentation on Cardano developer portal
  • Community outreach

The time budget for each milestone is 1 month, so the project should be completed after 4 months.

Please describe the deliverables, outputs and intended outcomes of each milestone.

The milestones as laid out are tracks of work. These will sometimes be worked in parallel, and as an actively used open source project, there will be software releases created on demand as new features are added, allowing them to be used in downstream projects.

For every milestone, the tasks within it will be completed. Each work item is merged into the main software project, which includes documentation generation and publishing on pkg.go.dev, the primary developer documentation site for Go language apps.

The cardano-submit-api project uses GitHub issues for tracking individual items of work and the work scoped in this proposal will be tracked in a Kanban board within GitHub Projects (<https://github.com/orgs/blinklabs-io/projects/9/views/1>).

Please provide a detailed budget breakdown of the proposed work and resources.

Funding will primarily pay for engineering time. There is also a small piece set aside for paying administrative staff for project management.

The project budget is 46250 ADA per month to pay for Engineering (40000) and Project Management (6250). Each milestone corresponds to a month, and time is allocated to take approximately 75 percent of a full time software engineer or 120 hours and approximately 10 hours of project management.

No additional funding is necessary for third party products or services.

Who is in the project team and what are their roles?

The project development will be completed by the Blink Labs engineering team. Our team includes Principal / Staff Engineers, with more than 40 years combined experience. This project will be primarily assigned to Chris Gianelloni (<https://github.com/wolf31o2>) for development completion, with Aurora Gaffney (<https://github.com/agaffney>) providing code review, documentation, and support.

Blink Labs has previously completed two Catalyst Fund 9 proposals:

Additional Blink Labs staff may be used for administrative functions, such as project management and community reporting.

How does the cost of the project represent value for money for the Cardano ecosystem?

Costs are estimated on a 333.33 ADA per hour rate for a senior golang blockchain software engineer working remotely within the United States (~ $192k USD annually) and 150 ADA per hour rate for a project manager working remotely (~ $86k USD annually)

close

Playlist

  • EP2: epoch_length

    Authored by: Darlington Kofa

    3m 24s
    Darlington Kofa
  • EP1: 'd' parameter

    Authored by: Darlington Kofa

    4m 3s
    Darlington Kofa
  • EP3: key_deposit

    Authored by: Darlington Kofa

    3m 48s
    Darlington Kofa
  • EP4: epoch_no

    Authored by: Darlington Kofa

    2m 16s
    Darlington Kofa
  • EP5: max_block_size

    Authored by: Darlington Kofa

    3m 14s
    Darlington Kofa
  • EP6: pool_deposit

    Authored by: Darlington Kofa

    3m 19s
    Darlington Kofa
  • EP7: max_tx_size

    Authored by: Darlington Kofa

    4m 59s
    Darlington Kofa
0:00
/
~0:00