@agoric/deploy-script-support 0.10.4-dev-00cccfc.0 → 0.10.4-dev-db0b9d7.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.
Files changed (2) hide show
  1. package/README.md +85 -2
  2. package/package.json +11 -11
package/README.md CHANGED
@@ -1,4 +1,87 @@
1
1
  # Deploy Script Support
2
2
 
3
- Import this code in your dapp deploy scripts to more easily install and
4
- interact with Zoe contracts.
3
+ To install code on chain or in the a3p-integration environment, you'll have to
4
+ generate a proposal, and write a script to build the core proposal. The
5
+ proposals have limited access to bootstrap powers, described by their manifests.
6
+
7
+
8
+ ### Proposal
9
+
10
+ The proposal is called with `(powers, options)` available. The manifest
11
+ detailing the powers that will be used is usually in the same file, and
12
+ 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 script.
14
+ The usual format is
15
+ ```js
16
+ export const foo = async (
17
+ {
18
+ consume: {
19
+ ...
20
+ },
21
+ brands: {
22
+ ...
23
+ }
24
+ },
25
+ options,
26
+ ) => {
27
+ // do the things using powers and options
28
+ };
29
+
30
+ export const getManifestForFoo = (powers, options) => {
31
+ manifest: {
32
+ [foo.name]: {
33
+ consume: {
34
+ ...
35
+ },
36
+ options,
37
+ )};
38
+ ```
39
+
40
+ `manifest` contains descriptions of powers to be provided to the proposals.
41
+
42
+ **TODO** what happens with the `installations` in [`startPsm.js`](https://github.com/Agoric/agoric-sdk/blob/b13743a2cccf0cb63a412b54384435596d4e81ea/packages/inter-protocol/src/proposals/startPSM.js#L496)?
43
+
44
+ `options` allows the proposal to be provided with arbitray other powerful
45
+ objects.
46
+
47
+ ### Script
48
+
49
+ The script describes how to build the core proposal. For
50
+ `agoric-3-proposals` and uploading to the chain, the script must be named in the
51
+ `CoreProposalSteps` section in
52
+ [`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.
55
+
56
+ Script files should export `defaultProposalBuilder` and a `default` function
57
+ that invokes `writeCoreProposal` one or more times to generate sets of files
58
+ describing the proposal.
59
+
60
+ ```js
61
+ export const defaultProposalBuilder = ({ publishRef, install }) => {
62
+ return harden({
63
+ sourceSpec: '@agoric/vats/src/proposals/foo.js',
64
+ getManifestCall: [
65
+ 'getManifestForFoo',
66
+ {
67
+ fooRef: publishRef(install('@agoric/...')),
68
+ ...otherParams,
69
+ },
70
+ ],
71
+ });
72
+ };
73
+ `
74
+ export default async (homeP, endowments) => {
75
+ const { writeCoreProposal } = await makeHelpers(homeP, endowments);
76
+ await writeCoreProposal('proposalName', defaultProposalBuilder);
77
+ };
78
+ ```
79
+
80
+ The first element of `getManifestCall` is interpreted as the name of a proposal.
81
+ The second element of `getManifestCall` produces the `options` argument passed
82
+ to the proposal. (`foo` in the example above). A common thing to want to pass in
83
+ options is a reference to code to be installed on-chain. The `fooRef` example
84
+ above shows how. `publishRef(install(<path>))` is built from sources in the
85
+ sdk, and passed as a `bundleRef`, which contains a `bundleID` suitable for
86
+ passing to Zoe (for contracts) or `vatAdminService` (for non-contract vat code).
87
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/deploy-script-support",
3
- "version": "0.10.4-dev-00cccfc.0+00cccfc",
3
+ "version": "0.10.4-dev-db0b9d7.0+db0b9d7",
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-00cccfc.0+00cccfc",
38
- "@agoric/ertp": "0.16.3-dev-00cccfc.0+00cccfc",
39
- "@agoric/import-manager": "0.3.12-dev-00cccfc.0+00cccfc",
40
- "@agoric/internal": "0.3.3-dev-00cccfc.0+00cccfc",
41
- "@agoric/notifier": "0.6.3-dev-00cccfc.0+00cccfc",
42
- "@agoric/store": "0.9.3-dev-00cccfc.0+00cccfc",
43
- "@agoric/time": "0.3.3-dev-00cccfc.0+00cccfc",
44
- "@agoric/zoe": "0.26.3-dev-00cccfc.0+00cccfc",
37
+ "@agoric/assert": "0.6.1-dev-db0b9d7.0+db0b9d7",
38
+ "@agoric/ertp": "0.16.3-dev-db0b9d7.0+db0b9d7",
39
+ "@agoric/import-manager": "0.3.12-dev-db0b9d7.0+db0b9d7",
40
+ "@agoric/internal": "0.3.3-dev-db0b9d7.0+db0b9d7",
41
+ "@agoric/notifier": "0.6.3-dev-db0b9d7.0+db0b9d7",
42
+ "@agoric/store": "0.9.3-dev-db0b9d7.0+db0b9d7",
43
+ "@agoric/time": "0.3.3-dev-db0b9d7.0+db0b9d7",
44
+ "@agoric/zoe": "0.26.3-dev-db0b9d7.0+db0b9d7",
45
45
  "@endo/base64": "^1.0.4",
46
46
  "@endo/bundle-source": "^3.2.2",
47
47
  "@endo/far": "^1.1.1",
@@ -51,7 +51,7 @@
51
51
  "@endo/zip": "^1.0.4"
52
52
  },
53
53
  "devDependencies": {
54
- "@agoric/vats": "0.15.2-dev-00cccfc.0+00cccfc",
54
+ "@agoric/vats": "0.15.2-dev-db0b9d7.0+db0b9d7",
55
55
  "@endo/init": "^1.1.1",
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.47
77
77
  },
78
- "gitHead": "00cccfc6fad7465b6dc611d2c861b32f07fdeaea"
78
+ "gitHead": "db0b9d70315699b173561f9b422d81f4068576de"
79
79
  }