标签: consensys-truffle

6
推荐指数
1
解决办法
3086
查看次数

合约尚未部署到 Rinkeby Network 上检测到的网络(网络/工件不匹配)

我一直遇到标题中指定的。

我开发了一个智能合约并成功编译并部署到网络如下: 1. 运行 testrpc 2. truffle compile 3. truffle migrate

但是,仍然显示上述错误。然后我尝试删除构建文件并按照以下步骤操作: 1. 运行 testrpc 2. truffle compile 3. truffle migrate --network rinkeby

错误仍然显示。

下面是 truffle.js 文件

module.exports = {
  migrations_directory: "./migrations",
  networks: {
development: {
  host: "localhost",
  port: 8545,
  network_id: "*" // Match any network id
},
rinkeby: {
  host: "localhost", // Connect to geth on the specified
  port: 8545, 
  network_id: "*",
}
Run Code Online (Sandbox Code Playgroud)

} };

如果有人遇到任何类似的问题并已解决,如果您能分享您是如何解决的,我将不胜感激。

提前致谢

ethereum smartcontracts truffle consensys-truffle

5
推荐指数
3
解决办法
8619
查看次数

为什么不可能使用 Truffle 部署智能合约(到主网)?

为什么使用 Truffle 部署到主网如此困难?

这是尝试部署到主网的概述......

  1. 当前 Gasprice 为 110 威。所以110000000000 wei

让我们插上它..

mainnet: {
      provider: () =>
        new HDWalletProvider({
          mnemonic: { phrase: process.env.MNEMONIC },
          providerOrUrl: process.env.RPC_URL_1_WSS,
        }),
      network_id: 1, 
      from: process.env.DEPLOYERS_ADDRESS,
      gasPrice: 110000000000, /*  GAS PRICE!! */
      confirmations: 2,
      timeoutBlocks: 200,
      skipDryRun: false, public nets )
    },
  },
Run Code Online (Sandbox Code Playgroud)
  1. 让我们来估算一下部署的 gas 成本。这将在 的gas参数中设置truffle-config

NODE_ENV=production truffle migrate --network mainnet --dry-run

Summary
=======
> Total deployments:   2
> Final cost:          0.001403824 ETH
Run Code Online (Sandbox Code Playgroud)

0.001403824 ETH 是 2.04 美元。
所以这很可能是错误的。

??失败?? …

ethereum smartcontracts truffle consensys-truffle

5
推荐指数
0
解决办法
410
查看次数

无法运行 truffle@2.1.2 migrate --network live。“超出区块气体限制”

我正在使用 truffle@2.1.2 针对 rpc 部署智能合约,使用已在 geth 控制台上localhost:8545 geth@1.5.9-stable解锁的 Ether 资助的帐户。personal.unlockAccount

\n\n

我还通过 RPC 对远程 Parity 节点进行了相同的尝试,但这是我相当坚持的最新版本。

\n\n

松露.js

\n\n
module.exports = {\n  build: {\n    "index.html": "index.html",\n    "app.js": [\n      "javascripts/app.js"\n    ],\n    "app.css": [\n      "stylesheets/app.css"\n    ],\n    "images/": "images/"\n  },\n  rpc: {\n    host: "localhost",\n    port: 8545\n  },\n  networks: {\n    "ropsten": {\n      network_id: 3,\n      port: 8548, // ssh tunnelled to AWS geth/parity node localhost:8545\n      from: "0x4f000Bcf4641E2fDcE85BF26A694b053996850D4"\n    },\n    "live": {\n      network_id: 1,\n      port: 8545,\n      from: "0x00269400181f1B379784BD8cDF786bb20e91Bdef",\n      gas: 4612388,\n      gasPrice: 2776297000 // taken …
Run Code Online (Sandbox Code Playgroud)

ethereum truffle consensys-truffle parity-io

5
推荐指数
1
解决办法
3636
查看次数

为松露设置气体

truffle migrate在 main 上运行。也使用geth。我最初在 truffle.js 中将 Gas Price 和 Gas 留空,但现在看起来像这样:

live: {
  network_id: 1,
  host: "127.0.0.1",
  port: 8545,
  from: "3984bc76cb775d7866d1cd55c4f49e3d13d411d4",
  gas: 40000,
  gasPrice: 22000000000 // Specified in Wei
}
Run Code Online (Sandbox Code Playgroud)

我似乎遇到了一种情况,要么汽油太多,要么汽油不足,不可能获得适量的汽油。

 <   {
 <     "jsonrpc": "2.0",
 <     "id": 2,
 <     "error": {
 <       "code": -32000,
 <       "message": "insufficient funds for gas * price + value"
 <     }
 <   }
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: insufficient funds for gas * price + value …
Run Code Online (Sandbox Code Playgroud)

ethereum truffle consensys-truffle go-ethereum cryptocurrency

5
推荐指数
1
解决办法
1万
查看次数

Truffle 无法在 Mac M1 上安装

我正在尝试在我的 mac M1 上安装 Truffle。

我首先按照 Pet Shop 教程中 truffle 网站上的说明操作,成功安装了节点,但随后出现此错误...

sudo npm install -g truffle
...
npm ERR! xcrun: error: unable to load libxcrun (dlopen(/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib, 0x0005): tried: '/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/lib/libxcrun.dylib' (no such file)).
Run Code Online (Sandbox Code Playgroud)

我做了一些研究,并被指出在自制软件中尝试它。由于我的 M1 芯片,我必须先更新自制程序,我成功地做到了。但我仍然得到看似相同或相似的错误......

/opt/homebrew/bin/brew install truffle
...
xcrun: error: unable to load libxcrun (dlopen(/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib, 0x0005): tried: '/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/lib/libxcrun.dylib' (no such file)).
truffle: The x86_64 architecture …
Run Code Online (Sandbox Code Playgroud)

truffle consensys-truffle

3
推荐指数
1
解决办法
1743
查看次数