wao 0.25.1 → 0.25.4
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/cjs/ao.js +249 -116
- package/cjs/armem-base.js +6 -5
- package/cjs/hb.js +125 -66
- package/cjs/hyperbeam.js +140 -28
- package/cjs/lua/aos_wamr.js +1 -0
- package/cjs/lua/hyper-aos.js +1 -0
- package/cjs/signer.js +35 -6
- package/cjs/utils.js +2 -1
- package/esm/ao.js +106 -43
- package/esm/armem-base.js +5 -2
- package/esm/hb.js +36 -14
- package/esm/hyperbeam.js +59 -14
- package/esm/lua/aos_wamr.js +1 -0
- package/esm/lua/hyper-aos.js +1 -0
- package/esm/signer.js +21 -4
- package/esm/utils.js +3 -1
- package/package.json +1 -1
- package/cjs/lua/aos2-wamr.wasm +0 -0
- package/cjs/lua/hyper-aos.lua +0 -2563
- package/esm/lua/aos2-wamr.wasm +0 -0
- package/esm/lua/hyper-aos.lua +0 -2563
package/cjs/armem-base.js
CHANGED
|
@@ -225,7 +225,8 @@ var ArMemBase = exports["default"] = /*#__PURE__*/function () {
|
|
|
225
225
|
this.msgs = {};
|
|
226
226
|
this.wasms = {
|
|
227
227
|
"ISShJH1ij-hPPt9St5UFFr_8Ys3Kj5cyg7zrMGt7H9s": {
|
|
228
|
-
file: "aos2_0_6"
|
|
228
|
+
file: "aos2_0_6",
|
|
229
|
+
variant: "ao.TN.1"
|
|
229
230
|
},
|
|
230
231
|
"WASM32-D8q2OmZ4Mok00sD2Y_6SYEQ7Hjx-6VZ_jl3g": {
|
|
231
232
|
file: "aos2_0_4_32",
|
|
@@ -248,7 +249,7 @@ var ArMemBase = exports["default"] = /*#__PURE__*/function () {
|
|
|
248
249
|
}
|
|
249
250
|
var txs = [];
|
|
250
251
|
for (var key in this.wasms) {
|
|
251
|
-
var
|
|
252
|
+
var _ref2, _w$variant, _w$format, _w$input_encoding, _w$output_encoding, _w$memory_limit, _w$compute_limit, _w$extension;
|
|
252
253
|
var w = this.wasms[key];
|
|
253
254
|
txs.push(key);
|
|
254
255
|
this.txs[key] = {
|
|
@@ -256,7 +257,7 @@ var ArMemBase = exports["default"] = /*#__PURE__*/function () {
|
|
|
256
257
|
block: 0,
|
|
257
258
|
tags: (0, _utils.buildTags)(null, {
|
|
258
259
|
"Data-Protocol": "ao",
|
|
259
|
-
Variant: (
|
|
260
|
+
Variant: (_ref2 = (_w$variant = w.variant) !== null && _w$variant !== void 0 ? _w$variant : this.variant) !== null && _ref2 !== void 0 ? _ref2 : "ao.TN.1",
|
|
260
261
|
Type: "Module",
|
|
261
262
|
"Module-Format": (_w$format = w.format) !== null && _w$format !== void 0 ? _w$format : "wasm64-unknown-emscripten-draft_2024_02_15",
|
|
262
263
|
"Input-Encoding": (_w$input_encoding = w.input_encoding) !== null && _w$input_encoding !== void 0 ? _w$input_encoding : "JSON-V1",
|
|
@@ -268,7 +269,7 @@ var ArMemBase = exports["default"] = /*#__PURE__*/function () {
|
|
|
268
269
|
};
|
|
269
270
|
}
|
|
270
271
|
if (this.scheduler && this.SU_URL) {
|
|
271
|
-
var _this$
|
|
272
|
+
var _this$variant;
|
|
272
273
|
var _key = this.scheduler;
|
|
273
274
|
txs.push(_key);
|
|
274
275
|
this.addrmap[this.scheduler] = {
|
|
@@ -280,7 +281,7 @@ var ArMemBase = exports["default"] = /*#__PURE__*/function () {
|
|
|
280
281
|
owner: this.scheduler,
|
|
281
282
|
tags: (0, _utils.buildTags)(null, {
|
|
282
283
|
"Data-Protocol": "ao",
|
|
283
|
-
Variant: (_this$
|
|
284
|
+
Variant: (_this$variant = this.variant) !== null && _this$variant !== void 0 ? _this$variant : "ao.TN.1",
|
|
284
285
|
Type: "Scheduler-Location",
|
|
285
286
|
Url: this.SU_URL,
|
|
286
287
|
"Time-To-Live": 1000 * 60 * 60 * 24 * 365 * 10
|
package/cjs/hb.js
CHANGED
|
@@ -10,7 +10,10 @@ var _utils = require("./utils.js");
|
|
|
10
10
|
var _signer = require("./signer.js");
|
|
11
11
|
var _path4 = require("path");
|
|
12
12
|
var _fs = require("fs");
|
|
13
|
+
var _hyperAos = _interopRequireDefault(require("./lua/hyper-aos.js"));
|
|
14
|
+
var _aos_wamr = _interopRequireDefault(require("./lua/aos_wamr.js"));
|
|
13
15
|
var _excluded = ["path"];
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
17
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
15
18
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
16
19
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
@@ -44,8 +47,11 @@ var HB = /*#__PURE__*/function () {
|
|
|
44
47
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
45
48
|
_ref$url = _ref.url,
|
|
46
49
|
url = _ref$url === void 0 ? "http://localhost:10001" : _ref$url,
|
|
50
|
+
_ref$cu = _ref.cu,
|
|
51
|
+
cu = _ref$cu === void 0 ? "http://localhost:6363" : _ref$cu,
|
|
47
52
|
jwk = _ref.jwk;
|
|
48
53
|
_classCallCheck(this, HB);
|
|
54
|
+
this.cu = cu;
|
|
49
55
|
this.url = url;
|
|
50
56
|
this.dev = {};
|
|
51
57
|
this.dev.hyperbuddy = {
|
|
@@ -332,7 +338,7 @@ var HB = /*#__PURE__*/function () {
|
|
|
332
338
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
333
339
|
while (1) switch (_context10.prev = _context10.next) {
|
|
334
340
|
case 0:
|
|
335
|
-
wasm =
|
|
341
|
+
wasm = Buffer.from(_aos_wamr["default"], "base64");
|
|
336
342
|
_context10.next = 3;
|
|
337
343
|
return this.cacheModule(wasm, "application/wasm");
|
|
338
344
|
case 3:
|
|
@@ -359,7 +365,7 @@ var HB = /*#__PURE__*/function () {
|
|
|
359
365
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
360
366
|
while (1) switch (_context11.prev = _context11.next) {
|
|
361
367
|
case 0:
|
|
362
|
-
lua =
|
|
368
|
+
lua = Buffer.from(_hyperAos["default"], "base64");
|
|
363
369
|
_context11.next = 3;
|
|
364
370
|
return this.cacheModule(lua, "application/lua");
|
|
365
371
|
case 3:
|
|
@@ -1025,6 +1031,7 @@ var HB = /*#__PURE__*/function () {
|
|
|
1025
1031
|
Type: "Process",
|
|
1026
1032
|
image: image,
|
|
1027
1033
|
"execution-device": "stack@1.0",
|
|
1034
|
+
"push-device": "push@1.0",
|
|
1028
1035
|
"device-stack": ["wasi@1.0", "json-iface@1.0", "wasm-64@1.0", "patch@1.0", "multipass@1.0"],
|
|
1029
1036
|
"output-prefix": "wasm",
|
|
1030
1037
|
"patch-from": "/results/outbox",
|
|
@@ -1103,6 +1110,7 @@ var HB = /*#__PURE__*/function () {
|
|
|
1103
1110
|
Type: "Process",
|
|
1104
1111
|
module: lua,
|
|
1105
1112
|
"execution-device": "lua@5.3a",
|
|
1113
|
+
"push-device": "push@1.0",
|
|
1106
1114
|
"patch-from": "/results/outbox"
|
|
1107
1115
|
});
|
|
1108
1116
|
case 18:
|
|
@@ -1318,10 +1326,11 @@ var HB = /*#__PURE__*/function () {
|
|
|
1318
1326
|
Authority: this._info.address,
|
|
1319
1327
|
"scheduler-location": this._info.address,
|
|
1320
1328
|
"random-seed": seed(16),
|
|
1321
|
-
module: "ISShJH1ij-hPPt9St5UFFr_8Ys3Kj5cyg7zrMGt7H9s",
|
|
1329
|
+
module: module !== null && module !== void 0 ? module : "ISShJH1ij-hPPt9St5UFFr_8Ys3Kj5cyg7zrMGt7H9s",
|
|
1322
1330
|
device: "process@1.0",
|
|
1323
1331
|
"scheduler-device": "scheduler@1.0",
|
|
1324
1332
|
"execution-device": "stack@1.0",
|
|
1333
|
+
"push-device": "push@1.0",
|
|
1325
1334
|
"device-stack": ["genesis-wasm@1.0", "patch@1.0"],
|
|
1326
1335
|
"patch-from": "/results/outbox",
|
|
1327
1336
|
"stack-keys": ["init", "compute", "snapshot", "normalize"]
|
|
@@ -1342,43 +1351,93 @@ var HB = /*#__PURE__*/function () {
|
|
|
1342
1351
|
return spawnLegacy;
|
|
1343
1352
|
}()
|
|
1344
1353
|
}, {
|
|
1345
|
-
key: "
|
|
1354
|
+
key: "results",
|
|
1346
1355
|
value: function () {
|
|
1347
|
-
var
|
|
1356
|
+
var _results = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
|
|
1348
1357
|
var _ref15,
|
|
1349
|
-
|
|
1358
|
+
process,
|
|
1359
|
+
limit,
|
|
1360
|
+
_ref15$sort,
|
|
1361
|
+
sort,
|
|
1362
|
+
from,
|
|
1363
|
+
to,
|
|
1364
|
+
params,
|
|
1365
|
+
addParam,
|
|
1366
|
+
res,
|
|
1367
|
+
_args34 = arguments;
|
|
1368
|
+
return _regeneratorRuntime().wrap(function _callee34$(_context34) {
|
|
1369
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
1370
|
+
case 0:
|
|
1371
|
+
_ref15 = _args34.length > 0 && _args34[0] !== undefined ? _args34[0] : {}, process = _ref15.process, limit = _ref15.limit, _ref15$sort = _ref15.sort, sort = _ref15$sort === void 0 ? "DESC" : _ref15$sort, from = _ref15.from, to = _ref15.to;
|
|
1372
|
+
params = "";
|
|
1373
|
+
addParam = function addParam(key, val) {
|
|
1374
|
+
params += params === "" ? "?" : "&";
|
|
1375
|
+
params += "".concat(key, "=").concat(val);
|
|
1376
|
+
};
|
|
1377
|
+
if (limit) addParam("limit", limit);
|
|
1378
|
+
if (sort) addParam("sort", sort);
|
|
1379
|
+
if (from) addParam("from", from);
|
|
1380
|
+
if (to) addParam("to", to);
|
|
1381
|
+
_context34.next = 9;
|
|
1382
|
+
return this.post({
|
|
1383
|
+
path: "/~relay@1.0/call",
|
|
1384
|
+
method: "GET",
|
|
1385
|
+
"relay-path": "".concat(this.cu, "/results/").concat(process).concat(params),
|
|
1386
|
+
"content-type": "application/json"
|
|
1387
|
+
});
|
|
1388
|
+
case 9:
|
|
1389
|
+
res = _context34.sent;
|
|
1390
|
+
return _context34.abrupt("return", JSON.parse(res.body));
|
|
1391
|
+
case 11:
|
|
1392
|
+
case "end":
|
|
1393
|
+
return _context34.stop();
|
|
1394
|
+
}
|
|
1395
|
+
}, _callee34, this);
|
|
1396
|
+
}));
|
|
1397
|
+
function results() {
|
|
1398
|
+
return _results.apply(this, arguments);
|
|
1399
|
+
}
|
|
1400
|
+
return results;
|
|
1401
|
+
}()
|
|
1402
|
+
}, {
|
|
1403
|
+
key: "dryrun",
|
|
1404
|
+
value: function () {
|
|
1405
|
+
var _dryrun = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee35() {
|
|
1406
|
+
var _ref16,
|
|
1407
|
+
_ref16$tags,
|
|
1350
1408
|
tags,
|
|
1351
1409
|
pid,
|
|
1352
1410
|
action,
|
|
1353
1411
|
data,
|
|
1354
1412
|
json,
|
|
1355
1413
|
res,
|
|
1356
|
-
|
|
1357
|
-
return _regeneratorRuntime().wrap(function
|
|
1358
|
-
while (1) switch (
|
|
1414
|
+
_args35 = arguments;
|
|
1415
|
+
return _regeneratorRuntime().wrap(function _callee35$(_context35) {
|
|
1416
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
1359
1417
|
case 0:
|
|
1360
|
-
|
|
1418
|
+
_ref16 = _args35.length > 0 && _args35[0] !== undefined ? _args35[0] : {}, _ref16$tags = _ref16.tags, tags = _ref16$tags === void 0 ? {} : _ref16$tags, pid = _ref16.pid, action = _ref16.action, data = _ref16.data;
|
|
1361
1419
|
if (typeof action === "string") tags.Action = action;
|
|
1362
1420
|
json = {
|
|
1363
|
-
Tags: (0, _utils.buildTags)(tags)
|
|
1421
|
+
Tags: (0, _utils.buildTags)(_objectSpread({}, tags)),
|
|
1422
|
+
Owner: this.addr
|
|
1364
1423
|
};
|
|
1365
1424
|
if (data) json.Data = data;
|
|
1366
|
-
|
|
1425
|
+
_context35.next = 6;
|
|
1367
1426
|
return this.post({
|
|
1368
1427
|
path: "/~relay@1.0/call",
|
|
1369
|
-
|
|
1370
|
-
"relay-path": "/dry-run?process-id=".concat(pid),
|
|
1428
|
+
method: "POST",
|
|
1429
|
+
"relay-path": "".concat(this.cu, "/dry-run?process-id=").concat(pid),
|
|
1371
1430
|
"content-type": "application/json",
|
|
1372
|
-
body: JSON.stringify(json)
|
|
1431
|
+
"relay-body": JSON.stringify(json)
|
|
1373
1432
|
});
|
|
1374
1433
|
case 6:
|
|
1375
|
-
res =
|
|
1376
|
-
return
|
|
1434
|
+
res = _context35.sent;
|
|
1435
|
+
return _context35.abrupt("return", JSON.parse(res.body));
|
|
1377
1436
|
case 8:
|
|
1378
1437
|
case "end":
|
|
1379
|
-
return
|
|
1438
|
+
return _context35.stop();
|
|
1380
1439
|
}
|
|
1381
|
-
},
|
|
1440
|
+
}, _callee35, this);
|
|
1382
1441
|
}));
|
|
1383
1442
|
function dryrun() {
|
|
1384
1443
|
return _dryrun.apply(this, arguments);
|
|
@@ -1388,27 +1447,27 @@ var HB = /*#__PURE__*/function () {
|
|
|
1388
1447
|
}, {
|
|
1389
1448
|
key: "post",
|
|
1390
1449
|
value: function () {
|
|
1391
|
-
var _post = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1450
|
+
var _post = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee36(obj, json) {
|
|
1392
1451
|
var _json;
|
|
1393
|
-
return _regeneratorRuntime().wrap(function
|
|
1394
|
-
while (1) switch (
|
|
1452
|
+
return _regeneratorRuntime().wrap(function _callee36$(_context36) {
|
|
1453
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
1395
1454
|
case 0:
|
|
1396
1455
|
_json = json ? "/~json@1.0/serialize" : "";
|
|
1397
1456
|
obj.path += _json;
|
|
1398
|
-
|
|
1399
|
-
|
|
1457
|
+
_context36.t0 = this;
|
|
1458
|
+
_context36.next = 5;
|
|
1400
1459
|
return this.sign(obj);
|
|
1401
1460
|
case 5:
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
return
|
|
1461
|
+
_context36.t1 = _context36.sent;
|
|
1462
|
+
_context36.next = 8;
|
|
1463
|
+
return _context36.t0.send.call(_context36.t0, _context36.t1);
|
|
1405
1464
|
case 8:
|
|
1406
|
-
return
|
|
1465
|
+
return _context36.abrupt("return", _context36.sent);
|
|
1407
1466
|
case 9:
|
|
1408
1467
|
case "end":
|
|
1409
|
-
return
|
|
1468
|
+
return _context36.stop();
|
|
1410
1469
|
}
|
|
1411
|
-
},
|
|
1470
|
+
}, _callee36, this);
|
|
1412
1471
|
}));
|
|
1413
1472
|
function post(_x27, _x28) {
|
|
1414
1473
|
return _post.apply(this, arguments);
|
|
@@ -1418,7 +1477,7 @@ var HB = /*#__PURE__*/function () {
|
|
|
1418
1477
|
}, {
|
|
1419
1478
|
key: "get",
|
|
1420
1479
|
value: function () {
|
|
1421
|
-
var _get = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1480
|
+
var _get = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee37(_ref17) {
|
|
1422
1481
|
var _path3;
|
|
1423
1482
|
var path,
|
|
1424
1483
|
params,
|
|
@@ -1429,12 +1488,12 @@ var HB = /*#__PURE__*/function () {
|
|
|
1429
1488
|
k,
|
|
1430
1489
|
response,
|
|
1431
1490
|
headers,
|
|
1432
|
-
|
|
1433
|
-
return _regeneratorRuntime().wrap(function
|
|
1434
|
-
while (1) switch (
|
|
1491
|
+
_args37 = arguments;
|
|
1492
|
+
return _regeneratorRuntime().wrap(function _callee37$(_context37) {
|
|
1493
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
1435
1494
|
case 0:
|
|
1436
|
-
path =
|
|
1437
|
-
json =
|
|
1495
|
+
path = _ref17.path, params = _objectWithoutProperties(_ref17, _excluded);
|
|
1496
|
+
json = _args37.length > 1 && _args37[1] !== undefined ? _args37[1] : false;
|
|
1438
1497
|
_json = json ? "/~json@1.0/serialize" : "";
|
|
1439
1498
|
(_path3 = path) !== null && _path3 !== void 0 ? _path3 : path = "/~message@1.0";
|
|
1440
1499
|
if (!/^\//.test(path)) path = "/" + path;
|
|
@@ -1446,32 +1505,32 @@ var HB = /*#__PURE__*/function () {
|
|
|
1446
1505
|
i++;
|
|
1447
1506
|
}
|
|
1448
1507
|
}
|
|
1449
|
-
|
|
1508
|
+
_context37.next = 9;
|
|
1450
1509
|
return fetch("".concat(this.url).concat(path).concat(_json).concat(_params));
|
|
1451
1510
|
case 9:
|
|
1452
|
-
response =
|
|
1511
|
+
response = _context37.sent;
|
|
1453
1512
|
headers = {};
|
|
1454
1513
|
response.headers.forEach(function (v, k) {
|
|
1455
1514
|
return headers[k] = v;
|
|
1456
1515
|
});
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1516
|
+
_context37.t0 = response;
|
|
1517
|
+
_context37.t1 = headers;
|
|
1518
|
+
_context37.next = 16;
|
|
1460
1519
|
return response.text();
|
|
1461
1520
|
case 16:
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
return
|
|
1465
|
-
response:
|
|
1466
|
-
headers:
|
|
1467
|
-
body:
|
|
1468
|
-
status:
|
|
1521
|
+
_context37.t2 = _context37.sent;
|
|
1522
|
+
_context37.t3 = response.status;
|
|
1523
|
+
return _context37.abrupt("return", {
|
|
1524
|
+
response: _context37.t0,
|
|
1525
|
+
headers: _context37.t1,
|
|
1526
|
+
body: _context37.t2,
|
|
1527
|
+
status: _context37.t3
|
|
1469
1528
|
});
|
|
1470
1529
|
case 19:
|
|
1471
1530
|
case "end":
|
|
1472
|
-
return
|
|
1531
|
+
return _context37.stop();
|
|
1473
1532
|
}
|
|
1474
|
-
},
|
|
1533
|
+
}, _callee37, this);
|
|
1475
1534
|
}));
|
|
1476
1535
|
function get(_x29) {
|
|
1477
1536
|
return _get.apply(this, arguments);
|
|
@@ -1481,21 +1540,21 @@ var HB = /*#__PURE__*/function () {
|
|
|
1481
1540
|
}, {
|
|
1482
1541
|
key: "postJSON",
|
|
1483
1542
|
value: function () {
|
|
1484
|
-
var _postJSON = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1543
|
+
var _postJSON = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee38(args) {
|
|
1485
1544
|
var res;
|
|
1486
|
-
return _regeneratorRuntime().wrap(function
|
|
1487
|
-
while (1) switch (
|
|
1545
|
+
return _regeneratorRuntime().wrap(function _callee38$(_context38) {
|
|
1546
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
1488
1547
|
case 0:
|
|
1489
|
-
|
|
1548
|
+
_context38.next = 2;
|
|
1490
1549
|
return this.post(args, true);
|
|
1491
1550
|
case 2:
|
|
1492
|
-
res =
|
|
1493
|
-
return
|
|
1551
|
+
res = _context38.sent;
|
|
1552
|
+
return _context38.abrupt("return", JSON.parse(res.body));
|
|
1494
1553
|
case 4:
|
|
1495
1554
|
case "end":
|
|
1496
|
-
return
|
|
1555
|
+
return _context38.stop();
|
|
1497
1556
|
}
|
|
1498
|
-
},
|
|
1557
|
+
}, _callee38, this);
|
|
1499
1558
|
}));
|
|
1500
1559
|
function postJSON(_x30) {
|
|
1501
1560
|
return _postJSON.apply(this, arguments);
|
|
@@ -1505,21 +1564,21 @@ var HB = /*#__PURE__*/function () {
|
|
|
1505
1564
|
}, {
|
|
1506
1565
|
key: "getJSON",
|
|
1507
1566
|
value: function () {
|
|
1508
|
-
var _getJSON = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1567
|
+
var _getJSON = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee39(args) {
|
|
1509
1568
|
var res;
|
|
1510
|
-
return _regeneratorRuntime().wrap(function
|
|
1511
|
-
while (1) switch (
|
|
1569
|
+
return _regeneratorRuntime().wrap(function _callee39$(_context39) {
|
|
1570
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
1512
1571
|
case 0:
|
|
1513
|
-
|
|
1572
|
+
_context39.next = 2;
|
|
1514
1573
|
return this.get(args, true);
|
|
1515
1574
|
case 2:
|
|
1516
|
-
res =
|
|
1517
|
-
return
|
|
1575
|
+
res = _context39.sent;
|
|
1576
|
+
return _context39.abrupt("return", JSON.parse(res.body));
|
|
1518
1577
|
case 4:
|
|
1519
1578
|
case "end":
|
|
1520
|
-
return
|
|
1579
|
+
return _context39.stop();
|
|
1521
1580
|
}
|
|
1522
|
-
},
|
|
1581
|
+
}, _callee39, this);
|
|
1523
1582
|
}));
|
|
1524
1583
|
function getJSON(_x31) {
|
|
1525
1584
|
return _getJSON.apply(this, arguments);
|
package/cjs/hyperbeam.js
CHANGED
|
@@ -9,6 +9,9 @@ var _path = require("path");
|
|
|
9
9
|
var _ramda = require("ramda");
|
|
10
10
|
var _fs = require("fs");
|
|
11
11
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
12
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
13
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
14
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
12
15
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
16
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
17
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -27,6 +30,8 @@ var HyperBEAM = exports["default"] = /*#__PURE__*/function () {
|
|
|
27
30
|
port = _ref$port === void 0 ? 10001 : _ref$port,
|
|
28
31
|
_ref$cu = _ref.cu,
|
|
29
32
|
cu = _ref$cu === void 0 ? 6363 : _ref$cu,
|
|
33
|
+
_ref$as = _ref.as,
|
|
34
|
+
as = _ref$as === void 0 ? ["genesis_wasm"] : _ref$as,
|
|
30
35
|
bundler = _ref.bundler,
|
|
31
36
|
gateway = _ref.gateway,
|
|
32
37
|
wallet = _ref.wallet,
|
|
@@ -35,16 +40,17 @@ var HyperBEAM = exports["default"] = /*#__PURE__*/function () {
|
|
|
35
40
|
cwd = _ref$cwd === void 0 ? "./HyperBEAM" : _ref$cwd,
|
|
36
41
|
c = _ref.c,
|
|
37
42
|
cmake = _ref.cmake,
|
|
38
|
-
_ref$legacy = _ref.legacy,
|
|
39
|
-
legacy = _ref$legacy === void 0 ? false : _ref$legacy,
|
|
40
43
|
faff = _ref.faff,
|
|
41
44
|
_ref$simplePay = _ref.simplePay,
|
|
42
45
|
simplePay = _ref$simplePay === void 0 ? false : _ref$simplePay,
|
|
43
46
|
simplePayPrice = _ref.simplePayPrice,
|
|
44
47
|
p4_lua = _ref.p4_lua,
|
|
45
48
|
store_prefix = _ref.store_prefix,
|
|
46
|
-
operator = _ref.operator
|
|
49
|
+
operator = _ref.operator,
|
|
50
|
+
_ref$console = _ref.console,
|
|
51
|
+
console = _ref$console === void 0 ? true : _ref$console;
|
|
47
52
|
_classCallCheck(this, HyperBEAM);
|
|
53
|
+
this.console = console;
|
|
48
54
|
if (clearCache) {
|
|
49
55
|
var dirname = (0, _path.resolve)(process.cwd(), cwd);
|
|
50
56
|
var _iterator = _createForOfIteratorHelper((0, _fs.readdirSync)(dirname)),
|
|
@@ -80,27 +86,131 @@ var HyperBEAM = exports["default"] = /*#__PURE__*/function () {
|
|
|
80
86
|
this.cmake = cmake;
|
|
81
87
|
this.port = port;
|
|
82
88
|
this.bundler = bundler;
|
|
83
|
-
this.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
cwd: (0, _path.resolve)(process.cwd(), cwd)
|
|
89
|
-
});
|
|
90
|
-
this.hbeam.stdout.on("data", function (chunk) {
|
|
91
|
-
return console.log(chunk.toString());
|
|
92
|
-
});
|
|
93
|
-
this.hbeam.stderr.on("data", function (err) {
|
|
94
|
-
return console.error(err.toString());
|
|
95
|
-
});
|
|
96
|
-
this.hbeam.on("error", function (err) {
|
|
97
|
-
return console.error("failed to start process: ".concat(err));
|
|
98
|
-
});
|
|
99
|
-
this.hbeam.on("close", function (code) {
|
|
100
|
-
return console.log("child process exited with code ".concat(code));
|
|
101
|
-
});
|
|
89
|
+
this.as = as;
|
|
90
|
+
this.gateway = gateway;
|
|
91
|
+
this.wallet = wallet;
|
|
92
|
+
this.cwd = cwd;
|
|
93
|
+
this.run();
|
|
102
94
|
}
|
|
103
95
|
return _createClass(HyperBEAM, [{
|
|
96
|
+
key: "run",
|
|
97
|
+
value: function run() {
|
|
98
|
+
var _as = this.as.length === 0 ? [] : ["as", this.as.join(", ")];
|
|
99
|
+
this.hbeam = (0, _child_process.spawn)("rebar3", [].concat(_as, ["shell", "--eval", this.genEval({
|
|
100
|
+
gateway: this.gateway,
|
|
101
|
+
wallet: this.wallet
|
|
102
|
+
})]), {
|
|
103
|
+
env: _objectSpread(_objectSpread({}, process.env), this.genEnv()),
|
|
104
|
+
cwd: (0, _path.resolve)(process.cwd(), this.cwd)
|
|
105
|
+
});
|
|
106
|
+
if (this.console) {
|
|
107
|
+
this.hbeam.stdout.on("data", function (chunk) {
|
|
108
|
+
return console.log(chunk.toString());
|
|
109
|
+
});
|
|
110
|
+
this.hbeam.stderr.on("data", function (err) {
|
|
111
|
+
return console.error(err.toString());
|
|
112
|
+
});
|
|
113
|
+
this.hbeam.on("error", function (err) {
|
|
114
|
+
return console.error("failed to start process: ".concat(err));
|
|
115
|
+
});
|
|
116
|
+
this.hbeam.on("close", function (code) {
|
|
117
|
+
return console.log("child process exited with code ".concat(code));
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}, {
|
|
122
|
+
key: "ok",
|
|
123
|
+
value: function () {
|
|
124
|
+
var _ok = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
125
|
+
var address;
|
|
126
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
127
|
+
while (1) switch (_context.prev = _context.next) {
|
|
128
|
+
case 0:
|
|
129
|
+
_context.prev = 0;
|
|
130
|
+
_context.next = 3;
|
|
131
|
+
return fetch("http://localhost:".concat(this.port, "/~meta@1.0/info/address")).then(function (r) {
|
|
132
|
+
return r.text();
|
|
133
|
+
});
|
|
134
|
+
case 3:
|
|
135
|
+
address = _context.sent;
|
|
136
|
+
return _context.abrupt("return", address ? true : false);
|
|
137
|
+
case 7:
|
|
138
|
+
_context.prev = 7;
|
|
139
|
+
_context.t0 = _context["catch"](0);
|
|
140
|
+
return _context.abrupt("return", false);
|
|
141
|
+
case 10:
|
|
142
|
+
case "end":
|
|
143
|
+
return _context.stop();
|
|
144
|
+
}
|
|
145
|
+
}, _callee, this, [[0, 7]]);
|
|
146
|
+
}));
|
|
147
|
+
function ok() {
|
|
148
|
+
return _ok.apply(this, arguments);
|
|
149
|
+
}
|
|
150
|
+
return ok;
|
|
151
|
+
}()
|
|
152
|
+
}, {
|
|
153
|
+
key: "ready",
|
|
154
|
+
value: function () {
|
|
155
|
+
var _ready = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
156
|
+
var _this = this;
|
|
157
|
+
var timeout,
|
|
158
|
+
start,
|
|
159
|
+
_args3 = arguments;
|
|
160
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
161
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
162
|
+
case 0:
|
|
163
|
+
timeout = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : 30000;
|
|
164
|
+
start = Date.now();
|
|
165
|
+
return _context3.abrupt("return", new Promise(function (res) {
|
|
166
|
+
var to = setInterval(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
167
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
168
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
169
|
+
case 0:
|
|
170
|
+
_context2.prev = 0;
|
|
171
|
+
if (!(Date.now() - start > 30000)) {
|
|
172
|
+
_context2.next = 6;
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
clearInterval(to);
|
|
176
|
+
res(false);
|
|
177
|
+
_context2.next = 11;
|
|
178
|
+
break;
|
|
179
|
+
case 6:
|
|
180
|
+
_context2.next = 8;
|
|
181
|
+
return _this.ok();
|
|
182
|
+
case 8:
|
|
183
|
+
if (!_context2.sent) {
|
|
184
|
+
_context2.next = 11;
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
clearInterval(to);
|
|
188
|
+
res(_this);
|
|
189
|
+
case 11:
|
|
190
|
+
_context2.next = 15;
|
|
191
|
+
break;
|
|
192
|
+
case 13:
|
|
193
|
+
_context2.prev = 13;
|
|
194
|
+
_context2.t0 = _context2["catch"](0);
|
|
195
|
+
case 15:
|
|
196
|
+
case "end":
|
|
197
|
+
return _context2.stop();
|
|
198
|
+
}
|
|
199
|
+
}, _callee2, null, [[0, 13]]);
|
|
200
|
+
})), 1000);
|
|
201
|
+
}));
|
|
202
|
+
case 3:
|
|
203
|
+
case "end":
|
|
204
|
+
return _context3.stop();
|
|
205
|
+
}
|
|
206
|
+
}, _callee3);
|
|
207
|
+
}));
|
|
208
|
+
function ready() {
|
|
209
|
+
return _ready.apply(this, arguments);
|
|
210
|
+
}
|
|
211
|
+
return ready;
|
|
212
|
+
}()
|
|
213
|
+
}, {
|
|
104
214
|
key: "genEnv",
|
|
105
215
|
value: function genEnv() {
|
|
106
216
|
var _env = {};
|
|
@@ -113,17 +223,19 @@ var HyperBEAM = exports["default"] = /*#__PURE__*/function () {
|
|
|
113
223
|
}
|
|
114
224
|
}, {
|
|
115
225
|
key: "genEval",
|
|
116
|
-
value: function genEval(
|
|
117
|
-
var gateway =
|
|
118
|
-
|
|
119
|
-
wallet =
|
|
226
|
+
value: function genEval(_ref3) {
|
|
227
|
+
var gateway = _ref3.gateway,
|
|
228
|
+
_ref3$wallet = _ref3.wallet,
|
|
229
|
+
wallet = _ref3$wallet === void 0 ? ".wallet.json" : _ref3$wallet;
|
|
120
230
|
var _wallet = ", priv_key_location => <<\"".concat(wallet, "\">>");
|
|
121
231
|
var _gateway = gateway ? ", gateway => <<\"http://localhost:".concat(gateway, "\">>") : "";
|
|
122
232
|
|
|
123
233
|
// store option will be overwritten by hb.erl
|
|
124
234
|
var _store = this.store_prefix ? ", store => [#{ <<\"store-module\">> => hb_store_fs, <<\"prefix\">> => <<\"".concat(this.store_prefix, "\">> }, #{ <<\"store-module\">> => hb_store_gateway, <<\"subindex\">> => [#{ <<\"name\">> => <<\"Data-Protocol\">>, <<\"value\">> => <<\"ao\">> }], <<\"store\">> => [#{ <<\"store-module\">> => hb_store_fs, <<\"prefix\">> => <<\"").concat(this.store_prefix, "\">> }] }, #{ <<\"store-module\">> => hb_store_gateway, <<\"store\">> => [#{ <<\"store-module\">> => hb_store_fs, <<\"prefix\">> => <<\"").concat(this.store_prefix, "\">> }] }]") : "";
|
|
125
235
|
var _bundler = this.bundler ? ", bundler_httpsig => <<\"http://localhost:".concat(this.bundler, "\">>") : "";
|
|
126
|
-
|
|
236
|
+
/*
|
|
237
|
+
const _routes = `, routes => [#{ <<"template">> => <<"/result/.*">>, <<"node">> => #{ <<"prefix">> => <<"http://localhost:${this.cu}">> } }, #{ <<\"template\">> => <<\"/dry-run\">>, <<\"node\">> => #{ <<\"prefix\">> => <<\"http://localhost:${this.cu}\">> } }, #{ <<"template">> => <<"/graphql">>, <<"nodes">> => [#{ <<"prefix">> => <<"http://localhost:${gateway}">>, <<"opts">> => #{ http_client => httpc, protocol => http2 } }, #{ <<"prefix">> => <<"http://localhost:${gateway}">>, <<"opts">> => #{ http_client => gun, protocol => http2 } }] }, #{ <<"template">> => <<"/raw">>, <<"node">> => #{ <<"prefix">> => <<"http://localhost:${gateway}">>, <<"opts">> => #{ http_client => gun, protocol => http2 } } }]`
|
|
238
|
+
*/
|
|
127
239
|
var _p4_non_chargable = this.p4_lua ? ", p4_non_chargable_routes => [#{ <<\"template\">> => <<\"/*~node-process@1.0/*\">> }, #{ <<\"template\">> => <<\"/~wao@1.0/*\">> }, #{ <<\"template\">> => <<\"/~p4@1.0/balance\">> }, #{ <<\"template\">> => <<\"/~meta@1.0/*\">> }]" : !this.simplePay ? "" : ", p4_non_chargable_routes => [#{ <<\"template\">> => <<\"/~simple-pay@1.0/topup\">> }, #{ <<\"template\">> => <<\"/~p4@1.0/balance\">> }, #{ <<\"template\">> => <<\"/~meta@1.0/*\">> }, #{ <<\"template\">> => <<\"/~p4@1.0/balance\">> }, #{ <<\"template\">> => <<\"/~meta@1.0/*\">> }]";
|
|
128
240
|
var _operator = this.operator ? ", operator => <<\"".concat(this.operator, "\">>") : "";
|
|
129
241
|
var _spp = this.spp ? ", simple_pay_price => ".concat(this.spp) : "";
|
|
@@ -134,7 +246,7 @@ var HyperBEAM = exports["default"] = /*#__PURE__*/function () {
|
|
|
134
246
|
return "<<\"".concat(addr, "\">>");
|
|
135
247
|
})(this.faff).join(", "), " ]");
|
|
136
248
|
var _on = this.p4_lua ? ", on => #{ <<\"request\">> => ".concat(processor, ", <<\"response\">> => ").concat(processor, " }") : this.simplePay ? ", on => #{ <<\"request\">> => #{ <<\"device\">> => <<\"p4@1.0\">>, <<\"pricing-device\">> => <<\"simple-pay@1.0\">>, <<\"ledger-device\">> => <<\"simple-pay@1.0\">> }, <<\"response\">> => #{ <<\"device\">> => <<\"p4@1.0\">>, <<\"pricing-device\">> => <<\"simple-pay@1.0\">>, <<\"ledger-device\">> => <<\"simple-pay@1.0\">> } }" : !(0, _ramda.isNil)(this.faff) ? ", on => #{ <<\"request\">> => #{ <<\"device\">> => <<\"p4@1.0\">>, <<\"pricing-device\">> => <<\"faff@1.0\">>, <<\"ledger-device\">> => <<\"faff@1.0\">> }, <<\"response\">> => #{ <<\"device\">> => <<\"p4@1.0\">>, <<\"pricing-device\">> => <<\"faff@1.0\">>, <<\"ledger-device\">> => <<\"faff@1.0\">> } }" : "";
|
|
137
|
-
var start = "hb:start_mainnet(#{ ".concat(_port).concat(_gateway).concat(_wallet).concat(_faff).concat(_bundler).concat(
|
|
249
|
+
var start = "hb:start_mainnet(#{ ".concat(_port).concat(_gateway).concat(_wallet).concat(_faff).concat(_bundler).concat(_on).concat(_p4_non_chargable).concat(_operator).concat(_spp).concat(_node_processes, "}).");
|
|
138
250
|
return start;
|
|
139
251
|
}
|
|
140
252
|
}, {
|