Agoric / dapp-orchestration-basics

Agoric Orchestration Sample dApp
1 stars 1 forks source link

contract deployment process working #3

Closed Jovonni closed 2 weeks ago

Jovonni commented 2 months ago

contract deployment working

todo: fix contract start function error:

prepareStakingAccountKit: no function

failing here:


import { prepareStakingAccountKit } from '@agoric/orchestration/src/exos/stakingAccountKit.js';
...
const makeStakingAccountKit = prepareStakingAccountKit(
        baggage,
        makeRecorderKit,
        zcf,
    );
Jovonni commented 2 months ago

Installation & Start function Success:

4:18AM INF proposal tallied module=x/gov proposal=7 results=passed
2024-06-25T04:18:23.021Z SwingSet: vat: v1: start proposal module evaluating
2024-06-25T04:18:23.022Z SwingSet: vat: v1: startOrcaContract()...
2024-06-25T04:18:23.022Z SwingSet: vat: v1: getting ist issuer and brand
2024-06-25T04:18:23.022Z SwingSet: vat: v1: got terms for contract
2024-06-25T04:18:23.023Z SwingSet: vat: v1: getting orca installation
2024-06-25T04:18:23.024Z SwingSet: vat: v1: { consume: { agoricNames: Promise [Promise] {}, brandAuxPublisher: Promise [Promise] {}, board: Promise [Promise] {}, chainStorage: Promise [Promise] {}, startUpgradable: Promise [Promise] {}, zoe: Promise [Promise] {}, localchain: Promise [Promise] {}, chainTimerService: Promise [Promise] {}, orchestration: Promise [Promise] {} }, installation: { consume: { orca: Promise [Promise] {} }, produce: { orca: { resolve: [Function: resolve], reject: [Function: reject], reset: [Function: reset] } } }, issuer: { consume: { IST: Promise [Promise] {} }, produce: {} }, brand: { consume: { IST: Promise [Promise] {} }, produce: {} }, instance: { produce: { orca: { resolve: [Function: resolve], reject: [Function: reject], reset: [Function: reset] } } } }
2024-06-25T04:18:23.024Z SwingSet: vat: v1: { consume: { orca: Promise [Promise] {} }, produce: { orca: { resolve: [Function: resolve], reject: [Function: reject], reset: [Function: reset] } } }
2024-06-25T04:18:23.025Z SwingSet: vat: v1: { orca: Promise [Promise] {} }
2024-06-25T04:18:23.026Z SwingSet: vat: v1: config
2024-06-25T04:18:23.026Z SwingSet: vat: v1: undefined
2024-06-25T04:18:23.026Z SwingSet: vat: v1: orcaInstallationP
2024-06-25T04:18:23.027Z SwingSet: vat: v1: Promise [Promise] {}
2024-06-25T04:18:23.027Z SwingSet: vat: v1: produceInstance
2024-06-25T04:18:23.027Z SwingSet: vat: v1: { resolve: [Function: resolve], reject: [Function: reject], reset: [Function: reset] }
2024-06-25T04:18:23.028Z SwingSet: vat: v1: installContract function:  b1-d3d04eecdf7602c2ceb98745a9acb0ee3ce17f83646e6240bdd95fb78f1c30913b73f838398764274b8fa6a28c6dcb4a3da9b7b6f6c91b2072b1c89b1682b587
2024-06-25T04:18:23.028Z SwingSet: vat: v1: installContract zoe:  Promise [Promise] {}
2024-06-25T04:18:23.047Z SwingSet: vat: v1: installContract: after installBundleID
2024-06-25T04:18:23.047Z SwingSet: vat: v1: Object [Alleged: BundleIDInstallation] {}
2024-06-25T04:18:23.048Z SwingSet: vat: v1: installation orca: new Promise
2024-06-25T04:18:23.048Z SwingSet: vat: v1: orca (re-)installed as b1-d3d04
2024-06-25T04:18:23.049Z SwingSet: vat: v1: installation orca settled; remaining: []
2024-06-25T04:18:23.252Z SwingSet: vat: v1: startContract...
2024-06-25T04:18:23.252Z SwingSet: vat: v1: POWERS
2024-06-25T04:18:23.253Z SwingSet: vat: v1: { consume: { agoricNames: Promise [Promise] {}, brandAuxPublisher: Promise [Promise] {}, board: Promise [Promise] {}, chainStorage: Promise [Promise] {}, startUpgradable: Promise [Promise] {}, zoe: Promise [Promise] {}, localchain: Promise [Promise] {}, chainTimerService: Promise [Promise] {}, orchestration: Promise [Promise] {} }, installation: { consume: { orca: Promise [Promise] {} }, produce: { orca: { resolve: [Function: resolve], reject: [Function: reject], reset: [Function: reset] } } }, issuer: { consume: { IST: Promise [Promise] {} }, produce: {} }, brand: { consume: { IST: Promise [Promise] {} }, produce: {} }, instance: { produce: { orca: { resolve: [Function: resolve], reject: [Function: reject], reset: [Function: reset] } } } }
2024-06-25T04:18:23.254Z SwingSet: vat: v1: { installation: Object [Alleged: BundleIDInstallation] {}, terms: {} }
2024-06-25T04:18:23.254Z SwingSet: vat: v1: { storageNode: Object [Alleged: ChainStorageNode] {}, marshaller: Object [Alleged: Board publishingMarshaller] {}, orchestration: Object [Alleged: Orchestration public] {}, timer: Object [Alleged: timerService] {} }
2024-06-25T04:18:23.254Z SwingSet: vat: v1: orca start args: { installation: Object [Alleged: BundleIDInstallation] {}, terms: {} }
4:18AM INF Timed out dur=400 height=2747 module=consensus round=0 step=3
2024-06-25T04:18:25.490Z SwingSet: vat: v44: CONTRACT START FUNCTION...
2024-06-25T04:18:25.491Z SwingSet: vat: v44: CONTRACT START FUNCTION 2...
2024-06-25T04:18:25.492Z SwingSet: vat: v44: CONTRACT START FUNCTION 3...
2024-06-25T04:18:25.547Z SwingSet: vat: v44: CONTRACT START FUNCTION 4...abc
2024-06-25T04:18:25.548Z SwingSet: vat: v44: CONTRACT START FUNCTION 5...
4:18AM INF executed block height=2747 module=state num_invalid_txs=0 num_valid_txs=0

