AI Network
  • What is AI Network
  • AIN Blockchain
    • Architecture
      • Design Principles
      • Event-driven Architectures
      • Blockchain Database
        • States
          • State Types
          • Operations
          • Predefined Structures
        • Rules and Owners
          • Rule Configs
          • Owner Configs
        • Functions
          • Built-in Functions
      • Instant Execution, and Eventual Consistency
      • Network ID and Chain ID
      • Transactions
        • Structure
        • Nonce
        • Read Concern
        • Propagation
      • Block Structure
      • Account and Keys
      • Consensus
      • Scalability
      • Apps
    • Developer Guide
      • Quick Start
      • AI Network Products
        • AI Network Worker
        • AI Network Insight
        • Testnet Server Node
        • Ainize Trigger
          • Project user
          • Project deployer
          • Why do we have to use Ainize Trigger?
      • Token Bridge
      • Trouble Shooting
    • Developer Reference
      • Blockchain API
        • JSON RPC API
        • Node Client API
      • Blockchain SDK
        • ain-js
        • ain-py
      • Validators
    • Staking
  • AIN DAO
    • What is AIN DAO
      • Runo (Run Your Node)
      • GPU Sponsorship Program
    • Onboarding & Participation
    • Governance
    • Tokenomics
      • AI Network Tokenomics
      • AINFT Tokenomics
  • AI Agents
    • AINFT
    • AINFT Factory
    • AINFT Projects
      • 🍳MiniEggs
      • 🦈Baby Shark
      • 🛸Soul Fiction
      • 🎻NFT Classics Society
    • Developer Reference
      • Ainft-Js
      • AINFT tutorial
        • Create AINFT object and Mint
        • Transfer AINFT
        • Set metadata of AINFT
        • Search and Retrieve AINFT
  • AIN Wallet
    • What is AIN Wallet?
    • AIN Wallet API
  • PROPOSAL DOCUMENTS
    • AIN Improvement Memos (AIMs)
    • AIN Improvement Proposals (AIPs)
Powered by GitBook
On this page

Was this helpful?

  1. AIN Blockchain
  2. Architecture

Event-driven Architectures

PreviousDesign PrinciplesNextBlockchain Database

Last updated 5 years ago

Was this helpful?

AI Network works as event-driven application backend. The lifecycle of application request is as follows.

  1. Client (dApp) sends transactions to blockchain

  2. Block state of blockchain node is updated by the transaction.

  3. Block state listener listens to the path and triggers event to the worker.

  4. AIN workers executes functions for the path and may generate another transactions. If it generates another transaction it goes to (2) and updates block state.

  5. Dapp registers listener to the blockchain data and gets result through the modified blockchain state.

In traditional server-based computing, users need to prepare the server, install OS and necessary drivers and software. Then, users need to manage servers and take care of hardware and software upgrades. To maintain highly-available and scalable servers, users also need to configure load-balancers. The idea behind serverless computing is for developers to focus on writing application code.

Figure1. AIN Triggers listen for value changes of specific paths in the blockchain state. When a trigger is invoked, AIN workers generate additional transactions as a result. These additional transactions may subsequently trigger other workers if necessary.