moonstream-to / moonworm

codegen for crypto degens and other ethereum smart contract toolkit for python
Apache License 2.0
36 stars 7 forks source link

IPC as web3 provider? #81

Open billbradley opened 2 years ago

billbradley commented 2 years ago

You can currently specify a URL as the web3 provider. However, you can't use IPC if you happen to be running your own node.

I think this could be fixed by changing line 119 of cli.py from:

    web3 = Web3(Web3.HTTPProvider(args.web3))

to

    # Assume "args.web3" is an URL; if no connection,
    # see if it's an IPC file.
    web3 = Web3(Web3.HTTPProvider(args.web3))
    if not(web3.isConnected()):
        web3 = Web3(Web3.IPCProvider(args.web3))

I don't have permission to submit a PR or I'd do that myself :)