Vstorage showing the instance is live:

agd query vstorage data published.agoricNames.instance        
value: '{"blockHeight":"2748","values":["{\"body\":\"#[[\\\"ATOM-USD price feed\\\",\\\"$0.Alleged:
  InstanceHandle\\\"],[\\\"VaultFactory\\\",\\\"$1.Alleged: InstanceHandle\\\"],[\\\"VaultFactoryGovernor\\\",\\\"$2.Alleged:
  InstanceHandle\\\"],[\\\"auctioneer\\\",\\\"$3.Alleged: InstanceHandle\\\"],[\\\"economicCommittee\\\",\\\"$4.Alleged:
  InstanceHandle\\\"],[\\\"feeDistributor\\\",\\\"$5.Alleged: InstanceHandle\\\"],[\\\"provisionPool\\\",\\\"$6.Alleged:
  InstanceHandle\\\"],[\\\"psm-IST-USDC_axl\\\",\\\"$7.Alleged: InstanceHandle\\\"],[\\\"reserve\\\",\\\"$8.Alleged:
  InstanceHandle\\\"],[\\\"reserveGovernor\\\",\\\"$9.Alleged: InstanceHandle\\\"],[\\\"scaledPriceAuthority-ATOM\\\",\\\"$10.Alleged:
  InstanceHandle\\\"],[\\\"walletFactory\\\",\\\"$11.Alleged: InstanceHandle\\\"]]\",\"slots\":[\"board03138\",\"board04542\",\"board00443\",\"board01034\",\"board01029\",\"board03935\",\"board05736\",\"board03040\",\"board02733\",\"board02437\",\"board05141\",\"board05039\"]}","{\"body\":\"#[[\\\"ATOM-USD
  price feed\\\",\\\"$0.Alleged: InstanceHandle\\\"],[\\\"VaultFactory\\\",\\\"$1.Alleged:
  InstanceHandle\\\"],[\\\"VaultFactoryGovernor\\\",\\\"$2.Alleged: InstanceHandle\\\"],[\\\"auctioneer\\\",\\\"$3.Alleged:
  InstanceHandle\\\"],[\\\"economicCommittee\\\",\\\"$4.Alleged: InstanceHandle\\\"],[\\\"feeDistributor\\\",\\\"$5.Alleged:
  InstanceHandle\\\"],[\\\"provisionPool\\\",\\\"$6.Alleged: InstanceHandle\\\"],[\\\"psm-IST-USDC_axl\\\",\\\"$7.Alleged:
  InstanceHandle\\\"],[\\\"reserve\\\",\\\"$8.Alleged: InstanceHandle\\\"],[\\\"reserveGovernor\\\",\\\"$9.Alleged:
  InstanceHandle\\\"],[\\\"scaledPriceAuthority-ATOM\\\",\\\"$10.Alleged: InstanceHandle\\\"],[\\\"walletFactory\\\",\\\"$11.Alleged:
  InstanceHandle\\\"],[\\\"orca\\\",\\\"$12.Alleged: InstanceHandle\\\"]]\",\"slots\":[\"board03138\",\"board04542\",\"board00443\",\"board01034\",\"board01029\",\"board03935\",\"board05736\",\"board03040\",\"board02733\",\"board02437\",\"board05141\",\"board05039\",\"board01151\"]}"]}'

had to comment out this, but adding it back:


import { prepareCosmosOrchestrationAccountKit, prepareCosmosOrchestrationAccount } from '@agoric/orchestration/src/exos/cosmosOrchestrationAccount.js';

const makeStakingAccountKit = prepareCosmosOrchestrationAccountKit(
        baggage,
        makeRecorderKit,
        zcf,
    );
Jovonni commented 2 months ago

Note for reference: Whenever I comment back in:

import { prepareCosmosOrchestrationAccountKit } from '@agoric/orchestration/src/exos/cosmosOrchestrationAccount.js';
...
const makeStakingAccountKit = prepareCosmosOrchestrationAccountKit(
        baggage,
        makeRecorderKit,
        zcf,
    );

I get:

TypeError#1: prepareCosmosOrchestrationAccountKit: no function

Started using version: 0.1.1-upgrade-16-dev-d45b478.0

Chris-Hibbert commented 2 months ago

TypeError#1: prepareCosmosOrchestrationAccountKit: no function is a rather obscure and hard to parse message. It generally means that while executing inside prepareCosmosOrchestrationAccountKit javascript tried to invoke a function that turned out to be undefined. It doesn't give you any clue about where inside the function the problem was, but it's easier to find once you realize that the problem isn't invoking the named function, it's while running inside. I often throw a bunch of log messages in to find the problem, unless I'm lucky enough to be working where a debugger is useable.

