Filter auf Infura kann nicht über web3.py erstellt werden

Ich habe ein Infura-Konto und ich habe den folgenden Code:

...
web3 = Web3(HTTPProvider("https://ropsten.infura.io/mytoken") )
web3_pending_filter = web3.eth.filter('pending')
...

Wenn die Zeile web3_pending_filter = web3.eth.filter('pending')ausgeführt wird, erhalte ich einen Fehler:

Requests.Exceptions.HTTPError: 405 Client Error: Method Not Allowed for URL: https://ropsten.infura.io/mytoken

Wie kann ich dieses Problem beheben?

Antworten (1)

Infura unterstützt keine Filter.

Per https://api.infura.io/v1/jsonrpc/ropsten/methods (aus der Dokumentation sind dies die unterstützten Methoden:

{
  "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"
  ]
}