Linera Protocol

repository·main·Indexed 12 days ago

https://github.com/linera-io/linera-protocol

A decentralized blockchain infrastructure utilizing a microchain architecture for scalable, secure, and low-latency Web3 applications. The protocol includes base definitions for cryptography and supports advanced implementations such as an LLM-powered Linera Agent, an Automated Market Maker (AMM) for DeFi liquidity and swaps, and an EVM-Linera Bridge for cross-chain token transfers between EVM chains and Linera.

Tokens
200.7K
Snippets
608
Records
943
Agent score
98%

What's inside Linera

  1. Overview of the linera-indexer library

    main

    The linera-indexer library is designed to process blockchain data by connecting to a node service and applying plugins to the block stream. It consists of four primary components:

    • Indexer connection: Manages the connection to the node service (service.rs).
    • Block processing: Handles the logic for processing incoming blocks (indexer.rs).
    • Generic plugin trait: Defines the interface for creating custom data processing plugins (plugin.rs).
    • Runner struct: Orchestrates the execution of the indexer and its plugins (runner.rs).
  2. Overview of Linera Playground

    main
    Linera Playground is a browser-based GraphQL playground designed for interacting with Linera applications. It allows users to enter a faucet URL, a Chain ID, and an Application ID to execute GraphQL queries and mutations. The client runs entirely in the browser using the @linera/client WASM package, which handles Client instantiation, ChainClient creation, synchronization with validators, and querying the application's GraphQL service.
  3. Overview of the `linera` CLI commands

    main

    The linera command-line tool provides a comprehensive interface for interacting with the Linera protocol. It includes subcommands for managing wallets, chains, applications, validators, storage, and network operations.

    Key functional areas include:

    • Wallet Management: linera wallet (init, show, request-chain, etc.)
    • Chain Operations: linera chain, linera open-chain, linera close-chain
    • Application Lifecycle: linera create-application, linera publish-module, linera describe-application
    • Validator Management: linera validator (add, list, query, sync, etc.)
    • Storage Interaction: linera storage (list-namespaces, list-chain-ids, etc.)
    • Network & Infrastructure: linera net, linera faucet, linera benchmark
    • Project Scaffolding: linera project (new, test, publish-and-create)
  4. Overview of Linera Protocol Repository Structure

    main

    The Linera repository is organized into several core crates that build upon each other. Understanding this hierarchy helps in identifying where to find specific logic for development:

    • linera-base: Foundational definitions and cryptography.
    • linera-version: Version management for binaries and services.
    • linera-views: Mapping complex data structures to key-value stores (includes linera-views-derive macros).
    • linera-execution: Logic for runtime and execution of Linera applications.
    • linera-chain: Logic for blocks, certificates, and cross-chain messaging.
    • linera-storage: Storage abstractions built on top of linera-chain.
    • linera-core: The core protocol, including client/server logic and node synchronization.
    • linera-rpc: Data types and schemas for RPC messages (client $\leftrightarrow$ proxy $\leftrightarrow$ chain interactions).
    • linera-client: Library for writing clients (used by CLI, node services, and web clients).
    • linera-service: Executable for clients (CLI wallets), proxies (validator frontends), and servers.
    • linera-sdk: The primary library for developing Rust-based Linera applications for the Wasm VM (includes linera-sdk-derive macros).
    • examples: Reference implementations of Linera applications.
  5. Overview of writing Linera application frontends

    main

    Linera provides a Web client library that allows developers to interact with Linera applications using a JavaScript API directly within web pages. This library enables building interactive frontends that leverage Linera's push notifications to implement real-time reactivity.

    To build a frontend, you typically need a deployed Linera application and its corresponding Application ID.

  6. Use linera-rpc for network abstractions and RPC schemas

    main
    The linera-rpc module provides the core network abstractions and data schemas required for performing Remote Procedure Calls (RPCs) within the Linera protocol. Developers building components that require network communication or need to adhere to the protocol's RPC data formats should use this module.
  7. Use the linera-storage-service for key-value storage

    main

    The linera-storage-service module provides a shared key-value store server. It is built using two primary storage backends:

    1. RocksDB store: For persistent storage.
    2. In-memory store: Provided by linera-views.

    To interact with this service, use the corresponding client which implements the KeyValueStore and KeyValueDatabase traits.