区块链既然是一个分布式的存储数据库,那么链外的应用应该如何访问链上数据呢?链外数据又如何上链呢?
1、链外的应用应该如何访问链上数据呢?
首先,我们需要了解一下,区块链对外的接口。
其实:区块链系统里面有一个RPC服务,里面已经支持了JavaSDK,和JSSDK
我们看看链接:
java调用接口和方法:https://github.com/taiyuechain/TaiWeb3j.git
JS 调用接口和方法:https://github.com/taiyuechain/TaiWeb3js.git
其中这些Java的接口里面有很多方法可以访问到链:
详细举例:这个例子就是 getBalance的RPC 请求规范,
gtai_getBalance
Returns the balance of the account of given address.
Parameters
DATA
, 20 Bytes - address to check for balance.QUANTITY|TAG<