networks: { development: { host:"127.0.0.1", // Localhost (default: none) port:8545, // Standard Ethereum port (default: none) network_id:"*", // Any network (default: none) }, }
部署
truffle migrate --network development -f 1
这是部署在本地,然后会输出下面的样子
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
1_initial_migration.js ======================
Deploying 'Migrations' ---------------------- > account:0xa2dfcFC197f811d0a53b537713Ae02a49485b0eB > balance:999.999726634 > gas used:136683 > gas price:2 gwei > value sent:0 ETH > total cost:0.000273366 ETH
TypeError: migrations.setCompleted is not a function at Migration._deploy (/Users/licong/solidity/test/node_modules/truffle/build/webpack:/packages/truffle-migrate/migration.js:106:1) at processTicksAndRejections (internal/process/task_queues.js:97:5) at /Users/licong/solidity/test/node_modules/truffle/build/webpack:/packages/truffle-migrate/migration.js:60:1 Truffle v5.0.7 (core:5.0.7) Node v13.14.0
⠋ Saving migration to chain. TypeError: migrations.setCompleted is not a function at Migration._deploy (/Users/licong/solidity/multiswap/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:99:1) at processTicksAndRejections (node:internal/process/task_queues:96:5) at Migration._load (/Users/licong/solidity/multiswap/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:56:1) at Migration.run (/Users/licong/solidity/multiswap/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:217:1) at Object.runMigrations (/Users/licong/solidity/multiswap/node_modules/truffle/build/webpack:/packages/migrate/index.js:150:1) at Object.runFrom (/Users/licong/solidity/multiswap/node_modules/truffle/build/webpack:/packages/migrate/index.js:110:1) at runMigrations (/Users/licong/solidity/multiswap/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:253:1) at Object.run (/Users/licong/solidity/multiswap/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:223:1) at Command.run (/Users/licong/solidity/multiswap/node_modules/truffle/build/webpack:/packages/core/lib/command.js:183:1) Truffle v5.4.12 (core:5.4.12) Node v16.13.1