Skip to content

Separating API parts from SEBAK #912

@spikeekips

Description

@spikeekips

This is the proposal to make the new server to handle the API requests. This new server(at this time, I call it 'API Server') can serve the client-side APIs requests. With API Server, SEBAK will only do the consensus and its data will be simple and it's operations also will be lighter than now.

The major features of API Server are,

  • Serve data query of client
  • Relay transactions from client

Data

SEBAK API Server
block.Block block.Block
transaction.Transacion transaction.Transacion
block.Account block.Account
block.BlockOperation
block.BlockTransaction

SEBAK will only handle the core data for consensus and the others will be owned by API Server.

Specifications

  • Client-side network protocol: http2
  • SEBAK-side network protocol: jsonrpc
  • API query: REST(current) and GraphQL
  • Storage: LevelDB

When APIs Server starts,

  1. Check SEBAK is alive
  2. Get the node information from SEBAK
  3. check the latest block
  4. Load block from SEBAK
  5. Create additional data from the loaded blocks
  6. All the block is completed, API Server serves API
  7. Open the streaming channel of SEBAK

When a new block is created at SEBAK,

  1. The jsonrpc of SEBAK supports the streaming
  2. API Server opens the streaming channel of SEBAK
  3. When a new block is created, API Server can receive the new block fro the streaming channel

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions