Position: Home page » Blockchain » Blockchain RPC call timeout

Blockchain RPC call timeout

Publish: 2021-03-29 00:12:43
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. The development is OK. I think it is more stable than other platforms.
3.

Huanggang port is 24 hours a day for customs clearance, and other ports can pass at 6:30 at the earliest

Huanggang pass is the only 24-hour customs clearance port. However, there is a long way between the mainland pass and the Hong Kong pass, so we have to get on and off the train twice before we cross the pass

Luohu port - 6:30 to 24:00,
Huanggang port - 24 hours customs clearance,
Futian port - 6:30 to 22:30,
Shenzhen Bay Port - 6:30 to 24:00,
Shekou Port - 7:15 to 22:30,
Fuyong port - 8:00 to 21:30
Shatoujiao port - 7:00 to 22:00

extended information

Huanggang port is located in Futian District, Shenzhen City, Guangdong Province, opposite to Lok Ma Chau port in the new territories of Hong Kong. It is one of the five first-line ports between Shenzhen and Hong Kong. Huanggang port is the largest comprehensive highway port for passenger and freight transportation in China, It is the only all-weather land port in China and one of the largest land ports in China

4. You first check the port for NFS, and then open the port in the firewall.
5. In the actual development, we often encounter some situations like this,
(1) in the case of sudden high concurrency, when the server is under great pressure and calls some methods for more than 100ms and does not respond, we should automatically reject the service instead of blocking until the server crashes, It can be regarded as a disguised service degradation
(2) for the unpredictable code that may have deadlock, add time threshold limit to avoid unlimited resource competition
(3) for the unpredictable code that may have deadlock, add time threshold monitoring, Avoid dead cycle deterioration

some mature open source frameworks generally have the function of timeout response, such as
search framework: Lucene, Solr, elasticsearch,
RPC framework: Dubbo, thrift,
service coordination framework: zookeeper, etc.
if we want to add this function, what should we do
in fact, it's not difficult to add a timing function before and after the method call. If the threshold is exceeded, the thread should be terminated actively and the exception code should be thrown. Of course, in order not to affect the operation of the main service, this code should run independently in a sub thread, rather than coupled in the main thread. The idea is roughly the same. Of course, in order not to build a wheel repeatedly, we suggest to use Google's open source guava toolkit, which provides many useful functions, including the automatic termination of timeout method introced this time, and some functions to limit network traffic or the number of visits within a specified period of time, You can see guava's documentation for yourself<
timelimiter is an interface. There are two subclasses below,
faketimelimiter, which is often used to limit time-out debugging ring debugging.
simpletimelimiter is often used in formal methods, which call method time-out, that is, throw exception.
this paper focuses on the use of simpletimelimiter, There are mainly two methods in this class:
(1) newproxy implements timeout interception through JDK dynamic proxy and callwithtimeout
(2) callwithtimeout implements timeout interception through callable callback
the difference between the two methods lies in that the strategy implemented through proxy can be applied to every called method in this class, The implementation of timeout interception
and the implementation strategy through callback is applicable to the implementation of timeout interception only for a certain code block or method
introce the latest guava package through Maven:
java code

& lt; dependency> < br /> < groupId> com.google.guava</ groupId> < br /> < artifactId> guava</ artifactId> < br /> < version> 19.0</ version> < br /> </ dependency> <
A: Interception Based on proxy mode:
since guava uses JDK dynamic proxy to implement AOP interception, it requires that the proxy class must have an interface implementation, so it's a little troublesome to use.
we need to define an interface first, then define the implementation class, and rewrite the method to be called:
b: callback based usage, which is relatively simple, Because there is no need to use proxy mode,
both methods can implement method call timeout interruption, proxy mode is suitable for class level method timeout interruption, while callback based mode is more suitable for any single method.
6. The basic architecture is as follows:
the front-end web is implemented based on socket.io or rest,
add a layer of mongodb / MySQL and other databases to replace the stand-alone level dB for data storage

the purpose should be:
1. Speed up query
2. Do higher-level data analysis
3. Do distributed database

thinking:
of course, these online queries can facilitate our daily use, so how to integrate with related applications? Can we achieve the same effect with simple RPC command
there are several uses:
1. You can do your own query on qukuai.com or blockchain.info:)
2. Integrate RPC command into your own store and query after collection
3. Integrate into wallet application
4. Other application scenarios
7. 应该可以的,setTimeOutInMilliSeconds是设毫秒的喔,你尝试一下再改短一点setTimeOutInMilliSeconds(100L)

org.apache.commons.httpclient.ConnectTimeoutException: The host did not accept the connection within timeout of 100 ms
at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:155)
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:125)
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
at org.apache.commons.httpclient.$HttpConnectionAdapter.open(.java:1361)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
8. 1 tcpmux TCP port service multiplexing 5 RJE remote job entry
7 echo echo service
9 discard empty service for connection test
11 SYSTAT used to enumerate the system status of connected ports
13 daytime sent date and time to the requesting host
17 qotd sent daily maxim to the connected host
18 MSP message Sending protocol
19 chargen character generation service; Send endless character stream
20 FTP data FTP data port
21 FTP file transfer protocol (FTP) port; Sometimes it is used by FSP
22 SSH service
23 telnet service
9. Use multithreading to deal with similar problems
put the program calling this WebService into an independent thread a, and then create another thread B for timing. Thread a and thread B share a variable responseok

start the thread B before calling WebService in thread A. After successful return, set responseOK=true.
when thread B starts, it will stop timing if responseok = = true. If the timing exceeds 20 seconds, it will terminate thread a and return an error message

it seems that if the server times out when calling WebService, an exception will be triggered. Just intercept this exception.
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