agoric 0.21.2-other-dev-3eb1a1d.0 → 0.21.2-other-dev-fbe72e7.0.fbe72e7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/main.js CHANGED
@@ -87,19 +87,6 @@ const main = async (progname, rawArgs, powers) => {
87
87
  return subMain(cosmosMain, ['cosmos', ...command], opts);
88
88
  });
89
89
 
90
- const ibcSetup = path.join(
91
- dirname,
92
- '..',
93
- 'node_modules',
94
- '.bin',
95
- 'ibc-setup',
96
- );
97
- program.command(
98
- 'ibc-setup <command...>',
99
- 'set up Inter Blockchain Communication',
100
- { executableFile: ibcSetup },
101
- );
102
-
103
90
  baseCmd('open')
104
91
  .description('launch the Agoric UI')
105
92
  .option(
@@ -184,21 +171,6 @@ const main = async (progname, rawArgs, powers) => {
184
171
  return subMain(setDefaultsMain, ['set-defaults', prog, configDir], opts);
185
172
  });
186
173
 
187
- const ibcRelayer = path.join(
188
- dirname,
189
- '..',
190
- 'node_modules',
191
- '.bin',
192
- 'ibc-relayer',
193
- );
194
- program.command(
195
- 'ibc-relayer',
196
- 'run an Inter Blockchain Communications relayer',
197
- {
198
- executableFile: ibcRelayer,
199
- },
200
- );
201
-
202
174
  baseCmd('install [force-sdk-version]')
203
175
  .description('install Dapp dependencies')