Jovonni commented 2 months ago

successfully deploys contract, and runs in start function with prepareCosmosOrchestrationAccount:

import { prepareCosmosOrchestrationAccount } from '@agoric/orchestration/src/exos/cosmosOrchestrationAccount.js';
...
const makeCosmosOrchestrationAccount = prepareCosmosOrchestrationAccount(
        zone,
        makeRecorderKit,
        vowTools,
        zcf,
      );
 console.log("makeCosmosOrchestrationAccount")
 console.log(makeCosmosOrchestrationAccount)

logs:

11:04PM INF proposal tallied module=x/gov proposal=16 results=passed
2024-06-25T23:04:50.313Z SwingSet: vat: v1: start proposal module evaluating
2024-06-25T23:04:50.314Z SwingSet: vat: v1: startOrcaContract()...
2024-06-25T23:04:50.314Z SwingSet: vat: v1: getting ist issuer and brand
2024-06-25T23:04:50.314Z SwingSet: vat: v1: got terms for contract
2024-06-25T23:04:50.314Z SwingSet: vat: v1: getting orca installation
2024-06-25T23:04:50.316Z SwingSet: vat: v1: { consume: { agoricNames: Promise [Promise] {}, brandAuxPublisher: Promise [Promise] {}, board: Promise [Promise] {}, chainStorage: Promise [Promise] {}, startUpgradable: Promise [Promise] {}, zoe: Promise [Promise] {}, localchain: Promise [Promise] {}, chainTimerService: Promise [Promise] {}, orchestration: Promise [Promise] {} }, installation: { consume: { orca: Promise [Promise] {} }, produce: { orca: { resolve: [Function: resolve], reject: [Function: reject], reset: [Function: reset] } } }, issuer: { consume: { IST: Promise [Promise] {} }, produce: {} }, brand: { consume: { IST: Promise [Promise] {} }, produce: {} }, instance: { produce: { orca: { resolve: [Function: resolve], reject: [Function: reject], reset: [Function: reset] } } } }
2024-06-25T23:04:50.316Z SwingSet: vat: v1: { consume: { orca: Promise [Promise] {} }, produce: { orca: { resolve: [Function: resolve], reject: [Function: reject], reset: [Function: reset] } } }
2024-06-25T23:04:50.317Z SwingSet: vat: v1: { orca: Promise [Promise] {} }
2024-06-25T23:04:50.317Z SwingSet: vat: v1: config
2024-06-25T23:04:50.317Z SwingSet: vat: v1: undefined
2024-06-25T23:04:50.317Z SwingSet: vat: v1: orcaInstallationP
2024-06-25T23:04:50.317Z SwingSet: vat: v1: Promise [Promise] {}
2024-06-25T23:04:50.318Z SwingSet: vat: v1: produceInstance
2024-06-25T23:04:50.318Z SwingSet: vat: v1: { resolve: [Function: resolve], reject: [Function: reject], reset: [Function: reset] }
2024-06-25T23:04:50.318Z SwingSet: vat: v1: installContract function:  b1-7413457d7828c4b6fd7ec9be01f8e4f78af2b64017ed85447d766b425abd92a5a5843db2b67d81c2088ddbdfc5dfd9c86b0be54605b409ea5066ff71c74e9580
2024-06-25T23:04:50.318Z SwingSet: vat: v1: installContract zoe:  Promise [Promise] {}
2024-06-25T23:04:50.337Z SwingSet: vat: v1: installContract: after installBundleID
2024-06-25T23:04:50.338Z SwingSet: vat: v1: Object [Alleged: BundleIDInstallation] {}
2024-06-25T23:04:50.338Z SwingSet: vat: v1: installation orca: new Promise
2024-06-25T23:04:50.338Z SwingSet: vat: v1: orca (re-)installed as b1-74134
2024-06-25T23:04:50.339Z SwingSet: vat: v1: installation orca settled; remaining: []
2024-06-25T23:04:50.529Z SwingSet: vat: v1: startContract...
2024-06-25T23:04:50.529Z SwingSet: vat: v1: POWERS
2024-06-25T23:04:50.530Z SwingSet: vat: v1: { consume: { agoricNames: Promise [Promise] {}, brandAuxPublisher: Promise [Promise] {}, board: Promise [Promise] {}, chainStorage: Promise [Promise] {}, startUpgradable: Promise [Promise] {}, zoe: Promise [Promise] {}, localchain: Promise [Promise] {}, chainTimerService: Promise [Promise] {}, orchestration: Promise [Promise] {} }, installation: { consume: { orca: Promise [Promise] {} }, produce: { orca: { resolve: [Function: resolve], reject: [Function: reject], reset: [Function: reset] } } }, issuer: { consume: { IST: Promise [Promise] {} }, produce: {} }, brand: { consume: { IST: Promise [Promise] {} }, produce: {} }, instance: { produce: { orca: { resolve: [Function: resolve], reject: [Function: reject], reset: [Function: reset] } } } }
2024-06-25T23:04:50.530Z SwingSet: vat: v1: { installation: Object [Alleged: BundleIDInstallation] {}, terms: {} }
2024-06-25T23:04:50.531Z SwingSet: vat: v1: { storageNode: Object [Alleged: ChainStorageNode] {}, marshaller: Object [Alleged: Board publishingMarshaller] {}, orchestration: Object [Alleged: Orchestration public] {}, timer: Object [Alleged: timerService] {} }
2024-06-25T23:04:50.531Z SwingSet: vat: v1: orca start args: { installation: Object [Alleged: BundleIDInstallation] {}, terms: {} }
11:04PM INF Timed out dur=400 height=8757 module=consensus round=0 step=3
2024-06-25T23:04:55.369Z SwingSet: vat: v53: CONTRACT START FUNCTION... 123 sanity check 1
2024-06-25T23:04:55.369Z SwingSet: vat: v53: CONTRACT START FUNCTION 2...
2024-06-25T23:04:55.375Z SwingSet: vat: v53: CONTRACT START FUNCTION 3...
2024-06-25T23:04:55.607Z SwingSet: vat: v53: CONTRACT START FUNCTION 4...zyx2
2024-06-25T23:04:57.483Z SwingSet: vat: v53: makeCosmosOrchestrationAccount
2024-06-25T23:04:57.483Z SwingSet: vat: v53: [Function (anonymous)]
2024-06-25T23:04:57.483Z SwingSet: vat: v53: CONTRACT START FUNCTION 5...
Jovonni commented 2 months ago

