简体   繁体   English

固体迁移合同空转与实际

[英]Solidity migrate contract dry run vs for real

Summary: Using truffle to deploy to rinkeby via infura. 简介:使用松露通过infura部署到rinkeby。

I just deployed my crowdsale and that seems to succeed. 我刚刚进行了众筹,似乎成功了。 However truffle is not showing me a contract address which is worrying. 但是,松露并未显示给我令人担忧的合同地址。 I notice Migrations dry-run (simulation) at the top, which makes me wonder if its not being deployed, its just testing it... is this a thing? 我在顶部注意到了Migrations dry-run (simulation) ,这使我想知道是否未部署它,只是对其进行了测试……这是问题吗? How do i get it to actually deploy? 我如何才能真正部署它?

OK as this was hard to debug, I have an answer that may help others. 好的,因为这很难调试,我有一个可以帮助其他人的答案。

  1. Using the latest bleeding edge truffle, I was informed through a warning, to use the 1.0.0-web3one.0 version of truffle-hdwallet-provider 使用最新的边缘松露,通过警告我被告知使用truffle-hdwallet-provider1.0.0-web3one.0版本
  2. Once I installed that, I could get past the simulation. 一旦安装了该软件,就可以通过模拟。 When migrating for the rinkeby/live networks, a simulation will be attempted before actual deployment. 在迁移到rinkeby /实时网络时,将在实际部署之前尝试进行模拟。 This didn't seem documented anywhere and as truffle hung after simulation completed, this was a real brainer.... 这似乎没有记录在案,并且在完成模拟后由于松露悬挂,这真是令人费解。
  3. Although it seems obvious now, if there is any time related code (such as a start time for a crowdsale) this needs to be minutes into the future for deployment. 尽管现在看起来很明显,但是如果有任何与时间相关的代码(例如,开始众筹的时间),则需要在几分钟后进行部署。 Not something obvious when using ganache - I had mine 20 seconds into the future, but by the time that would have been deployed, that was now in the past, causing a revert on my contracts 使用ganache时不是很明显-我有20秒的时间,但是到了可以部署的时间,那已经是过去了,这导致我的合同被撤销

I'm making quite good progress with the new 1.0 version of ethereum tools, and beta of truffle, so shout if I an be of assistance! 我在新的以太坊工具1.0版本和松露测试版方面取得了不错的进展,如果我有帮助,请大喊大叫!

Please try put it in the networks section, the option skipDryRun: true 请尝试将其放入“网络”部分,选项skipDryRun: true

module.exports = {

  networks: {
    ...

    ropsten:{
     provider: () => new HDWalletProvider(mnemonics, endpoint),
     network_id: 3,
     gas: 5000000,
     confirmation: 2, 
     timeoutBlocks: 200,
     skipDryRun: true
    },
    ...
  }
}

You can use Etherlime for deployment of smart contracts. 您可以使用Etherlime部署智能合约。 Actually you can use it for everything instead of truffle. 实际上,您可以使用它代替松露。 It is simpler and with more information. 它更简单,并且包含更多信息。 In my opinion is the better tool. 我认为是更好的工具。 It is based on ethersjs which is a lot better than web3js. 它基于ethersjs,比web3js更好。 Here is a link to the documentation 这是文档的链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在rinkeby测试网络上部署固态智能合约的问题 - issues deploying solidity smart contract to rinkeby test network 尽管合约账户中有 5 BNB,但在 Truffle 上运行 migrate function 时 bscTes.net 上的资金不足 - Insufficient funds on bscTestnet when running migrate function on Truffle despite having .5 BNB in the contract account “ heroku运行rails db:迁移”(LoadError) - “heroku run rails db: migrate” (LoadError) “ heroku run rake db:migrate”命令返回ETIMEDOUT错误消息 - “heroku run rake db:migrate” command returns ETIMEDOUT error message ecs 运行与 ecs 部署 - Ecs run vs ecs deploy 现实世界的机器学习生产系统如何运行? - How does real world machine learning production systems run? 如何在 solidity 中调试 parsererror - How to debug a parsererror in solidity 如何使用heroku或heroku-api gem在自动部署中运行rake db:migrate? - How do I run rake db:migrate in automated deploy with heroku or heroku-api gem? VS 安装程序的快捷方式中缺少“以管理员身份运行” - Missing “Run as Administrator” in VS Installer's Shortcut 在 Docker 与 VM 上运行 Ansible - Run Ansible over Docker vs VM
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM