Thanks so much Carlos, the issue was related to something else which has now been resolved. I’m still getting the same error for the erc1155 files which is showing me this. Changing this to 0.6.0 resolves the error but I’m still unable to compile this. Can you try deploying this locally to see if you are able to? My new code can be found here: https://github.com/lohba/Ethereum-Game
Hey @Iowa, hope you are good.
Now i have downloaded your project, try to compile it but i got a lot of errors from missing files.
So basically you dont have that module into that folder of @trufflesuite
, I go check the folders and is true, the module is not there.
But then i check the node_module
main folder, which is the one that npm install package like eth-block-tracker
:
And yes, you have it on the main folder. What I did is just move that
eth-block-tracker
into the folder that error provided:Then lets run truffle migrate --reset
again and buuum, there is another module missing, async
, so we have to do the same process to fix it.
Now just a tip: move the async
folder to the node_modules
of the web3-provider-engine
and try to compile again.
My main goal here is that you learn/understand to read the errors from the console to get an idea on why your project is not working, this will happen time to time, is good practice to know how to read the console by yourself.
If you have any more questions, please let us know so we can help you!
Carlos Z.
Carlos, thank you! It looks like the contract is compiling after I move those files. I’m now getting an issue related to the network configuration. Currently my compiler version in my truffle-config is 0.6.2. Does this version have to be the same as my Migrations file? However, I know you mentioned compiler versions can be different across files:
Is your ganache up and running?
Your compiler version and contracts should be able to work with newly versions, in case of your migration file it start with:
pragma solidity >=0.4.22 <0.8.0;
Meaning, it should be able to run from version (greater or equal) 0.4.22 to 0.8.0.
If you have any more questions, please let us know so we can help you!
Carlos Z.
Thanks a ton Carlos! I was actually able to finally deploy this on Ropsten network. However, I’m having issues with the index file as I’m not seeing the actual game appear in my local python server, any idea why? Really appreciate your help thus far!
Mmmm, I might need to see your index file to have a better picture, better yet if I could check all the project files, but I think you are not importing correctly your game files, I might be wrong, maybe you can upload the entire project into a repository of github, so i can try to run it.
If you have any more questions, please let us know so we can help you!
Carlos Z.
Hello guys. I’m stuck and I don’t understand what I can do to resolve my problem. I have found nothing on Internet. When I try to migrate on ropsten network I get this error:
var e = new Error('ETIMEDOUT')
^
Error: PollingBlockTracker - encountered an error while attempting to update latest block:
Error: ETIMEDOUT
at Timeout.<anonymous> (D:\Dapps\ERC20 Game\node_modules\request\request.js:848:19)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7)
at PollingBlockTracker._performSync (D:\Dapps\ERC20 Game\node_modules\eth-block-tracker\src\polling.js:51:24)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
I think that I set up everything correctly. Here my truffle config file.
const HDWalletProvider = require('@truffle/hdwallet-provider');
const infuraKey = "fa8bb2863a31442fac1d3f8e2cb5b8a1";
const fs = require('fs');
const mnemonic = fs.readFileSync(".secret").toString().trim();
ropsten: {
provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/v3/143ef184f1bd4bfc985ca3bd49a0fd37`),
network_id: 3, // Ropsten's id
gas: 5500000, // Ropsten has a lower block limit than mainnet
confirmations: 2, // # of confs to wait between deployments. (default: 0)
timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
},
Anyone can help me please because i’m gonna be crazy? Thanks in advance
Hey Carlos - any luck?
Thanks as always
Hey @lohba, hope you are good.
Sorry for the delay, got some issues with my ISP these days.
I have downloaded, compile, migrate and deploy successfully your contracts, no issue showed while deploying them.
now running my python server for your website also works good. Getting transactions over your buttons also work with no issue.
Now I see that you have created your entire logic for your game, but you have not add it to the html file, you only have 3 buttons and nothing more, you should create a div and them implement all the necessary logic to show the game.
If you have any more questions, please let us know so we can help you!
Carlos Z.
Hi Carlos, no problem and thanks for getting back. I’m looking through Filip’s completed code and I’m not seeing any difference in the index file compared to mine. What am I missing here?
Hi Carlos, anything?
Yep, sorry for the delay, you assign the game initializer to a function and you never invoke the function, so the game never load. I suggest to delete var game;
and the function, then just declare the `var game = new Phaser.Game(config); has public variable.
Here you are assigning the game variable which is the one that initialize the game into a function.
Filip code does not have a function to initialize the game.
If you have any more questions, please let us know so we can help you!
Carlos Z.
Is there a guide on how to estimate the gas price and gas limits for transactions? I can’t deploy my contract onto the testnet.
EDIT: Forgot to mention that I have 5.72 ETH in my Ropsten test network account.
Thank you Carlos, it looks like its working now! One last question I hope, if another user wants to play this game by downloading the files, do they need to run this on a testnet and fire up a local python server? I’m trying to understand the logistics of sharing this game and having users play easily. Thanks again for all your help on this.
That will depend on your project, if you want to provide the game worldwide, but keeping control on payments and users, you have to provide a website (which will be a server that contain all the files necesary to run the App), in case like this: only a academic project, a user should download the game files (like i did with your github) and run it locally through his own python server.
Glad to know you made it work
If you have any more questions, please let us know so we can help you!
Carlos Z.
Hey @Uyan, hope you are well.
I found this interesting article which apparently could explain this better than me, I suggest to read it
https://ethereum.stackexchange.com/a/27461
If you have any more questions, please let us know so we can help you!
Carlos Z.
@thecil Hello again! After 2 weeks of struggle - only an hour a day, but still - I think I know what the problem is. I have plenty of ETH on my testnet account now, so I don’t think the insufficient funds
error is telling the whole story.
I believe the Metamask account I’m trying to use is not synced with the Ropsten network, hence it showing the insufficient funds
error (see previous post), as whatever account address the contract is trying to use has no ETH.
See comment by user ‘ulu’ here: https://ethereum.stackexchange.com/questions/38521/truffle-migrate-to-rinkeby-fails-with-insufficient-gas-price
How can I create an account that will work easily with this project? Is there an alternative, yet repeatable process that I can turn to for future projects?
I did (first) try the MyEtherWallet account, as well as the mnemonic that truffle develop
provides but neither has worked. I also haven’t seen any use of Ganache in the video tutorials so far. How much help would Ganache provide for this problem?
I would post lots of screenshots and/or upload the whole project to Github, but I believe my hypothesis to be correct, given how much independent research I have done on this pretty basic problem (which I realise is causing more trouble than it should). Let me know if you would like the code to be uploaded, but as I say I think the problem is my account/public/private key/mnemonic management.
Here’s the account address I was trying to use. I think I can post it here:
testnet account address
0x04f17473ee101053C0ac771579eb017AE27BF738
I also have the list of public and private keys that MyEtherWallet generated ready to go, if needed.
Hey @Uyan
Glad to know you are making progress and thank you for researching that issue in-deep, now I read on the link you provide a suggestion to set the gas price according to the network. But I assume you already tried that, so it would be better for me to try to deploy the contract by myself, lets see if I face the same issue, if not I would post an step by step what I did so you can use it has guideline, but probably it is a weird issue with the keys management.
So, please update the contract files in a github repository, I dont need any private key, I will deploy it on my own address. I just want to run the same code that you have in order to face the same issue.
If you have any more questions, please let us know so we can help you!
Carlos Z.