bundle process still works, test setup incorporated and base tests passing, and contract STILL deploys successfully while making use of makeCosmosOrchestrationAccount

test logs:

yarn test ./test/test-orca-contract.js

start proposal module evaluating
bundles/ bundle-orca.js valid: 422 files bundled at 2024-06-26T06:11:55.020Z with size 5119357
    before hook
    ℹ bootstrap
    ℹ brand timer: new Promise
    ℹ brand BLD: new Promise
    ℹ brand IST: new Promise
    ℹ brand Invitation: new Promise
    ℹ issuer BLD: new Promise
    ℹ issuer IST: new Promise
    ℹ issuer Invitation: new Promise
    ℹ brand timer settled; remaining: [
        'BLD',
        'IST',
        'Invitation',
      ]
    ℹ brand BLD settled; remaining: [
        'IST',
        'Invitation',
      ]
    ℹ brand IST settled; remaining: [
        'Invitation',
      ]
    ℹ brand Invitation settled; remaining: []
    ℹ issuer BLD settled; remaining: [
        'IST',
        'Invitation',
      ]
    ℹ issuer IST settled; remaining: [
        'Invitation',
      ]
    ℹ issuer Invitation settled; remaining: []
    ℹ issuer MNY: new Promise
    ℹ brand MNY: new Promise
    ℹ issuer Item: new Promise
    ℹ brand Item: new Promise
    ℹ issuer ATOM: new Promise
    ℹ brand ATOM: new Promise
    ℹ issuer MNY settled; remaining: [
        'ATOM',
        'Item',
      ]
    ℹ brand MNY settled; remaining: [
        'ATOM',
        'Item',
      ]
    ℹ issuer Item settled; remaining: [
        'ATOM',
      ]
    ℹ brand Item settled; remaining: [
        'ATOM',
      ]
    ℹ issuer ATOM settled; remaining: []
    ℹ brand ATOM settled; remaining: []
publish bundle orca b1-725c9
startOrcaContract()...
----- OrCE.2  2 config {
  options: {
    orca: {
      bundleID: 'b1-725c96ffe80edac34db9f74275ebd64f9466d5893e40cb9f6da061e2c548476eecf77b06645fb8c7d3bbf3d4a8dfaaebf8a59b3fb13d4d3cb25abc1df288fcd8'
    }
  }
}
installContract function:  b1-725c96ffe80edac34db9f74275ebd64f9466d5893e40cb9f6da061e2c548476eecf77b06645fb8c7d3bbf3d4a8dfaaebf8a59b3fb13d4d3cb25abc1df288fcd8
installContract zoe:  Promise { Object [Alleged: ZoeService] {} }
  ✔ Install the contract
    ℹ installed: Object @Alleged: BundleInstallation {}
installContract: after installBundleID
Object [Alleged: BundleIDInstallation] {}
orca (re-)installed as b1-725c9
----- OrCE.2  3 awaiting consume.orchestration
----- OrCE.2  4 orchestration Object [Alleged: DummyOrchestration] {}
startContract...
POWERS
{
  produce: {},
  consume: {},
  installation: { produce: {}, consume: {} },
  instance: { produce: {}, consume: {} },
  issuer: { produce: {}, consume: {} },
  brand: { produce: {}, consume: {} },
  zone: Object [Alleged: durableZone] {
    exo: [Function: wrapper],
    exoClass: [Function: wrapper],
    exoClassKit: [Function: wrapper],
    subZone: [Function: subZone],
    makeOnce: [Function: makeOnce],
    watchPromise: [Function: watchPromise],
    detached: [Function: detached],
    isStorable: [Function: isStorable],
    mapStore: [Function: wrapper],
    setStore: [Function: wrapper],
    weakMapStore: [Function: wrapper],
    weakSetStore: [Function: wrapper]
  }
}
{ installation: Object [Alleged: BundleIDInstallation] {} }
{
  storageNode: Object [Alleged: ChainStorageNode] {},
  marshaller: Object [Alleged: Board publishingMarshaller] {},
  orchestration: Object [Alleged: DummyOrchestration] {},
  timer: Object [Alleged: ManualTimer] {
    __getInterfaceGuard__: [Function: value],
    __getMethodNames__: [Function: value],
    advanceBy: [Function: value],
    advanceTo: [Function: value],
    cancel: [Function: value],
    delay: [Function: value],
    getClock: [Function: value],
    getCurrentTimestamp: [Function: value],
    getTimerBrand: [Function: value],
    makeNotifier: [Function: value],
    makeRepeater: [Function: value],
    repeatAfter: [Function: value],
    setWakeup: [Function: value],
    wakeAt: [Function: value],
    tick: [Function: tick],
    tickN: [AsyncFunction: tickN]
  }
}
orca start args: { installation: Object [Alleged: BundleIDInstallation] {} }
----- OrchDev1.2  2 CONTRACT START FUNCTION... 123 sanity check 1
----- OrchDev1.2  3 CONTRACT START FUNCTION 2...
----- OrchDev1.2  4 CONTRACT START FUNCTION 3...
----- OrchDev1.2  5 CONTRACT START FUNCTION 4...abc-dev1
makeCosmosOrchestrationAccount
[Function (anonymous)]
----- OrchDev1.2  6 CONTRACT START FUNCTION 5...
  ✔ Start Orca contract (1.5s)
    ℹ started: Object @Alleged: InstanceHandle {}
