GithubHelp home page GithubHelp logo

broody / apibara Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apibara/dna

0.0 0.0 0.0 665 KB

Composable streams of web3 data

Home Page: https://www.apibara.com/

License: Apache License 2.0

Rust 46.90% Nix 53.10%

apibara's Introduction


Apibara Node and SDK

The Apibara SDK provides an high-level interface to build applications that transform streams of web3 data. Streams can be composed to form more complex applications. Streams can be transformed using any programming language.

Overview

The Apibara SDK enables developers to build nodes that combine and transform multiple streams of data into a new stream. Nodes don't transform data directly, but delegate the operation to applications. Applications can run externally of the node or they can be built-in. External applications can be implemented in any language and communicate with the node through gRPC, while built-in applications are implemented in Rust and run directly within the node.

The problem

As smart contract developers, we need to expose our data in a format easily accessible by frontend libraries so that our users are delighted by a responsive application that loads fast, even on slower networks.

The main challenge is that StarkNet, like other networks, doesn't provide an API to access a contract's storage like a database. Smart contracts include functions to read specific values from storage, like the owner of an NFT or the ERC-20 balance of an address, but that's not enough if we need more complex queries like a list of NFTs owned by an address or their historical ERC-20 balances. This issue becomes even more critical when we implement smart contracts for complex systems like on-chain games that need to minimize the amount of storage used to reduce transaction costs.

Solution

Apibara can be used as a tool to index smart contract events on StarkNet and, in the future, other EVM-compatible chains like Ethereum. Apibara runs locally on your machine and its job is to:

  • fetch events from the blockchain and send them to the indexer to index
  • track the current chain's head and detect chain reorganizations
  • track and store the indexers progress

Project Structure

The SDK is comprised of several crates, refer to their READMEs to learn more about each one of them.

  • core: types shared by all other crates.
  • node: used to build and run Apibara nodes.
  • starknet: StarkNet source node.
  • cli: the CLI interface to manage and start Apibara nodes.

License

Copyright 2022 GNC Labs Limited

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

apibara's People

Contributors

fracek avatar martiangreed avatar anthonybuisset avatar ivpavici avatar larkooo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.