Jess

Comms at WakeUp Labs.

February 7, 2024

Mission Accomplished! RFG-1: Onchain Historical Data API deployed!

WakeUp has exceeded expectations in successfully delivering one of its projects with Optimism Blockchain. The initiative involved providing a service to query the blockchain for specific past moments, empowering developers to access historical state from the Optimism mainnet more easily and in a lightweight manner. The project included various requirements and milestones to truly impact the ecosystem. In this article, we'll delve into an overview of this Request for Grants, financed by the Optimism Foundation, examining ideas, improvements, next steps, and drawing some conclusions.

Why WakeUp?

After mid-2023, WakeUp committed to adding more technical value to the OP ecosystem. This dedication resulted in a successful bid for an Open Source project, contributing to the ecosystem of Public Goods within this space. The project got direct funding from the Optimism Governance, and our selection, among numerous applications, came after rigorous evaluation, competing with highly relevant teams in the ecosystem.

This isn't the first time we've worked on the Optimism Blockchain, and certainly not the first time we've interacted with its ecosystem:

  • WakeUp started by adding the Optimism Blockchain to their developer platform. (You can check it here).

  • Following that, we conducted workshops, classes, and created two GitHub repositories. These resources allow any developer, through video tutorials, to easily check deployed NFTs on Optimism.

  • WakeUp also did talks in Mendoza, made YouTube videos, and Twitch Live Streamings alongside Optimism en Español and Layer 2 en Español.


Wrapping it up, we proudly finished the RFG-1!


These actions and initiatives aim to support an ecosystem that completely aligns with our principles, adding our contribution to a technological revolution.


Decoding Requests for Grants (RFGs) and Their Role in the EVM Ecosystem.

RFGs, or Requests for Grants, are a program introduced by the Grants Council. Operating with principles of transparency, speed, and alignment with the Governance Fund Mandate, RFGs are designed to efficiently drive impactful projects within the Optimism ecosystem. The process involves collaboration between the RFG Lead and the Grant Council Lead, ensuring public engagement, ethical guidelines, and a focus on measurable impact.

These lead to "Public good projects" backed by the Council and often the community. These projects make a real impact, with the investment in software development teams for building essential components in the ecosystem.   


Overview of RFG-1: Understanding the Task and Objectives.

Embarking on a quest to enrich the Optimism blockchain experience, we proposed to create a service to query the Optimism blockchain for specific moments in the past.

Our mission: empower users to query any public view function of smart contracts deployed on the Optimism Blockchain, spanning from its inception to the present.

Powered by the NODEjs framework (JavaScript and TypeScript), our team meticulously crafted a dedicated service and APIs. The ethers.js library seamlessly connects us to the blockchain, while a private RPC node ensures minimal latency.

Crucially, accessibility is at the core of our vision. Anyone will be able to deploy their own instance of the service, embracing decentralization. Simultaneously, a live version integrated into the WakeUp platform, hosted on AWS infrastructure, ensures scalability and security.

Operational 24/7, the service will be easily accessible through REST APIs, providing a user-friendly experience. And the journey continues with a commitment to fortify security and enhance scalability, and smart contracts queried without parameters.

For more in-depth information on our proposal, please visit our postulation here.


Showcasing the Possibilities: What can we build using these endpoints.

With this kind of APIs developers can create Historical Analytics tools to examine past transactions and trends. A community Dashboard can display real-time data, and a notification bot can be created with ease. In decentralized finance (DeFi), integrating queried data enhances user experiences by offering historical data for financial analysis and increasing transparency. The endpoints can also provide valuable information on transactions in a decentralized Marketplace.


From WakeUp, we have built this End-user Demo to showcase a Study Case.


 👉 https://rfg1-demo.wakeuplabs.link/

In this website you can simply enter an address, select a specific date, and it will retrieve the current balance of OP Tokens for that date. Furthermore, through the API, you can view the balance of any ERC-20 token. 


Why GitHub and Open Source Matter: Enabling Local Deployment for Developers.

With the GitHub standardized interface, any developer is able to set the project up locally and use it without any issues.

We made this project 100% open source and easily reusable. You can find the repository with everything you need (include a setup guide) here.

Our Architecture & Sequence Diagrams:

Our service is designed for easy integration, streamlined maintenance, and adaptable extensibility with external services.

This RESTful API seamlessly interacts with the OP blockchain, persisting invoked functions in a dedicated database. Subsequently, users can conveniently bypass providing ABI information on following interactions.

Moreover, an additional component empowers project owners to populate the database with smart contracts they deem pertinent.

To grasp the full spectrum of possibilities, delve into our sequence diagrams:

This diagram shows how to leverage pre-loaded contracts. In that way, the user could check which are those contracts considered most popular and avoid the need to manually load the ABI information.

Nevertheless, users always have the option to inspect any contract using a generic endpoint by passing the necessary parameters.

Besides, through the WakeUp Platform, utilizing AWS infrastructure, we've deployed a scalable and high-performing solution. (You can read more about below 😉)

Even from the platform, one of the endpoints has a dedicated service that interfaces with the database, loading a roster of well-known contracts. This approach provides flexibility for the current solution and supports future implementations with custom sets of contracts.


WakeUp Platform Integration:

WakeUp Labs offers a deployed version ready for use.

Simply sign up for our platform, obtain your unique and free API key, and seamlessly integrate it into your workflow.


You can find all the documentation directly through our Platform Docs 👈

The concept behind having APIs on the platform is to allow you to test the project without the need to run it locally; it's ready for coding, with a framework that a developer is familiar with.


Final Thoughts.

If this proves useful, this type of project is entirely scalable across various blockchains.

Ideally, we're looking to team up with anyone interested in it and help them to successfully apply it in a specific use case. We're here to assist in achieving success.

If after that, there’s a need to keep iterating the project, we can even dive into more sophisticated searches through the blockchain. 

We hope this solidifies our connection with Optimism, and we're keen on exploring further collaboration, focusing on what we do best – tackling progressively intricate technical challenges.


We can't conclude this article without giving a big shoutout to our amazing team for pulling off this project, and a huge thanks to the collaborators at Optimism for their ongoing feedback and recommendations. It wouldn't have been possible without all of you! Thanks a bunch.


For the latest updates, follow us and stay in the loop as we continue supporting the Optimism Ecosystem! 🙌