----- OrchDev1.2  2 CONTRACT START FUNCTION... 123 sanity check 1
----- OrchDev1.2  3 CONTRACT START FUNCTION 2...
----- OrchDev1.2  4 CONTRACT START FUNCTION 3...
----- OrchDev1.2  5 CONTRACT START FUNCTION 4...abc-dev1
makeCosmosOrchestrationAccount
[Function (anonymous)]
----- OrchDev1.2  6 CONTRACT START FUNCTION 5...
orca started
----- OrCE.2  5 orca (re)started
  ✔ Start Orca contract using core-eval (1.8s)
    ℹ run core-eval to start (dummy) orchestration
    ℹ run orca core-eval
    ℹ Object @Alleged: InstanceHandle {}
  ─

  3 tests passed

deployment logs:

6:16AM INF proposal tallied module=x/gov proposal=3 results=passed
2024-06-26T06:16:08.295Z SwingSet: vat: v1: start proposal module evaluating
2024-06-26T06:16:08.295Z SwingSet: vat: v1: startOrcaContract()...
2024-06-26T06:16:08.296Z SwingSet: vat: v1: ----- OrCE.2  2 config undefined
2024-06-26T06:16:08.296Z SwingSet: vat: v1: installContract function:  b1-f651691970d36972cfd6698ac2914f0378104d633b12fb7f35abfa85fd4a110a1f86d1b481bbf3a8532c672785406286f6f8a19c0d1f8b800b36256e36783466
2024-06-26T06:16:08.296Z SwingSet: vat: v1: installContract zoe:  Promise [Promise] {}
2024-06-26T06:16:08.314Z SwingSet: vat: v1: installContract: after installBundleID
2024-06-26T06:16:08.314Z SwingSet: vat: v1: Object [Alleged: BundleIDInstallation] {}
2024-06-26T06:16:08.315Z SwingSet: vat: v1: installation orca: new Promise
2024-06-26T06:16:08.315Z SwingSet: vat: v1: orca (re-)installed as b1-f6516
2024-06-26T06:16:08.317Z SwingSet: vat: v1: installation orca settled; remaining: []
2024-06-26T06:16:08.317Z SwingSet: vat: v1: ----- OrCE.2  3 awaiting consume.orchestration
2024-06-26T06:16:08.318Z SwingSet: vat: v1: ----- OrCE.2  4 orchestration Object [Alleged: Orchestration public] {}
2024-06-26T06:16:08.517Z SwingSet: vat: v1: startContract...
2024-06-26T06:16:08.517Z SwingSet: vat: v1: POWERS
2024-06-26T06:16:08.518Z SwingSet: vat: v1: { consume: { agoricNames: Promise [Promise] {}, brandAuxPublisher: Promise [Promise] {}, board: Promise [Promise] {}, chainStorage: Promise [Promise] {}, startUpgradable: Promise [Promise] {}, zoe: Promise [Promise] {}, localchain: Promise [Promise] {}, chainTimerService: Promise [Promise] {}, orchestration: Promise [Promise] {} }, installation: { consume: { orca: Promise [Promise] {} }, produce: { orca: { resolve: [Function: resolve], reject: [Function: reject], reset: [Function: reset] } } }, issuer: { consume: { IST: Promise [Promise] {} }, produce: {} }, brand: { consume: { IST: Promise [Promise] {} }, produce: {} }, instance: { produce: { orca: { resolve: [Function: resolve], reject: [Function: reject], reset: [Function: reset] } } } }
2024-06-26T06:16:08.518Z SwingSet: vat: v1: { installation: Object [Alleged: BundleIDInstallation] {} }
2024-06-26T06:16:08.519Z SwingSet: vat: v1: { storageNode: Object [Alleged: ChainStorageNode] {}, marshaller: Object [Alleged: Board publishingMarshaller] {}, orchestration: Object [Alleged: Orchestration public] {}, timer: Object [Alleged: timerService] {} }
2024-06-26T06:16:08.519Z SwingSet: vat: v1: orca start args: { installation: Object [Alleged: BundleIDInstallation] {} }
6:16AM INF Timed out dur=400 height=3070 module=consensus round=0 step=3
2024-06-26T06:16:11.964Z SwingSet: vat: v40: ----- OrchDev1.2  2 CONTRACT START FUNCTION... 123 sanity check 1
2024-06-26T06:16:11.964Z SwingSet: vat: v40: ----- OrchDev1.2  3 CONTRACT START FUNCTION 2...
2024-06-26T06:16:11.965Z SwingSet: vat: v40: ----- OrchDev1.2  4 CONTRACT START FUNCTION 3...
2024-06-26T06:16:12.046Z SwingSet: vat: v40: ----- OrchDev1.2  5 CONTRACT START FUNCTION 4...abc-dev1
2024-06-26T06:16:12.232Z SwingSet: vat: v40: makeCosmosOrchestrationAccount
2024-06-26T06:16:12.232Z SwingSet: vat: v40: [Function (anonymous)]
2024-06-26T06:16:12.233Z SwingSet: vat: v40: ----- OrchDev1.2  6 CONTRACT START FUNCTION 5..

