I am trying to deploy my smart contract code in Infura using truffle, but this error has been raised
Deploying 'Migrations'
----------------------
Error: *** Deployment Failed ***
"Migrations" -- Unknown Error: {"jsonrpc":"2.0","id":6,"error": {"code":-32002,"message":"project ID does not have access to archive state","data":{"see":"https://infura.io/dashboard"}}}
{
"originalError": {}
}.
Any help
Thanks
It is weird.
I think it works if I skip the dry-run. But not sure why kovan-fork is not working. It was working yesterday.
You can change the network as you want
truffle migrate --network kovan --reset --skip-dry-run
Related
I tried to migrate the contract Migrations by using Truffle migrate, it got hang and show error message as belows. Please help me if I configured anything wrong.
⠸ Saving migration to chain. {
"jsonrpc": "2.0",
"id": 1574154369501,
"result": "0x"
}
Error: Error: Error: Transaction was not mined within 750 seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!
at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:92:1)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
Truffle v5.1.0 (core: 5.1.0)
Node v8.10.0
This problem was fixed. The root cause was an environment. At the first time I ran this on VirtualBox Ubantu. The performance was quite slow. Then I tried to run on Host Windows. It's fast and worked.
I am trying to compile my smart contracts using truffle pet-shop. I have the following contract in directory election/contracts/election.sol ;
pragma solidity >=0.4.0 <0.6.0;
contract Election{
string public candidate;
constructor() public{
candidate="Zeeshan";
}
}
The migration file to deploy contracts in directory election/migrations/2_deploy_contracts1.js is as follows;
var Election1=artifacts.require("election.sol");
module.export=function(deployer){
deployer.deploy(Election1)
};
I am using the following command to migrate the contracts:
truffle migrate
And I am getting the following results:
Compiling your contracts...
===========================
> Compiling .\contracts\Election.sol
> Compiling .\contracts\election.sol
> Artifacts written to D:\Notes\BCS\Semester 8\FYP\Practise Coding\dapp university 2 hr video code\election\build\contracts
> Compiled successfully using:
- solc: 0.5.8+commit.23d335f2.Emscripten.clang
Starting migrations...
======================
> Network name: 'development'
> Network id: 5777
> Block gas limit: 0x6691b7
2_deploy_contracts1.js
======================
Error: Error: Migration D:\Notes\BCS\Semester 8\FYP\Practise Coding\dapp university 2 hr video code\election\migrations\2_deploy_contracts1.js invalid or does not take any parameters
at Object.run (C:\Users\mk141\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-migrate\index.js:92:1)
at process._tickCallback (internal/process/next_tick.js:68:7)
Truffle v5.0.30 (core: 5.0.30)
Node v10.16.1
Its also compiling Election.sol because I renamed election.sol to Election.sol and it stores election.sol in cache perhaps.
As you can see above its giving Error:Migration 2_deploy_contracts invalid or does not take any parameters at Object.run() and i don't know how to resolve it.
I was making a mistake in 2_deploy_contracts1.js file. There is module.exports instead of module.export. So the new 2_deploy_contracts1.js file will be;
var Election1=artifacts.require("election.sol");
module.exports=function(deployer){
deployer.deploy(Election1)
};
Also, I was using the following command to migrate again;
truffle migrate
Instead, I should use the following command if I am migrating again;
truffle migrate --reset
We use this command because we already migrated our smart contracts in the built folder. This command will remove all previously migrated files in the built folder and add new migrated files of smart contracts.
In the require function you need to check the name of your contract like Election.sol and check for any typos
I'm trying to deploy/migrate contract to rinkeby network, while using command:
truffle deploy --reset --network=rinkeby
It loads the keys and afterwards throws error:
C:\Users\marti\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-provider\wrapper.js:26
var originalSendAsync = provider.sendAsync.bind(provider);
TypeError: Cannot read property 'bind' of undefined
I'm able to run truffle develop without any issues
I'm also using:
truffle-hdwallet-provider
zappelin-solidity
Okay so the issue was comming from the truffle-hdwallet-provider version.
changing the ver from : 1.0.0-web3one.2
to : 0.0.6
solved the issue
I'm trying to deploy simple crowdsale coin on the rinkeby test network. I'm using https://github.com/gustavoguimaraes/my-ico as template, where my code is at https://github.com/nmiculinic/shitcoin ; master commit; hash 599edc5d5a7d1c614d64fb43f96e19bdab9e8252
However I'm unable to get this simple coin deployed to the rinkeby test network (nor the gustav's one for that matter) with the following error:
shitcoin (master) ✔ truffle migrate --reset --network rinkeby
Compiling ./contracts/Shitcoin.sol...
Compiling zeppelin-solidity/contracts/math/SafeMath.sol...
Compiling zeppelin-solidity/contracts/ownership/Ownable.sol...
Compiling zeppelin-solidity/contracts/token/BasicToken.sol...
Compiling zeppelin-solidity/contracts/token/ERC20.sol...
Compiling zeppelin-solidity/contracts/token/ERC20Basic.sol...
Compiling zeppelin-solidity/contracts/token/MintableToken.sol...
Compiling zeppelin-solidity/contracts/token/StandardToken.sol...
Writing artifacts to ./build/contracts
Using network 'rinkeby'.
Running migration: 1_initial_migration.js
Replacing Migrations...
... 0x0bd42558d2daba72c886b369a492d1432397d9d617d14ce6655e1723b1d03058
Migrations: 0xb5b69afbaf45bdfb3e3fd73164259a6cd55d031a
Saving successful migration to network...
... 0xb3f5e8d87729e05b258fa97fda467d068e68c2903b60b8dc3989631c2e804262
Saving artifacts...
Running migration: 2_deploy_contracts.js
Deploying ShitCoinCrowdsale...
... 0x113fbb45883d804a6befe05d3fa9ef940ecc2ab02196abc830b5b994064e57cc
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: The contract code couldn't be stored, please check your gas amount.
at Object.callback (/usr/lib/node_modules/truffle/build/cli.bundled.js:222830:46)
at /usr/lib/node_modules/truffle/build/cli.bundled.js:35149:25
at /usr/lib/node_modules/truffle/build/cli.bundled.js:224768:9
at /usr/lib/node_modules/truffle/build/cli.bundled.js:66971:11
at /usr/lib/node_modules/truffle/build/cli.bundled.js:208348:9
at XMLHttpRequest.request.onreadystatechange (/usr/lib/node_modules/truffle/build/cli.bundled.js:209773:13)
at XMLHttpRequestEventTarget.dispatchEvent (/usr/lib/node_modules/truffle/build/cli.bundled.js:67130:18)
at XMLHttpRequest._setReadyState (/usr/lib/node_modules/truffle/build/cli.bundled.js:67420:12)
at XMLHttpRequest._onHttpResponseEnd (/usr/lib/node_modules/truffle/build/cli.bundled.js:67575:12)
at IncomingMessage.<anonymous> (/usr/lib/node_modules/truffle/build/cli.bundled.js:67535:24)
I want to develop a new cartridge for my own use. I use OpenShift Cartridge Development Kit to start my work. My building script is written in .openshift/action_hooks/build and it can be successfully executed.
But when I tried to use the command displayed on the homepage of the CDK project - "rhc create-app mynewcart http://##YOUR-DOMAIN##/manifest/##YOUR-COMMIT-ID##" - to create an app, I got the following error: "Unable to complete the requested operation due to: An invalid exit code (1) was returned from the server ex-std-node161.prod.rhcloud.com. This indicates an unexpected problem during the
execution of your request."
How can I trace the progress of deploying and find out where is the code that caused the problem? Is there any log file available for me to analyse?
Use the --debug option when running the command and you'll get much more detailed output:
rhc create-app mynewcart http://##YOUR-DOMAIN##/manifest/##YOUR-COMMIT-ID## --debug