Skip to content

Commit

Permalink
Merge pull request #7132 from Agoric/dc-bid-cli
Browse files Browse the repository at this point in the history
initial inter liquidation bidding CLI
  • Loading branch information
mergify[bot] authored Mar 28, 2023
2 parents 0985679 + 395a5af commit 7268232
Show file tree
Hide file tree
Showing 13 changed files with 1,079 additions and 57 deletions.
1 change: 1 addition & 0 deletions packages/agoric-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@agoric/inter-protocol": "^0.13.1",
"@agoric/internal": "^0.2.1",
"@agoric/smart-wallet": "^0.4.2",
"@agoric/store": "^0.8.3",
"@agoric/swingset-vat": "^0.30.2",
"@agoric/vats": "^0.13.0",
"@agoric/zoe": "^0.25.3",
Expand Down
35 changes: 31 additions & 4 deletions packages/agoric-cli/src/bin-agops.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
#!/usr/bin/env node
// @ts-check
/* eslint-disable @jessie.js/no-nested-await */
/* global process */
/* global fetch */

import '@agoric/casting/node-fetch-shim.js';
import '@endo/init';
import '@endo/init/pre.js';

import anylogger from 'anylogger';
import { Command } from 'commander';
import { execFileSync } from 'child_process';
import path from 'path';
import process from 'process';
import anylogger from 'anylogger';
import { Command, CommanderError, createCommand } from 'commander';
import { makeOracleCommand } from './commands/oracle.js';
import { makeEconomicCommiteeCommand } from './commands/ec.js';
import { makePsmCommand } from './commands/psm.js';
import { makeReserveCommand } from './commands/reserve.js';
import { makeVaultsCommand } from './commands/vaults.js';
import { makePerfCommand } from './commands/perf.js';
import { makeInterCommand } from './commands/inter.js';

const logger = anylogger('agops');
const progname = path.basename(process.argv[1]);
Expand All @@ -29,4 +33,27 @@ program.addCommand(await makePsmCommand(logger));
program.addCommand(await makeReserveCommand(logger));
program.addCommand(await makeVaultsCommand(logger));

await program.parseAsync(process.argv);
program.addCommand(
await makeInterCommand(
{
env: { ...process.env },
stdout: process.stdout,
stderr: process.stderr,
createCommand,
execFileSync,
now: () => Date.now(),
},
{ fetch },
),
);

try {
await program.parseAsync(process.argv);
} catch (err) {
if (err instanceof CommanderError) {
console.error(err.message);
} else {
console.error(err); // CRASH! show stack trace
}
process.exit(1);
}
Loading

0 comments on commit 7268232

Please sign in to comment.