BlockRazor
Go to website
繁体中文
繁体中文
  • 👉关于BlockRazor
  • 👨‍💻用户案例
    • 钱包
    • 去中心化交易所
    • Trading Bot
    • Searcher
    • 量化交易系统
  • 💸Solana
    • 总览
    • Authentication
    • APIs
      • sendTransaction
      • getTransactionFee
      • Sandwich Detector
  • 🖥️BSC
    • Authentication
    • Dedicate Node
      • 創建Dedicate Node
      • 使用Dedicate Node
    • 高性能網絡
      • Proto
      • Subscribe NewTxs
      • Subscribe NewBlocks
      • Send RawTx
      • Send RawTxBatch
      • 全節點同步
    • Block Builder
      • Send Bundle
      • Send PrivateTransaction
      • Call Bundle
      • Trace Bundle
    • APIs
      • GetGasPriceStream
      • GetAllGasPriceStream
      • Sandwich Detector
  • 🛡️Scutum(ETH & BSC)
    • 总览
    • New to MEV
    • 項目專屬RPC
    • 錢包用戶通用RPC
    • Searcher
      • Authentication
      • Subscribe Bundle
      • Send Bundle
  • 📄声明
    • 隱私聲明
Powered by GitBook
On this page
  1. BSC
  2. 高性能網絡

Proto

relay.proto文件代碼如下:

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;
}

代码示例

Previous高性能網絡NextSubscribe NewTxs

Last updated 1 month ago

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