204
176
  .action(async (forceSdkVersion, _options, cmd) => {
@@ -210,17 +182,13 @@ const main = async (progname, rawArgs, powers) => {
210
182
  baseCmd('follow <path-spec...>')
211
183
  .description('follow an Agoric Casting leader')
212
184
  .option(
213
- '--proof <strict | optimistic | none>',
214
- 'set proof mode',
185
+ '--proof <none>',
186
+ `set proof mode (currently only 'none' is supported)`,
215
187
  value => {
216
- assert(
217
- ['strict', 'optimistic', 'none'].includes(value),
218
- X`--proof must be one of 'strict', 'optimistic', or 'none'`,
219
- TypeError,
220
- );
188
+ assert.equal(value, 'none', X`--proof can only be 'none'`, TypeError);
221
189
  return value;
222
190
  },
223
- 'optimistic',
191
+ 'none',
224
192
  )
225
193
  .option(
226
194
  '--sleep <seconds>',
package/src/scripts.js CHANGED
@@ -2,15 +2,11 @@
2
2
  /* eslint-env node */
3
3
  import bundleSource from '@endo/bundle-source';
4
4
  import { E } from '@endo/captp';
5
- import { search as readContainingPackageDescriptor } from '@endo/compartment-mapper';
6
5
 
7
- import createEsmRequire from 'esm';
8
6
  import { createRequire } from 'module';
9
7
  import path from 'path';
10
- import url from 'url';
11
8
 
12
9
  const require = createRequire(import.meta.url);
13
- const esmRequire = createEsmRequire(/** @type {NodeModule} */ ({}));
14
10
 
15
11
  const PATH_SEP_RE = new RegExp(`${path.sep.replace(/\\/g, '\\\\')}`, 'g');
16
12
 
@@ -133,31 +129,8 @@ export { bootPlugin } from ${JSON.stringify(absPath)};
133
129
  // Use a dynamic import to load the deploy script.
134
130
  // It is unconfined.
135
131
 
136
- // Use Node.js ESM support if package.json of template says "type":
137
- // "module".
138
- const read = async location => fs.readFile(url.fileURLToPath(location));
139
- const { packageDescriptorText } = await readContainingPackageDescriptor(
140
- read,
141
- url.pathToFileURL(moduleFile).href,
142
- ).catch(cause => {
143
- throw Error(
144
- `Expected a package.json beside deploy script ${moduleFile}, ${cause}`,
145
- { cause },
146
- );
147
- });
148
- const packageDescriptor = JSON.parse(packageDescriptorText);
149
- const nativeEsm = packageDescriptor.type === 'module';
150
- console.log(
151
- `Deploy script will run with ${
152
- nativeEsm ? 'Node.js ESM' : 'standardthings/esm emulation'
153
- }`,
154
- );
155
-
156
132
  const modulePath = pathResolve(moduleFile);
157
- let mainNS = await (nativeEsm && import(modulePath));
158
- if (!mainNS) {
159
- mainNS = esmRequire(modulePath);
160
- }
133
+ const mainNS = await import(modulePath);
161
134
 
162
135
  const allEndowments = harden({
163
136
  home: bootP,
@@ -1,11 +1,18 @@
1
1
  // DO NOT EDIT - automatically generated by get-sdk-package-names.js
2
2
  // prettier-ignore
3
3
  export default [
4
+ "@aglocal/benchmark",
5
+ "@aglocal/boot",
6
+ "@aglocal/deployment",
7
+ "@aglocal/fast-usdc-contract",
8
+ "@aglocal/fast-usdc-deploy",
9
+ "@aglocal/portfolio-contract",
10
+ "@aglocal/portfolio-deploy",
11
+ "@aglocal/swingset-runner",
12
+ "@aglocal/ymax-planner",
4
13
  "@agoric/access-token",
5
14
  "@agoric/async-flow",
6
15
  "@agoric/base-zone",
7
- "@agoric/benchmark",
8
- "@agoric/boot",
9
16
  "@agoric/builders",
10
17
  "@agoric/cache",
11
18
  "@agoric/casting",
@@ -15,7 +22,6 @@ export default [
15
22
  "@agoric/cosmos",
16
23
  "@agoric/create-dapp",
17
24
  "@agoric/deploy-script-support",
18
- "@agoric/deployment",
19
25
  "@agoric/ertp",
20
26
  "@agoric/eslint-config",
21
27
  "@agoric/fast-usdc",
@@ -28,6 +34,8 @@ export default [
28
34
  "@agoric/notifier",
29
35
  "@agoric/orchestration",
30
36
  "@agoric/pegasus",
37
+ "@agoric/pola-io",
38
+ "@agoric/portfolio-api",
31
39
  "@agoric/smart-wallet",
32
40
  "@agoric/solo",
33
41
  "@agoric/sparse-ints",
@@ -36,7 +44,6 @@ export default [
36
44
  "@agoric/store",
37
45
  "@agoric/swing-store",
38
46
  "@agoric/swingset-liveslots",
39
- "@agoric/swingset-runner",
40
47
  "@agoric/swingset-vat",
41
48
  "@agoric/swingset-xsnap-supervisor",
42
49
  "@agoric/telemetry",
package/src/start.js CHANGED
@@ -597,7 +597,6 @@ export default async function startMain(progname, rawArgs, powers, opts) {
597
597
  'swingset',
598
598
  'egress',
599
599
  soloAddr,
600
- `--chain-id=${CHAIN_ID}`,
601
600
  `--node=tcp://${rpcAddr}`,
602
601
  ]);
603
602
  if (exitStatus) {
@@ -108,12 +108,30 @@ export const gettingStartedWorkflowTest = async (t, options = {}) => {
108
108
  });
109
109
  }
110
110
 
111
- function yarn(args) {
112
- return pspawnStdout('yarn', args, {
111
+ /**
112
+ * @param {string[]} args
113
+ * @returns {{childProcess?: import('child_process').ChildProcess} & Promise<void>}
114
+ */
115
+ function yarn(...args) {
116
+ const ps = pspawnStdout('yarn', args, {
113
117
  stdio: ['ignore', 'pipe', 'inherit'],
114
118
  env: { ...process.env },
115
119
  detached: true,
116
120
  });
121
+ /** @type {{childProcess?: import('child_process').ChildProcess} & Promise<void>} */
122
+ const p = new Promise((resolve, reject) => {
123
+ ps.then(code => {
124
+ if (code !== 0) {
125
+ reject(
126
+ new Error(`yarn ${args.join(' ')} failed with exit code ${code}`),
127
+ );
128
+ } else {
129
+ resolve();
130
+ }
131
+ }).catch(reject);
132
+ });
133
+ p.childProcess = ps.childProcess;
134
+ return p;
117
135
  }
118
136
 
119
137
  const olddir = process.cwd();
@@ -170,12 +188,12 @@ export const gettingStartedWorkflowTest = async (t, options = {}) => {
170
188
  } else {
171
189
  // ==============
172
190
  // yarn install
173
- t.is(await yarn(['install', ...installOptions]), 0, 'yarn install works');
191
+ await yarn('install', ...installOptions);
174
192
  }
175
193
 
176
194
  // ==============
177
195
  // yarn start:docker
178
- t.is(await yarn(['start:docker']), 0, 'yarn start:docker works');
196
+ await yarn('start:docker');
179
197
 
180
198
  // ==============
181
199
  // wait for the chain to start
@@ -205,11 +223,11 @@ export const gettingStartedWorkflowTest = async (t, options = {}) => {
205
223
 
206
224
  // ==============
207
225
  // yarn start:contract
208
- t.is(await yarn(['start:contract']), 0, 'yarn start:contract works');
226
+ await yarn('start:contract');
209
227
 
210
228
  // ==============
211
229
  // yarn start:ui
212
- const startUiP = yarn(['start:ui']);
230
+ const startUiP = yarn('start:ui');
213
231
  finalizers.push(() => pkill(startUiP.childProcess, 'SIGINT'));
214
232
  const uiListening = makePromiseKit();
215
233
  let retries = 0;
@@ -1,41 +0,0 @@
1
- import { NonNullish } from '@agoric/internal';
2
-
3
- /**
4
- * @import {MinimalNetworkConfig} from '@agoric/client-utils';
5
- */
6
-
7
- export const networkConfigUrl = agoricNetSubdomain =>
8
- `https://${agoricNetSubdomain}.agoric.net/network-config`;
9
- export const rpcUrl = agoricNetSubdomain =>
10
- `https://${agoricNetSubdomain}.rpc.agoric.net:443`;
11
-
12
- /**
13
- * @param {string} str
14
- * @param {{ fetch: typeof fetch }} io
15
- * @returns {Promise<MinimalNetworkConfig>}
16
- */
17
- const fromAgoricNet = (str, { fetch }) => {
18
- const [netName, chainName] = str.split(',');
19
- if (chainName) {
20
- return Promise.resolve({ chainName, rpcAddrs: [rpcUrl(netName)] });
21
- }
22
- return fetch(networkConfigUrl(netName)).then(res => res.json());
23
- };
24
-
25
- /**
26
- * @param {{ env: typeof process.env, fetch: typeof fetch }} io
27
- * @returns {Promise<MinimalNetworkConfig>}
28
- */
29
- export const getNetworkConfig = async ({ env, fetch }) => {
30
- if (!('AGORIC_NET' in env) || env.AGORIC_NET === 'local') {
31
- return { rpcAddrs: ['http://0.0.0.0:26657'], chainName: 'agoriclocal' };
32
- }
33
-
34
- return fromAgoricNet(NonNullish(env.AGORIC_NET), { fetch }).catch(err => {
35
- throw Error(
36
- `cannot get network config (${env.AGORIC_NET || 'local'}): ${
37
- err.message
38
- }`,
39
- );
40
- });
41
- };