乌拉公链--节点接口API

本文详细介绍了乌拉公链的节点API,包括web3_sha3、net_listening、net_peerCount等多个接口的使用方法和示例。此外,还提供了节点服务部的安装操作指南,涵盖环境要求、安装规划、安装步骤等关键信息,帮助用户成功部署和管理乌拉公链节点。
摘要由CSDN通过智能技术生成

成为节点条件: 1万RMB募集BIK,锁仓一年

BIK购买: 乌拉钱包

乌拉钱包下载地址:
android: https://www.pgyer.com/cHXc
IOS: https://www.pgyer.com/NJ3M

节点API

web3_sha3

返回指定数据的Keccak-256(不同于标准的SHA3-256算法)哈希值。.

调用方式:

节点

调用方法

RPC

{"jsonrpc":"2.0","method":"web3_sha3","params":["0x68656c6c6f20776f726c64"],"id":67}

GET

api.php?action=sha3&data=0x68656c6c6f20776f726c64

参数

  1. DATA - 要计算SHA3哈希的数据

返回

DATA - 指定字符串的SHA3结果.

例子

// Request
curl -XPOST--data '{"jsonrpc":"2.0","method":"web3_sha3","params":["0x68656c6c6f20776f726c64"],"id":64}'
 
// Result
{
  
"id":64,
"jsonrpc":"2.0",
"result":"0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad"
}

net_listening

检测节点主动侦听网络连接的状态,则返回 true.

调用方式:

节点

调用方法

RPC

{"jsonrpc":"2.0","method":"net_listening","params":[""],"id":67}

GET

api.php?action=listening

返回

Boolean - 如果节点正在主动侦听网络连接,则返回true否则 false.

例子

// Request
curl -XPOST--data '{"jsonrpc":"2.0","method":"net_listening","params":[],"id":67}'
 
// Result
{
  
"id":67,
"jsonrpc":"2.0",
"result":true
}

net_peerCount

返回当前节点所连接的端对端节点数量.

调用方式:

节点

调用方法

RPC

{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":67}

GET

api.php?action=peercount

 

返回

QUANTITY -  连接PEER的数量

例子

// Request
curl -XPOST--data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":74}'
 
// Result
{
  
"id":74,
"jsonrpc":"2.0",
"result":"0x2"// 2
}

fwl_protocolVersion

返回软件版本.

调用方式:

节点

调用方法

RPC

{"jsonrpc":"2.0","method":"fwl_protocolVersion","params":[""],"id":67}

GET

api.php?action=protocolVersion

返回

String -当前软件版本

例子

// Request
curl -XPOST--data '{"jsonrpc":"2.0","method":"fwl_protocolVersion","params":[],"id":67}'
 
// Result
{
  
"id":67,
"jsonrpc":"2.0",
"result":"54"
}

fwl_syncing

对于已经同步的客户端,该调用返回一个描述同步状态的对象;对于未同步客户端,返回false

调用方式:

节点

调用方法

RPC

{"jsonrpc":"2.0","method":"fwl_syncing","params":[""],"id":67}

GET

api.php?action=syncing

返回

Object|Boolean同步状态对象或false。同步对象的结构如下:

  • startingBlock:QUANTITY- 导入开始的块
  • currentBlock:QUANTITY- 当前块
  • highestBlock:QUANTITY- 估计的最高区块

例子

// Request
curl -XPOST--data '{"jsonrpc":"2.0","method":"fwl_syncing","params":[],"id":1}'
 
// Result
{
  
"id":1,
"jsonrpc":"2.0",
"result": {
  
    startingBlock:'0x384',
    currentBlock:'0x386',
    highestBlock:'0x454'
  }
}
// Or when not syncing
{
  
"id":1,
"jsonrpc":"2.0",
"result":false
}

fwl_coinbase

返回节点coinbase地址.

调用方式:

节点

调用方法

RPC

{"jsonrpc":"2.0","method":"fwl_coinbase","params":[""],"id":67}

GET

api.php?action=coinbase

 

返回

DATA20个字节 - 当前coinbase地址.

 

例子

// Request
curl -XPOST--data '{"jsonrpc":"2.0","method":"fwl_coinbase","params":[],"id":64}'
 
// Result
{
  
"id":64,
"jsonrpc":"2.0",
"result":"0x407d73d8a49eeb85d32cf465507dd71d507100c1"
}

fwl_hashrate

返回节点每秒可算出的哈希数量.

调用方式:

节点

调用方法

RPC

{"jsonrpc":"2.0","method":"fwl_hashrate","params":[""],"id":67}

GET

api.php?action=hashrate

返回

QUANTITY -每秒的哈希数.

例子

// Request
curl -XPOST--data '{"jsonrpc":"2.0","method":"fwl_ashrate","params":[],"id":71}'
 
// Result
{
  
"id":71,
"jsonrpc":"2.0",
"result":"0x38a"
}

fwl_gasPrice

返回当前的gas价格,单位:wei.

调用方式:(注意RPC参数中gasPrice的大小写)

节点

调用方法

RPC

{"jsonrpc":"2.0","method":"fwl_gasPrice","params":[""],"id":67}

GET

api.php?action=gasprice

返回

QUANTITY -当前GAS价格的整数.

例子

// Request
curl -XPOST--data '{"jsonrpc":"2.0","method":"fwl_gasPrice","params":[],"id":73}'
 
// Result
{
  
"id":73,
"jsonrpc":"2.0",
"result":"0x09184e72a000"// 10000000000000
}

fwl_accounts

返回节点持有的地址列表.

调用方式:

节点

调用方法

RPC

{"jsonrpc":"2.0","method":"fwl_accounts","params":[""],"id":67}

GET

api.php?action=accounts

返回

Array of DATA20字节 - 节点拥有的地址.

例子

// Request
curl -XPOST--data '{"jsonrpc":"2.0","method":"fwl_accounts","params":[],"id":1}'
 
// Result
{
  
"id":1,
"jsonrpc":"2.0",
"result": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1"]
}

fwl_blockNumber

返回最近块的块号.

调用方式:

节点

调用方法

RPC

{"jsonrpc":"2.0","method":"fwl_blockNumber","params":[<

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值