0

I’m trying to deploy to Rinkeby using Infura (using Etherlime), but am getting a strange error:

'Error: connect ECONNREFUSED 127.0.0.1:443\n' +
    '    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16)'

Prior I was getting a different error, but after shutting down a local web server (nginx, not that it matters) I started getting this one. It would seem to me that something in Infura is trying to listen on port 443, and that the issues stem from that, but I’m not at all certain that I’m diagnosing right. We’ve tried this on Linux, Mac, and Windows, and are all getting the same error (though triggered by different lines in net.js it seems).

One thought is that somehow changing the port that Infura is using would help. I've tried making the api call like so: https:/rinkeby.infura.io/v3/${process.env.INFURA_API_KEY_RINKEBY}:{NEW PORT NUMBER}, and even though it doesn't crash the api call, I get the same error with port 443. Maybe it's not Infura after all?

Any thoughts about what we can do to fix this?

0

This ended up being a problem in the deployer.

In order to give some context, this is what the relevant part of /deployment/deploy.js looked like at the time of the question:

} else if (network == 'rinkeby') {
        // Overriding default config for rinkeby test net
        defaultConfigs.chainId = 4;
        // Setting private key for this network
        secret = process.env.DEPLOYER_PRIVATE_KEY_RINKEBY;
        // Setting the RPC
        RPC = `https:/rinkeby.infura.io/v3/${process.env.INFURA_API_KEY_RINKEBY}`;

       deployer = new etherlime.JSONRPCPrivateKeyDeployer(
            secret, 
            RPC, 
            defaultConfigs
        );


        console.log("Deploying to Rinkeby network");
    }

When using Infura, though, the deployer needs to be configured differently, using the InfuraPrivateKeyDeployer instead of the JSONRPCPrivateKeyDeployer:

} else if (network == 'rinkeby') {
        // Overriding default config for rinkeby test net
        defaultConfigs.chainId = 4;
        // Setting private key for this network
        secret = process.env.DEPLOYER_PRIVATE_KEY_RINKEBY;
        // Setting the RPC
        // RPC = 'https://rinkeby.infura.io'
        RPC = `https:/rinkeby.infura.io/v3/${process.env.INFURA_API_KEY_RINKEBY}`;

        deployer = new etherlime.InfuraPrivateKeyDeployer(
            secret, 
            network, 
            process.env.INFURA_API_KEY_RINKEBY, 
            defaultConfigs
        );

        console.log("Deploying to Rinkeby network");
    }
| improve this answer | |

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.