poa_agent v0.1.0 POAAgent.Plugins.Collectors.Eth.LatestBlock View Source

This is a Collector’s Plugin which makes requests to a Ethereum node in order to know if a new block has been added.

It also sends the history when the plugin starts.

This Collector needs the url of the node to iteract. That url must be placed in the args field in the config file. For example:

{:eth_latest_block, POAAgent.Plugins.Collectors.Eth.LatestBlock, 500, :latest_block, [url: "http://localhost:8545"]}

In this example, the Collector will check with the Ethereum node every 500 miliseconds if a new block has been added to the blockchain. If that is the case it will retrieve it and send it to the Transfers encapsulated in a POAAgent.Entity.Ethereum.Block struct