Hello guys,
Im using the infura to test my contract on rinkeby network but i got error that ‘Subscriptions are not supported with the CustomProvider’ . is the website still working or it is kind of problem in my code ?
best regards,
Ahmed
Hello guys,
Im using the infura to test my contract on rinkeby network but i got error that ‘Subscriptions are not supported with the CustomProvider’ . is the website still working or it is kind of problem in my code ?
best regards,
Ahmed
Can you provide the code where you are setting up and using the websocket connection? Can you also provide the full error response?
Hi Mike,
I created a new project here and copy the Rinkeby endpoint link to my code. Here are deploy.js package.json and the error in the order:
const HDWalletProvider = require(“truffle-hdwallet-provider”);
const Web3 = require(“web3”);
const compiledFactory = require("./build/Factory.json");
const provider = new HDWalletProvider(
"‘my mnemonic’
, ‘my url from infura’
);
const web3 = new Web3(provider);
const deploy = async () => {
const accounts = await web3.eth.getAccounts();
console.log(“Attempting to deploy from account”, accounts[0]);
const result = await new web3.eth.Contract(
JSON.parse(compiledFactory.interface)
)
.deploy({ data: “0x” + compiledFactory.bytecode })
.send({ gas: “5000000”, from: accounts[0] });
console.log(“contract deployed to”, result.options.address);
};
deploy();
when i checked https://rinkeby.etherscan.io i found that it is deployed but i still get the error message, maybe it is from truffle version but Im not sure .
Looks like this may be a problem w/ web3, and may be related to this issue, https://github.com/ethereum/web3.js/issues/2405
We do not support the account APIs for security reasons we are not sure if the HDWalletProvider is in turn simulating that locally or not though, but we only support sending transactions that are signed off-node via eth_sendRawTransaction.