azureazure-logic-appsazure-blockchain-service

How to connect Azure Blockchain Service and Logic app with "When a smart contract event occurs" trigger


My work flow is like this.

a

INPUT log

{
    "method": "get",
    "queries": {
        "abi": "[\n    {\n      \"inputs\": [],\n      \"payable\": false,\n      \"stateMutability\": \"nonpayable\",\n      \"type\": \"constructor\"\n    },\n    {\n      \"anonymous\": false,\n      \"inputs\": [\n        {\n          \"indexed\": true,\n          \"internalType\": \"address\",\n          \"name\": \"_from\",\n          \"type\": \"address\"\n        },\n        {\n          \"indexed\": true,\n          \"internalType\": \"address\",\n          \"name\": \"_to\",\n          \"type\": \"address\"\n        },\n        {\n          \"indexed\": false,\n          \"internalType\": \"uint256\",\n          \"name\": \"_value\",\n          \"type\": \"uint256\"\n        }\n      ],\n      \"name\": \"Transfer\",\n      \"type\": \"event\"\n    },\n    {\n      \"constant\": false,\n      \"inputs\": [\n        {\n          \"internalType\": \"address\",\n          \"name\": \"receiver\",\n          \"type\": \"address\"\n        },\n        {\n          \"internalType\": \"uint256\",\n          \"name\": \"amount\",\n          \"type\": \"uint256\"\n        }\n      ],\n      \"name\": \"sendCoin\",\n      \"outputs\": [\n        {\n          \"internalType\": \"bool\",\n          \"name\": \"sufficient\",\n          \"type\": \"bool\"\n        }\n      ],\n      \"payable\": false,\n      \"stateMutability\": \"nonpayable\",\n      \"type\": \"function\"\n    },\n    {\n      \"constant\": true,\n      \"inputs\": [\n        {\n          \"internalType\": \"address\",\n          \"name\": \"addr\",\n          \"type\": \"address\"\n        }\n      ],\n      \"name\": \"getBalanceInEth\",\n      \"outputs\": [\n        {\n          \"internalType\": \"uint256\",\n          \"name\": \"\",\n          \"type\": \"uint256\"\n        }\n      ],\n      \"payable\": false,\n      \"stateMutability\": \"view\",\n      \"type\": \"function\"\n    },\n    {\n      \"constant\": true,\n      \"inputs\": [\n        {\n          \"internalType\": \"address\",\n          \"name\": \"addr\",\n          \"type\": \"address\"\n        }\n      ],\n      \"name\": \"getBalance\",\n      \"outputs\": [\n        {\n          \"internalType\": \"uint256\",\n          \"name\": \"\",\n          \"type\": \"uint256\"\n        }\n      ],\n      \"payable\": false,\n      \"stateMutability\": \"view\",\n      \"type\": \"function\"\n    }\n  ]",
        "contractAddress": "0x03985eF62D7776bc5047A9Ee531aA0e7dbb5962c",
        "eventName": "Transfer"
    },
    "path": "/contract/OnNewEvent",
    "host": {
        "connection": {
            "name": "/subscriptions/90660d8a-4446-4255-a65f-9b0ff071c1df/resourceGroups/diggluegroup/providers/Microsoft.Web/connections/blockchainethereum-1"
        }
    }
}

output log

{
    "statusCode": 500,
    "headers": {
        "Pragma": "no-cache",
        "x-ms-request-id": "ba5917f1-3323-4c95-8898-b142e76c7f89",
        "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
        "X-Content-Type-Options": "nosniff",
        "X-Frame-Options": "DENY",
        "Timing-Allow-Origin": "*",
        "x-ms-apihub-cached-response": "true",
        "Cache-Control": "no-store, no-cache",
        "Date": "Thu, 06 Feb 2020 10:56:34 GMT",
        "Set-Cookie": "ARRAffinity=7fec6b3d494d502cd339a098a470860ddaf458b68c32b8ce8e190c362de93b94;Path=/;HttpOnly;Domain=blockchainethereum-eus.azconn-eus-01.p.azurewebsites.net",
        "Content-Length": "481",
        "Content-Type": "application/json",
        "Expires": "-1"
    },
    "body": {
        "error": {
            "code": 500,
            "source": "logic-apis-eastus.azure-apim.net",
            "clientRequestId": "ba5917f1-3323-4c95-8898-b142e76c7f89",
            "message": "BadGateway",
            "innerError": {
                "status": 500,
                "message": "Source array was not long enough. Check srcIndex and length, and the array's lower bounds.\r\nclientRequestId: ba5917f1-3323-4c95-8898-b142e76c7f89",
                "source": "blockchainethereum-eus.azconn-eus-01.p.azurewebsites.net"
            }
        }
    }
}

I know that there isn't enough information to know what is problem, but can anyone give some hint about where problem might be.

I create transactions from RPC and Smart contract event is triggered surely.

I checked Connection setting to SQL is correct by doing other Logic app and it suceeeded.

'When a samrt contract event occurs' Event only fails, so I think the prblem is related to smart contract event setting.


Solution

  • removing indexed modifier fixed problem.

    address indexed _from
    

    TO

    address _from