Will revisit this, but this is for note taking, and ideation:
Here the difference between makeDeployBuilder functions (could paraneterize it with the path used in await tools.installBundles):
export const makeDeployBuilder = (tools, readJSON, execa) =>
async function deployBuilder(builder) {
console.log(`building plan: ${builder}`);
// build the plan
const { stdout } = await execa`agoric run ${builder}`;
const match = stdout.match(/ (?<name>[-\w]+)-permit.json/);
if (!(match && match.groups)) {
throw new Error('no permit found');
}
const plan = await readJSON(`./${match.groups.name}-plan.json`);
console.log(plan);
console.log('copying files to container');
tools.copyFiles([
nodeRequire.resolve(`../${plan.script}`),
nodeRequire.resolve(`../${plan.permit}`),
...plan.bundles.map(b => b.fileName),
]);
console.log('installing bundles');
await tools.installBundles(
// plan.bundles.map(b => `/tmp/contracts/${b.bundleID}.json`),
plan.bundles.map(b => `/root/${b.bundleID}.json`), // <===== HERE
console.log,
);
console.log('executing proposal');
await tools.runCoreEval({
name: plan.name,
description: `${plan.name} proposal`,
});
};
export const makeDeployBuilderE2E = (tools, readJSON, execa) =>
async function deployBuilder(builder) {
console.log(`building plan: ${builder}`);
// build the plan
const { stdout } = await execa`agoric run ${builder}`;
const match = stdout.match(/ (?<name>[-\w]+)-permit.json/);
if (!(match && match.groups)) {
throw new Error('no permit found');
}
const plan = await readJSON(`./${match.groups.name}-plan.json`);
console.log(plan);
console.log('copying files to container');
tools.copyFiles([
nodeRequire.resolve(`../${plan.script}`),
nodeRequire.resolve(`../${plan.permit}`),
...plan.bundles.map(b => b.fileName),
]);
console.log('installing bundles');
await tools.installBundles(
plan.bundles.map(b => `/tmp/contracts/${b.bundleID}.json`),
// plan.bundles.map(b => `/root/${b.bundleID}.json`), // <===== HERE
console.log,
);
console.log('executing proposal');
await tools.runCoreEval({
name: plan.name,
description: `${plan.name} proposal`,
});
};
and here is the diffference between installBundles, and installBundlesE2E (could parameterize it to follow a different control flow based on if its for orca-multichain.test.js, or the e2e script to preserve DRY (if orca-multichain, take simple path, else do more work etc) :
Here the difference between makeDeployBuilder functions (could paraneterize it with the path used in
await tools.installBundles
):and here is the diffference between installBundles, and installBundlesE2E (could parameterize it to follow a different control flow based on if its for
orca-multichain.test.js
, or thee2e
script to preserve DRY (iforca-multichain
, take simple path, else do more work etc) :Originally posted by @Jovonni in https://github.com/Agoric/dapp-orchestration-basics/issues/37#issuecomment-2373175880