TODO: clean up any straggling test code, and will also do another pass over which deps we don't need, resolutions, etc. Had some weird dep issues, and also temporarily saw the The requested module '@endo/patterns' does not provide an export named 'isCopySet' issue I ran into way earlier. So I am keeping the deps for now until further diagnosis 🚀

cc @dckc

Jovonni commented 2 months ago

solving these failed tests:

yarn workspace dapp-agoric-orca-contract test                               

  ✘ No tests found in test/test-build-proposal.js
start proposal module evaluating
  ✔ deploy-tools › local copy of ParamTypes matches @agoric/governance
  ✔ deploy-tools › local copy of ELECTORATE matches @agoric/governance
  ✔ deploy-tools › local copy of INVITATION_MAKERS_DESC matches @agoric/iner-protocol
  ✔ deploy-tools › boardAux marshal short-cut matches @endo/marshal
  ✔ deploy-tools › AmountMath.make work-alike matches @agoric/ertp
bundles/ bundle-orca.js valid: 177 files bundled at 2024-06-27T16:50:43.844Z with size 1342189
    orca-contract › before hook
    ℹ bootstrap
    ℹ brand timer: new Promise
    ℹ brand BLD: new Promise
    ℹ brand IST: new Promise
    ℹ brand Invitation: new Promise
    ℹ issuer BLD: new Promise
    ℹ issuer IST: new Promise
    ℹ issuer Invitation: new Promise
    ℹ brand timer settled; remaining: [
        'BLD',
        'IST',
        'Invitation',
      ]
    ℹ brand BLD settled; remaining: [
        'IST',
        'Invitation',
      ]
    ℹ brand IST settled; remaining: [
        'Invitation',
      ]
    ℹ brand Invitation settled; remaining: []
    ℹ issuer BLD settled; remaining: [
        'IST',
        'Invitation',
      ]
    ℹ issuer IST settled; remaining: [
        'Invitation',
      ]
    ℹ issuer Invitation settled; remaining: []
    ℹ issuer MNY: new Promise
    ℹ brand MNY: new Promise
    ℹ issuer Item: new Promise
    ℹ brand Item: new Promise
    ℹ issuer ATOM: new Promise
    ℹ brand ATOM: new Promise
    ℹ issuer MNY settled; remaining: [
        'ATOM',
        'Item',
      ]
    ℹ brand MNY settled; remaining: [
        'ATOM',
        'Item',
      ]
    ℹ issuer Item settled; remaining: [
        'ATOM',
      ]
    ℹ brand Item settled; remaining: [
        'ATOM',
      ]
    ℹ issuer ATOM settled; remaining: []
    ℹ brand ATOM settled; remaining: []
publish bundle orca b1-f46e0
startOrcaContract()...
----- OrCE.2  2 config {
  options: {
    orca: {
      bundleID: 'b1-f46e01c0d83e51c1d888a9fc6ecdfce9815cee530442b73f9a6c7bd7856cd165afe3c7c58e97dd268b21fb3d44478ff28c899749c11b09cf882c02be4b6325a0'
    }
  }
}
installContract function:  b1-f46e01c0d83e51c1d888a9fc6ecdfce9815cee530442b73f9a6c7bd7856cd165afe3c7c58e97dd268b21fb3d44478ff28c899749c11b09cf882c02be4b6325a0
installContract zoe:  Promise { Object [Alleged: ZoeService] {} }
  ✔ orca-contract › Install the contract
    ℹ installed: Object @Alleged: BundleInstallation {}
