@agoric/builders 0.2.0-u20.0 → 0.2.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/CHANGELOG.md +4 -1
- package/package.json +24 -24
- package/scripts/bundles/bundle-contractGovernor-js-meta.json +925 -0
- package/scripts/bundles/bundle-contractGovernor.js +1 -0
- package/scripts/bundles/bundle-fluxAggregatorKit-js-meta.json +1085 -0
- package/scripts/bundles/bundle-fluxAggregatorKit.js +1 -0
- package/scripts/bundles/bundle-psm-js-meta.json +920 -0
- package/scripts/bundles/bundle-psm.js +1 -0
- package/scripts/bundles/bundle-scaledPriceAuthority-js-meta.json +995 -0
- package/scripts/bundles/bundle-scaledPriceAuthority.js +1 -0
- package/scripts/bundles/bundle-vaultFactory-js-meta.json +1220 -0
- package/scripts/bundles/bundle-vaultFactory.js +1 -0
- package/scripts/orchestration/axelar-gmp.build.js +74 -0
- package/scripts/orchestration/get-chain-config.js +117 -0
- package/scripts/orchestration/helpers.js +46 -0
- package/scripts/orchestration/init-basic-flows.js +2 -33
- package/scripts/orchestration/init-stakeAtom.js +11 -2
- package/scripts/orchestration/init-stakeOsmo.js +11 -2
- package/scripts/testing/init-auto-stake-it.js +2 -33
- package/scripts/testing/init-send-anywhere.js +2 -33
- package/scripts/testing/init-swap-anything.js +36 -0
- package/scripts/testing/restart-axelar-gmp.js +94 -0
- package/scripts/testing/start-query-flows.js +43 -23
- package/scripts/vats/upgrade-provisionPool-to-BLD.js +25 -0
- package/scripts/vats/upgrade-vats.js +30 -4
- package/index.js +0 -0
|
@@ -0,0 +1,74 @@
|
|
|
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 chainDetails = await getChainConfig({
|
|
59
|
+
net: flags.net,
|
|
60
|
+
peers: flags.peer,
|
|
61
|
+
execFileSync,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const opts = harden({
|
|
65
|
+
chainInfo: chainDetails,
|
|
66
|
+
assetInfo: parseAssetInfo(),
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
70
|
+
|
|
71
|
+
await writeCoreEval(startAxelarGmp.name, utils =>
|
|
72
|
+
defaultProposalBuilder(utils, opts),
|
|
73
|
+
);
|
|
74
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
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 { networkConfigs } from '@agoric/orchestration/src/utils/gmp.js';
|
|
5
|
+
import * as childProcess from 'node:child_process';
|
|
6
|
+
import fetchedChainInfo from '@agoric/orchestration/src/fetched-chain-info.js';
|
|
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
|
+
/**
|
|
28
|
+
* Get the IBC chain configuration based on the provided network and peer inputs.
|
|
29
|
+
*
|
|
30
|
+
* @param {object} args - The arguments object.
|
|
31
|
+
* @param {string} args.net - The network name (e.g., 'emerynet').
|
|
32
|
+
* @param {string[]} args.peers - The peers to connect .
|
|
33
|
+
* @param {childProcess.execFileSync} [args.execFileSync] - Optional execFileSync function.
|
|
34
|
+
* @returns {Promise<Record<string, CosmosChainInfo>>} A promise that resolves to the chain configuration details keyed by chain name.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
export const getChainConfig = async ({
|
|
38
|
+
net,
|
|
39
|
+
peers,
|
|
40
|
+
execFileSync = childProcess.execFileSync,
|
|
41
|
+
}) => {
|
|
42
|
+
await null;
|
|
43
|
+
|
|
44
|
+
if (net === 'bootstrap') {
|
|
45
|
+
return {
|
|
46
|
+
agoric: fetchedChainInfo.agoric,
|
|
47
|
+
axelar: fetchedChainInfo.axelar,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** @type {Record<string, CosmosChainInfo>} */
|
|
52
|
+
const chainDetails = {};
|
|
53
|
+
|
|
54
|
+
/** @type {Record<string, IBCConnectionInfo>} */
|
|
55
|
+
const connections = {};
|
|
56
|
+
const portId = 'transfer';
|
|
57
|
+
|
|
58
|
+
const { chainId, rpc } = networkConfigs[net];
|
|
59
|
+
const agd = makeAgd({ execFileSync }).withOpts({ rpcAddrs: [rpc] });
|
|
60
|
+
|
|
61
|
+
for (const [peerName, myConn, myChan, denom] of parsePeers(peers)) {
|
|
62
|
+
console.debug(peerName, { denom });
|
|
63
|
+
const connInfo = await agd
|
|
64
|
+
.query(['ibc', 'connection', 'end', myConn])
|
|
65
|
+
.then(x => x.connection);
|
|
66
|
+
const { client_id: clientId } = connInfo;
|
|
67
|
+
const clientState = await agd
|
|
68
|
+
.query(['ibc', 'client', 'state', clientId])
|
|
69
|
+
.then(x => x.client_state);
|
|
70
|
+
const { chain_id: peerId } = clientState;
|
|
71
|
+
console.debug(peerName, { chainId: peerId, denom });
|
|
72
|
+
chainDetails[peerName] = {
|
|
73
|
+
namespace: 'cosmos',
|
|
74
|
+
reference: peerId,
|
|
75
|
+
chainId: peerId,
|
|
76
|
+
stakingTokens: [{ denom }],
|
|
77
|
+
bech32Prefix: peerName,
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const chan = await agd
|
|
81
|
+
.query(['ibc', 'channel', 'end', portId, myChan])
|
|
82
|
+
.then(r => r.channel);
|
|
83
|
+
|
|
84
|
+
/** @type {IBCConnectionInfo} */
|
|
85
|
+
const info = harden({
|
|
86
|
+
client_id: clientId,
|
|
87
|
+
counterparty: {
|
|
88
|
+
client_id: connInfo.counterparty.client_id,
|
|
89
|
+
connection_id: connInfo.counterparty.connection_id,
|
|
90
|
+
},
|
|
91
|
+
id: myConn,
|
|
92
|
+
state: connInfo.state,
|
|
93
|
+
transferChannel: {
|
|
94
|
+
channelId: myChan,
|
|
95
|
+
counterPartyChannelId: chan.counterparty.channel_id,
|
|
96
|
+
counterPartyPortId: chan.counterparty.port_id,
|
|
97
|
+
ordering: chan.ordering,
|
|
98
|
+
portId,
|
|
99
|
+
state: chan.state,
|
|
100
|
+
version: chan.version,
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
mustMatch(info, IBCConnectionInfoShape);
|
|
104
|
+
connections[peerId] = info;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
chainDetails.agoric = {
|
|
108
|
+
namespace: 'cosmos',
|
|
109
|
+
reference: chainId,
|
|
110
|
+
chainId,
|
|
111
|
+
stakingTokens: [{ denom: 'ubld' }],
|
|
112
|
+
connections,
|
|
113
|
+
bech32Prefix: 'agoric',
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
return chainDetails;
|
|
117
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
2
|
import { startBasicFlows } from '@agoric/orchestration/src/proposals/start-basic-flows.js';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @import {ParseArgsConfig} from 'node:util'
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/** @type {ParseArgsConfig['options']} */
|
|
10
|
-
const parserOpts = {
|
|
11
|
-
chainInfo: { type: 'string' },
|
|
12
|
-
assetInfo: { type: 'string' },
|
|
13
|
-
};
|
|
3
|
+
import { parseChainHubOpts } from './helpers.js';
|
|
14
4
|
|
|
15
5
|
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
16
6
|
export const defaultProposalBuilder = async (
|
|
@@ -38,29 +28,8 @@ export const defaultProposalBuilder = async (
|
|
|
38
28
|
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
39
29
|
export default async (homeP, endowments) => {
|
|
40
30
|
const { scriptArgs } = endowments;
|
|
41
|
-
|
|
42
|
-
const {
|
|
43
|
-
values: { chainInfo, assetInfo },
|
|
44
|
-
} = parseArgs({
|
|
45
|
-
args: scriptArgs,
|
|
46
|
-
options: parserOpts,
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
const parseChainInfo = () => {
|
|
50
|
-
if (typeof chainInfo !== 'string') return undefined;
|
|
51
|
-
return JSON.parse(chainInfo);
|
|
52
|
-
};
|
|
53
|
-
const parseAssetInfo = () => {
|
|
54
|
-
if (typeof assetInfo !== 'string') return undefined;
|
|
55
|
-
return JSON.parse(assetInfo);
|
|
56
|
-
};
|
|
57
|
-
const opts = harden({
|
|
58
|
-
chainInfo: parseChainInfo(),
|
|
59
|
-
assetInfo: parseAssetInfo(),
|
|
60
|
-
});
|
|
61
|
-
|
|
31
|
+
const opts = parseChainHubOpts(scriptArgs);
|
|
62
32
|
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
63
|
-
|
|
64
33
|
await writeCoreEval(startBasicFlows.name, utils =>
|
|
65
34
|
defaultProposalBuilder(utils, opts),
|
|
66
35
|
);
|
|
@@ -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
|
};
|
|
@@ -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-stakeOsmo.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-stakeOsmo',
|
|
30
|
+
await writeCoreEval('start-stakeOsmo', utils =>
|
|
31
|
+
defaultProposalBuilder(utils, opts),
|
|
32
|
+
);
|
|
24
33
|
};
|
|
@@ -6,17 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
8
8
|
import { startAutoStakeIt } from '@agoric/orchestration/src/proposals/start-auto-stake-it.js';
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @import {ParseArgsConfig} from 'node:util'
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/** @type {ParseArgsConfig['options']} */
|
|
16
|
-
const parserOpts = {
|
|
17
|
-
chainInfo: { type: 'string' },
|
|
18
|
-
assetInfo: { type: 'string' },
|
|
19
|
-
};
|
|
9
|
+
import { parseChainHubOpts } from '../orchestration/helpers.js';
|
|
20
10
|
|
|
21
11
|
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
22
12
|
export const defaultProposalBuilder = async (
|
|
@@ -44,29 +34,8 @@ export const defaultProposalBuilder = async (
|
|
|
44
34
|
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
45
35
|
export default async (homeP, endowments) => {
|
|
46
36
|
const { scriptArgs } = endowments;
|
|
47
|
-
|
|
48
|
-
const {
|
|
49
|
-
values: { chainInfo, assetInfo },
|
|
50
|
-
} = parseArgs({
|
|
51
|
-
args: scriptArgs,
|
|
52
|
-
options: parserOpts,
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
const parseChainInfo = () => {
|
|
56
|
-
if (typeof chainInfo !== 'string') return undefined;
|
|
57
|
-
return JSON.parse(chainInfo);
|
|
58
|
-
};
|
|
59
|
-
const parseAssetInfo = () => {
|
|
60
|
-
if (typeof assetInfo !== 'string') return undefined;
|
|
61
|
-
return JSON.parse(assetInfo);
|
|
62
|
-
};
|
|
63
|
-
const opts = harden({
|
|
64
|
-
chainInfo: parseChainInfo(),
|
|
65
|
-
assetInfo: parseAssetInfo(),
|
|
66
|
-
});
|
|
67
|
-
|
|
37
|
+
const opts = parseChainHubOpts(scriptArgs);
|
|
68
38
|
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
69
|
-
|
|
70
39
|
await writeCoreEval(startAutoStakeIt.name, utils =>
|
|
71
40
|
defaultProposalBuilder(utils, opts),
|
|
72
41
|
);
|
|
@@ -3,17 +3,7 @@ import {
|
|
|
3
3
|
getManifest,
|
|
4
4
|
startSendAnywhere,
|
|
5
5
|
} from '@agoric/orchestration/src/proposals/start-send-anywhere.js';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @import {ParseArgsConfig} from 'node:util'
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/** @type {ParseArgsConfig['options']} */
|
|
13
|
-
const parserOpts = {
|
|
14
|
-
chainInfo: { type: 'string' },
|
|
15
|
-
assetInfo: { type: 'string' },
|
|
16
|
-
};
|
|
6
|
+
import { parseChainHubOpts } from '../orchestration/helpers.js';
|
|
17
7
|
|
|
18
8
|
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
19
9
|
export const defaultProposalBuilder = async (
|
|
@@ -38,29 +28,8 @@ export const defaultProposalBuilder = async (
|
|
|
38
28
|
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
39
29
|
export default async (homeP, endowments) => {
|
|
40
30
|
const { scriptArgs } = endowments;
|
|
41
|
-
|
|
42
|
-
const {
|
|
43
|
-
values: { chainInfo, assetInfo },
|
|
44
|
-
} = parseArgs({
|
|
45
|
-
args: scriptArgs,
|
|
46
|
-
options: parserOpts,
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
const parseChainInfo = () => {
|
|
50
|
-
if (typeof chainInfo !== 'string') return undefined;
|
|
51
|
-
return JSON.parse(chainInfo);
|
|
52
|
-
};
|
|
53
|
-
const parseAssetInfo = () => {
|
|
54
|
-
if (typeof assetInfo !== 'string') return undefined;
|
|
55
|
-
return JSON.parse(assetInfo);
|
|
56
|
-
};
|
|
57
|
-
const opts = harden({
|
|
58
|
-
chainInfo: parseChainInfo(),
|
|
59
|
-
assetInfo: parseAssetInfo(),
|
|
60
|
-
});
|
|
61
|
-
|
|
31
|
+
const opts = parseChainHubOpts(scriptArgs);
|
|
62
32
|
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
63
|
-
|
|
64
33
|
await writeCoreEval(startSendAnywhere.name, utils =>
|
|
65
34
|
defaultProposalBuilder(utils, opts),
|
|
66
35
|
);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
2
|
+
import {
|
|
3
|
+
getManifest,
|
|
4
|
+
startSwapAnything,
|
|
5
|
+
} from '@agoric/orchestration/src/proposals/start-swap-anything.js';
|
|
6
|
+
import { parseChainHubOpts } from '../orchestration/helpers.js';
|
|
7
|
+
|
|
8
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
9
|
+
export const defaultProposalBuilder = async (
|
|
10
|
+
{ publishRef, install },
|
|
11
|
+
options,
|
|
12
|
+
) =>
|
|
13
|
+
harden({
|
|
14
|
+
sourceSpec: '@agoric/orchestration/src/proposals/start-swap-anything.js',
|
|
15
|
+
getManifestCall: [
|
|
16
|
+
getManifest.name,
|
|
17
|
+
{
|
|
18
|
+
installationRef: publishRef(
|
|
19
|
+
install(
|
|
20
|
+
'@agoric/orchestration/src/examples/swap-anything.contract.js',
|
|
21
|
+
),
|
|
22
|
+
),
|
|
23
|
+
options,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
29
|
+
export default async (homeP, endowments) => {
|
|
30
|
+
const { scriptArgs } = endowments;
|
|
31
|
+
const opts = parseChainHubOpts(scriptArgs);
|
|
32
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
33
|
+
await writeCoreEval(startSwapAnything.name, utils =>
|
|
34
|
+
defaultProposalBuilder(utils, opts),
|
|
35
|
+
);
|
|
36
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file This is for use in tests in a3p-integration
|
|
3
|
+
* Unlike most builder scripts, this one includes the proposal exports as well.
|
|
4
|
+
*/
|
|
5
|
+
import {
|
|
6
|
+
deeplyFulfilledObject,
|
|
7
|
+
makeTracer,
|
|
8
|
+
NonNullish,
|
|
9
|
+
} from '@agoric/internal';
|
|
10
|
+
import { E } from '@endo/far';
|
|
11
|
+
|
|
12
|
+
/// <reference types="@agoric/vats/src/core/types-ambient"/>
|
|
13
|
+
|
|
14
|
+
const trace = makeTracer('StartAxelarGmp', true);
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @import {start as StartFn} from '@agoric/orchestration/src/examples/axelar-gmp.contract.js';
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @param {BootstrapPowers} powers
|
|
22
|
+
*/
|
|
23
|
+
export const restartAxelarGmp = async ({
|
|
24
|
+
consume: {
|
|
25
|
+
agoricNames,
|
|
26
|
+
board,
|
|
27
|
+
chainStorage,
|
|
28
|
+
chainTimerService,
|
|
29
|
+
cosmosInterchainService,
|
|
30
|
+
localchain,
|
|
31
|
+
contractKits,
|
|
32
|
+
},
|
|
33
|
+
instance: instances,
|
|
34
|
+
}) => {
|
|
35
|
+
trace(restartAxelarGmp.name);
|
|
36
|
+
|
|
37
|
+
const marshaller = await E(board).getReadonlyMarshaller();
|
|
38
|
+
const privateArgs = await deeplyFulfilledObject(
|
|
39
|
+
harden({
|
|
40
|
+
agoricNames,
|
|
41
|
+
localchain,
|
|
42
|
+
marshaller,
|
|
43
|
+
orchestrationService: cosmosInterchainService,
|
|
44
|
+
storageNode: E(NonNullish(await chainStorage)).makeChildNode('axelarGmp'),
|
|
45
|
+
timerService: chainTimerService,
|
|
46
|
+
}),
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
// @ts-expect-error unknown instance
|
|
50
|
+
const instance = await instances.consume.axelarGmp;
|
|
51
|
+
trace('instance', instance);
|
|
52
|
+
/** @type {StartedInstanceKit<StartFn>} */
|
|
53
|
+
const kit = /** @type {any} */ (await E(contractKits).get(instance));
|
|
54
|
+
|
|
55
|
+
await E(kit.adminFacet).restartContract(privateArgs);
|
|
56
|
+
trace('done');
|
|
57
|
+
};
|
|
58
|
+
harden(restartAxelarGmp);
|
|
59
|
+
|
|
60
|
+
export const getManifest = () => {
|
|
61
|
+
return {
|
|
62
|
+
manifest: {
|
|
63
|
+
[restartAxelarGmp.name]: {
|
|
64
|
+
consume: {
|
|
65
|
+
agoricNames: true,
|
|
66
|
+
board: true,
|
|
67
|
+
chainTimerService: true,
|
|
68
|
+
chainStorage: true,
|
|
69
|
+
cosmosInterchainService: true,
|
|
70
|
+
localchain: true,
|
|
71
|
+
contractKits: true,
|
|
72
|
+
},
|
|
73
|
+
instance: {
|
|
74
|
+
consume: { axelarGmp: true },
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
82
|
+
export const defaultProposalBuilder = async () =>
|
|
83
|
+
harden({
|
|
84
|
+
sourceSpec: '@agoric/builders/scripts/testing/restart-axelar-gmp.js',
|
|
85
|
+
getManifestCall: [getManifest.name],
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
89
|
+
export default async (homeP, endowments) => {
|
|
90
|
+
const dspModule = await import('@agoric/deploy-script-support');
|
|
91
|
+
const { makeHelpers } = dspModule;
|
|
92
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
93
|
+
await writeCoreEval(restartAxelarGmp.name, defaultProposalBuilder);
|
|
94
|
+
};
|