agoric 0.22.0-u20.0 → 0.22.0-u21.0.1
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/package.json +26 -27
- package/src/bin-agops.js +0 -2
- package/src/chain-config.js +8 -2
- package/src/commands/auction.js +1 -1
- package/src/commands/perf.js +14 -10
- package/src/commands/wallet.js +5 -7
- package/src/entrypoint.js +0 -2
- package/src/follow.js +8 -7
- package/src/scripts.js +1 -28
- package/src/sdk-package-names.js +1 -0
- package/tools/getting-started.js +24 -6
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agoric",
|
|
3
|
-
"version": "0.22.0-
|
|
3
|
+
"version": "0.22.0-u21.0.1",
|
|
4
4
|
"description": "Manage the Agoric Javascript smart contract platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/main.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"
|
|
9
|
-
"
|
|
8
|
+
"agops": "src/bin-agops.js",
|
|
9
|
+
"agoric": "src/entrypoint.js"
|
|
10
10
|
},
|
|
11
11
|
"exports": {
|
|
12
12
|
"./src/entrypoint.js": "./src/entrypoint.js",
|
|
@@ -25,33 +25,33 @@
|
|
|
25
25
|
"test:xs": "exit 0",
|
|
26
26
|
"integration-test": "ava --config .ava-integration-test.config.js",
|
|
27
27
|
"lint-fix": "yarn lint:eslint --fix",
|
|
28
|
-
"lint": "run-s --continue-on-error lint:*",
|
|
29
|
-
"lint:types": "tsc",
|
|
30
|
-
"lint:eslint": "eslint ."
|
|
28
|
+
"lint": "yarn run -T run-s --continue-on-error 'lint:*'",
|
|
29
|
+
"lint:types": "yarn run -T tsc",
|
|
30
|
+
"lint:eslint": "yarn run -T eslint ."
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@agoric/cosmic-swingset": "
|
|
34
|
-
"@agoric/deploy-script-support": "
|
|
33
|
+
"@agoric/cosmic-swingset": "0.42.0-u21.0.1",
|
|
34
|
+
"@agoric/deploy-script-support": "0.10.4-u21.0.1",
|
|
35
35
|
"ava": "^5.3.0",
|
|
36
36
|
"c8": "^10.1.2"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@agoric/access-token": "
|
|
40
|
-
"@agoric/cache": "
|
|
41
|
-
"@agoric/casting": "
|
|
42
|
-
"@agoric/client-utils": "
|
|
43
|
-
"@agoric/cosmic-proto": "
|
|
44
|
-
"@agoric/ertp": "
|
|
45
|
-
"@agoric/governance": "
|
|
46
|
-
"@agoric/inter-protocol": "
|
|
47
|
-
"@agoric/internal": "
|
|
48
|
-
"@agoric/network": "
|
|
49
|
-
"@agoric/smart-wallet": "
|
|
50
|
-
"@agoric/store": "
|
|
51
|
-
"@agoric/swingset-vat": "
|
|
52
|
-
"@agoric/vats": "
|
|
53
|
-
"@agoric/zoe": "
|
|
54
|
-
"@agoric/zone": "
|
|
39
|
+
"@agoric/access-token": "0.4.22-u21.0.1",
|
|
40
|
+
"@agoric/cache": "0.3.3-u21.0.1",
|
|
41
|
+
"@agoric/casting": "0.5.0-u21.0.1",
|
|
42
|
+
"@agoric/client-utils": "0.2.0-u21.0.1",
|
|
43
|
+
"@agoric/cosmic-proto": "0.5.0-u21.0.1",
|
|
44
|
+
"@agoric/ertp": "0.16.3-u21.0.1",
|
|
45
|
+
"@agoric/governance": "0.10.4-u21.0.1",
|
|
46
|
+
"@agoric/inter-protocol": "0.17.0-u21.0.1",
|
|
47
|
+
"@agoric/internal": "0.4.0-u21.0.1",
|
|
48
|
+
"@agoric/network": "0.2.0-u21.0.1",
|
|
49
|
+
"@agoric/smart-wallet": "0.5.4-u21.0.1",
|
|
50
|
+
"@agoric/store": "0.9.3-u21.0.1",
|
|
51
|
+
"@agoric/swingset-vat": "0.33.0-u21.0.1",
|
|
52
|
+
"@agoric/vats": "0.16.0-u21.0.1",
|
|
53
|
+
"@agoric/zoe": "0.27.0-u21.0.1",
|
|
54
|
+
"@agoric/zone": "0.3.0-u21.0.1",
|
|
55
55
|
"@cosmjs/crypto": "^0.33.0",
|
|
56
56
|
"@cosmjs/encoding": "^0.33.0",
|
|
57
57
|
"@cosmjs/math": "^0.33.0",
|
|
@@ -75,7 +75,6 @@
|
|
|
75
75
|
"chalk": "^5.2.0",
|
|
76
76
|
"commander": "^12.1.0",
|
|
77
77
|
"deterministic-json": "^1.0.5",
|
|
78
|
-
"esm": "agoric-labs/esm#Agoric-built",
|
|
79
78
|
"inquirer": "^8.2.2",
|
|
80
79
|
"opener": "^1.5.2",
|
|
81
80
|
"tmp": "^0.2.1",
|
|
@@ -100,7 +99,7 @@
|
|
|
100
99
|
"workerThreads": false
|
|
101
100
|
},
|
|
102
101
|
"typeCoverage": {
|
|
103
|
-
"atLeast":
|
|
102
|
+
"atLeast": 79.15
|
|
104
103
|
},
|
|
105
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "f5318add2db0f254e5647374088bb7ae350ad3fa"
|
|
106
105
|
}
|
package/src/bin-agops.js
CHANGED
package/src/chain-config.js
CHANGED
|
@@ -255,8 +255,14 @@ export function finishCosmosGenesis({ genesisJson, exportedGenesisJson }) {
|
|
|
255
255
|
|
|
256
256
|
// Set the denomination for different modules.
|
|
257
257
|
genesis.app_state.mint.params.mint_denom = MINT_DENOM;
|
|
258
|
-
|
|
259
|
-
|
|
258
|
+
|
|
259
|
+
{
|
|
260
|
+
const gov = genesis.app_state.gov;
|
|
261
|
+
const depositParams = gov.params ?? gov.deposit_params;
|
|
262
|
+
const votingParams = gov.params ?? gov.voting_params;
|
|
263
|
+
depositParams.min_deposit = GOV_DEPOSIT_COINS;
|
|
264
|
+
votingParams.voting_period = GOV_VOTING_PERIOD;
|
|
265
|
+
}
|
|
260
266
|
|
|
261
267
|
// Reduce the cost of a transaction.
|
|
262
268
|
genesis.app_state.auth.params.tx_size_cost_per_byte = '1';
|
package/src/commands/auction.js
CHANGED
|
@@ -11,6 +11,7 @@ import { outputActionAndHint } from '../lib/wallet.js';
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @import {ParamTypesMap, ParamTypesMapFromRecord} from '@agoric/governance/src/contractGovernance/typedParamManager.js'
|
|
14
|
+
* @import {AuctionParamRecord} from '@agoric/inter-protocol/src/auction/params.js';
|
|
14
15
|
* @import {ParamValueForType} from '@agoric/governance/src/types.js'
|
|
15
16
|
*/
|
|
16
17
|
|
|
@@ -23,7 +24,6 @@ const networkConfig = await fetchEnvNetworkConfig({ env: process.env, fetch });
|
|
|
23
24
|
* }} ParamValues
|
|
24
25
|
*/
|
|
25
26
|
|
|
26
|
-
/** @typedef {ReturnType<import('@agoric/inter-protocol/src/auction/params.js').makeAuctioneerParams>} AuctionParamRecord */
|
|
27
27
|
/** @typedef {ParamValues<ParamTypesMapFromRecord<AuctionParamRecord>>} AuctionParams */
|
|
28
28
|
|
|
29
29
|
/**
|
package/src/commands/perf.js
CHANGED
|
@@ -51,6 +51,7 @@ export const makePerfCommand = logger => {
|
|
|
51
51
|
'address literal or name',
|
|
52
52
|
normalizeAddress,
|
|
53
53
|
)
|
|
54
|
+
.option('--verbose')
|
|
54
55
|
.action(async function (opts) {
|
|
55
56
|
const sharedOpts = perf.opts();
|
|
56
57
|
logger.warn({ sharedOpts, opts });
|
|
@@ -63,15 +64,13 @@ export const makePerfCommand = logger => {
|
|
|
63
64
|
|
|
64
65
|
const spec = `:published.wallet.${opts.from}`;
|
|
65
66
|
|
|
66
|
-
const leaderOptions = makeLeaderOptions({
|
|
67
|
-
sleep: SLEEP_SECONDS,
|
|
68
|
-
jitter: 0,
|
|
69
|
-
log: () => undefined,
|
|
70
|
-
});
|
|
71
|
-
|
|
72
67
|
const leader = makeLeaderFromRpcAddresses(
|
|
73
68
|
networkConfig.rpcAddrs,
|
|
74
|
-
|
|
69
|
+
makeLeaderOptions({
|
|
70
|
+
sleep: SLEEP_SECONDS,
|
|
71
|
+
jitter: 0,
|
|
72
|
+
log: console.warn,
|
|
73
|
+
}),
|
|
75
74
|
);
|
|
76
75
|
|
|
77
76
|
logger.warn('Following', spec);
|
|
@@ -86,9 +85,10 @@ export const makePerfCommand = logger => {
|
|
|
86
85
|
if (status.error) {
|
|
87
86
|
console.error(status.error);
|
|
88
87
|
exit(1);
|
|
89
|
-
} else if (status.numWantsSatisfied)
|
|
88
|
+
} else if (status.numWantsSatisfied) {
|
|
90
89
|
process.stdout.write(`satisfied: ${status.numWantsSatisfied}\n`);
|
|
91
|
-
|
|
90
|
+
exit(0);
|
|
91
|
+
}
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
};
|
|
@@ -102,7 +102,11 @@ export const makePerfCommand = logger => {
|
|
|
102
102
|
if (sharedOpts.home) {
|
|
103
103
|
cmd.push(`--home=${sharedOpts.home}`);
|
|
104
104
|
}
|
|
105
|
-
execSwingsetTransaction(cmd, {
|
|
105
|
+
execSwingsetTransaction(cmd, {
|
|
106
|
+
from: opts.from,
|
|
107
|
+
verbose: opts.verbose,
|
|
108
|
+
...networkConfig,
|
|
109
|
+
});
|
|
106
110
|
});
|
|
107
111
|
|
|
108
112
|
return perf;
|
package/src/commands/wallet.js
CHANGED
|
@@ -278,15 +278,13 @@ export const makeWalletCommand = async command => {
|
|
|
278
278
|
.action(async function ({ from }) {
|
|
279
279
|
const spec = `:published.wallet.${from}`;
|
|
280
280
|
|
|
281
|
-
const leaderOptions = makeLeaderOptions({
|
|
282
|
-
sleep: SLEEP_SECONDS,
|
|
283
|
-
jitter: 0,
|
|
284
|
-
log: () => undefined,
|
|
285
|
-
});
|
|
286
|
-
|
|
287
281
|
const leader = makeLeaderFromRpcAddresses(
|
|
288
282
|
networkConfig.rpcAddrs,
|
|
289
|
-
|
|
283
|
+
makeLeaderOptions({
|
|
284
|
+
sleep: SLEEP_SECONDS,
|
|
285
|
+
jitter: 0,
|
|
286
|
+
log: console.warn,
|
|
287
|
+
}),
|
|
290
288
|
);
|
|
291
289
|
|
|
292
290
|
console.warn('Following', spec);
|
package/src/entrypoint.js
CHANGED
package/src/follow.js
CHANGED
|
@@ -126,16 +126,17 @@ export default async function followerMain(progname, rawArgs, powers, opts) {
|
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
const leaderOptions = makeLeaderOptions({
|
|
130
|
-
sleep,
|
|
131
|
-
jitter,
|
|
132
|
-
log: verbose ? console.warn : () => undefined,
|
|
133
|
-
});
|
|
134
|
-
|
|
135
129
|
const [_cmd, ...specs] = rawArgs;
|
|
136
130
|
|
|
137
131
|
verbose && console.warn('Creating leader for', bootstrap);
|
|
138
|
-
const leader = makeLeader(
|
|
132
|
+
const leader = makeLeader(
|
|
133
|
+
bootstrap,
|
|
134
|
+
makeLeaderOptions({
|
|
135
|
+
sleep,
|
|
136
|
+
jitter,
|
|
137
|
+
log: verbose ? console.warn : () => undefined,
|
|
138
|
+
}),
|
|
139
|
+
);
|
|
139
140
|
const iterate = opts.lossy ? iterateLatest : iterateEach;
|
|
140
141
|
await Promise.all(
|
|
141
142
|
specs.map(async spec => {
|
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
|
-
|
|
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,
|
package/src/sdk-package-names.js
CHANGED
package/tools/getting-started.js
CHANGED
|
@@ -108,12 +108,30 @@ export const gettingStartedWorkflowTest = async (t, options = {}) => {
|
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
|
|
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
|
-
|
|
191
|
+
await yarn('install', ...installOptions);
|
|
174
192
|
}
|
|
175
193
|
|
|
176
194
|
// ==============
|
|
177
195
|
// yarn start:docker
|
|
178
|
-
|
|
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
|
-
|
|
226
|
+
await yarn('start:contract');
|
|
209
227
|
|
|
210
228
|
// ==============
|
|
211
229
|
// yarn start:ui
|
|
212
|
-
const startUiP = yarn(
|
|
230
|
+
const startUiP = yarn('start:ui');
|
|
213
231
|
finalizers.push(() => pkill(startUiP.childProcess, 'SIGINT'));
|
|
214
232
|
const uiListening = makePromiseKit();
|
|
215
233
|
let retries = 0;
|