@agoric/orchestration 0.1.1-dev-70bc20f.0 → 0.1.1-dev-2670a4e.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/orchestration",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-2670a4e.0+2670a4e",
|
|
4
4
|
"description": "Chain abstraction for Agoric's orchestration clients",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -33,19 +33,19 @@
|
|
|
33
33
|
},
|
|
34
34
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@agoric/async-flow": "0.1.1-dev-
|
|
37
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
38
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
39
|
-
"@agoric/internal": "0.3.3-dev-
|
|
40
|
-
"@agoric/network": "0.1.1-dev-
|
|
41
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
42
|
-
"@agoric/store": "0.9.3-dev-
|
|
43
|
-
"@agoric/time": "0.3.3-dev-
|
|
44
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
45
|
-
"@agoric/vats": "0.15.2-dev-
|
|
46
|
-
"@agoric/vow": "0.1.1-dev-
|
|
47
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
48
|
-
"@agoric/zone": "0.2.3-dev-
|
|
36
|
+
"@agoric/async-flow": "0.1.1-dev-2670a4e.0+2670a4e",
|
|
37
|
+
"@agoric/cosmic-proto": "0.4.1-dev-2670a4e.0+2670a4e",
|
|
38
|
+
"@agoric/ertp": "0.16.3-dev-2670a4e.0+2670a4e",
|
|
39
|
+
"@agoric/internal": "0.3.3-dev-2670a4e.0+2670a4e",
|
|
40
|
+
"@agoric/network": "0.1.1-dev-2670a4e.0+2670a4e",
|
|
41
|
+
"@agoric/notifier": "0.6.3-dev-2670a4e.0+2670a4e",
|
|
42
|
+
"@agoric/store": "0.9.3-dev-2670a4e.0+2670a4e",
|
|
43
|
+
"@agoric/time": "0.3.3-dev-2670a4e.0+2670a4e",
|
|
44
|
+
"@agoric/vat-data": "0.5.3-dev-2670a4e.0+2670a4e",
|
|
45
|
+
"@agoric/vats": "0.15.2-dev-2670a4e.0+2670a4e",
|
|
46
|
+
"@agoric/vow": "0.1.1-dev-2670a4e.0+2670a4e",
|
|
47
|
+
"@agoric/zoe": "0.26.3-dev-2670a4e.0+2670a4e",
|
|
48
|
+
"@agoric/zone": "0.2.3-dev-2670a4e.0+2670a4e",
|
|
49
49
|
"@endo/base64": "^1.0.7",
|
|
50
50
|
"@endo/errors": "^1.2.5",
|
|
51
51
|
"@endo/far": "^1.1.5",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@noble/hashes": "^1.5.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
57
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-2670a4e.0+2670a4e",
|
|
58
58
|
"@chain-registry/client": "^1.47.4",
|
|
59
59
|
"@cosmjs/amino": "^0.32.3",
|
|
60
60
|
"@cosmjs/proto-signing": "^0.32.3",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"typeCoverage": {
|
|
95
95
|
"atLeast": 97.3
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "2670a4e8482a4d3c9da9d1d5a58101ff20e1d444"
|
|
98
98
|
}
|
|
@@ -9,7 +9,6 @@ export function prepareOrchestrator(zone: Zone, powers: {
|
|
|
9
9
|
asyncFlowTools: AsyncFlowTools;
|
|
10
10
|
chainHub: ChainHub;
|
|
11
11
|
localchain: Remote<LocalChain>;
|
|
12
|
-
chainByName: MapStore<string, HostInterface<Chain<any>>>;
|
|
13
12
|
makeRecorderKit: MakeRecorderKit;
|
|
14
13
|
makeLocalChainFacade: MakeLocalChainFacade;
|
|
15
14
|
makeRemoteChainFacade: MakeRemoteChainFacade;
|
|
@@ -44,14 +43,14 @@ import type { AsyncFlowTools } from '@agoric/async-flow';
|
|
|
44
43
|
import type { ChainHub } from './chain-hub.js';
|
|
45
44
|
import type { LocalChain } from '@agoric/vats/src/localchain.js';
|
|
46
45
|
import type { Remote } from '@agoric/internal';
|
|
47
|
-
import type { Chain } from '../types.js';
|
|
48
|
-
import type { HostInterface } from '@agoric/async-flow';
|
|
49
46
|
import type { MakeRecorderKit } from '@agoric/zoe/src/contractSupport/recorder.js';
|
|
50
47
|
import type { MakeLocalChainFacade } from './local-chain-facade.js';
|
|
51
48
|
import type { MakeRemoteChainFacade } from './remote-chain-facade.js';
|
|
52
49
|
import type { CosmosInterchainService } from './exo-interfaces.js';
|
|
53
50
|
import type { TimerService } from '@agoric/time';
|
|
54
51
|
import type { VowTools } from '@agoric/vow';
|
|
52
|
+
import type { Chain } from '../types.js';
|
|
53
|
+
import type { HostInterface } from '@agoric/async-flow';
|
|
55
54
|
import type { Vow } from '@agoric/vow';
|
|
56
55
|
import type { Orchestrator } from '../types.js';
|
|
57
56
|
import type { HostOf } from '@agoric/async-flow';
|
|
@@ -61,7 +60,6 @@ import type { HostOf } from '@agoric/async-flow';
|
|
|
61
60
|
* asyncFlowTools: AsyncFlowTools;
|
|
62
61
|
* chainHub: ChainHub;
|
|
63
62
|
* localchain: Remote<LocalChain>;
|
|
64
|
-
* chainByName: MapStore<string, HostInterface<Chain>>;
|
|
65
63
|
* makeRecorderKit: MakeRecorderKit;
|
|
66
64
|
* makeLocalChainFacade: MakeLocalChainFacade;
|
|
67
65
|
* makeRemoteChainFacade: MakeRemoteChainFacade;
|
|
@@ -72,11 +70,10 @@ import type { HostOf } from '@agoric/async-flow';
|
|
|
72
70
|
* zcf: ZCF;
|
|
73
71
|
* }} powers
|
|
74
72
|
*/
|
|
75
|
-
declare function prepareOrchestratorKit(zone: Zone, { chainHub, localchain,
|
|
73
|
+
declare function prepareOrchestratorKit(zone: Zone, { chainHub, localchain, makeLocalChainFacade, makeRemoteChainFacade, vowTools: { watch, asVow }, }: {
|
|
76
74
|
asyncFlowTools: AsyncFlowTools;
|
|
77
75
|
chainHub: ChainHub;
|
|
78
76
|
localchain: Remote<LocalChain>;
|
|
79
|
-
chainByName: MapStore<string, HostInterface<Chain<any>>>;
|
|
80
77
|
makeRecorderKit: MakeRecorderKit;
|
|
81
78
|
makeLocalChainFacade: MakeLocalChainFacade;
|
|
82
79
|
makeRemoteChainFacade: MakeRemoteChainFacade;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["orchestrator.js"],"names":[],"mappings":"AAmCA,0BAA0B;AAC1B;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["orchestrator.js"],"names":[],"mappings":"AAmCA,0BAA0B;AAC1B;;;;;GAKG;AA6JI,0CAfI,IAAI,UACJ;IACN,cAAc,EAAE,cAAc,CAAC;IAC/B,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,OAAO,UAAU,CAAC,CAAC;IAC/B,eAAe,EAAE,eAAe,CAAC;IACjC,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,oBAAoB,EAAE,OAAO,uBAAuB,CAAC,CAAC;IACtD,WAAW,EAAE,OAAO,WAAW,CAAC,CAAC;IACjC,YAAY,EAAE,OAAO,YAAY,CAAC,CAAC;IACnC,QAAQ,EAAE,QAAQ,CAAC;IACnB,GAAG,EAAE,GAAG,CAAC;CACV;IApEI,+CAA+C;;;;;;;;;;IAyB/C,mDAAmD;;IAqBnD,+CAA+C;cAApC,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC;GA2BlD;;;;;+BAMY,UAAU,CAClB,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAC1C,CAAC,cAAc,CAAC;0BAhMG,mBAAmB;oCAEc,oBAAoB;8BADhC,gBAAgB;gCAI/B,gCAAgC;4BAEpC,kBAAkB;qCADI,6CAA6C;0CAIrD,yBAAyB;2CACxB,0BAA0B;6CAFxB,qBAAqB;kCALhC,cAAc;8BADb,aAAa;2BASuB,aAAa;mCAVzB,oBAAoB;yBAC5C,aAAa;kCASuB,aAAa;4BAVzB,oBAAoB;AAwB5E;;;;;;;;;;;;;;;GAeG;AACH,8CAfW,IAAI,sGACJ;IACN,cAAc,EAAE,cAAc,CAAC;IAC/B,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,OAAO,UAAU,CAAC,CAAC;IAC/B,eAAe,EAAE,eAAe,CAAC;IACjC,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,oBAAoB,EAAE,OAAO,uBAAuB,CAAC,CAAC;IACtD,WAAW,EAAE,OAAO,WAAW,CAAC,CAAC;IACjC,YAAY,EAAE,OAAO,YAAY,CAAC,CAAC;IACnC,QAAQ,EAAE,QAAQ,CAAC;IACnB,GAAG,EAAE,GAAG,CAAC;CACV;IAyCE,2DAA2D;;QAEzD;;WAEG;qCADQ,gBAAgB,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;IAQtC;;;OAGG;;QAED;;;;;;WAMG;0HADQ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;QASjB,+CAA+C;;;;;;;;;;QAyB/C,mDAAmD;;QAqBnD,+CAA+C;kBAApC,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC;;GAKlD;qCAjK2C,gBAAgB;uCAWQ,aAAa;+BAAb,aAAa"}
|
package/src/exos/orchestrator.js
CHANGED
|
@@ -47,7 +47,6 @@ export const OrchestratorI = M.interface('Orchestrator', {
|
|
|
47
47
|
* asyncFlowTools: AsyncFlowTools;
|
|
48
48
|
* chainHub: ChainHub;
|
|
49
49
|
* localchain: Remote<LocalChain>;
|
|
50
|
-
* chainByName: MapStore<string, HostInterface<Chain>>;
|
|
51
50
|
* makeRecorderKit: MakeRecorderKit;
|
|
52
51
|
* makeLocalChainFacade: MakeLocalChainFacade;
|
|
53
52
|
* makeRemoteChainFacade: MakeRemoteChainFacade;
|
|
@@ -63,13 +62,20 @@ const prepareOrchestratorKit = (
|
|
|
63
62
|
{
|
|
64
63
|
chainHub,
|
|
65
64
|
localchain,
|
|
66
|
-
chainByName,
|
|
67
65
|
makeLocalChainFacade,
|
|
68
66
|
makeRemoteChainFacade,
|
|
69
67
|
vowTools: { watch, asVow },
|
|
70
68
|
},
|
|
71
|
-
) =>
|
|
72
|
-
|
|
69
|
+
) => {
|
|
70
|
+
/**
|
|
71
|
+
* @template T
|
|
72
|
+
* @typedef {{ vow: Vow<T>; pending: true } | { value: T; pending: false }} MaybePendingValue
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
/** @type {MapStore<string, MaybePendingValue<HostInterface<Chain>>>} */
|
|
76
|
+
const chainByName = zone.mapStore('chainName');
|
|
77
|
+
|
|
78
|
+
return zone.exoClassKit(
|
|
73
79
|
'Orchestrator',
|
|
74
80
|
{
|
|
75
81
|
orchestrator: OrchestratorI,
|
|
@@ -97,7 +103,7 @@ const prepareOrchestratorKit = (
|
|
|
97
103
|
*/
|
|
98
104
|
onFulfilled(agoricChainInfo) {
|
|
99
105
|
const it = makeLocalChainFacade(agoricChainInfo);
|
|
100
|
-
chainByName.
|
|
106
|
+
chainByName.set('agoric', harden({ value: it, pending: false }));
|
|
101
107
|
return it;
|
|
102
108
|
},
|
|
103
109
|
},
|
|
@@ -115,27 +121,32 @@ const prepareOrchestratorKit = (
|
|
|
115
121
|
*/
|
|
116
122
|
onFulfilled([_agoricChainInfo, remoteChainInfo, connectionInfo], name) {
|
|
117
123
|
const it = makeRemoteChainFacade(remoteChainInfo, connectionInfo);
|
|
118
|
-
chainByName.
|
|
124
|
+
chainByName.set(name, harden({ value: it, pending: false }));
|
|
119
125
|
return it;
|
|
120
126
|
},
|
|
121
127
|
},
|
|
122
128
|
orchestrator: {
|
|
123
129
|
/** @type {HostOf<Orchestrator['getChain']>} */
|
|
124
130
|
getChain(name) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
131
|
+
return asVow(() => {
|
|
132
|
+
if (chainByName.has(name)) {
|
|
133
|
+
const maybeChain = chainByName.get(name);
|
|
134
|
+
return maybeChain.pending ? maybeChain.vow : maybeChain.value;
|
|
135
|
+
}
|
|
136
|
+
const vow =
|
|
137
|
+
name === 'agoric'
|
|
138
|
+
? watch(
|
|
139
|
+
chainHub.getChainInfo('agoric'),
|
|
140
|
+
this.facets.makeLocalChainFacadeWatcher,
|
|
141
|
+
)
|
|
142
|
+
: watch(
|
|
143
|
+
chainHub.getChainsAndConnection('agoric', name),
|
|
144
|
+
this.facets.makeRemoteChainFacadeWatcher,
|
|
145
|
+
name,
|
|
146
|
+
);
|
|
147
|
+
chainByName.init(name, harden({ vow, pending: true }));
|
|
148
|
+
return vow;
|
|
149
|
+
});
|
|
139
150
|
},
|
|
140
151
|
makeLocalAccount() {
|
|
141
152
|
return watch(E(localchain).makeAccount());
|
|
@@ -147,10 +158,18 @@ const prepareOrchestratorKit = (
|
|
|
147
158
|
const { chainName, baseName, baseDenom, brand } = denomDetail;
|
|
148
159
|
chainByName.has(chainName) ||
|
|
149
160
|
Fail`use getChain(${q(chainName)}) before getDenomInfo(${q(denom)})`;
|
|
150
|
-
const
|
|
161
|
+
const maybeChain = chainByName.get(chainName);
|
|
162
|
+
if (maybeChain.pending) {
|
|
163
|
+
throw Fail`wait until getChain(${q(chainName)}) completes before getDenomInfo(${q(denom)})`;
|
|
164
|
+
}
|
|
165
|
+
const chain = maybeChain.value;
|
|
151
166
|
chainByName.has(baseName) ||
|
|
152
167
|
Fail`use getChain(${q(baseName)}) before getDenomInfo(${q(denom)})`;
|
|
153
|
-
const
|
|
168
|
+
const maybeBase = chainByName.get(baseName);
|
|
169
|
+
if (maybeBase.pending) {
|
|
170
|
+
throw Fail`wait until getChain(${q(baseName)}) completes before getDenomInfo(${q(denom)})`;
|
|
171
|
+
}
|
|
172
|
+
const base = maybeBase.value;
|
|
154
173
|
return harden({ chain, base, brand, baseDenom });
|
|
155
174
|
},
|
|
156
175
|
/** @type {HostOf<Orchestrator['asAmount']>} */
|
|
@@ -158,6 +177,7 @@ const prepareOrchestratorKit = (
|
|
|
158
177
|
},
|
|
159
178
|
},
|
|
160
179
|
);
|
|
180
|
+
};
|
|
161
181
|
harden(prepareOrchestratorKit);
|
|
162
182
|
|
|
163
183
|
/**
|
|
@@ -166,7 +186,6 @@ harden(prepareOrchestratorKit);
|
|
|
166
186
|
* asyncFlowTools: AsyncFlowTools;
|
|
167
187
|
* chainHub: ChainHub;
|
|
168
188
|
* localchain: Remote<LocalChain>;
|
|
169
|
-
* chainByName: MapStore<string, HostInterface<Chain>>;
|
|
170
189
|
* makeRecorderKit: MakeRecorderKit;
|
|
171
190
|
* makeLocalChainFacade: MakeLocalChainFacade;
|
|
172
191
|
* makeRemoteChainFacade: MakeRemoteChainFacade;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-helper.d.ts","sourceRoot":"","sources":["start-helper.js"],"names":[],"mappings":"AA8CO,0CANI,GAAG,WACH,OAAO,gBACP,mBAAmB,cACnB,UAAU;+
|
|
1
|
+
{"version":3,"file":"start-helper.d.ts","sourceRoot":"","sources":["start-helper.js"],"names":[],"mappings":"AA8CO,0CANI,GAAG,WACH,OAAO,gBACP,mBAAmB,cACnB,UAAU;+BA4GR,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BhB;AA8BM,kCAdgC,EAAE,SAA3B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAE,EAGhC,EAAE,SAFM,mBAAmB,GAAG;IAC/B,UAAU,EAAE,UAAU,CAAC;CACvB,EACQ,CAAC,cACH,CACN,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,EACZ,WAAW,EAAE,EAAE,EACf,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,kBAAkB,KACtB,OAAO,CAAC,CAAC,CAAC,GACL,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CAYzE;kCAjMU;IACR,UAAU,EAAE,OAAO,UAAU,CAAC,CAAC;IAC/B,oBAAoB,EAAE,OAAO,uBAAuB,CAAC,CAAC;IACtD,WAAW,EAAE,OAAO,WAAW,CAAC,CAAC;IACjC,YAAY,EAAE,OAAO,YAAY,CAAC,CAAC;IACnC,WAAW,EAAE,OAAO,OAAO,CAAC,CAAC;CAC9B;iCAuJU,IAAI,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,EAAE,MAAM,CAAC;6BArKzC,kBAAkB;0BAGrB,cAAc;gCALR,gCAAgC;4BAIpC,aAAa;6CAEI,2BAA2B;kCAL1B,cAAc;6BAE/B,cAAc"}
|
|
@@ -129,13 +129,10 @@ export const provideOrchestration = (
|
|
|
129
129
|
vowTools,
|
|
130
130
|
});
|
|
131
131
|
|
|
132
|
-
const chainByName = zones.orchestration.mapStore('chainName');
|
|
133
|
-
|
|
134
132
|
const makeOrchestrator = prepareOrchestrator(zones.orchestration, {
|
|
135
133
|
asyncFlowTools,
|
|
136
134
|
chainHub,
|
|
137
135
|
localchain: remotePowers.localchain,
|
|
138
|
-
chainByName,
|
|
139
136
|
makeRecorderKit,
|
|
140
137
|
makeLocalChainFacade,
|
|
141
138
|
makeRemoteChainFacade,
|