Skip to content

Commit

Permalink
feat: add command line flag to use XS
Browse files Browse the repository at this point in the history
  • Loading branch information
FUDCo committed Jul 27, 2021
1 parent 207d8d9 commit 66b5a5e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/swingset-runner/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ FLAGS may be:
--initonly - initialize the swingset but exit without running it
--lmdb - runs using LMDB as the data store (default)
--memdb - runs using the non-persistent in-memory data store
--usexs - run vats using the the XS engine
--dbdir DIR - specify where the data store should go (default BASEDIR)
--dbsize SIZE - set the LMDB size limit to SIZE megabytes (default 2GB)
--blockmode - run in block mode (checkpoint every BLOCKSIZE blocks)
Expand Down Expand Up @@ -180,6 +181,7 @@ export async function main() {
let dbDir = null;
let dbSize = 0;
let initOnly = false;
let useXS = false;

while (argv[0] && argv[0].startsWith('-')) {
const flag = argv.shift();
Expand Down Expand Up @@ -273,6 +275,10 @@ export async function main() {
case '--lmdb':
dbMode = flag;
break;
case '--usexs':
case '--useXS':
useXS = true;
break;
case '-v':
case '--verbose':
verbose = true;
Expand Down Expand Up @@ -332,6 +338,9 @@ export async function main() {
delete config.loopboxSenders;
deviceEndowments.loopbox = { ...loopboxEndowments };
}
if (useXS) {
config.defaultManagerType = 'xs-worker';
}
if (launchIndirectly) {
config = generateIndirectConfig(config);
}
Expand Down Expand Up @@ -530,6 +539,7 @@ export async function main() {
if (statLogger) {
statLogger.close();
}
controller.shutdown();

function getCrankNumber() {
return Number(swingStore.kvStore.get('crankNumber'));
Expand Down

0 comments on commit 66b5a5e

Please sign in to comment.