У меня есть учетная запись Infura, и у меня есть следующий код:
...
web3 = Web3(HTTPProvider("https://ropsten.infura.io/mytoken") )
web3_pending_filter = web3.eth.filter('pending')
...
когда строка web3_pending_filter = web3.eth.filter('pending')
выполняется, я получаю сообщение об ошибке:
request.exceptions.HTTPError: 405 Ошибка клиента: метод не разрешен для URL-адреса: https://ropsten.infura.io/mytoken
Как я могу решить эту проблему?
Infura не поддерживает фильтры.
Согласно https://api.infura.io/v1/jsonrpc/ropsten/methods (из документации это поддерживаемые методы:
{
"get": [
"web3_clientVersion",
"net_version",
"net_listening",
"net_peerCount",
"eth_protocolVersion",
"eth_syncing",
"eth_mining",
"eth_hashrate",
"eth_gasPrice",
"eth_accounts",
"eth_blockNumber",
"eth_getBalance",
"eth_getStorageAt",
"eth_getTransactionCount",
"eth_getBlockTransactionCountByHash",
"eth_getBlockTransactionCountByNumber",
"eth_getUncleCountByBlockHash",
"eth_getUncleCountByBlockNumber",
"eth_getCode",
"eth_call",
"eth_estimateGas",
"eth_getBlockByHash",
"eth_getBlockByNumber",
"eth_getTransactionByHash",
"eth_getTransactionByBlockHashAndIndex",
"eth_getTransactionByBlockNumberAndIndex",
"eth_getTransactionReceipt",
"eth_getUncleByBlockHashAndIndex",
"eth_getUncleByBlockNumberAndIndex",
"eth_getCompilers",
"eth_getLogs",
"eth_getWork"
],
"post": [
"eth_sendRawTransaction",
"eth_call",
"eth_estimateGas",
"eth_submitWork",
"eth_submitHashrate"
]
}