Closed ohaddahan closed 2 years ago
nvm, resolved, thanks.
Hi @ohaddahan could you elaborate on how you solved this? I'm hitting a similar issue and I'm not sure how to set up testing
For anyone still trying to figure out how to set up config to preload programs for auto-deployment on start, here is what worked for me:
const path = require('path');
function localDeployPath(programName) {
// return path.join(__dirname, 'programs', `${programName}.so`);
return path.join(__dirname, `target`, `deploy`, `${programName}.so`);
}
const programIds = {
program_to_deploy: "8dzhoiK95bw2JucMCG3GA8nFPCNk5ZUMHAY5To8kjxKh"
}
module.exports = {
validator: {
killRunningValidators: true,
programs: [
{
label: 'My Program',
programId: programIds.program_to_deploy,
deployPath: localDeployPath('program_to_deploy')
},
],
jsonRpcUrl: LOCALHOST,
websocketUrl: '',
commitment: 'confirmed',
ledgerDir: tmpLedgerDir(),
resetLedger: true,
verifyFees: false,
detached: process.env.CI != null,
},
relay: {
enabled: process.env.CI == null,
killlRunningRelay: true,
},
storage: {
enabled: process.env.CI == null,
storageId: 'mock-storage',
clearOnStart: true,
},
}```
You need to point localDeployPath to the target/deploy/program_to_deploy.so file. Hope this helps
Trying to run some
anchor
testing, using same config as https://github.com/metaplex-foundation/js-next/blob/main/.ammanrc.js (pasted my exact one, below)But I get the failure:
Caused By: Error: failed to send transaction: Transaction simulation failed: Attempt to load a program that does not exist
When I try to run:
metaplex.nfts().create
.Would love some guidance how to properly config to load
metaplex
programs intoamman
.