Position: Home page » Ethereum » Nonce of Ethereum RPC interface call

Nonce of Ethereum RPC interface call

Publish: 2021-05-18 21:17:38
1. At the top of Ethereum is DAPP. It exchanges with the smart contract layer through Web3. JS. All smart contracts run on EVM (Ethereum virtual machine) and use RPC calls. Below EVM and RPC are the four core contents of Ethereum, including: blockchain, consensus algorithm, mining and network layer. Except DAPP, all other parts are in the Ethereum client. The most popular Ethereum client is geth (go Ethereum)
2. 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
3. curl方法,file_get_contents,
4.

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

5. It's RPC.
RPC generally refers to calling remote code like calling local code, which is usually done by setting up a local agent
6.

关于RPC 路由器的实现主要分布在smd_rpcrouter.c、smd_rpcrouter_device.c、smd_rpcrouter_servers.c、smd_rpcrouter_clients.c等文件中RPC路由器起着RPC服务器查询、RPC服务器和RPC客户端的注册和销毁,以及底层通信的封装功能,类似于TCP协议

在实际的实现中,RPC路由器和RPC服务器均是作为一个虚拟的字符型设备来存在的

下面是RPC路由器的创建过程:

代码3-11 RPC 路由器的创建过程

int msm_rpcrouter_init_devices(void)

{

int rc;

int major;

msm_rpcrouter_class=class_create(THIS_MODULE,

"oncrpc"); //创建设备节点

if (IS_ERR(msm_rpcrouter_class)) {

rc=-ENOMEM;

printk(KERN_ERR

"rpcrouter: failed to create oncrpc class ");

goto fail;

}

rc=alloc_chrdev_region(&msm_rpcrouter_devno,

0, //作为字符型设备分配资源

RPCROUTER_MAX_REMOTE_SERVERS + 1, "oncrpc");

if (rc<0) {

printk(KERN_ERR

"rpcrouter: Failed to alloc chardev region (%d) ", rc);

goto fail_destroy_class;

}

major=MAJOR(msm_rpcrouter_devno);

rpcrouter_device=device_create(msm_

rpcrouter_class, NULL, //创建设备

msm_rpcrouter_devno, NULL, "%.8x:%d",

0, 0);

if (IS_ERR(rpcrouter_device)) {

rc=-ENOMEM;

goto fail_unregister_cdev_region;

}

cdev_init(&rpcrouter_cdev, &rpcrouter_

router_fops); //字符型设备初始化

rpcrouter_cdev.owner=THIS_MODULE;

rc=cdev_add(&rpcrouter_cdev, msm_rpcrouter_devno, 1);

if (rc<0)

goto fail_destroy_device;

return 0;

fail_destroy_device:

device_destroy(msm_rpcrouter_class,

msm_rpcrouter_devno);//销毁设备

fail_unregister_cdev_region:

unregister_chrdev_region(msm_rpcrouter_devno, //去注册

RPCROUTER_MAX_REMOTE_SERVERS + 1);

fail_destroy_class:

class_destroy(msm_rpcrouter_class);

fail:

return rc;

}

7. Telnet calls RPC interface remotely, passes a number through invoke, and receives long type in the background. The code is int type. How to solve this problem? Telnet calls RPC interface remotely, passes a number through invoke, and receives long type in the background. The code is int type. How to solve this problem?
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. These are two conceptual things
DWR is used for Ajax server and client data transfer, its role is to make the client can easily call the server-side function directly
GWT is a complete set of Ajax framework, which not only has data transfer interface (RPC), but also has the generation and configuration of foreground pages
in short, if you want to use DWR, you need another library (such as ext) to generate foreground pages< br />
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