Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update on zoe.installBundle and zoe.installBundleId #1265

Merged
merged 3 commits into from
Jan 22, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 22 additions & 10 deletions main/reference/zoe-api/zoe.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,16 @@ const invitation = await invitationIssuer.claim(untrustedInvitation);
const invitationValue = await E(Zoe).getInvitationDetails(invitation);
```

## E(Zoe).install(bundle)
## E(Zoe).install(bundle, bundleLabel?)

- **bundle**: **SourceBundle**
- **bundleLabel**: string - Optional
- Returns: **Promise<Installation>**

Takes bundled source code for a Zoe contract as an argument and installs the code on Zoe.
Returns a **Promise** for an **Installation** object.
Takes bundled source code for a Zoe contract as an argument and
installs the code with Zoe. The _bundleLabel_ will be accessible on the
**Installation** object. Returns a **Promise** for an **Installation**
object.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re "accessible on the Installation object" might as well say how. something like:

accessible on the Installation using E(anInstallation).getBundleLabel().

and / or make Installation into a link.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should .install(...) be deprecated except for testing?

Discussion such as Agoric/agoric-sdk#3269 (comment) makes it clear that we aim to keep bundles out of vat transcripts.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good ideas, all.


```js
// bundleSource takes source code files and
Expand All @@ -157,6 +160,22 @@ const bundle = await bundleSource(pathResolve(`./src/contract.js`));
const installationP = await E(Zoe).install(bundle);
```

## E(Zoe).installBundleID(bundleId, bundleLabel?)

- **bundleId**: **BundleId**
- **bundleLabel**: string - Optional
- Returns: **Promise<Installation>**

Takes a bundleId for a Zoe contract (often generated in a [coreEval
proposal](/guides/coreeval/local-testnet.html#deploying-contracts-using-core-eval-proposals)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coreEval happens on chain. Bundle generation happens off-chain in a builder script.

I suggest linking to bundling a contract instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

as an argument and installs the code with Zoe. The _bundleLabel_ will be
accessible on the **Installation** object. Returns a **Promise** for
an **Installation** object.

```js
const installationP = await E(Zoe).installBundleID(bundleId, bundleLabel);
```

## E(Zoe).getConfiguration()

- Returns: **Promise<Object>**
Expand Down Expand Up @@ -406,13 +425,6 @@ const paymentKeywordRecord = harden({ Asset: quatloosPayment });
[`zcf.makeInvitation(...)`](./zoe-contract-facet#zcf-makeinvitation-offerhandler-description-customdetails-proposalshape).
Each contract can define the properties it supports and which are required.

## E(Zoe).installBundleID(bundleId)

- bundleId: **BundleId**
- Returns: **Promise<Installation>**

Reserved for future use.

## E(Zoe).getBundleIDFromInstallation(installation)

- **installation**: **Installation**
Expand Down
Loading