BlockRazor
Go to website
English
English
  • 👉About BlockRazor
  • 👨‍💻Use Cases
    • Wallet
    • DEX
    • Searcher
    • Trading Bot
    • Algorithmic Trading
  • 💸Solana
    • Overview
    • Authentication
    • APIs
      • sendTransaction
      • getTransactionFee
      • Sandwich Detector
  • 🖥️BSC
    • Authentication
    • High-performance Network
      • Proto
      • Subscribe NewTxs
      • Subscribe NewBlocks
      • Send RawTx
      • Send RawTxBatch
      • Full Node Synchronization
    • Block Builder
      • Send Bundle
      • Send PrivateTransaction
      • Call Bundle
      • Trace Bundle
    • APIs
      • GetGasPriceStream
      • GetAllGasPriceStream
      • Sandwich Detector
  • 🛡️Scutum(ETH & BSC)
    • Overview
    • New to MEV
    • Exclusive for Project
    • General for Wallet User
    • Searcher
      • Authentication
      • Subscribe Bundle
      • Send Bundle
  • 📄Statement
    • Privacy Statement
Powered by GitBook
On this page
  1. BSC
  2. High-performance Network

Proto

The code of relay.proto is as follows:

syntax = "proto3";

package blockchain;

option go_package = "/Users/code/relay/grpcServer"; 
service Gateway {
  rpc SendTx (SendTxRequest) returns (SendTxReply) {}
  rpc SendTxs (SendTxsRequest) returns (SendTxsReply) {}
  rpc NewTxs (TxsRequest) returns (stream TxsReply){}
  rpc NewBlocks (BlocksRequest) returns (stream BlocksReply){}
}

message TxsRequest{
  bool node_validation = 1;
}

message Tx{
  bytes from = 1;
  int64 timestamp = 2;
  bytes raw_tx = 3;
}

message TxsReply{
   Tx tx = 1;
}

message BlocksRequest{
  bool node_validation = 1;
}

message BlockHeader{
  string parent_hash = 1;
  string sha3_uncles = 2;
  string miner = 3;
  string state_root = 4;
  string transactions_root = 5;
  string receipts_root = 6;
  string logs_bloom = 7;
  string difficulty = 8;
  string number = 9;
  uint64 gas_limit = 10;
  uint64 gas_used = 11;
  uint64 timestamp = 12;
  bytes extra_data = 13;
  string mix_hash = 14;
  uint64 nonce = 15;
  uint64 base_fee_per_gas = 16;
  string withdrawals_root = 17;
  uint64 blob_gas_used = 18;
  uint64 excess_blob_gas = 19;
  string parent_beacon_block_root = 20;
}

message NextValidator{
  string block_height = 1;
  string coinbase = 2;
}

message BlocksReply{
  string hash = 1;
  BlockHeader header = 2;
  repeated NextValidator nextValidator = 3;
  repeated Tx txs = 4;
}

message Transaction {
  string content = 1;
}

message Transactions {
  repeated Transaction transactions = 1;
}

message SendTxRequest {
  string transaction = 1;
}

message SendTxsRequest {
  string transactions = 1;
}

message SendTxReply {
  string tx_hash = 1;
}

message SendTxsReply {
  repeated string tx_hashs = 1;
}

Example code

PreviousHigh-performance NetworkNextSubscribe NewTxs

Last updated 1 month ago

🖥️
https://github.com/BlockRazorinc/relay_example