@agoric/builders 0.1.1-other-dev-3eb1a1d.0 → 0.1.1-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/package.json +38 -37
- package/scripts/inter-protocol/replace-feeDistributor-combo.js +82 -0
- package/scripts/inter-protocol/replace-feeDistributor.js +12 -4
- package/scripts/inter-protocol/updatePriceFeeds.js +11 -1
- package/scripts/inter-protocol/withdraw-reserve.build.js +68 -0
- package/scripts/orchestration/axelar-gmp.build.js +81 -0
- package/scripts/orchestration/get-chain-config.js +121 -0
- package/scripts/orchestration/helpers.js +46 -0
- package/scripts/orchestration/hook-localchain-msg-send.js +30 -0
- package/scripts/orchestration/init-basic-flows.js +11 -2
- package/scripts/orchestration/init-stakeAtom.js +11 -2
- package/scripts/orchestration/init-stakeOsmo.js +11 -2
- package/scripts/testing/add-USD-LEMONS.js +19 -0
- package/scripts/testing/add-USD-OLIVES.js +19 -0
- package/scripts/testing/append-chain-info.js +4 -2
- package/scripts/testing/init-auto-stake-it.js +42 -0
- package/scripts/testing/init-send-anywhere.js +36 -0
- package/scripts/testing/init-swap-anything.js +36 -0
- package/scripts/testing/provokeBOYD.js +54 -0
- package/scripts/testing/publish-test-info.js +79 -0
- package/scripts/testing/recorded-retired-instances.js +81 -0
- package/scripts/testing/register-interchain-bank-assets.js +199 -0
- package/scripts/testing/replace-feeDistributor-short.js +7 -1
- package/scripts/testing/restart-axelar-gmp.js +94 -0
- package/scripts/testing/start-query-flows.js +43 -23
- package/scripts/testing/test-upgraded-board.js +15 -0
- package/scripts/testing/tweak-chain-info.js +7 -2
- package/scripts/testing/{fix-buggy-sendAnywhere.js → upgrade-send-anywhere.js} +14 -18
- package/scripts/testing/upgrade-vaultFactory.js +21 -0
- package/scripts/vats/upgrade-agoricNames.js +21 -0
- package/scripts/vats/upgrade-asset-reserve.js +21 -0
- package/scripts/vats/upgrade-bank.js +2 -2
- package/scripts/vats/upgrade-board.js +20 -0
- package/scripts/vats/upgrade-mintHolder.js +105 -0
- package/scripts/vats/upgrade-orchestration.js +21 -0
- package/scripts/vats/upgrade-paRegistry.js +21 -0
- package/scripts/vats/upgrade-provisionPool-to-BLD.js +25 -0
- package/scripts/vats/upgrade-psm.js +19 -0
- package/scripts/vats/upgrade-vats.js +49 -0
- package/index.js +0 -0
- package/scripts/fast-usdc/init-fast-usdc.js +0 -242
- package/scripts/testing/start-auto-stake-it.js +0 -128
- package/scripts/testing/start-buggy-sendAnywhere.js +0 -143
- package/scripts/testing/start-send-anywhere.js +0 -136
- package/scripts/vats/upgrade-orch-core.js +0 -24
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/builders",
|
|
3
|
-
"version": "0.1.1-other-dev-
|
|
3
|
+
"version": "0.1.1-other-dev-fbe72e7.0.fbe72e7",
|
|
4
4
|
"description": "Build scripts for proposals to an Agoric chain",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -10,50 +10,51 @@
|
|
|
10
10
|
"build:add-STARS-proposal": "echo This command has been deprecated. Please run this instead: agoric run scripts/inter-protocol/add-STARS.js",
|
|
11
11
|
"build:restart-vats-proposal": "echo This command has been deprecated. Please run this instead: agoric run scripts/vats/restart-vats.js",
|
|
12
12
|
"build:zcf-proposal": "echo This command has been deprecated. Please run this instead: agoric run scripts/vats/replace-zoe.js",
|
|
13
|
-
"prepack": "tsc --build tsconfig.build.json",
|
|
14
|
-
"postpack": "git clean -f '*.d
|
|
13
|
+
"prepack": "yarn run -T tsc --build tsconfig.build.json",
|
|
14
|
+
"postpack": "git clean -f '*.d.*ts*' '*.tsbuildinfo'",
|
|
15
15
|
"test": "ava",
|
|
16
16
|
"test:xs": "exit 0",
|
|
17
17
|
"lint-fix": "yarn lint:eslint --fix",
|
|
18
|
-
"lint": "run-s --continue-on-error lint:*",
|
|
19
|
-
"lint:types": "tsc",
|
|
20
|
-
"lint:eslint": "eslint ."
|
|
18
|
+
"lint": "yarn run -T run-s --continue-on-error 'lint:*'",
|
|
19
|
+
"lint:types": "yarn run -T tsc",
|
|
20
|
+
"lint:eslint": "yarn run -T eslint ."
|
|
21
21
|
},
|
|
22
22
|
"keywords": [],
|
|
23
23
|
"author": "Agoric",
|
|
24
24
|
"license": "Apache-2.0",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@agoric/
|
|
27
|
-
"@agoric/
|
|
28
|
-
"@agoric/internal": "0.3.3-other-dev-
|
|
29
|
-
"@agoric/notifier": "0.6.3-other-dev-
|
|
30
|
-
"@agoric/smart-wallet": "0.5.4-other-dev-
|
|
31
|
-
"@agoric/vat-data": "0.5.3-other-dev-
|
|
32
|
-
"@agoric/vats": "0.15.2-other-dev-
|
|
33
|
-
"@agoric/zoe": "0.26.3-other-dev-
|
|
34
|
-
"@endo/bundle-source": "^
|
|
35
|
-
"@endo/captp": "^4.4.
|
|
36
|
-
"@endo/eventual-send": "^1.
|
|
37
|
-
"@endo/far": "^1.1.
|
|
38
|
-
"@endo/init": "^1.1.
|
|
39
|
-
"@endo/marshal": "^1.
|
|
40
|
-
"@endo/
|
|
41
|
-
"@endo/
|
|
42
|
-
"@endo/
|
|
43
|
-
"
|
|
26
|
+
"@agoric/client-utils": "0.1.1-other-dev-fbe72e7.0.fbe72e7",
|
|
27
|
+
"@agoric/ertp": "0.16.3-other-dev-fbe72e7.0.fbe72e7",
|
|
28
|
+
"@agoric/internal": "0.3.3-other-dev-fbe72e7.0.fbe72e7",
|
|
29
|
+
"@agoric/notifier": "0.6.3-other-dev-fbe72e7.0.fbe72e7",
|
|
30
|
+
"@agoric/smart-wallet": "0.5.4-other-dev-fbe72e7.0.fbe72e7",
|
|
31
|
+
"@agoric/vat-data": "0.5.3-other-dev-fbe72e7.0.fbe72e7",
|
|
32
|
+
"@agoric/vats": "0.15.2-other-dev-fbe72e7.0.fbe72e7",
|
|
33
|
+
"@agoric/zoe": "0.26.3-other-dev-fbe72e7.0.fbe72e7",
|
|
34
|
+
"@endo/bundle-source": "^4.1.2",
|
|
35
|
+
"@endo/captp": "^4.4.8",
|
|
36
|
+
"@endo/eventual-send": "^1.3.4",
|
|
37
|
+
"@endo/far": "^1.1.14",
|
|
38
|
+
"@endo/init": "^1.1.12",
|
|
39
|
+
"@endo/marshal": "^1.8.0",
|
|
40
|
+
"@endo/nat": "^5.1.3",
|
|
41
|
+
"@endo/patterns": "^1.7.0",
|
|
42
|
+
"@endo/promise-kit": "^1.1.13",
|
|
43
|
+
"@endo/stream": "^1.2.13",
|
|
44
|
+
"import-meta-resolve": "^4.1.0"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
|
-
"@agoric/deploy-script-support": "0.10.4-other-dev-
|
|
47
|
-
"@agoric/governance": "0.10.4-other-dev-
|
|
48
|
-
"@agoric/inter-protocol": "0.16.2-other-dev-
|
|
49
|
-
"@agoric/orchestration": "0.1.1-other-dev-
|
|
50
|
-
"@agoric/store": "0.9.3-other-dev-
|
|
51
|
-
"@agoric/swing-store": "0.9.2-other-dev-
|
|
52
|
-
"@agoric/swingset-liveslots": "0.10.3-other-dev-
|
|
53
|
-
"@agoric/time": "0.3.3-other-dev-
|
|
54
|
-
"@endo/errors": "^1.2.
|
|
47
|
+
"@agoric/deploy-script-support": "0.10.4-other-dev-fbe72e7.0.fbe72e7",
|
|
48
|
+
"@agoric/governance": "0.10.4-other-dev-fbe72e7.0.fbe72e7",
|
|
49
|
+
"@agoric/inter-protocol": "0.16.2-other-dev-fbe72e7.0.fbe72e7",
|
|
50
|
+
"@agoric/orchestration": "0.1.1-other-dev-fbe72e7.0.fbe72e7",
|
|
51
|
+
"@agoric/store": "0.9.3-other-dev-fbe72e7.0.fbe72e7",
|
|
52
|
+
"@agoric/swing-store": "0.9.2-other-dev-fbe72e7.0.fbe72e7",
|
|
53
|
+
"@agoric/swingset-liveslots": "0.10.3-other-dev-fbe72e7.0.fbe72e7",
|
|
54
|
+
"@agoric/time": "0.3.3-other-dev-fbe72e7.0.fbe72e7",
|
|
55
|
+
"@endo/errors": "^1.2.13",
|
|
55
56
|
"ava": "^5.3.0",
|
|
56
|
-
"c8": "^10.1.
|
|
57
|
+
"c8": "^10.1.3"
|
|
57
58
|
},
|
|
58
59
|
"files": [
|
|
59
60
|
"CHANGELOG.md",
|
|
@@ -68,7 +69,7 @@
|
|
|
68
69
|
"access": "public"
|
|
69
70
|
},
|
|
70
71
|
"engines": {
|
|
71
|
-
"node": "^
|
|
72
|
+
"node": "^20.9 || ^22.11"
|
|
72
73
|
},
|
|
73
74
|
"ava": {
|
|
74
75
|
"files": [
|
|
@@ -81,7 +82,7 @@
|
|
|
81
82
|
"workerThreads": false
|
|
82
83
|
},
|
|
83
84
|
"typeCoverage": {
|
|
84
|
-
"atLeast": 89.
|
|
85
|
+
"atLeast": 89.94
|
|
85
86
|
},
|
|
86
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "fbe72e72107f9997f788674e668c660d92ec4492"
|
|
87
88
|
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { parseScriptArgs, makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
import { getManifestForReplaceFeeDistributor } from '@agoric/inter-protocol/src/proposals/replace-fee-distributor.js';
|
|
3
|
+
import { SECONDS_PER_HOUR } from '@agoric/inter-protocol/src/proposals/econ-behaviors.js';
|
|
4
|
+
|
|
5
|
+
const configurations = {
|
|
6
|
+
A3P_INTEGRATION: {
|
|
7
|
+
params: {
|
|
8
|
+
collectionInterval: 30n,
|
|
9
|
+
keywordShares: {
|
|
10
|
+
RewardDistributor: 0n,
|
|
11
|
+
Reserve: 1n,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
MAINNET: {
|
|
16
|
+
params: {
|
|
17
|
+
collectionInterval: 1n * SECONDS_PER_HOUR,
|
|
18
|
+
keywordShares: {
|
|
19
|
+
RewardDistributor: 0n,
|
|
20
|
+
Reserve: 1n,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
DEVNET: {
|
|
25
|
+
params: {
|
|
26
|
+
collectionInterval: 1n * SECONDS_PER_HOUR,
|
|
27
|
+
keywordShares: {
|
|
28
|
+
RewardDistributor: 0n,
|
|
29
|
+
Reserve: 1n,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
EMERYNET: {
|
|
34
|
+
params: {
|
|
35
|
+
collectionInterval: 1n * SECONDS_PER_HOUR,
|
|
36
|
+
keywordShares: {
|
|
37
|
+
RewardDistributor: 0n,
|
|
38
|
+
Reserve: 1n,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const { keys } = Object;
|
|
45
|
+
const knownVariants = keys(configurations);
|
|
46
|
+
|
|
47
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
48
|
+
export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
|
|
49
|
+
const config = opts.config || configurations[opts.variant];
|
|
50
|
+
console.log('feeDist OPTS', opts, config);
|
|
51
|
+
if (!config) {
|
|
52
|
+
const error = `Unknown variant "${opts.variant}". Expected one of ${knownVariants.join(', ')}`;
|
|
53
|
+
console.error(error);
|
|
54
|
+
throw Error(error);
|
|
55
|
+
}
|
|
56
|
+
const { params } = config;
|
|
57
|
+
|
|
58
|
+
return harden({
|
|
59
|
+
sourceSpec:
|
|
60
|
+
'@agoric/inter-protocol/src/proposals/replace-fee-distributor.js',
|
|
61
|
+
getManifestCall: [
|
|
62
|
+
getManifestForReplaceFeeDistributor.name,
|
|
63
|
+
{
|
|
64
|
+
feeDistributorRef: publishRef(
|
|
65
|
+
install('@agoric/inter-protocol/src/feeDistributor.js'),
|
|
66
|
+
),
|
|
67
|
+
...params,
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
74
|
+
export default async (homeP, endowments) => {
|
|
75
|
+
const name = 'replace-feeDistributor-combo';
|
|
76
|
+
const opts = parseScriptArgs(endowments, name, knownVariants);
|
|
77
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
78
|
+
|
|
79
|
+
await writeCoreEval('replace-feeDistributor', utils =>
|
|
80
|
+
defaultProposalBuilder(utils, opts),
|
|
81
|
+
);
|
|
82
|
+
};
|
|
@@ -3,12 +3,20 @@ import { getManifestForReplaceFeeDistributor } from '@agoric/inter-protocol/src/
|
|
|
3
3
|
import { SECONDS_PER_HOUR } from '@agoric/inter-protocol/src/proposals/econ-behaviors.js';
|
|
4
4
|
|
|
5
5
|
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
6
|
-
export const defaultProposalBuilder = async (
|
|
7
|
-
console.log('OPTS', opts);
|
|
6
|
+
export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
|
|
7
|
+
console.log('feeDist OPTS', opts);
|
|
8
8
|
return harden({
|
|
9
9
|
sourceSpec:
|
|
10
10
|
'@agoric/inter-protocol/src/proposals/replace-fee-distributor.js',
|
|
11
|
-
getManifestCall: [
|
|
11
|
+
getManifestCall: [
|
|
12
|
+
getManifestForReplaceFeeDistributor.name,
|
|
13
|
+
{
|
|
14
|
+
feeDistributorRef: publishRef(
|
|
15
|
+
install('@agoric/inter-protocol/src/feeDistributor.js'),
|
|
16
|
+
),
|
|
17
|
+
...opts,
|
|
18
|
+
},
|
|
19
|
+
],
|
|
12
20
|
});
|
|
13
21
|
};
|
|
14
22
|
|
|
@@ -16,7 +24,7 @@ export const defaultProposalBuilder = async (_, opts) => {
|
|
|
16
24
|
export default async (homeP, endowments) => {
|
|
17
25
|
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
18
26
|
|
|
19
|
-
await writeCoreEval('replace-feeDistributor
|
|
27
|
+
await writeCoreEval('replace-feeDistributor', utils =>
|
|
20
28
|
defaultProposalBuilder(utils, {
|
|
21
29
|
collectionInterval: 1n * SECONDS_PER_HOUR,
|
|
22
30
|
keywordShares: {
|
|
@@ -32,7 +32,7 @@ const configurations = {
|
|
|
32
32
|
'agoric1qj07c7vfk3knqdral0sej7fa6eavkdn8vd8etf', // Simply Staking
|
|
33
33
|
'agoric10vjkvkmpp9e356xeh6qqlhrny2htyzp8hf88fk', // P2P
|
|
34
34
|
],
|
|
35
|
-
inBrandNames: ['ATOM', 'stTIA', 'stkATOM'],
|
|
35
|
+
inBrandNames: ['ATOM', 'stTIA', 'stkATOM', 'dATOM'],
|
|
36
36
|
},
|
|
37
37
|
EMERYNET: {
|
|
38
38
|
oracleAddresses: [
|
|
@@ -41,6 +41,16 @@ const configurations = {
|
|
|
41
41
|
],
|
|
42
42
|
inBrandNames: ['ATOM', 'stATOM', 'stOSMO', 'stTIA', 'stkATOM'],
|
|
43
43
|
},
|
|
44
|
+
BOOT_TEST: {
|
|
45
|
+
oracleAddresses: [
|
|
46
|
+
'agoric144rrhh4m09mh7aaffhm6xy223ym76gve2x7y78', // DSRV
|
|
47
|
+
'agoric19d6gnr9fyp6hev4tlrg87zjrzsd5gzr5qlfq2p', // Stakin
|
|
48
|
+
'agoric19uscwxdac6cf6z7d5e26e0jm0lgwstc47cpll8', // 01node
|
|
49
|
+
'agoric1krunjcqfrf7la48zrvdfeeqtls5r00ep68mzkr', // Simply Staking
|
|
50
|
+
'agoric1n4fcxsnkxe4gj6e24naec99hzmc4pjfdccy5nj', // P2P
|
|
51
|
+
],
|
|
52
|
+
inBrandNames: ['ATOM'],
|
|
53
|
+
},
|
|
44
54
|
};
|
|
45
55
|
|
|
46
56
|
const { keys } = Object;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/* eslint-env node */
|
|
2
|
+
import { parseArgs } from 'node:util';
|
|
3
|
+
import { isNat } from '@endo/nat';
|
|
4
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
5
|
+
import { getManifestForInviteWithdrawer } from '@agoric/inter-protocol/src/proposals/withdraw-reserve-proposal.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @template {{ type: string }} T
|
|
9
|
+
* @typedef { T['type'] extends 'string' ? string : T['type'] extends 'boolean' ? boolean : (string | boolean) } TypeFromParseArgsOptionDescriptor
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @template {Record<string, { type: string, multiple?: boolean }>} T
|
|
14
|
+
* @typedef {{
|
|
15
|
+
* [K in keyof T]: (
|
|
16
|
+
* T[K]['multiple'] extends true
|
|
17
|
+
* ? TypeFromParseArgsOptionDescriptor<T[K]>[]
|
|
18
|
+
* : T[K]['multiple'] extends (false | unknown)
|
|
19
|
+
* ? TypeFromParseArgsOptionDescriptor<T[K]>
|
|
20
|
+
* : (TypeFromParseArgsOptionDescriptor<T[K]>[] | TypeFromParseArgsOptionDescriptor<T[K]>)
|
|
21
|
+
* )
|
|
22
|
+
* }} CliOptions
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
const { Fail } = assert;
|
|
26
|
+
|
|
27
|
+
const cliOptions = /** @type {const} */ ({
|
|
28
|
+
address: { type: 'string', multiple: false },
|
|
29
|
+
count: { type: 'string', multiple: false },
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
33
|
+
export const defaultProposalBuilder = async (
|
|
34
|
+
{ publishRef: _publishRef, install: _install },
|
|
35
|
+
namedArgs = {},
|
|
36
|
+
) => {
|
|
37
|
+
const { address, count } = namedArgs;
|
|
38
|
+
|
|
39
|
+
typeof address === 'string' || Fail`string address is required`;
|
|
40
|
+
if (count !== undefined) {
|
|
41
|
+
isNat(count) || Fail`count must be a safe natural number`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return harden({
|
|
45
|
+
sourceSpec:
|
|
46
|
+
'@agoric/inter-protocol/src/proposals/withdraw-reserve-proposal.js',
|
|
47
|
+
getManifestCall: [getManifestForInviteWithdrawer.name, { address, count }],
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
52
|
+
export default async (homeP, endowments) => {
|
|
53
|
+
const { scriptArgs: argv } = endowments;
|
|
54
|
+
/** @type {{ values: Partial<CliOptions<typeof cliOptions>> }} */
|
|
55
|
+
const { values: rawArgs } = parseArgs({ args: argv, options: cliOptions });
|
|
56
|
+
const { address, count: rawCount } = rawArgs;
|
|
57
|
+
const count = (() => {
|
|
58
|
+
if (rawCount === undefined) return undefined;
|
|
59
|
+
/[0-9]/.test(rawCount) || Fail`--count value must be numeric`;
|
|
60
|
+
return +rawCount;
|
|
61
|
+
})();
|
|
62
|
+
const namedArgs = { address, count };
|
|
63
|
+
|
|
64
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
65
|
+
await writeCoreEval('withdraw-reserve', utils =>
|
|
66
|
+
defaultProposalBuilder(utils, namedArgs),
|
|
67
|
+
);
|
|
68
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { execFileSync } from 'node:child_process';
|
|
2
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
3
|
+
import { parseArgs } from 'node:util';
|
|
4
|
+
import {
|
|
5
|
+
getManifest,
|
|
6
|
+
startAxelarGmp,
|
|
7
|
+
} from '@agoric/orchestration/src/proposals/start-axelar-gmp.js';
|
|
8
|
+
import { assetInfo } from '@agoric/orchestration/src/utils/axelar-static-config.js';
|
|
9
|
+
import { getChainConfig } from './get-chain-config.js';
|
|
10
|
+
|
|
11
|
+
/** @typedef {{ net?: string, peer?: string[] }} PeerChainOpts */
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/** @type {CoreEvalBuilder} */
|
|
18
|
+
export const defaultProposalBuilder = async (
|
|
19
|
+
{ publishRef, install },
|
|
20
|
+
options,
|
|
21
|
+
) =>
|
|
22
|
+
harden({
|
|
23
|
+
sourceSpec: '@agoric/orchestration/src/proposals/start-axelar-gmp.js',
|
|
24
|
+
getManifestCall: [
|
|
25
|
+
getManifest.name,
|
|
26
|
+
{
|
|
27
|
+
installationRef: publishRef(
|
|
28
|
+
install('@agoric/orchestration/dist/axelar-gmp.contract.bundle.js'),
|
|
29
|
+
),
|
|
30
|
+
options,
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
36
|
+
export default async (homeP, endowments) => {
|
|
37
|
+
const { scriptArgs } = endowments;
|
|
38
|
+
|
|
39
|
+
/** @type {import('node:util').ParseArgsConfig['options']} */
|
|
40
|
+
const options = {
|
|
41
|
+
net: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
},
|
|
44
|
+
peer: { type: 'string', multiple: true },
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/** @type {{ values: PeerChainOpts }} */
|
|
48
|
+
const { values: flags } = parseArgs({ args: scriptArgs, options });
|
|
49
|
+
|
|
50
|
+
const parseAssetInfo = () => {
|
|
51
|
+
if (typeof assetInfo !== 'string') return undefined;
|
|
52
|
+
return JSON.parse(assetInfo);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
if (!flags.net) throw Error('--net required');
|
|
56
|
+
if (!flags.peer) throw Error('--peer required');
|
|
57
|
+
|
|
58
|
+
const validNets = ['bootstrap', 'devnet', 'emerynet', 'local'];
|
|
59
|
+
if (!validNets.includes(flags.net)) {
|
|
60
|
+
throw Error(`--net must be one of: ${validNets.join(', ')}`);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const chainDetails = await getChainConfig({
|
|
64
|
+
net: /** @type {'bootstrap' | 'devnet' | 'emerynet' | 'local'} */ (
|
|
65
|
+
flags.net
|
|
66
|
+
),
|
|
67
|
+
peers: flags.peer,
|
|
68
|
+
execFileSync,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const opts = harden({
|
|
72
|
+
chainInfo: chainDetails,
|
|
73
|
+
assetInfo: parseAssetInfo(),
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
77
|
+
|
|
78
|
+
await writeCoreEval(startAxelarGmp.name, utils =>
|
|
79
|
+
defaultProposalBuilder(utils, opts),
|
|
80
|
+
);
|
|
81
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { IBCConnectionInfoShape } from '@agoric/orchestration/src/typeGuards.js';
|
|
2
|
+
import { mustMatch } from '@endo/patterns';
|
|
3
|
+
import { makeAgd } from '@agoric/orchestration/src/utils/agd-lib.js';
|
|
4
|
+
import * as childProcess from 'node:child_process';
|
|
5
|
+
import fetchedChainInfo from '@agoric/orchestration/src/fetched-chain-info.js';
|
|
6
|
+
import { fetchNetworkConfig } from '@agoric/client-utils';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @import {IBCChannelID, IBCConnectionID} from '@agoric/vats';
|
|
10
|
+
* @import {CosmosChainInfo, IBCConnectionInfo} from '@agoric/orchestration'
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/** @param {string[]} strs */
|
|
14
|
+
const parsePeers = strs => {
|
|
15
|
+
/** @type {[name: string, conn: IBCConnectionID, chan: IBCChannelID, denom:string][]} */
|
|
16
|
+
// @ts-expect-error XXX ID syntax should be dynamically checked
|
|
17
|
+
const peerParts = strs.map(s => s.split(':'));
|
|
18
|
+
const badPeers = peerParts.filter(d => d.length !== 4);
|
|
19
|
+
if (badPeers.length) {
|
|
20
|
+
throw Error(
|
|
21
|
+
`peers must be name:connection-X:channel-Y:denom, not ${badPeers.join(', ')}`,
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
return peerParts;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// TODO: Can these be sourced from chain-registry?
|
|
28
|
+
/**
|
|
29
|
+
* Get the IBC chain configuration based on the provided network and peer inputs.
|
|
30
|
+
*
|
|
31
|
+
* @param {object} args - The arguments object.
|
|
32
|
+
* @param {'bootstrap' | 'devnet' |'emerynet' | 'local' } args.net - Agoric network shorthand (e.g., 'emerynet').
|
|
33
|
+
* @param {string[]} args.peers - The peers to connect .
|
|
34
|
+
* @param {childProcess.execFileSync} [args.execFileSync] - Optional execFileSync function.
|
|
35
|
+
* @returns {Promise<Record<string, CosmosChainInfo>>} A promise that resolves to the chain configuration details keyed by chain name.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
export const getChainConfig = async ({
|
|
39
|
+
net,
|
|
40
|
+
peers,
|
|
41
|
+
execFileSync = childProcess.execFileSync,
|
|
42
|
+
}) => {
|
|
43
|
+
await null;
|
|
44
|
+
|
|
45
|
+
if (net === 'bootstrap') {
|
|
46
|
+
return {
|
|
47
|
+
agoric: fetchedChainInfo.agoric,
|
|
48
|
+
axelar: fetchedChainInfo.axelar,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** @type {Record<string, CosmosChainInfo>} */
|
|
53
|
+
const chainDetails = {};
|
|
54
|
+
|
|
55
|
+
/** @type {Record<string, IBCConnectionInfo>} */
|
|
56
|
+
const connections = {};
|
|
57
|
+
const portId = 'transfer';
|
|
58
|
+
|
|
59
|
+
const { chainName: chainId, rpcAddrs } = await fetchNetworkConfig(net, {
|
|
60
|
+
fetch,
|
|
61
|
+
});
|
|
62
|
+
// XXX execFileSync bad POLA; these queries can be made with `fetch`
|
|
63
|
+
const agd = makeAgd({ execFileSync }).withOpts({ rpcAddrs });
|
|
64
|
+
|
|
65
|
+
for (const [peerName, myConn, myChan, denom] of parsePeers(peers)) {
|
|
66
|
+
console.debug(peerName, { denom });
|
|
67
|
+
const connInfo = await agd
|
|
68
|
+
.query(['ibc', 'connection', 'end', myConn])
|
|
69
|
+
.then(x => x.connection);
|
|
70
|
+
const { client_id: clientId } = connInfo;
|
|
71
|
+
const clientState = await agd
|
|
72
|
+
.query(['ibc', 'client', 'state', clientId])
|
|
73
|
+
.then(x => x.client_state);
|
|
74
|
+
const { chain_id: peerId } = clientState;
|
|
75
|
+
console.debug(peerName, { chainId: peerId, denom });
|
|
76
|
+
chainDetails[peerName] = {
|
|
77
|
+
namespace: 'cosmos',
|
|
78
|
+
reference: peerId,
|
|
79
|
+
chainId: peerId,
|
|
80
|
+
stakingTokens: [{ denom }],
|
|
81
|
+
bech32Prefix: peerName,
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const chan = await agd
|
|
85
|
+
.query(['ibc', 'channel', 'end', portId, myChan])
|
|
86
|
+
.then(r => r.channel);
|
|
87
|
+
|
|
88
|
+
/** @type {IBCConnectionInfo} */
|
|
89
|
+
const info = harden({
|
|
90
|
+
client_id: clientId,
|
|
91
|
+
counterparty: {
|
|
92
|
+
client_id: connInfo.counterparty.client_id,
|
|
93
|
+
connection_id: connInfo.counterparty.connection_id,
|
|
94
|
+
},
|
|
95
|
+
id: myConn,
|
|
96
|
+
state: connInfo.state,
|
|
97
|
+
transferChannel: {
|
|
98
|
+
channelId: myChan,
|
|
99
|
+
counterPartyChannelId: chan.counterparty.channel_id,
|
|
100
|
+
counterPartyPortId: chan.counterparty.port_id,
|
|
101
|
+
ordering: chan.ordering,
|
|
102
|
+
portId,
|
|
103
|
+
state: chan.state,
|
|
104
|
+
version: chan.version,
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
mustMatch(info, IBCConnectionInfoShape);
|
|
108
|
+
connections[peerId] = info;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
chainDetails.agoric = {
|
|
112
|
+
namespace: 'cosmos',
|
|
113
|
+
reference: chainId,
|
|
114
|
+
chainId,
|
|
115
|
+
stakingTokens: [{ denom: 'ubld' }],
|
|
116
|
+
connections,
|
|
117
|
+
bech32Prefix: 'agoric',
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
return chainDetails;
|
|
121
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @import {DeployScriptEndownments} from '@agoric/deploy-script-support/src/externalTypes.js';
|
|
3
|
+
* @import {CosmosChainInfo, Denom, DenomDetail} from '@agoric/orchestration';
|
|
4
|
+
* @import {ParseArgsConfig} from 'node:util'
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Parse `chainInfo` and `assetInfo` into builder opts
|
|
9
|
+
*
|
|
10
|
+
* NOTE: Ambient authority via `node:util`
|
|
11
|
+
*
|
|
12
|
+
* @param {DeployScriptEndownments['scriptArgs']} scriptArgs
|
|
13
|
+
* @returns {Promise<{
|
|
14
|
+
* chainInfo: Record<string, CosmosChainInfo>;
|
|
15
|
+
* assetInfo: [Denom, DenomDetail & { brandKey?: string }][];
|
|
16
|
+
* }>}
|
|
17
|
+
*/
|
|
18
|
+
export const parseChainHubOpts = async scriptArgs => {
|
|
19
|
+
// import dynamically so the modules can work in CoreEval environment
|
|
20
|
+
const { parseArgs } = await import('node:util');
|
|
21
|
+
|
|
22
|
+
/** @type {ParseArgsConfig['options']} */
|
|
23
|
+
const parserOpts = {
|
|
24
|
+
chainInfo: { type: 'string' },
|
|
25
|
+
assetInfo: { type: 'string' },
|
|
26
|
+
};
|
|
27
|
+
const {
|
|
28
|
+
values: { chainInfo, assetInfo },
|
|
29
|
+
} = parseArgs({
|
|
30
|
+
args: scriptArgs,
|
|
31
|
+
options: parserOpts,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const parseChainInfo = () => {
|
|
35
|
+
if (typeof chainInfo !== 'string') return undefined;
|
|
36
|
+
return JSON.parse(chainInfo);
|
|
37
|
+
};
|
|
38
|
+
const parseAssetInfo = () => {
|
|
39
|
+
if (typeof assetInfo !== 'string') return undefined;
|
|
40
|
+
return JSON.parse(assetInfo);
|
|
41
|
+
};
|
|
42
|
+
return harden({
|
|
43
|
+
chainInfo: parseChainInfo(),
|
|
44
|
+
assetInfo: parseAssetInfo(),
|
|
45
|
+
});
|
|
46
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
|
|
3
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
4
|
+
export const defaultProposalBuilder = async ({ publishRef, install }) => {
|
|
5
|
+
const vatNameToEntrypoint = {
|
|
6
|
+
localchain: '@agoric/vats/src/vat-localchain.js',
|
|
7
|
+
transfer: '@agoric/vats/src/vat-transfer.js',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
return harden({
|
|
11
|
+
sourceSpec: '@agoric/vats/src/proposals/localchain-hook-msg-send.js',
|
|
12
|
+
getManifestCall: [
|
|
13
|
+
'getManifestForMsgSendToTransfer',
|
|
14
|
+
{
|
|
15
|
+
bundleRefs: Object.fromEntries(
|
|
16
|
+
Object.entries(vatNameToEntrypoint).map(
|
|
17
|
+
([name, entrypoint]) =>
|
|
18
|
+
/** @type {const} */ ([name, publishRef(install(entrypoint))]),
|
|
19
|
+
),
|
|
20
|
+
),
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
27
|
+
export default async (homeP, endowments) => {
|
|
28
|
+
const { writeCoreProposal } = await makeHelpers(homeP, endowments);
|
|
29
|
+
await writeCoreProposal('hook-localchain', defaultProposalBuilder);
|
|
30
|
+
};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
2
|
import { startBasicFlows } from '@agoric/orchestration/src/proposals/start-basic-flows.js';
|
|
3
|
+
import { parseChainHubOpts } from './helpers.js';
|
|
3
4
|
|
|
4
5
|
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
5
|
-
export const defaultProposalBuilder = async (
|
|
6
|
+
export const defaultProposalBuilder = async (
|
|
7
|
+
{ publishRef, install },
|
|
8
|
+
options,
|
|
9
|
+
) => {
|
|
6
10
|
return harden({
|
|
7
11
|
sourceSpec: '@agoric/orchestration/src/proposals/start-basic-flows.js',
|
|
8
12
|
getManifestCall: [
|
|
@@ -15,6 +19,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }) => {
|
|
|
15
19
|
),
|
|
16
20
|
),
|
|
17
21
|
},
|
|
22
|
+
options,
|
|
18
23
|
},
|
|
19
24
|
],
|
|
20
25
|
});
|
|
@@ -22,6 +27,10 @@ export const defaultProposalBuilder = async ({ publishRef, install }) => {
|
|
|
22
27
|
|
|
23
28
|
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
24
29
|
export default async (homeP, endowments) => {
|
|
30
|
+
const { scriptArgs } = endowments;
|
|
31
|
+
const opts = parseChainHubOpts(scriptArgs);
|
|
25
32
|
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
26
|
-
await writeCoreEval(startBasicFlows.name,
|
|
33
|
+
await writeCoreEval(startBasicFlows.name, utils =>
|
|
34
|
+
defaultProposalBuilder(utils, opts),
|
|
35
|
+
);
|
|
27
36
|
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
import { parseChainHubOpts } from './helpers.js';
|
|
2
3
|
|
|
3
4
|
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
4
|
-
export const defaultProposalBuilder = async (
|
|
5
|
+
export const defaultProposalBuilder = async (
|
|
6
|
+
{ publishRef, install },
|
|
7
|
+
options,
|
|
8
|
+
) => {
|
|
5
9
|
return harden({
|
|
6
10
|
sourceSpec: '@agoric/orchestration/src/proposals/start-stakeAtom.js',
|
|
7
11
|
getManifestCall: [
|
|
@@ -12,6 +16,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }) => {
|
|
|
12
16
|
install('@agoric/orchestration/src/examples/stake-ica.contract.js'),
|
|
13
17
|
),
|
|
14
18
|
},
|
|
19
|
+
options,
|
|
15
20
|
},
|
|
16
21
|
],
|
|
17
22
|
});
|
|
@@ -19,6 +24,10 @@ export const defaultProposalBuilder = async ({ publishRef, install }) => {
|
|
|
19
24
|
|
|
20
25
|
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
21
26
|
export default async (homeP, endowments) => {
|
|
27
|
+
const { scriptArgs } = endowments;
|
|
28
|
+
const opts = parseChainHubOpts(scriptArgs);
|
|
22
29
|
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
23
|
-
await writeCoreEval('start-stakeAtom',
|
|
30
|
+
await writeCoreEval('start-stakeAtom', utils =>
|
|
31
|
+
defaultProposalBuilder(utils, opts),
|
|
32
|
+
);
|
|
24
33
|
};
|