Last active
January 16, 2020 08:42
-
-
Save ItayPodhajcer/678f2e135875fbc43ee432ca1d254f4f to your computer and use it in GitHub Desktop.
ethereum-event-azure-function-trigger/EthereumEventListener.StartAsync
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task StartAsync(CancellationToken cancellationToken) | |
{ | |
_cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); | |
var web3 = new Web3(_attribute.Url); | |
var contract = web3.Eth.GetContract(_attribute.Abi, _attribute.ContractAddress); | |
_event = contract.GetEvent(_attribute.EventName); | |
_filter = await _event.CreateFilterAsync(); | |
ListenAsync(_cts.Token); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment