I know there are many similar questions, but I've been through all of them and haven't got the answer I'm looking for.
I'm trying to deploy a smart contract (that's already been compiled and deployed in Rinkeby) to a private network.
1_initial_migrations.js
const Migrations = artifacts.require("Migrations");
module.exports = function (deployer) {
deployer.deploy(Migrations, {from: "[address]"});
};
2_deploy.js
// migrations/2_deploy.js
// SPDX-License-Identifier: MIT
const compsc = artifacts.require("compsc");
module.exports = function(deployer) {
deployer.deploy(compsc);
};
truffle-config.js
const PrivateKeyProvider = require('truffle-privatekey-provider');
const { projectId, mnemonic } = require('./secrets.json');
const privateKey = "[PK]";
module.exports = {
networks: {
rinkeby: {
provider: () => new PrivateKeyProvider(privateKey, `[PROVIDER_URL]`),
network_id: 4,
gas: 4612388,
timeoutBlocks: 200
},
nodalblock: {
provider: () => new PrivateKeyProvider(privateKey, `[IP:PORT]`),
network_id: 4660
},
},
compilers: {
solc: {
version: "0.8.0", // Fetch exact version from solc-bin (default: truffle's version)
}
},
db: {
enabled: false
}
};
And I'm always getting:
1_initial_migration.js
======================
Current account balance 0
Deploying 'Migrations'
----------------------
Error: *** Deployment Failed ***
"Migrations" -- Web3ProviderEngine does not support synchronous requests..
at /node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:365:1
Truffle v5.2.6 (core: 5.2.6)
Node v10.16.0
I've read that there's a problem with some web3 functions being async but being called synchronous by Truffle (at least, I think I understood the problem that way) but I can't get what I need to change/do differently to make it work.
The versions I'm using are:
"dependencies": {
"truffle": "^5.2.6",
"truffle-privatekey-provider": "^1.5.0"
}
Any help would be greatly appreciated. Thanks,