Position: Home page » Ethereum » Ethereum rpcapi

Ethereum rpcapi

Publish: 2021-04-19 15:21:30
1. How to run Ethereum source code go Ethereum
install MIPS based Linux header file
$CD $prjroot / kernel
$tar - xjvf linux-2.6.38. Tar. Bz2
$CD linux-2.6.38

create an include folder under the specified path to store related header files< br />$ mkdir -p $TARGET_ Prefix / include

ensures that the Linux source code is clean
$make mrproper

generates the required header file< br />$ make ARCH=mips headers_ check
$ make ARCH=mips INSTALL_ HDR_ PATH=dest headers_ Install

all the files in dest folder to the specified include folder< br />$ cp -rv dest/include/* $TARGET_ Prefix / include

delete dest folder at last
$RM - RF dest
$LS - L $target_ PREFIX/include
2.

If you want to query the transaction records on the main network, you can use Etherscan. However, if you build your own private chain, how should you query the transaction records

the answer is that you need to listen to the logs on the chain, save them in the database, and then query them in the database. For example:

< pre t = "code" L = "Java" > varaddr = & quot& quot;< br />varfilter=web3.eth.filter({fromB lock:0 ,toBlock:' latest', address:addr });< br />filter.get(function(err,transactions){
transactions.forEach(function(tx){
vartxInfo=web3.eth.getTransaction(tx.transactionHash);
/ / at this time, the transaction information txinfo can be stored in the database
})< br />});

Web3. Eth. Filter() is used to monitor the log on the chain, and Web3. Eth. Gettransaction() is used to extract the information of the specified transaction. Once the transaction information is obtained, it can be stored in the database for query

recommend a practical introction, you can see: Ethereum tutorial

3. Because blockchain technology has natural advantages in realizing smart contracts. bitcoin, Ruitai, Laite, Ethereum and other digital cryptocurrencies all use blockchain technology. Blockchain is an important concept of bitcoin. In essence, it is a decentralized database and the underlying technology of bitcoin. Blockchain is a chain of uses
4.

Ethereum specifies the JSON RPC API application development interface that each node needs to implement. This interface is transport independent. Applications can use this interface protocol to operate Ethereum nodes through HTTP, websocket or IPC and other communication mechanisms:

5. The Internet has just begun, intelligent life coming
6. This ini means initialization. File extension in Microsoft Windows operating system. As the term indicates, INI file is used to initialize or set parameters for operating system or specific program
7. RESTful API 和 JSON-RPC 都不好用应该二者结合,用兼容 RESTful API 的 RPC 才对
我们 ThoughtWorks 的几个小伙伴最近开源的 ThoughtWorksInc/microbuilder ,让你直接写 RPC 接口,然后自动转换成 RESTful 调用
这有一个例子,摘自 Microbuilder的文档,类似这样定义:
@:structuralFailure(userSdk.model.Models.Failure)
interface IUserProfileService {
@:route("GET", "users/{userId}")
@:responseContentType("text/json")
function getProfile(userId:String):Future<Profile>;
@:requestHeader("Your-Custom-Header", "custom-header-value")
@:route("PUT", "users/{userId}")
@:requestContentType("text/json")
function setProfile(userId:String, profile:Profile):Future<Void>;
}
然后 Microbuilder 会自动生成接口实现,你就可以直接调用 RPC 了
8. API is just a way of implementation. Many platforms have API interface calls, such as aggregate data, which is very convenient to use
Web service belongs to web service in architecture, and RPC is a way of using web service
Web Service:
in terms of usage, it can be divided into RPC, soap and rest
in terms of data format, it is divided into XML and JSON
among them, the use of RPC and soap is decreasing, and restful architecture is dominant; The use of XML format is decreasing, and the use of lightweight formats such as JSON is increasing
RPC is a remote procere call, which calls the server's service (method) just like calling the local service (method). There are XML-RPC and json-rpc in implementation, but the transmission data format is different, and the usage is similar.
9. RPC: the so-called remote procere call (method oriented)
SOA: the so-called service-oriented architecture (message oriented)
rest: the so-called representational state transfer (resource oriented)
RPC is the remote procere call, a very simple concept, which calls the server's service (method) just like calling the local service (method)
the common implementations are XML-RPC and json-rpc. The communication mode is basically the same, but the only difference is the format of data transmission
the three elements of rest are unique resource identification, simple method (the method here is an abstract concept) and certain expression
important feature: stateless.
Hot content
Inn digger Publish: 2021-05-29 20:04:36 Views: 341
Purchase of virtual currency in trust contract dispute Publish: 2021-05-29 20:04:33 Views: 942
Blockchain trust machine Publish: 2021-05-29 20:04:26 Views: 720
Brief introduction of ant mine Publish: 2021-05-29 20:04:25 Views: 848
Will digital currency open in November Publish: 2021-05-29 19:56:16 Views: 861
Global digital currency asset exchange Publish: 2021-05-29 19:54:29 Views: 603
Mining chip machine S11 Publish: 2021-05-29 19:54:26 Views: 945
Ethereum algorithm Sha3 Publish: 2021-05-29 19:52:40 Views: 643
Talking about blockchain is not reliable Publish: 2021-05-29 19:52:26 Views: 754
Mining machine node query Publish: 2021-05-29 19:36:37 Views: 750