@agoric/orchestration 0.1.1-dev-50c9518.0 → 0.1.1-dev-d15cb41.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 +14 -14
- package/src/proposals/orchestration-proposal.js +5 -14
- package/src/service.js +6 -9
- package/src/types.d.ts +0 -2
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-d15cb41.0+d15cb41",
|
|
4
4
|
"description": "Chain abstraction for Agoric's orchestration clients",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -29,18 +29,18 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@agoric/assert": "0.6.1-dev-
|
|
33
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
34
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
35
|
-
"@agoric/internal": "0.3.3-dev-
|
|
36
|
-
"@agoric/network": "0.1.1-dev-
|
|
37
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
38
|
-
"@agoric/store": "0.9.3-dev-
|
|
39
|
-
"@agoric/time": "0.3.3-dev-
|
|
40
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
41
|
-
"@agoric/vats": "0.15.2-dev-
|
|
42
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
43
|
-
"@agoric/zone": "0.2.3-dev-
|
|
32
|
+
"@agoric/assert": "0.6.1-dev-d15cb41.0+d15cb41",
|
|
33
|
+
"@agoric/cosmic-proto": "0.4.1-dev-d15cb41.0+d15cb41",
|
|
34
|
+
"@agoric/ertp": "0.16.3-dev-d15cb41.0+d15cb41",
|
|
35
|
+
"@agoric/internal": "0.3.3-dev-d15cb41.0+d15cb41",
|
|
36
|
+
"@agoric/network": "0.1.1-dev-d15cb41.0+d15cb41",
|
|
37
|
+
"@agoric/notifier": "0.6.3-dev-d15cb41.0+d15cb41",
|
|
38
|
+
"@agoric/store": "0.9.3-dev-d15cb41.0+d15cb41",
|
|
39
|
+
"@agoric/time": "0.3.3-dev-d15cb41.0+d15cb41",
|
|
40
|
+
"@agoric/vat-data": "0.5.3-dev-d15cb41.0+d15cb41",
|
|
41
|
+
"@agoric/vats": "0.15.2-dev-d15cb41.0+d15cb41",
|
|
42
|
+
"@agoric/zoe": "0.26.3-dev-d15cb41.0+d15cb41",
|
|
43
|
+
"@agoric/zone": "0.2.3-dev-d15cb41.0+d15cb41",
|
|
44
44
|
"@endo/base64": "^1.0.4",
|
|
45
45
|
"@endo/far": "^1.1.1",
|
|
46
46
|
"@endo/marshal": "^1.4.1",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"typeCoverage": {
|
|
83
83
|
"atLeast": 96.39
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "d15cb41b5dc7d3c47a1bc4c034ae74adfc7f838a"
|
|
86
86
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
import { V as E } from '@agoric/vat-data/vow.js';
|
|
3
|
-
import { Far } from '@endo/far';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
|
-
* @import { AttenuatedNetwork } from '../types'
|
|
7
5
|
* @import { OrchestrationService } from '../service.js'
|
|
8
6
|
* @import { OrchestrationVat } from '../vat-orchestration.js'
|
|
9
7
|
*/
|
|
@@ -12,7 +10,7 @@ import { Far } from '@endo/far';
|
|
|
12
10
|
* @param {BootstrapPowers & {
|
|
13
11
|
* consume: {
|
|
14
12
|
* loadCriticalVat: VatLoader<any>;
|
|
15
|
-
*
|
|
13
|
+
* portAllocator: PortAllocator;
|
|
16
14
|
* };
|
|
17
15
|
* produce: {
|
|
18
16
|
* orchestration: Producer<any>;
|
|
@@ -29,7 +27,7 @@ import { Far } from '@endo/far';
|
|
|
29
27
|
*/
|
|
30
28
|
export const setupOrchestrationVat = async (
|
|
31
29
|
{
|
|
32
|
-
consume: { loadCriticalVat,
|
|
30
|
+
consume: { loadCriticalVat, portAllocator: portAllocatorP },
|
|
33
31
|
produce: {
|
|
34
32
|
orchestrationVat,
|
|
35
33
|
orchestration,
|
|
@@ -49,17 +47,10 @@ export const setupOrchestrationVat = async (
|
|
|
49
47
|
orchestrationVat.reset();
|
|
50
48
|
orchestrationVat.resolve(vats.orchestration);
|
|
51
49
|
|
|
52
|
-
await
|
|
53
|
-
/** @type {AttenuatedNetwork} */
|
|
54
|
-
const network = Far('Attenuated Network', {
|
|
55
|
-
/** @param {string} localAddr */
|
|
56
|
-
async bindPort(localAddr) {
|
|
57
|
-
return E(networkVat).bindPort(localAddr);
|
|
58
|
-
},
|
|
59
|
-
});
|
|
50
|
+
const portAllocator = await portAllocatorP;
|
|
60
51
|
|
|
61
52
|
const newOrchestrationKit = await E(vats.orchestration).makeOrchestration({
|
|
62
|
-
|
|
53
|
+
portAllocator,
|
|
63
54
|
});
|
|
64
55
|
|
|
65
56
|
orchestration.reset();
|
|
@@ -88,7 +79,7 @@ export const getManifestForOrchestration = (_powers, { orchestrationRef }) => ({
|
|
|
88
79
|
[setupOrchestrationVat.name]: {
|
|
89
80
|
consume: {
|
|
90
81
|
loadCriticalVat: true,
|
|
91
|
-
|
|
82
|
+
portAllocator: 'portAllocator',
|
|
92
83
|
},
|
|
93
84
|
produce: {
|
|
94
85
|
orchestration: 'orchestration',
|
package/src/service.js
CHANGED
|
@@ -11,10 +11,11 @@ import { makeICAConnectionAddress, parseAddress } from './utils/address.js';
|
|
|
11
11
|
import { makeTxPacket, parsePacketAck } from './utils/tx.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* @import {
|
|
14
|
+
* @import { ChainAccount, ChainAddress } from './types.js';
|
|
15
15
|
* @import { IBCConnectionID } from '@agoric/vats';
|
|
16
16
|
* @import { Zone } from '@agoric/base-zone';
|
|
17
17
|
* @import { TxBody } from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
|
|
18
|
+
*
|
|
18
19
|
*/
|
|
19
20
|
|
|
20
21
|
const { Fail, bare } = assert;
|
|
@@ -24,7 +25,7 @@ const trace = makeTracer('Orchestration');
|
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
27
|
* @typedef {object} OrchestrationPowers
|
|
27
|
-
* @property {ERef<
|
|
28
|
+
* @property {ERef<PortAllocator>} portAllocator
|
|
28
29
|
*/
|
|
29
30
|
|
|
30
31
|
/**
|
|
@@ -232,17 +233,13 @@ const prepareOrchestration = (zone, createChainAccount) =>
|
|
|
232
233
|
powers.init(/** @type {keyof OrchestrationPowers} */ (name), power);
|
|
233
234
|
}
|
|
234
235
|
}
|
|
235
|
-
return { powers
|
|
236
|
+
return { powers };
|
|
236
237
|
},
|
|
237
238
|
{
|
|
238
239
|
self: {
|
|
239
240
|
async bindPort() {
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
`/ibc-port/icacontroller-${this.state.icaControllerNonce}`,
|
|
243
|
-
);
|
|
244
|
-
this.state.icaControllerNonce += 1;
|
|
245
|
-
return port;
|
|
241
|
+
const portAllocator = getPower(this.state.powers, 'portAllocator');
|
|
242
|
+
return E(portAllocator).allocateICAControllerPort();
|
|
246
243
|
},
|
|
247
244
|
},
|
|
248
245
|
public: {
|
package/src/types.d.ts
CHANGED
|
@@ -13,8 +13,6 @@ import type {
|
|
|
13
13
|
UnbondingDelegation,
|
|
14
14
|
} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
|
|
15
15
|
|
|
16
|
-
export type AttenuatedNetwork = Pick<RouterProtocol, 'bindPort'>;
|
|
17
|
-
|
|
18
16
|
/**
|
|
19
17
|
* static declaration of known chain types will allow type support for
|
|
20
18
|
* additional chain-specific operations like `liquidStake`
|