-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors for Calls, Events, and SubscriptionsNo provider set
and Provider not set or invalid
for deployed contract instance when current IPC Provider valid
#1266
Comments
This looks similar to the problem that I ran into. I used this workaround #1253 (comment). I'm guessing that you'll get what you need with |
@mjhm Thanks that fixed it. Here's the commit in my repo that fixed it all. Happy New Year! ltfschoen/geth-node@85e247a |
I'm glad to see I'm not the only one that has encountered this issue. I'm working my way through a Blockgeeks course module and testing a smartcontract in testRPC with the requisite ten accounts with 100 play ether in each. The contract appears to have been deployed and, when queried, web3 returns an address confirming that the contract has been mined. So @mjhm, what exactly is the simple solution to this issue? I'm running web3.js v1.0.0-beta.27 on Ubuntu 16.04.
|
@Snerken My best guess is doing |
Thanks @mjhm , you're a legend! After running the deploy command:
I ran the command you suggested and got true:
Problem solvered! |
I've tested and improved the IpcProvider on the last 1.0 beta release. Please update to the latest version of Web3.js. |
INFO
Which Web3.js version?: 1.0.0-beta.27
Which operating system?: MacOS
How installed?: NPM
actual behaviour, expected behaviour, and steps to reproduce
I’m using Web3.js v1.0.0-beta.27. I followed all the steps described in the README of my repository https://github.com/ltfschoen/geth-node. In summary, I created a Node.js script https://github.com/ltfschoen/geth-node/blob/master/scripts/main.js using Web3.js and IPC to connect to my Geth Private Network. I used Web3.js to load a Solidity contract file and then compile it. I've now managed to get it to successfully deploy the contract to the blockchain.
I've now tried to use Web3.js to Call contract methods, listen to contract Events, and added Subscriptions as follows:
"Call" Solidity contract
constant
methods - Example here between Line 172 and 183: https://github.com/ltfschoen/geth-node/blob/master/scripts/main.js#L172Event listeners (
once
,allEvents
,getPastEvents
) plus Custom Solidity events listeners (Created
,Approved
) added - Example here between Line 202 and 286: https://github.com/ltfschoen/geth-node/blob/master/scripts/main.js#L202Subscriptions (
pendingTransactions
,log
). Example here between lines 286 to 298: https://github.com/ltfschoen/geth-node/blob/master/scripts/main.js#L286But after it successfully deploys the Contract instance to the blockchain on Line 158 https://github.com/ltfschoen/geth-node/blob/master/scripts/main.js#L158 it shows the following errors
Error: No provider set.
andError: Provider not set or invalid
in Bash terminal as a result of theconsole.log
's that I've included in the Error handlers of each of the Callback functions.As you can see, on Line 161 I've verified using
web3.currentProvider
that there is an IPC Provider that I'm connected to https://github.com/ltfschoen/geth-node/blob/master/scripts/main.js#L161, hence my confusion.The text was updated successfully, but these errors were encountered: