@agoric/builders 0.2.0-u19.3 → 0.2.0-u21.0
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 +18 -25
- package/package.json +34 -35
- 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/append-chain-info.js +4 -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/testing/tweak-chain-info.js +7 -2
- package/scripts/vats/upgrade-mintHolder.js +7 -6
- package/scripts/vats/upgrade-orchestration.js +13 -19
- package/scripts/vats/upgrade-provisionPool-to-BLD.js +25 -0
- package/scripts/vats/upgrade-vats.js +49 -0
- package/scripts/fast-usdc/add-operators.build.js +0 -83
- package/scripts/fast-usdc/fast-usdc-fees.build.js +0 -75
- package/scripts/fast-usdc/fast-usdc-update.build.js +0 -65
- package/scripts/fast-usdc/start-fast-usdc.build.js +0 -207
- package/scripts/vats/terminate-governor-instance.js +0 -134
package/CHANGELOG.md
CHANGED
|
@@ -3,35 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
##
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @agoric/builders
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
## [0.2.0-u19.2](https://github.com/Agoric/agoric-sdk/compare/@agoric/builders@0.2.0-u19.1...@agoric/builders@0.2.0-u19.2) (2025-03-06)
|
|
15
|
-
|
|
16
|
-
**Note:** Version bump only for package @agoric/builders
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## [0.2.0-u19.1](https://github.com/Agoric/agoric-sdk/compare/@agoric/builders@0.2.0-u19.0...@agoric/builders@0.2.0-u19.1) (2025-03-03)
|
|
23
|
-
|
|
24
|
-
**Note:** Version bump only for package @agoric/builders
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
## 0.2.0-u19.0 (2025-02-24)
|
|
6
|
+
## 0.2.0-u21.0 (2025-06-19)
|
|
31
7
|
|
|
32
8
|
|
|
33
9
|
### ⚠ BREAKING CHANGES
|
|
34
10
|
|
|
11
|
+
* **chainHub:** register and retrieve non-cosmos chains
|
|
35
12
|
* remove orch.makeLocalAccount
|
|
36
13
|
* make Network and IBC vats durable (#8721)
|
|
37
14
|
|
|
@@ -40,9 +17,13 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
40
17
|
* smartWallet verstion 2 with watchedPromises ([5ed5107](https://github.com/Agoric/agoric-sdk/commit/5ed51078d39e643d91b572d9c50fad4a276d7ded))
|
|
41
18
|
* `ForwardOpts` accepts `intermediateRecipient` ([eb975f1](https://github.com/Agoric/agoric-sdk/commit/eb975f1df1587bc9307b27c20b7b236cc7fe386e))
|
|
42
19
|
* `ForwardOptsShape` ([50b1717](https://github.com/Agoric/agoric-sdk/commit/50b1717c1e40ed67a5e69810961ad8d0144c5f9e))
|
|
20
|
+
* `IcaAccountKit` accepts `relativeTimeoutNs` opt for outgoing tx packets ([57b4bde](https://github.com/Agoric/agoric-sdk/commit/57b4bdea6b22202d4e58b82b1ca6f94de660682a))
|
|
21
|
+
* `update-fee-config` proposal ([5d8775c](https://github.com/Agoric/agoric-sdk/commit/5d8775c409896369a931e6d78ae1d7958ad9d901))
|
|
43
22
|
* a proposal to upgrade scaledPriceAuthorities ([e5ed0ff](https://github.com/Agoric/agoric-sdk/commit/e5ed0ff6abcb83f52b32d49125e21e6e41923ed0))
|
|
44
23
|
* add `bech32Prefix?: string` to `CosmosChainInfo` ([cb9e1ee](https://github.com/Agoric/agoric-sdk/commit/cb9e1eeab9295b44ec009b82d73c457299e8d6f4))
|
|
24
|
+
* add axelar gmp core-eval and bootstrap tests ([e0d7ef8](https://github.com/Agoric/agoric-sdk/commit/e0d7ef82f1fc4ea42c6fc8ae7faaf5c74de8e36e))
|
|
45
25
|
* add priceFeed for StkAtom ([6a861df](https://github.com/Agoric/agoric-sdk/commit/6a861dfa14f42b4547a24ba31175a3b1a74c97c1))
|
|
26
|
+
* Add terminate-governed-instance.js proposal ([c2cb517](https://github.com/Agoric/agoric-sdk/commit/c2cb51779039ef2a5921efcc35b3b365a7b6159f)), closes [#10725](https://github.com/Agoric/agoric-sdk/issues/10725) [#10861](https://github.com/Agoric/agoric-sdk/issues/10861)
|
|
46
27
|
* add transfer method to CosmosOrchestrationAccount ([b1fdde1](https://github.com/Agoric/agoric-sdk/commit/b1fdde18b33237d1a2ea6f02938d998f55ce4d01))
|
|
47
28
|
* add upgrade zcf only proposal ([73e0bb8](https://github.com/Agoric/agoric-sdk/commit/73e0bb830e7612e74c8fb510b909db154d2b2219))
|
|
48
29
|
* added replace electorate proposal in chain upgrade ([4e88d9f](https://github.com/Agoric/agoric-sdk/commit/4e88d9f0412fe2b90efda30df0afbb61887bf35f))
|
|
@@ -55,8 +36,13 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
55
36
|
* **builders:** fast-usdc oracleSet option for MAINNET, ... ([3bf01a2](https://github.com/Agoric/agoric-sdk/commit/3bf01a279e5b2c72d6667704a07056501012260e))
|
|
56
37
|
* **builders:** fast-usdc policy update builder ([8ded3d8](https://github.com/Agoric/agoric-sdk/commit/8ded3d8be612a6944b80f3f63ab6fb727c76d179))
|
|
57
38
|
* **builders:** non-ambient `strictPriceFeedProposalBuilder` in `priceFeedSupport.js` ([95174a2](https://github.com/Agoric/agoric-sdk/commit/95174a23671ed16f7497ef6b0edaa63a54f1343d))
|
|
39
|
+
* **builders:** to reconfigure Fast USDC ([833e674](https://github.com/Agoric/agoric-sdk/commit/833e67499acfe20e2d73c9322b8c3b28df52b1d6))
|
|
40
|
+
* Caip10RecordShape ([8a104f2](https://github.com/Agoric/agoric-sdk/commit/8a104f27cae9c6c1bd44c86d7bd2736fea333234))
|
|
58
41
|
* chain-capabilities.js constants ([52ff70a](https://github.com/Agoric/agoric-sdk/commit/52ff70a187df1fadc89ccc506228bc6d0ca48da6))
|
|
42
|
+
* **chainHub:** register and retrieve non-cosmos chains ([bd11be2](https://github.com/Agoric/agoric-sdk/commit/bd11be25656ad0dd9ea4ad18c85f74a11ef2e520))
|
|
59
43
|
* coreEval to update priceFeeds, auction, and vaultManager ([fd91f78](https://github.com/Agoric/agoric-sdk/commit/fd91f781ad721033d67485d1732272af0c689ae7))
|
|
44
|
+
* **cosmos:** add Reserve withdrawal upgrade ([9e97cbd](https://github.com/Agoric/agoric-sdk/commit/9e97cbd7438e3df5aec96091d18ecdcde720978b))
|
|
45
|
+
* **cosmos:** upgrade IBC vat for next release ([c994490](https://github.com/Agoric/agoric-sdk/commit/c99449081560480e7e2dd6fc069b12dbcc630370))
|
|
60
46
|
* examples/auto-stake-it.contract.js ([b87ecba](https://github.com/Agoric/agoric-sdk/commit/b87ecba0ea41f1397dbd513d8e4c541f1299fd3f)), closes [#9042](https://github.com/Agoric/agoric-sdk/issues/9042)
|
|
61
47
|
* export `DenomDetailShape` ([2dfddb3](https://github.com/Agoric/agoric-sdk/commit/2dfddb3fb2018d769b1acc1b32f4ff3b4c7f67b7))
|
|
62
48
|
* export `OrchestrationPowersShape` ([34b61ea](https://github.com/Agoric/agoric-sdk/commit/34b61eae918a5f02ba6e06ac7e15b24750494821))
|
|
@@ -83,6 +69,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
83
69
|
* stakeBld contract ([a7e30a4](https://github.com/Agoric/agoric-sdk/commit/a7e30a4e43c00b2916d2d57c70063650e726321f))
|
|
84
70
|
* start a new auction in a3p-integration ([969235b](https://github.com/Agoric/agoric-sdk/commit/969235b18abbd15187e343d5f616f12177d224c4))
|
|
85
71
|
* update price feed proposal support for custom config ([8804ed2](https://github.com/Agoric/agoric-sdk/commit/8804ed28e259bf4ee9dd8872ccdd9ec42897e279))
|
|
72
|
+
* update settler reference proposal ([23e52dc](https://github.com/Agoric/agoric-sdk/commit/23e52dc7a074c3366a24bbd34a4df7a419fd992f))
|
|
86
73
|
* upgrade auction and vaults to use the new governor ([5aeac6d](https://github.com/Agoric/agoric-sdk/commit/5aeac6d2bd3a95357c9a725e01391b3d967530ff))
|
|
87
74
|
* upgrade v7-board and test it ([#10516](https://github.com/Agoric/agoric-sdk/issues/10516)) ([d8a109e](https://github.com/Agoric/agoric-sdk/commit/d8a109edcc78c977ef856131b52dd449e6a9d724)), closes [#10394](https://github.com/Agoric/agoric-sdk/issues/10394)
|
|
88
75
|
* **vat-transfer:** first cut at working proposal ([2864bd5](https://github.com/Agoric/agoric-sdk/commit/2864bd5c12300c3595df9676bcfde894dbe59b29))
|
|
@@ -100,5 +87,11 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
100
87
|
* **orchestration:** makeAccount never resolves when icqEnabled: false ([a74b6a2](https://github.com/Agoric/agoric-sdk/commit/a74b6a27d5108c5e014d546b86c695e3fc8bf2e5))
|
|
101
88
|
* repair storage of zcfBundleCap and add a3p test ([72c7574](https://github.com/Agoric/agoric-sdk/commit/72c75740aff920ffb53231441d0f00a8747400f1))
|
|
102
89
|
* support issuerName separate from keyword in add-collateral-core ([f0b1559](https://github.com/Agoric/agoric-sdk/commit/f0b1559374fe67d10e92f20c85d90a6f07e03cf0))
|
|
90
|
+
* **types:** discriminate `ChainInfo` union on `namespace` ([0f9f3fc](https://github.com/Agoric/agoric-sdk/commit/0f9f3fcbdd9da33b2eca1c02a2f7189c5405e8ff))
|
|
103
91
|
* validate scriptArgs endowment ([6864614](https://github.com/Agoric/agoric-sdk/commit/68646147d3e95c68b4a90c9e37d888ef00e9d35d))
|
|
104
92
|
* write-chain-info after u17 ([fc1f3ce](https://github.com/Agoric/agoric-sdk/commit/fc1f3ce1fe03bb2018edd4eb55d6561312d5fbe8))
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
### Reverts
|
|
96
|
+
|
|
97
|
+
* Revert "chore: remove 'encoding' from ChainAddress" ([be9dee2](https://github.com/Agoric/agoric-sdk/commit/be9dee245a04714568a45ae8b328f54b20b43d8a))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/builders",
|
|
3
|
-
"version": "0.2.0-
|
|
3
|
+
"version": "0.2.0-u21.0",
|
|
4
4
|
"description": "Build scripts for proposals to an Agoric chain",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -10,50 +10,49 @@
|
|
|
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",
|
|
13
|
+
"prepack": "yarn run -T tsc --build tsconfig.build.json",
|
|
14
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/ertp": "
|
|
27
|
-
"@agoric/
|
|
28
|
-
"@agoric/
|
|
29
|
-
"@agoric/
|
|
30
|
-
"@agoric/
|
|
31
|
-
"@agoric/
|
|
32
|
-
"@agoric/
|
|
33
|
-
"@
|
|
34
|
-
"@endo/
|
|
35
|
-
"@endo/
|
|
36
|
-
"@endo/
|
|
37
|
-
"@endo/
|
|
38
|
-
"@endo/
|
|
39
|
-
"@endo/
|
|
40
|
-
"@endo/
|
|
41
|
-
"@endo/
|
|
42
|
-
"@endo/stream": "^1.2.9",
|
|
26
|
+
"@agoric/ertp": "workspace:*",
|
|
27
|
+
"@agoric/internal": "workspace:*",
|
|
28
|
+
"@agoric/notifier": "workspace:*",
|
|
29
|
+
"@agoric/smart-wallet": "workspace:*",
|
|
30
|
+
"@agoric/vat-data": "workspace:*",
|
|
31
|
+
"@agoric/vats": "workspace:*",
|
|
32
|
+
"@agoric/zoe": "workspace:*",
|
|
33
|
+
"@endo/bundle-source": "^4.0.0",
|
|
34
|
+
"@endo/captp": "^4.4.5",
|
|
35
|
+
"@endo/eventual-send": "^1.3.1",
|
|
36
|
+
"@endo/far": "^1.1.11",
|
|
37
|
+
"@endo/init": "^1.1.9",
|
|
38
|
+
"@endo/marshal": "^1.6.4",
|
|
39
|
+
"@endo/patterns": "^1.5.0",
|
|
40
|
+
"@endo/promise-kit": "^1.1.10",
|
|
41
|
+
"@endo/stream": "^1.2.10",
|
|
43
42
|
"import-meta-resolve": "^4.1.0"
|
|
44
43
|
},
|
|
45
44
|
"devDependencies": {
|
|
46
|
-
"@agoric/deploy-script-support": "
|
|
47
|
-
"@agoric/governance": "
|
|
48
|
-
"@agoric/inter-protocol": "
|
|
49
|
-
"@agoric/orchestration": "
|
|
50
|
-
"@agoric/store": "
|
|
51
|
-
"@agoric/swing-store": "
|
|
52
|
-
"@agoric/swingset-liveslots": "
|
|
53
|
-
"@agoric/time": "
|
|
54
|
-
"@endo/errors": "^1.2.
|
|
45
|
+
"@agoric/deploy-script-support": "workspace:*",
|
|
46
|
+
"@agoric/governance": "workspace:*",
|
|
47
|
+
"@agoric/inter-protocol": "workspace:*",
|
|
48
|
+
"@agoric/orchestration": "workspace:*",
|
|
49
|
+
"@agoric/store": "workspace:*",
|
|
50
|
+
"@agoric/swing-store": "workspace:*",
|
|
51
|
+
"@agoric/swingset-liveslots": "workspace:*",
|
|
52
|
+
"@agoric/time": "workspace:*",
|
|
53
|
+
"@endo/errors": "^1.2.10",
|
|
55
54
|
"ava": "^5.3.0",
|
|
56
|
-
"c8": "^10.1.
|
|
55
|
+
"c8": "^10.1.3"
|
|
57
56
|
},
|
|
58
57
|
"files": [
|
|
59
58
|
"CHANGELOG.md",
|
|
@@ -68,7 +67,7 @@
|
|
|
68
67
|
"access": "public"
|
|
69
68
|
},
|
|
70
69
|
"engines": {
|
|
71
|
-
"node": "^
|
|
70
|
+
"node": "^20.9 || ^22.11"
|
|
72
71
|
},
|
|
73
72
|
"ava": {
|
|
74
73
|
"files": [
|
|
@@ -81,7 +80,7 @@
|
|
|
81
80
|
"workerThreads": false
|
|
82
81
|
},
|
|
83
82
|
"typeCoverage": {
|
|
84
|
-
"atLeast":
|
|
83
|
+
"atLeast": 90.62
|
|
85
84
|
},
|
|
86
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "e4dd46857133403d584bcf822a81817b355532f9"
|
|
87
86
|
}
|
|
@@ -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
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="ses" />
|
|
2
2
|
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
3
3
|
|
|
4
|
-
/** @type {Record<string, import('@agoric/orchestration
|
|
4
|
+
/** @type {Record<string, import('@agoric/orchestration').ChainInfo>} */
|
|
5
5
|
const chainInfo = {
|
|
6
6
|
hot: {
|
|
7
|
-
|
|
7
|
+
bech32Prefix: 'cosmos',
|
|
8
8
|
chainId: 'hot-1',
|
|
9
9
|
connections: {
|
|
10
10
|
'cosmoshub-4': {
|
|
@@ -26,6 +26,8 @@ const chainInfo = {
|
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
28
|
},
|
|
29
|
+
namespace: 'cosmos',
|
|
30
|
+
reference: 'hot-1',
|
|
29
31
|
},
|
|
30
32
|
};
|
|
31
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
|
);
|