I need to listen to events on the Ethereum blockchain on a small vps server with limited ressources (1 vcore, 10go SSD, 2go of RAM). Is it possible to do so without running a full Ethereum node ? What are the different options and their drawbacks ?
According to the Logs section of the Ethereum docs :https://solidity.readthedocs.io/en/develop/introduction-to-smart-contracts.html#logs
Since some part of the log data is stored in bloom filters, it is possible to search for this data in an efficient and cryptographically secure way, so network peers that do not download the whole blockchain (“light clients”) can still find these logs.
You can learn more about light clients here: https://github.com/ethereum/wiki/wiki/Light-client-protocol
- Light clients want to "watch" for events that are logged. The protocol here is the following:
- A light client gets all block headers, checks for block headers that contain bloom filters that match one of a desired list of addresses or topics that the light client is interested in
- Upon finding a potentially matching block header, the light client downloads all transaction receipts, checks them for transactions whose bloom filters match
- Upon finding a potentially matching transaction, the light client checks its actual log RLP, and sees if it actually matches
Both geth and parity have a light mode :
parity --light --no-serve-light (https://github.com/paritytech/parity/wiki/Light-Client)
geth --syncmode "light" (https://www.reddit.com/r/ethereum/comments/6lzw8y/how_to_run_ethereum_wallet_in_light_mode/)