installContract: after installBundleID
Object [Alleged: BundleIDInstallation] {}
orca (re-)installed as b1-f46e0
----- OrCE.2  3 awaiting consume.orchestration
----- OrCE.2  4 orchestration Object [Alleged: DummyOrchestration] {}
startContract...
POWERS
{
  produce: {},
  consume: {},
  installation: { produce: {}, consume: {} },
  instance: { produce: {}, consume: {} },
  issuer: { produce: {}, consume: {} },
  brand: { produce: {}, consume: {} },
  zone: Object [Alleged: durableZone] {
    exo: [Function: wrapper],
    exoClass: [Function: wrapper],
    exoClassKit: [Function: wrapper],
    subZone: [Function: subZone],
    makeOnce: [Function: makeOnce],
    watchPromise: [Function: watchPromise],
    detached: [Function: detached],
    isStorable: [Function: isStorable],
    mapStore: [Function: wrapper],
    setStore: [Function: wrapper],
    weakMapStore: [Function: wrapper],
    weakSetStore: [Function: wrapper]
  }
}
{ installation: Object [Alleged: BundleIDInstallation] {} }
{
  storageNode: Object [Alleged: ChainStorageNode] {},
  marshaller: Object [Alleged: Board publishingMarshaller] {},
  orchestration: Object [Alleged: DummyOrchestration] {},
  timer: Object [Alleged: ManualTimer] {
    __getInterfaceGuard__: [Function: value],
    __getMethodNames__: [Function: value],
    advanceBy: [Function: value],
    advanceTo: [Function: value],
    cancel: [Function: value],
    delay: [Function: value],
    getClock: [Function: value],
    getCurrentTimestamp: [Function: value],
    getTimerBrand: [Function: value],
    makeNotifier: [Function: value],
    makeRepeater: [Function: value],
    repeatAfter: [Function: value],
    setWakeup: [Function: value],
    wakeAt: [Function: value],
    tick: [Function: tick],
    tickN: [AsyncFunction: tickN]
  }
}
orca start args: { installation: Object [Alleged: BundleIDInstallation] {} }
  ✘ [fail]: orca-contract › Start Orca contract Rejected promise returned by test
    ℹ REJECTED from ava test("Start Orca contract"): (Error#1)
    ℹ Error#1: Cannot find file for internal module "./src/exos/cosmosOrchestrationAccount.js" (with candidates "./src/exos/cosmosOrchestrationAccount.js", "./src/exos/cosmosOrchestrationAccount.js.js", "./src/exos/cosmosOrchestrationAccount.js.json", "./src/exos/cosmosOrchestrationAccount.js.node", "./src/exos/cosmosOrchestrationAccount.js/index.js", "./src/exos/cosmosOrchestrationAccount.js/index.json", "./src/exos/cosmosOrchestrationAccount.js/index.node") in package file:///Users/jovonni/Documents/projects/dapp-agoric-orca/contract/node_modules/@agoric/orchestration/
    ℹ   at Object.execute (.../compartment-mapper/src/import-archive.js:52:7)
        at eval (.../dapp-agoric-orca-contract/src/orca.contract.js:1:242)
        at eval (.../dapp-agoric-orca-contract/src/orca.contract.js:107:3)
        at async importBundle (.../import-bundle/src/index.js:68:18)

  ✘ [fail]: orca-contract › Start Orca contract using core-eval Rejected promise returned by test
    ℹ run core-eval to start (dummy) orchestration
    ℹ run orca core-eval
    ℹ REJECTED from ava test("Start Orca contract using core-eval"): (Error#2)
    ℹ Error#2: Cannot find file for internal module "./src/exos/cosmosOrchestrationAccount.js" (with candidates "./src/exos/cosmosOrchestrationAccount.js", "./src/exos/cosmosOrchestrationAccount.js.js", "./src/exos/cosmosOrchestrationAccount.js.json", "./src/exos/cosmosOrchestrationAccount.js.node", "./src/exos/cosmosOrchestrationAccount.js/index.js", "./src/exos/cosmosOrchestrationAccount.js/index.json", "./src/exos/cosmosOrchestrationAccount.js/index.node") in package file:///Users/jovonni/Documents/projects/dapp-agoric-orca/contract/node_modules/@agoric/orchestration/
    ℹ   at Object.execute (.../compartment-mapper/src/import-archive.js:52:7)
        at eval (.../dapp-agoric-orca-contract/src/orca.contract.js:1:242)
        at eval (.../dapp-agoric-orca-contract/src/orca.contract.js:107:3)
        at async importBundle (.../import-bundle/src/index.js:68:18)

  ✔ bundle-source › bundleSource() bundles the contract for use with zoe (1.7s)
    ℹ f46e01c0d83e51c1d888a9fc6ecdfce9815cee530442b73f9a6c7bd7856cd165afe3c7c58e97dd268b21fb3d44478ff28c899749c11b09cf882c02be4b6325a0
    ℹ Object @Alleged: BundleInstallation {}
  ─

  orca-contract › Start Orca contract
  Rejected promise returned by test. Reason:

  Error {
    message: 'Cannot find file for internal module "./src/exos/cosmosOrchestrationAccount.js" (with candidates "./src/exos/cosmosOrchestrationAccount.js", "./src/exos/cosmosOrchestrationAccount.js.js", "./src/exos/cosmosOrchestrationAccount.js.json", "./src/exos/cosmosOrchestrationAccount.js.node", "./src/exos/cosmosOrchestrationAccount.js/index.js", "./src/exos/cosmosOrchestrationAccount.js/index.json", "./src/exos/cosmosOrchestrationAccount.js/index.node") in package file:///Users/jovonni/Documents/projects/dapp-agoric-orca/contract/node_modules/@agoric/orchestration/',
  }

  › Object.execute (.../compartment-mapper/src/import-archive.js:52:7)
  › eval (.../dapp-agoric-orca-contract/src/orca.contract.js:1:242)
  › eval (.../dapp-agoric-orca-contract/src/orca.contract.js:107:3)
  › async importBundle (.../import-bundle/src/index.js:68:18)

  orca-contract › Start Orca contract using core-eval
  Rejected promise returned by test. Reason:

  Error {
    message: 'Cannot find file for internal module "./src/exos/cosmosOrchestrationAccount.js" (with candidates "./src/exos/cosmosOrchestrationAccount.js", "./src/exos/cosmosOrchestrationAccount.js.js", "./src/exos/cosmosOrchestrationAccount.js.json", "./src/exos/cosmosOrchestrationAccount.js.node", "./src/exos/cosmosOrchestrationAccount.js/index.js", "./src/exos/cosmosOrchestrationAccount.js/index.json", "./src/exos/cosmosOrchestrationAccount.js/index.node") in package file:///Users/jovonni/Documents/projects/dapp-agoric-orca/contract/node_modules/@agoric/orchestration/',
  }

  › Object.execute (.../compartment-mapper/src/import-archive.js:52:7)
  › eval (.../dapp-agoric-orca-contract/src/orca.contract.js:1:242)
  › eval (.../dapp-agoric-orca-contract/src/orca.contract.js:107:3)
  › async importBundle (.../import-bundle/src/index.js:68:18)

  ─

  2 tests failed
Jovonni commented 2 months ago

contract accepts offers from UI to make accounts. Must pass real connection-id etc:

Logging sent error stack (Error#7)
2024-06-28T06:01:15.236Z SwingSet: ls: v15: Error#7: No listeners for /ibc-hop/connection-1/ibc-port/icahost/ordered/{"version":"ics27-1","controllerConnectionId":"connection-1","hostConnectionId":"connection-0","address":"","encoding":"proto3","txType":"sdk_multi_msg"}
2024-06-28T06:01:15.237Z SwingSet: ls: v15: Error: No listeners for /ibc-hop/connection-1/ibc-port/icahost/ordered/{"version":"ics27-1","controllerConnectionId":"connection-1","hostConnectionId":"connection-0","address":"","encoding":"proto3","txType":"sdk_multi_msg"}
Jovonni commented 2 months ago

back to hunting this down after that last change, but we moved the createAccountsFn to top-level scope already:

https://github.com/Agoric/dapp-orchestration-basics/blob/40e55e3227017456a1453c0bd6af0dd682f8bf41/contract/src/orca.contract.js#L88

2024-07-01T19:52:10.529Z SwingSet: vat: v104: Warning for now: vow expected, not promise Promise [Promise] {} (Error#5)
2024-07-01T19:52:10.529Z SwingSet: vat: v104: Error#5: where warning happened
2024-07-01T19:52:10.529Z SwingSet: vat: v104: Error: where warning happened
 at apply ()
 at Error (/bundled-source/.../node_modules/ses/src/error/tame-error-constructor.js:54)
 at tolerateHostPromiseToVow (.../async-flow/src/replay-membrane.js:157)
 at performCall (.../async-flow/src/replay-membrane.js:196)
 at guestCallsHost (.../async-flow/src/replay-membrane.js:256)
 at createAccountsFn (.../dapp-agoric-orca-contract/src/orca.contract.js:105)
 at createAccountsFn (.../dapp-agoric-orca-contract/src/orca.contract.js:88)
 at (.../async-flow/src/async-flow.js:220)
 at restart (.../async-flow/src/async-flow.js:222)
 at apply ()
 at In "restart" method of (asyncFlow flow) (/bundled-source/.../node_modules/@endo/exo/src/exo-tools.js:171)
 at makeAsyncFlowKit (.../async-flow/src/async-flow.js:430)
 at asyncFlow_hostFlow (.../async-flow/src/async-flow.js:448)
 at orcFn (.../orchestration/src/facade.js:125)
 at apply ()
 at localApplyFunction (/bundled-source/.../node_modules/@endo/eventual-send/src/local.js:87)
 at apply ()
 at dispatchToHandler (/bundled-source/.../node_modules/@endo/eventual-send/src/handled-promise.js:156)
 at win (/bundled-source/.../node_modules/@endo/eventual-send/src/handled-promise.js:505)
 at ()

7:52PM INF Timed out dur=400 height=95171 module=consensus round=0 step=3
2024-07-01T19:52:10.585Z SwingSet: xsnap: v104: UnhandledPromiseRejectionWarning: (Error#6)
2024-07-01T19:52:10.619Z SwingSet: xsnap: v104: Error#6: value for vow is not durable: slot 0 of { body: '#{"#tag":"Vow","payload":{"vowV0":"$0.Alleged: VowInternalsKit vowV0"}}', slots: [ 'o+44' ] }
2024-07-01T19:52:10.619Z SwingSet: xsnap: v104: Error: value for (a string) is not durable: slot 0 of (an object)
 at apply ()
 at Error (/bundled-source/.../node_modules/ses/src/error/tame-error-constructor.js:54)
 at makeError (/bundled-source/.../node_modules/ses/src/error/assert.js:349)
 at fail (/bundled-source/.../node_modules/ses/src/error/assert.js:479)
 at insistDurableCapdata (/bundled-source/.../packages/swingset-liveslots/src/virtualObjectManager.js:241)
 at set (/bundled-source/.../packages/swingset-liveslots/src/virtualObjectManager.js:881)
 at onFulfilled (.../vow/src/watch.js:118)
 at apply ()
 at In "onFulfilled" method of (PromiseWatcher) (/bundled-source/.../node_modules/@endo/exo/src/exo-tools.js:171)
 at (/bundled-source/.../packages/swingset-liveslots/src/watchedPromises.js:115)
 at ()

and also ready added M.promise @dckc :

 const publicFacet = zone.exo(
    'OrcaFacet',
    M.interface('OrcaFacet', {
      makeAccountInvitation: M.call().returns(M.promise()),
    }),
    {
      async makeAccountInvitation() {
        const invitation = await zcf.makeInvitation(
          createAccounts,
          'Create accounts',
          undefined,
          harden({
            give: {},
            want: {},
            exit: M.any(),
          }),
        );
        // return Promise.resolve(invitation);
        return invitation;
        // return M.promise()
      },
    },
  );
dckc commented 1 month ago

I assume this is obsolete in favor of #10 taking myself off the reviewer list