github.com/turingchain2020/turingchain@v1.1.21/types/proto/rpc.proto (about)

     1  syntax = "proto3";
     2  
     3  import "common.proto";
     4  import "transaction.proto";
     5  import "blockchain.proto";
     6  import "wallet.proto";
     7  import "p2p.proto";
     8  import "account.proto";
     9  import "executor.proto";
    10  
    11  package types;
    12  option go_package = "github.com/turingchain2020/turingchain/types";
    13  
    14  message serverTime {
    15      int64 currentTimestamp = 1;
    16  }
    17  
    18  service turingchain {
    19      // turingchain 对外提供服务的接口
    20      //区块链接口
    21      rpc GetBlocks(ReqBlocks) returns (Reply) {}
    22      //获取最新的区块头
    23      rpc GetLastHeader(ReqNil) returns (Header) {}
    24      //交易接口
    25      rpc CreateRawTransaction(CreateTx) returns (UnsignTx) {}
    26      rpc CreateRawTxGroup(CreateTransactionGroup) returns (UnsignTx) {}
    27      // 根据哈希查询交易
    28      rpc QueryTransaction(ReqHash) returns (TransactionDetail) {}
    29      // 发送交易&&根据哈希查询交易
    30      rpc SendTransactionSync(Transaction) returns (Reply) {}
    31      // 发送交易
    32      rpc SendTransaction(Transaction) returns (Reply) {}
    33  
    34      //通过地址获取交易信息
    35      rpc GetTransactionByAddr(ReqAddr) returns (ReplyTxInfos) {}
    36  
    37      //通过哈希数组获取对应的交易
    38      rpc GetTransactionByHashes(ReqHashes) returns (TransactionDetails) {}
    39  
    40      //缓存接口
    41      rpc GetMemPool(ReqGetMempool) returns (ReplyTxList) {}
    42  
    43      //钱包接口
    44      //获取钱包账户信息
    45      rpc GetAccounts(ReqNil) returns (WalletAccounts) {}
    46  
    47      //根据账户lable信息获取账户地址
    48      rpc GetAccount(ReqGetAccount) returns (WalletAccount) {}
    49  
    50      //创建钱包账户
    51      rpc NewAccount(ReqNewAccount) returns (WalletAccount) {}
    52  
    53      //获取钱包的交易列表
    54      rpc WalletTransactionList(ReqWalletTransactionList) returns (WalletTxDetails) {}
    55  
    56      //导入钱包私钥
    57      rpc ImportPrivkey(ReqWalletImportPrivkey) returns (WalletAccount) {}
    58  
    59      // 发送交易
    60      rpc SendToAddress(ReqWalletSendToAddress) returns (ReplyHash) {}
    61  
    62      //设置交易手续费
    63      rpc SetTxFee(ReqWalletSetFee) returns (Reply) {}
    64  
    65      //设置标签
    66      rpc SetLabl(ReqWalletSetLabel) returns (WalletAccount) {}
    67  
    68      //合并钱包余额
    69      rpc MergeBalance(ReqWalletMergeBalance) returns (ReplyHashes) {}
    70  
    71      //设置钱包密码
    72      rpc SetPasswd(ReqWalletSetPasswd) returns (Reply) {}
    73  
    74      //给钱包上锁
    75      rpc Lock(ReqNil) returns (Reply) {}
    76  
    77      //给钱包解锁
    78      rpc UnLock(WalletUnLock) returns (Reply) {}
    79  
    80      //获取最新的Mempool
    81      rpc GetLastMemPool(ReqNil) returns (ReplyTxList) {}
    82  
    83      //获取最新的ProperFee
    84      rpc GetProperFee(ReqProperFee) returns (ReplyProperFee) {}
    85  
    86      // 获取钱包状态
    87      rpc GetWalletStatus(ReqNil) returns (WalletStatus) {}
    88      //区块浏览器接口
    89      ///
    90      rpc GetBlockOverview(ReqHash) returns (BlockOverview) {}
    91      rpc GetAddrOverview(ReqAddr) returns (AddrOverview) {}
    92      rpc GetBlockHash(ReqInt) returns (ReplyHash) {}
    93      // seed
    94      // 创建seed
    95      rpc GenSeed(GenSeedLang) returns (ReplySeed) {}
    96      //获取seed
    97      rpc GetSeed(GetSeedByPw) returns (ReplySeed) {}
    98  
    99      //保存seed
   100      rpc SaveSeed(SaveSeedByPw) returns (Reply) {}
   101      // Balance Query
   102      //获取余额
   103      rpc GetBalance(ReqBalance) returns (Accounts) {}
   104  
   105      rpc QueryChain(ChainExecutor) returns (Reply) {}
   106      rpc ExecWallet(ChainExecutor) returns (Reply) {}
   107      rpc QueryConsensus(ChainExecutor) returns (Reply) {}
   108  
   109      rpc CreateTransaction(CreateTxIn) returns (UnsignTx) {}
   110      //获取交易的十六进制编码
   111      rpc GetHexTxByHash(ReqHash) returns (HexTx) {}
   112  
   113      // 导出私钥
   114      rpc DumpPrivkey(ReqString) returns (ReplyString) {}
   115  
   116      // 导出全部私钥到文件
   117      rpc DumpPrivkeysFile(ReqPrivkeysFile) returns (Reply) {}
   118      // 从文件中批量导入私钥
   119      rpc ImportPrivkeysFile(ReqPrivkeysFile) returns (Reply) {}
   120  
   121      //获取程序版本
   122      rpc Version(ReqNil) returns (VersionInfo) {}
   123  
   124      //是否同步
   125      rpc IsSync(ReqNil) returns (Reply) {}
   126  
   127      //获取当前节点连接的其他节点信息
   128      rpc GetPeerInfo(P2PGetPeerReq) returns (PeerList) {}
   129  
   130      //获取当前节点的网络信息
   131      rpc NetInfo(P2PGetNetInfoReq) returns (NodeNetInfo) {}
   132  
   133      // ntpclock是否同步
   134      rpc IsNtpClockSync(ReqNil) returns (Reply) {}
   135  
   136      //获取系统致命故障信息
   137      rpc GetFatalFailure(types.ReqNil) returns (Int32) {}
   138      rpc GetLastBlockSequence(ReqNil) returns (Int64) {}
   139  
   140      // get add block's sequence by hash
   141      rpc GetSequenceByHash(ReqHash) returns (Int64) {}
   142  
   143      //通过block hash 获取对应的blocks信息
   144      rpc GetBlockByHashes(ReqHashes) returns (BlockDetails) {}
   145  
   146      //通过block seq 获取对应的blocks hash 信息
   147      rpc GetBlockBySeq(Int64) returns (BlockSeq) {}
   148  
   149      //关闭turingchain
   150      rpc CloseQueue(ReqNil) returns (Reply) {}
   151  
   152      //获取地址所以合约下的余额
   153      rpc GetAllExecBalance(ReqAllExecBalance) returns (AllExecBalance) {}
   154      //签名交易
   155      rpc SignRawTx(ReqSignRawTx) returns (ReplySignRawTx) {}
   156  
   157      rpc CreateNoBalanceTransaction(NoBalanceTx) returns (ReplySignRawTx) {}
   158  
   159      // 获取随机HASH
   160      rpc QueryRandNum(ReqRandHash) returns (ReplyHash) {}
   161  
   162      // 获取是否达到fork高度
   163      rpc GetFork(ReqKey) returns (Int64) {}
   164  
   165      rpc CreateNoBalanceTxs(NoBalanceTxs) returns (ReplySignRawTx) {}
   166  
   167      //通过seq以及title获取对应平行连的交易
   168      rpc GetParaTxByTitle(ReqParaTxByTitle) returns (ParaTxDetails) {}
   169  
   170      //获取拥有此title交易的区块高度
   171      rpc LoadParaTxByTitle(ReqHeightByTitle) returns (ReplyHeightByTitle) {}
   172  
   173      //通过区块高度列表+title获取平行链交易
   174      rpc GetParaTxByHeight(ReqParaTxByHeight) returns (ParaTxDetails) {}
   175  
   176      //获取区块头信息
   177      rpc GetHeaders(ReqBlocks) returns (Headers) {}
   178  
   179      // get server time
   180      rpc GetServerTime(ReqNil) returns (serverTime) {}
   181  }