1

I'm having this other issue which has forced me to rely on either infura or web3.auto in order to make the getTransactionReceipt call. I've noticed that when I create a w3 instance from web3.auto it pretty much always successfully returns me a tx_receipt when calling getTransactionReceipt. So this leads me to wonder how web3.auto chooses a provider node. Does it only select full nodes? Does it ever select parity pruning nodes or light nodes? Are there any other restrictions?

I'm curious for 1, and for 2 I'd like to use this answer to apply it to my above-linked issue to see if I can determine why my parity node always returns null when I call getTransactionReceipt with some transaction hashes.

0

From the docs:

How Automated Detection Works

Web3 attempts to connect to nodes in the following order, using the first succesful connection it can make:

The docs are getting a bit stale, but should be a good place to start. I just noticed it is missing the WebsocketProvider, which is attempted after HTTPProvider. In the end, the best documentation is the code. For example, IPCProvider's default location is set using:

def get_default_ipc_path(testnet=False):
    if testnet:
        testnet = "testnet"
    else:
        testnet = ""

    if sys.platform == 'darwin':
        ipc_path = os.path.expanduser(os.path.join(
            "~",
            "Library",
            "Ethereum",
            testnet,
            "geth.ipc"
        ))
        if os.path.exists(ipc_path):
            return ipc_path

        ipc_path = os.path.expanduser(os.path.join(
            "~",
            "Library",
            "Application Support",
            "io.parity.ethereum",
            "jsonrpc.ipc"
        ))
        if os.path.exists(ipc_path):
            return ipc_path

    elif sys.platform.startswith('linux') or sys.platform.startswith('freebsd'):
        ipc_path = os.path.expanduser(os.path.join(
            "~",
            ".ethereum",
            testnet,
            "geth.ipc"
        ))
        if os.path.exists(ipc_path):
            return ipc_path

        ipc_path = os.path.expanduser(os.path.join(
            "~",
            ".local",
            "share",
            "io.parity.ethereum",
            "jsonrpc.ipc"
        ))
        if os.path.exists(ipc_path):
            return ipc_path

    elif sys.platform == 'win32':
        ipc_path = os.path.join(
            "\\\\",
            ".",
            "pipe",
            "geth.ipc"
        )
        if os.path.exists(ipc_path):
            return ipc_path

        ipc_path = os.path.join(
            "\\\\",
            ".",
            "pipe",
            "jsonrpc.ipc"
        )
        if os.path.exists(ipc_path):
            return ipc_path

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.