You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
every time I deploy my contracts via truffle migrate --reset I cannot dial tcp 127.0.0.1:7545 via ethclient (go-ethereum) as Ganache encounters an error.
The Deployment actually succeeds and after I relaunch Ganache, I can interact with my just deployed contracts, however, once I redeploy them, the error occurs and I have to relaunch Ganache.
This wasn't like this before. Currently I have these migration files:
constMiMC=artifacts.require("MiMC");
constMerkleTree=artifacts.require("MerkleTree");
constVerifier=artifacts.require("Verifier");
constRollup=artifacts.require("Rollup");
constBN=require('bn.js');
constfs=require('fs');
constpath=require('path');
// Function to save deployment info to a separate filefunctionsaveDeploymentInfo(contractName, instance, suffix, deployer) {
constdeploymentsDir= path.join(__dirname, '../build/contracts');
if (!fs.existsSync(deploymentsDir)){
fs.mkdirSync(deploymentsDir);
}
constfilePath=path.join(deploymentsDir, `${contractName}-${suffix}.json`);
constinfo= {
address: instance.address,
network: deployer.network,
transactionHash: instance.transactionHash,
};
fs.writeFileSync(filePath, JSON.stringify(info, null, 2));
}
letnumber=newBN('19929288186675197851976196030644791160893678128488844394573589927998971210120');
lethexNumber= '0x' + number.toString('hex');
module.exports=function(deployer) {
deployer.deploy(MiMC).then(function() {
// Link MiMC to MerkleTreereturndeployer.link(MiMC, MerkleTree).then(function() {
// Deploy MerkleTreereturndeployer.deploy(MerkleTree, 4).then(function() {
// Link MiMC and MerkleTree to Rollupreturndeployer.link(MiMC, Rollup).then(function() {
returndeployer.link(MerkleTree, Rollup).then(function() {
// Deploy Verifierreturndeployer.deploy(Verifier).then(function() {
// Correctly call deploy and then use the result within the .then() promise handlerreturndeployer.deploy(Rollup, Verifier.address, 4, hexNumber).then(function(rollupInstance) {
// Pass the deployer object to the saveDeploymentInfo functionsaveDeploymentInfo('Rollup', rollupInstance, '1', deployer);
});
});
});
});
});
});
});
};
3_rollup.js
constMiMC=artifacts.require("MiMC");
constMerkleTree=artifacts.require("MerkleTree");
// Assuming you have Verifier2 contract similar to VerifierconstVerifier2=artifacts.require("Verifier2");
constRollup=artifacts.require("Rollup");
constBN=require('bn.js');
letnumber=newBN('19929288186675197851976196030644791160893678128488844394573589927998971210120');
lethexNumber= '0x' + number.toString('hex');
module.exports=function(deployer) {
deployer.then(async () => {
awaitdeployer.deploy(Verifier2);
constverifier2Instance=awaitVerifier2.deployed();
// Assuming the deployment of MiMC and MerkleTree has already been done in the first migration file// and they do not need to be redeployed or relinked for the second Rollup deployment.// Deploy the second Rollup with Verifier2awaitdeployer.deploy(Rollup, verifier2Instance.address, 4, hexNumber);
});
};
Before
Before I just had 1_initial_migrations and one other migration file and I could freely use truffle migrate --reset to redeploy my contracts without any errors and I could interact with them.
constMiMC=artifacts.require("MiMC");
constMerkleTree=artifacts.require("MerkleTree");
constVerifier=artifacts.require("Verifier");
constRollup=artifacts.require("Rollup");
constBN=require('bn.js');
letnumber=newBN('19929288186675197851976196030644791160893678128488844394573589927998971210120');
lethexNumber= '0x' + number.toString('hex');
module.exports=function(deployer) {
deployer.deploy(MiMC).then(function() {
// Link MiMC to MerkleTreereturndeployer.link(MiMC, MerkleTree).then(function() {
// Deploy MerkleTreereturndeployer.deploy(MerkleTree, 4).then(function() {
// Link MiMC and MerkleTree to Rollupreturndeployer.link(MiMC, Rollup).then(function() {
returndeployer.link(MerkleTree, Rollup).then(function() {
// Deploy Verifierreturndeployer.deploy(Verifier).then(function() {
// Finally, deploy Rollup with the address of the Verifierreturndeployer.deploy(Rollup, Verifier.address, 4, hexNumber);
});
});
});
});
});
});
};
Error
PLATFORM: win32
GANACHE VERSION: 2.7.1
EXCEPTION:
TypeError: Cannot read property 'address' of null
at ProjectsWatcher.handleBlock (C:\Program Files\WindowsApps\GanacheUI_2.7.1.0_x64__rb4352f0jd4m2\app\resources\static\node\truffle-integration\projectsWatcher.js:208:24)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at Subscription.<anonymous> (C:\Program Files\WindowsApps\GanacheUI_2.7.1.0_x64__rb4352f0jd4m2\app\resources\static\node\truffle-integration\projectsWatcher.js:57:9)
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi there,
every time I deploy my contracts via
truffle migrate --reset
I cannot dial tcp 127.0.0.1:7545 via ethclient (go-ethereum) as Ganache encounters an error.The Deployment actually succeeds and after I relaunch Ganache, I can interact with my just deployed contracts, however, once I redeploy them, the error occurs and I have to relaunch Ganache.
This wasn't like this before. Currently I have these migration files:
1_initial_migrations.js
2_rollup.js
3_rollup.js
Before
Before I just had 1_initial_migrations and one other migration file and I could freely use
truffle migrate --reset
to redeploy my contracts without any errors and I could interact with them.Error
PLATFORM: win32
GANACHE VERSION: 2.7.1
EXCEPTION:
The text was updated successfully, but these errors were encountered: