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

feat(contractStarter): providing terms, privateArgs to started contracts #17

Open
wants to merge 7 commits into
base: dc-boot-tools
Choose a base branch
from

Conversation

dckc
Copy link
Collaborator

@dckc dckc commented Jan 14, 2024

Smart wallet offers can only refer to objects that are

  • on the board, and
  • mentioned in vstorage

For low-privilege services such as namesByAddress, we

  • add them to the terms of contractStarter,
  • publish the terms of the contractStarter as auxiliary data of the instance using boardAux conventions

For limited services (currently: storageNode and timerService), we add a permit property to offerArgs.

  • timerService: true results in privateArgs of the form { timerService: chainTimerService }.
  • storageNode: 'boardAux' causes a initStorageNode(node) call to the creatorFacet where
    node is a StorageNode at published.boardAux.${instanceBoardId}.info. It's not feasible to supply this in privateArgs since the instance is not known until after the contract starts.

We add prices for

  • installBundleID call, if used
  • the startInstance call
  • each of the permit properties/keys

See also: #4

fixes #14

DRAFT until:

  • clean up git history
  • test storageNode permit
  • test non-zero prices

contract/src/contractStarter.js Outdated Show resolved Hide resolved
contract/src/contractStarter.js Outdated Show resolved Hide resolved
contract/src/contractStarter.js Outdated Show resolved Hide resolved
@dckc dckc changed the title feat(contractStarter): providinf terms, privateArgs to started contracts feat(contractStarter): providing terms, privateArgs to started contracts Jan 14, 2024
contract/src/contractStarter.js Outdated Show resolved Hide resolved
@dckc dckc changed the base branch from main to dc-boot-tools January 14, 2024 22:49
@dckc
Copy link
Collaborator Author

dckc commented Jan 16, 2024

launched to local chain

note: I avoided a 2nd bundle. see also #19

6d3ea2d

ag-power-tools-agd-1  | 2024-01-16T06:51:29.480Z SwingSet: vat: v1: installation contractStarter settled; remaining: []
ag-power-tools-agd-1  | 2024-01-16T06:51:30.867Z SwingSet: vat: v1: contractStarterKit: new Promise
ag-power-tools-agd-1  | 2024-01-16T06:51:30.870Z SwingSet: vat: v1: contractStarterKit settled; remaining: [ 'anchorKits', 'bankMints', 'contractGovernor', 'reserveGovernorCreatorFacet', 'scaledPriceAuthorityKits', 'vBankKits', 'vaultFactoryGovernorCreator' ]
ag-power-tools-agd-1  | 2024-01-16T06:51:30.890Z SwingSet: vat: v1: instance contractStarter: new Promise
ag-power-tools-agd-1  | 2024-01-16T06:51:30.893Z SwingSet: vat: v1: instance contractStarter settled; remaining: []

TODO: print boardID?

I see it in published.agoricNames.installation and .instance as contractStarter.

published.boardAux.board00694 shows:

{
  "terms": {
    "agoricNames": {},
    "board": {},
    "brands": {
      "Fee": {},
      "Invitation": {}
    },
    "issuers": {
      "Fee": {},
      "Invitation": {}
    },
    "namesByAddress": {},
    "priceAuthority": {},
    "prices": {
      "installBundleID": {
        "brand": {},
        "value": "0"
      },
      "startInstance": {
        "brand": {},
        "value": "0"
      },
      "storageNode": {
        "brand": {},
        "value": "0"
      },
      "timerService": {
        "brand": {},
        "value": "0"
      }
    }
  }
}

instanceLabel,
);
// WARNING: adminFacet is dropped
const { instance, creatorFacet } = it;

const itsTerms = await E(zoe).getTerms(instance);
const itsId = await E(board).getId(instance);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

nothing is putting the installation on the board:

{
  installation: Object [Alleged: BundleIDInstallation#null] {},
  instance: Object [Alleged: InstanceHandle#board064124] {}
}

@dckc dckc force-pushed the dc-starter branch 2 times, most recently from 1282df8 to 317bcef Compare January 21, 2024 22:45
…EST)

 - refactor: use seatLike to clarify starterSam
 - start-contractStarer: use fixHub on namesByAddress
   - factor fixHub out of start-postalSvc
 - deprecate startPostalSvc
 - contractStarter: document storage schema
 - move board, priceAuthority to limitedAccess etc.
 - include labels
@dckc dckc marked this pull request as ready for review January 22, 2024 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

how does a user get powers for use with contractStarter?
1 participant