Я слежу за книгой Ethereum от Гэвина Вуда, и когда я использую truffle migrate --network ganache
, я получаю следующую ошибку:
TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type undefined
at Function.from (buffer.js:208:11)
at new Buffer (buffer.js:183:17)
at Object.<anonymous> (/home/superadmin/kittycoin/truffle-config.js:12:27)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at Object.require (internal/modules/cjs/helpers.js:20:18)
at Function.load (/home/superadmin/.nvm/versions/node/v10.13.0/lib/node_modules/truffle/build/webpack:/packages/config/dist/index.js:161:1)
at Function.detect (/home/superadmin/.nvm/versions/node/v10.13.0/lib/node_modules/truffle/build/webpack:/packages/config/dist/index.js:150:1)
at Object.run (/home/superadmin/.nvm/versions/node/v10.13.0/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:189:1)
at Command.run (/home/superadmin/.nvm/versions/node/v10.13.0/lib/node_modules/truffle/build/webpack:/packages/core/lib/command.js:136:1)
at Object.<anonymous> (/home/superadmin/.nvm/versions/node/v10.13.0/lib/node_modules/truffle/build/webpack:/packages/core/cli.js:51:1)
at __webpack_require__ (/home/superadmin/.nvm/versions/node/v10.13.0/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:19:1)
at /home/superadmin/.nvm/versions/node/v10.13.0/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:83:1
at Object.<anonymous> (/home/superadmin/.nvm/versions/node/v10.13.0/lib/node_modules/truffle/build/cli.bundled.js:89:10)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
Truffle v5.1.27 (core: 5.1.27)
Node v10.13.0
Я обнаружил, что это происходит из этой части в моем truffle-config.js
var ropstenPrivateKey = new Buffer(process.env["ROPSTEN_PRIVATE_KEY"], "hex")
var ropstenWallet = Wallet.fromPrivateKey(ropstenPrivateKey);
var ropstenProvider = new WalletProvider(ropstenWallet, "https://ropsten.infura.io/");`
мой .env
выглядит так;
ROPSTEN_PRIVATE_KEY="ABC123"
MAINNET_PRIVATE_KEY="ABC123"
Есть у кого-нибудь идеи?