Last active
January 16, 2020 08:39
-
-
Save ItayPodhajcer/2c624fd23f71a7b35a83629e06eae96c to your computer and use it in GitHub Desktop.
ethereum-event-azure-function-trigger/EthereumEventTriggeredFunction
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 static class EthereumEventTriggeredFunction | |
{ | |
private const string Abi = ""; | |
private const string ContractAddress = ""; | |
private const string EventName = ""; | |
[FunctionName(nameof(EthereumEventTriggeredFunction))] | |
public static void Run([EthereumEventTrigger(abi: Abi, contractAddress: ContractAddress, eventName: EventName)]EthereumEventData eventData, ILogger logger) | |
{ | |
string logMessage = $"Event data:\nBlock number: {eventData.BlockNumber}\n{string.Join('\n', eventData.Values.Select(value => $"{value.Key}: {value.Value}"))}"; | |
logger.LogInformation(logMessage); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment