Skip to content

Commit

Permalink
feat(cosmic-swingset): use bootMsg.params.bootstrap_vat_config
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Jan 12, 2022
1 parent 63e6e67 commit 28d3efd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
12 changes: 6 additions & 6 deletions packages/cosmic-swingset/src/chain-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,17 +236,17 @@ export default async function main(progname, args, { env, homedir, agcc }) {
}
}

const vatconfig = new URL(
await importMetaResolve(
'@agoric/vats/decentral-config.json',
import.meta.url,
),
).pathname;
const argv = {
ROLE: 'chain',
noFakeCurrencies: !env.FAKE_CURRENCIES,
bootMsg,
};
const vatconfig = new URL(
await importMetaResolve(
argv.bootMsg.params.bootstrap_vat_config,
import.meta.url,
),
).pathname;
const meterProvider = getMeterProvider(console, env);
const slogFile = env.SLOGFILE;
const consensusMode = env.DEBUG === undefined;
Expand Down
14 changes: 8 additions & 6 deletions packages/cosmic-swingset/src/sim-chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ export async function connectToFakeChain(basedir, GCI, delay, inbound) {

const mailboxStorage = await makeMapStorage(mailboxFile);

const vatconfig = new URL(
await importMetaResolve(
'@agoric/vats/decentral-config.json',
import.meta.url,
),
).pathname;
const argv = {
ROLE: 'sim-chain',
giveMeAllTheAgoricPowers: true,
Expand All @@ -69,8 +63,16 @@ export async function connectToFakeChain(basedir, GCI, delay, inbound) {
{ denom: 'ubld', amount: `${50_000n * 10n ** 6n}` },
{ denom: 'urun', amount: `${1_000_000n * 10n ** 6n}` },
],
params: DEFAULT_SIM_SWINGSET_PARAMS,
},
};

const vatconfig = new URL(
await importMetaResolve(
argv.bootMsg.params.bootstrap_vat_config,
import.meta.url,
),
).pathname;
const stateDBdir = path.join(basedir, `fake-chain-${GCI}-state`);
function flushChainSends(replay) {
assert(!replay, X`Replay not implemented`);
Expand Down
3 changes: 3 additions & 0 deletions packages/cosmic-swingset/src/sim-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ export const defaultFeeUnitPrice = [
},
];

export const defaultBootstrapVatConfig = '@agoric/vats/decentral-config.json';

export const DEFAULT_SIM_SWINGSET_PARAMS = {
beans_per_unit: defaultBeansPerUnit,
fee_unit_price: defaultFeeUnitPrice,
bootstrap_vat_config: defaultBootstrapVatConfig,
};

0 comments on commit 28d3efd

Please sign in to comment.