aionnetwork / aion_api Goto Github PK
View Code? Open in Web Editor NEWaion network api repository
License: MIT License
aion network api repository
License: MIT License
API.getNet().syncInfo()
returns unexpected values - i.e. the reported chainBestBlock is too low.
These are the numbers reported by the Java API:
Syncing: true, chainBest: 405384, netBest: 405785
These are the numbers reported by the web3 API:
aion-127.0.0.1:8545> eth.syncing
{ currentBlock: 405785,
highestBlock: 405384,
startingBlock: 400437 }
These are the last lines in the kernel's logs reffering to these node numbers:
18-06-12 09:46:49.482 INFO SYNC [p2p-worker-9]: <import-status: node = c33d5a, hash = be4867, number = 405384, txs = 0, result = IMPORTED_BEST, time elapsed = 1 ms>
18-06-12 10:58:36.047 INFO SYNC [p2p-worker-6]: <import-status: node = c33d22, hash = 4c3620, number = 405785, txs = 0, result = IMPORTED_BEST, time elapsed = 0 ms>
One thing that stood out is that the block reported as the chainBest was the first block processed by a p2p-worker-*
thread after a batch of blocks processed by sync-ib
nodes:
From these numbers I understand that I should not be able to access blocks that have higher numbers than 405384, but fom the Java API I can do that. This suggests that the number reported as chainBestBlock
is not acurate.
You can see below that I can get TransactionDetails from a Block that is higher than the current chainBestBlock:
405384 < 405583
L.E: Kernel version is: v0.2.7.1bbeec1
When multiple nodes are connected to client and one of the nodes becomes unresponsive, client becomes unresponsive.
Sample Application: app-template.zip
To reproduce:
Stacktrace when application unexpectedly crashes:
run TestGetBlocksDetailsByRange.
18-06-01 16:40:22.011 INFO BSE [main]: [connect] Api connected
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:/home/nuco/alisharif/nuco/aion-javaapi/app-template/lib/protobuf-java-3.5.0.jar) to field java.nio.Buffer.address
WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
18-06-01 16:40:26.559 ERROR EXE [pool-2-thread-1]: [checkHbRspMsg] Invalid msg header length!
18-06-01 16:40:28.063 ERROR EXE [pool-2-thread-1]: [checkHbRspMsg] Invalid msg header length!
18-06-01 16:40:29.565 ERROR EXE [pool-2-thread-1]: [checkHbRspMsg] Invalid msg header length!
18-06-01 16:40:30.066 WARN EXE [pool-2-thread-1]: Heartbeat Timeout, disconnect the connection!
18-06-01 16:40:31.045 INFO EXE [pool-2-thread-3]: worker closing!
18-06-01 16:40:31.046 INFO EXE [pool-2-thread-3]: worker closed!
18-06-01 16:40:31.052 INFO EXE [pool-2-thread-2]: Callback worker closing!
18-06-01 16:40:31.053 INFO EXE [pool-2-thread-2]: Callback worker closed!
18-06-01 16:40:31.564 INFO EXE [msg-exec]: [run] Socket disconnected!
18-06-01 16:40:33.070 INFO EXE [pool-2-thread-1]: Heartbeat worker closed!
Assertion failed: pfd.revents & POLLIN (src/signaler.cpp:249)
#0 0xfec73958c7d0 in ? (zmq::zmq_abort(char const*)+0x9)
#1 0x7f6371597f29 in /home/nuco/alisharif/nuco/aion-javaapi/app-template/native/linux/zmq/libzmq.so.5 (zmq::signaler_t::wait(int)+0x1c7)
#2 0x7f637157dd87 in /home/nuco/alisharif/nuco/aion-javaapi/app-template/native/linux/zmq/libzmq.so.5 (zmq::mailbox_t::recv(zmq::command_t*, int)+0x132)
#3 0x7f6371599e22 in /home/nuco/alisharif/nuco/aion-javaapi/app-template/native/linux/zmq/libzmq.so.5 (zmq::socket_base_t::process_commands(int, bool)+0x52)
#4 0x7f637159a602 in /home/nuco/alisharif/nuco/aion-javaapi/app-template/native/linux/zmq/libzmq.so.5 (zmq::socket_base_t::recv(zmq::msg_t*, int)+0x15b)
#5 0x7f63715b674b in /home/nuco/alisharif/nuco/aion-javaapi/app-template/native/linux/zmq/libzmq.so.5 (s_recvmsg(zmq::socket_base_t*, zmq_msg_t*, int)+0x9)
#6 0x7f6370968859 in /home/nuco/alisharif/nuco/aion-javaapi/app-template/native/linux/zmq/libjzmq.so (do_read(JNIEnv_*, _jobject*, zmq_msg_t*, int)+0x40)
#7 0x7f6370969880 in /home/nuco/alisharif/nuco/aion-javaapi/app-template/native/linux/zmq/libjzmq.so (Java_org_zeromq_ZMQ_00024Socket_recv__I+0x29)
#8 0x7f63ad3eab79 in ? (+0x29)
#9 0x7f63ad3e4ce9 in ? (+0x29)
#10 0x7f63ad3e4ce9 in ? (+0x29)
#11 0x7f63ad3e4dbf in ? (+0x29)
#12 0x7f63ad3dbb72 in ? (+0x29)
#13 0x7f63cd9b0869 in /home/nuco/alisharif/bin/jdk-10.0.1/lib/server/libjvm.so (JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x412)
#14 0x7f63cda1ee52 in /home/nuco/alisharif/bin/jdk-10.0.1/lib/server/libjvm.so (jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*) [clone .isra.86]+0x21f)
#15 0x7f63cda3206f in /home/nuco/alisharif/bin/jdk-10.0.1/lib/server/libjvm.so (jni_CallStaticVoidMethod+0x1a7)
#16 0x7f63ceb6bb97 in /home/nuco/alisharif/bin/jdk-10.0.1/bin/../lib/jli/libjli.so (JavaMain+0xa29)
#17 0x7f63ced7f029 in /lib/x86_64-linux-gnu/libpthread.so.0 (start_thread+0xdb)
#18 0x7f63ce694964 in /lib/x86_64-linux-gnu/libc.so.6 (clone+0x3f)
Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
right now, test fails because no way to retrive user's nonce.
Steps to reproduce:
Expected:
Actual:
The api query commands on the wiki are outdated or only works on the testnet-1.
https://github.com/aionnetwork/aion_explorer/wiki/Explorer-Data-API
aion_api/src/org/aion/api/ITx.java
Lines 101 to 119 in fe02037
Two things:
passphrase
field is redundant, does not actually get used.Test setup: Simple application that imports the javaapi jar; main() instantiates javaapi, calls an api function, and exits.
When destroyApi() is called, client threads are still running in the threadpool. Need to setup corrent thread exit coditions in MsgExecutor.
18-05-12 15:14:08.320 INFO BSE [main]: [destroyApi] Api destroyed
18-05-12 15:14:08.722 INFO EXE [msg-exec]: [run] Socket disconnected!
18-05-12 15:14:09.722 ERROR EXE [pool-6-thread-1]: [checkHbRspMsg] Invalid msg header length!
18-05-12 15:14:11.224 ERROR EXE [pool-6-thread-1]: [checkHbRspMsg] Invalid msg header length!
18-05-12 15:14:12.726 ERROR EXE [pool-6-thread-1]: [checkHbRspMsg] Invalid msg header length!
18-05-12 15:14:13.227 WARN EXE [pool-6-thread-1]: Heartbeat Timeout, disconnect the connection!
Exception in thread "pool-6-thread-2" org.zeromq.ZMQException: Context was terminated(0x9523dfd)
at org.zeromq.ZMQ$Socket.recv(Native Method)
at org.aion.api.impl.MsgExecutor.callbackRun(MsgExecutor.java:485)
at org.aion.api.impl.MsgExecutor.lambda$run$2(MsgExecutor.java:396)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:844)
Notice the following threads:
CallbackRun
HeartBeatRun
WorkerRun
This is the state of the threads at a breakpoint right after the call to api.destroyApi().
Added thread names by using Thread.currentThread().setName() on the workerRun(Context ctx), callbackRun(Context ctx) & heartbeatRun(Context ctx) functions, etc.
Have you tried it or is there any documentation specific for Android you can share with me?
Ahmmed Aion Chowdhury 2017
aion82/Hello World
Requirement:
The contract method call transaction can be signed outside the kernel in calling application.
Existing API
When I check in the web3 I can see my accounts:
aion-127.0.0.1:8545> eth.accounts
[ '0xd7803ef36bb407c73836498d14b2bc919e3dc109189cc18c2298752be9c60541',
'0x65607418bdb5c5e02b88b91eb27b2a06bbcca0d7a6ed9f17f044deed94a20a31',
'0xd23d6dd3aef5f4550d5c2ea76868a3ad2262f13d2733f9a92eb93b24f7b6415f',
'0x65742fab87870d2f4593278f17ce4edaae8f42efe30bffc515c28575e65ce2ab',
'0x68a8635329677e2c2bbd952c2ebbf12ae47e4d1191b29c207084acfaa4dd43be',
'0x1247934d3551a2644115c665d4e03489eb0b5814ef94993c39f023dd4cf18d04' ]
However when I try to query them through the API it is not finding any of them
https://api.aion.network/aion/accounts/search/findByAddr?addr=0xd7803ef36bb407c73836498d14b2bc919e3dc109189cc18c2298752be9c60541
For more security, can you change old spongycastle (based on old bouncycastle) to bouncycastle?
getAccountDetailsByAddressList
getBlocksByLatest
getBlockDetailsByLatest
getBlockDetailsByNumber
right now these functions have flimsy tests.
similar to getTransactionCount(address) web3 function
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.