366.5. Samples
侦听新的 mined 块,并将块散列发送到 jms 队列:
from("web3j://http://127.0.0.1:7545?operation=ETH_BLOCK_HASH_OBSERVABLE") .to("jms:queue:blocks");
使用块哈希代码来检索块和完整事务详情:
from("jms:queue:blocks") .setHeader(BLOCK_HASH, body()) .to("web3j://http://127.0.0.1:7545?operation=ETH_GET_BLOCK_BY_HASH&fullTransactionObjects=true");
根据特定块号读取地址的余额:
from("direct:start") .to("web3j://http://127.0.0.1:7545?operation=ETH_GET_BALANCE&address=0xc8CDceCE5d006dAB638029EBCf6Dd666efF5A952&atBlock=10");