Credit Smart Chain
  • Overview
  • Get started
    • Installation
    • Local Setup
    • CLI Commands
    • JSON RPC Commands
  • RPC mainnet
  • Configuration
    • Server configuration file
    • Manage private keys
    • Enable Prometheus metrics
  • Working with a node
    • Query JSON RPC endpoints
    • Query operator information
    • Backup/restore node instance
  • Consensus
    • Proof of Stake
    • Set up and use Proof of Stake (PoS)
  • Additional features
    • Network stress testing
  • Architecture
    • Architecture Overview
    • Modules
      • Blockchain
      • Minimal
      • Networking
      • State
      • TxPool
      • JSON RPC
      • Consensus
      • Storage
      • Types
      • Protocol
      • Sealer
      • Other modules
  • Concepts
    • State in Ethereum
  • Community
    • Propose a new feature
    • Report an issue
Powered by GitBook
On this page
  • Overview​
  • GRPC for Other Nodes​
  1. Architecture
  2. Modules

Protocol

PreviousTypesNextSealer

Last updated 1 year ago

Overview

The Protocol module contains the logic for the synchronization protocol.

The Credit Smart Chain uses libp2p as the networking layer, and on top of that runs gRPC.

GRPC for Other Nodes

protocol/proto/v1.proto

service V1 {
    // Returns status information regarding the specific point in time
    rpc GetCurrent(google.protobuf.Empty) returns (V1Status);
    
    // Returns any type of object (Header, Body, Receipts...)
    rpc GetObjectsByHash(HashRequest) returns (Response);
    
    // Returns a range of headers
    rpc GetHeaders(GetHeadersRequest) returns (Response);
    
    // Watches what new blocks get included
    rpc Watch(google.protobuf.Empty) returns (stream V1Status);
}

protocol/proto/v1.proto

message V1Status {
    string difficulty = 1;
    string hash = 2;
    int64 number = 3;
}

Status Object

​
​
​