@agoric/deploy-script-support 0.10.4-dev-60cffcf.0 → 0.10.4-dev-0270908.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/README.md +28 -7
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -4,14 +4,35 @@ To install code on chain or in the a3p-integration environment, you'll have to
|
|
|
4
4
|
generate a proposal, and write a script to build the core proposal. The
|
|
5
5
|
proposals have limited access to bootstrap powers, described by their manifests.
|
|
6
6
|
|
|
7
|
+
There are collections of proposals in .../vats/src/proposals,
|
|
8
|
+
smart-wallet/src/proposals, orchestration/src/proposals, pegasus/src/proposals.
|
|
9
|
+
|
|
10
|
+
The overall format is a proposalBuilder script (There are several in
|
|
11
|
+
.../builders/scripts/vats/) which has a default export that passes resources to
|
|
12
|
+
the proposal. The resources include bundled source code and string-value
|
|
13
|
+
parameters. The ProposalBuilder specifies (as an import string) the proposal
|
|
14
|
+
it uses, identifies the "manifest", (which associates permissions to access
|
|
15
|
+
powers in the bootstrap space with functions to be called), and builds bundles
|
|
16
|
+
of source code needed by the proposal.
|
|
17
|
+
|
|
18
|
+
`.../builders/scripts/vats/upgradeVaults.js` is a canonical example. It says the
|
|
19
|
+
proposal to run is '@agoric/inter-protocol/src/proposals/upgrade-vaults.js',
|
|
20
|
+
lists the manifest there as `'getManifestForUpgradeVaults'`, and directs the
|
|
21
|
+
creation of a bundle from
|
|
22
|
+
'@agoric/inter-protocol/src/vaultFactory/vaultFactory.js', which will be made
|
|
23
|
+
available to the proposal as `vaultsRef` in options.
|
|
24
|
+
|
|
25
|
+
`upgrade-vaults.js` defines `getManifestForUpgradeVaults()`, which returns a
|
|
26
|
+
`manifest` that says `upgradeVaults()` should be executed, and specifies what
|
|
27
|
+
powers it should have access to.
|
|
7
28
|
|
|
8
29
|
### Proposal
|
|
9
30
|
|
|
10
31
|
The proposal is called with `(powers, options)` available. The manifest
|
|
11
32
|
detailing the powers that will be used is usually in the same file, and
|
|
12
33
|
conventionally provided by a function named `getManifestForFoo`. The manifest
|
|
13
|
-
needs to have a unique name, since it will be referenced by name from the
|
|
14
|
-
The usual format is
|
|
34
|
+
needs to have a unique name, since it will be referenced by name from the
|
|
35
|
+
script. The usual format is
|
|
15
36
|
```js
|
|
16
37
|
export const foo = async (
|
|
17
38
|
{
|
|
@@ -24,6 +45,7 @@ export const foo = async (
|
|
|
24
45
|
},
|
|
25
46
|
options,
|
|
26
47
|
) => {
|
|
48
|
+
const { fooRef } = options;
|
|
27
49
|
// do the things using powers and options
|
|
28
50
|
};
|
|
29
51
|
|
|
@@ -44,14 +66,13 @@ export const getManifestForFoo = (powers, options) => {
|
|
|
44
66
|
`options` allows the proposal to be provided with arbitray other powerful
|
|
45
67
|
objects.
|
|
46
68
|
|
|
47
|
-
### Script
|
|
69
|
+
### proposalBuilder Script
|
|
48
70
|
|
|
49
71
|
The script describes how to build the core proposal. For
|
|
50
72
|
`agoric-3-proposals` and uploading to the chain, the script must be named in the
|
|
51
73
|
`CoreProposalSteps` section in
|
|
52
74
|
[`app.go`](https://github.com/Agoric/agoric-sdk/blob/b13743a2cccf0cb63a412b54384435596d4e81ea/golang/cosmos/app/app.go#L881),
|
|
53
|
-
and its `defaultProposalBuilder` will be invoked
|
|
54
|
-
directly.
|
|
75
|
+
and its `defaultProposalBuilder` will be invoked directly.
|
|
55
76
|
|
|
56
77
|
Script files should export `defaultProposalBuilder` and a `default` function
|
|
57
78
|
that invokes `writeCoreProposal` one or more times to generate sets of files
|
|
@@ -79,8 +100,8 @@ export default async (homeP, endowments) => {
|
|
|
79
100
|
|
|
80
101
|
The first element of `getManifestCall` is interpreted as the name of a proposal.
|
|
81
102
|
The second element of `getManifestCall` produces the `options` argument passed
|
|
82
|
-
to the proposal. (`
|
|
83
|
-
options is a reference to code to be installed on-chain. The `fooRef` example
|
|
103
|
+
to the proposal. (`fooRef` in the example above). A common thing to want to pass
|
|
104
|
+
in options is a reference to code to be installed on-chain. The `fooRef` example
|
|
84
105
|
above shows how. `publishRef(install(<path>))` is built from sources in the
|
|
85
106
|
sdk, and passed as a `bundleRef`, which contains a `bundleID` suitable for
|
|
86
107
|
passing to Zoe (for contracts) or `vatAdminService` (for non-contract vat code).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/deploy-script-support",
|
|
3
|
-
"version": "0.10.4-dev-
|
|
3
|
+
"version": "0.10.4-dev-0270908.0+0270908",
|
|
4
4
|
"description": "Helpers and other support for writing deploy scripts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/helpers.js",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
},
|
|
35
35
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@agoric/assert": "0.6.1-dev-
|
|
38
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
39
|
-
"@agoric/import-manager": "0.3.12-dev-
|
|
40
|
-
"@agoric/internal": "0.3.3-dev-
|
|
41
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
42
|
-
"@agoric/store": "0.9.3-dev-
|
|
43
|
-
"@agoric/time": "0.3.3-dev-
|
|
44
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
37
|
+
"@agoric/assert": "0.6.1-dev-0270908.0+0270908",
|
|
38
|
+
"@agoric/ertp": "0.16.3-dev-0270908.0+0270908",
|
|
39
|
+
"@agoric/import-manager": "0.3.12-dev-0270908.0+0270908",
|
|
40
|
+
"@agoric/internal": "0.3.3-dev-0270908.0+0270908",
|
|
41
|
+
"@agoric/notifier": "0.6.3-dev-0270908.0+0270908",
|
|
42
|
+
"@agoric/store": "0.9.3-dev-0270908.0+0270908",
|
|
43
|
+
"@agoric/time": "0.3.3-dev-0270908.0+0270908",
|
|
44
|
+
"@agoric/zoe": "0.26.3-dev-0270908.0+0270908",
|
|
45
45
|
"@endo/base64": "^1.0.5",
|
|
46
46
|
"@endo/bundle-source": "^3.2.3",
|
|
47
47
|
"@endo/far": "^1.1.2",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@endo/zip": "^1.0.5"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@agoric/vats": "0.15.2-dev-
|
|
54
|
+
"@agoric/vats": "0.15.2-dev-0270908.0+0270908",
|
|
55
55
|
"@endo/init": "^1.1.2",
|
|
56
56
|
"ava": "^5.3.0",
|
|
57
57
|
"import-meta-resolve": "^2.2.1"
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"typeCoverage": {
|
|
76
76
|
"atLeast": 81.63
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "0270908690b17f67dc4a390c650353841df9f1e0"
|
|
79
79
|
}
|