querysub 0.125.0 → 0.127.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 +1 -1
- package/src/2-proxy/PathValueProxyWatcher.ts +17 -2
- package/src/3-path-functions/PathFunctionRunner.ts +39 -4
- package/src/3-path-functions/pathFunctionLoader.ts +1 -36
- package/src/4-deploy/deployMain.ts +33 -11
- package/src/4-deploy/deploySchema.ts +7 -1
- package/src/4-deploy/edgeNodes.ts +72 -31
package/package.json
CHANGED
|
@@ -158,6 +158,10 @@ interface WatcherOptions<Result> {
|
|
|
158
158
|
// Triggers are also tracked if ClientWatcher.DEBUG_SOURCES
|
|
159
159
|
// Sometimes we need trigger tracking for delta watchers, so this isn't just for debugging
|
|
160
160
|
trackTriggers?: boolean;
|
|
161
|
+
|
|
162
|
+
// Fairly self explanatory. If there are nested createWatchers, instead of forking, we just
|
|
163
|
+
// run them immediately.
|
|
164
|
+
inlineNestedWatchers?: boolean;
|
|
161
165
|
}
|
|
162
166
|
|
|
163
167
|
let harvestableReadyLoopCount = 0;
|
|
@@ -889,7 +893,9 @@ export class PathValueProxyWatcher {
|
|
|
889
893
|
// callers would need to handle a variable return type, which is annoying.
|
|
890
894
|
// - This means any writes are attributed to the existing call, which... is fine, if the caller wants
|
|
891
895
|
// to disconnect the call from the existing watcher, they should use `Promise.resolve().finally(...)`.
|
|
892
|
-
|
|
896
|
+
// NOTE: We check for runImmediately as we still want to be able to create watchers in
|
|
897
|
+
// reaction to trigger of other watchers.
|
|
898
|
+
if (this.runningWatcher && (options.runImmediately || this.runningWatcher.options.inlineNestedWatchers)) {
|
|
893
899
|
// TODO: We COULD change our dispose out and change it back, if we find
|
|
894
900
|
// we often want to mutate shallow props of nested watchers.
|
|
895
901
|
const outerWatcher = {
|
|
@@ -1616,12 +1622,21 @@ export class PathValueProxyWatcher {
|
|
|
1616
1622
|
onWritesCommitted?: (writes: PathValue[]) => void;
|
|
1617
1623
|
}
|
|
1618
1624
|
): Promise<Result> {
|
|
1625
|
+
options = {
|
|
1626
|
+
canWrite: true,
|
|
1627
|
+
...options,
|
|
1628
|
+
};
|
|
1629
|
+
|
|
1630
|
+
if (this.runningWatcher?.options.inlineNestedWatchers) {
|
|
1631
|
+
this.createWatcher(options);
|
|
1632
|
+
return "Nested commitFunctions cannot return values" as any;
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1619
1635
|
let onResult!: (result: Result) => void;
|
|
1620
1636
|
let onError!: (error: Error) => void;
|
|
1621
1637
|
let resultPromise = new Promise<Result>((resolve, reject) => { onResult = resolve; onError = reject; });
|
|
1622
1638
|
let anyWrites = false;
|
|
1623
1639
|
this.createWatcher({
|
|
1624
|
-
canWrite: true,
|
|
1625
1640
|
...options,
|
|
1626
1641
|
onResultUpdated: (result, writes, watcher) => {
|
|
1627
1642
|
if (writes?.length) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { delay, runInfinitePoll } from "socket-function/src/batching";
|
|
2
2
|
import { cache } from "socket-function/src/caching";
|
|
3
|
-
import { magenta, red, yellow } from "socket-function/src/formatting/logColors";
|
|
3
|
+
import { blue, magenta, red, yellow } from "socket-function/src/formatting/logColors";
|
|
4
4
|
import { sha256HashBuffer, timeInHour } from "socket-function/src/misc";
|
|
5
5
|
import { measureFnc } from "socket-function/src/profiling/measure";
|
|
6
6
|
import { getLowUint32, getShortNumber } from "../bits";
|
|
7
7
|
import { registerDynamicResource } from "../diagnostics/trackResources";
|
|
8
|
-
import { logErrors } from "../errors";
|
|
8
|
+
import { errorToUndefined, logErrors } from "../errors";
|
|
9
9
|
import { getPathDepth, getPathFromStr, getPathIndex, trimPathStrToDepth } from "../path";
|
|
10
10
|
import { rawSchema } from "../2-proxy/pathDatabaseProxyBase";
|
|
11
11
|
import { ClientWatcher } from "../1-path-client/pathValueClientWatcher";
|
|
@@ -17,9 +17,11 @@ import debugbreak from "debugbreak";
|
|
|
17
17
|
import { parseArgs } from "./PathFunctionHelpers";
|
|
18
18
|
import { PERMISSIONS_FUNCTION_ID, getExportPath } from "./syncSchema";
|
|
19
19
|
import { formatTime } from "socket-function/src/formatting/format";
|
|
20
|
-
import { set_debug_getFunctionRunnerShards } from "../-g-core-values/NodeCapabilities";
|
|
20
|
+
import { getControllerNodeIdList, set_debug_getFunctionRunnerShards } from "../-g-core-values/NodeCapabilities";
|
|
21
21
|
import { diskLog } from "../diagnostics/logs/diskLogger";
|
|
22
22
|
import { FilterSelector, Filterable, doesMatch } from "../misc/filterable";
|
|
23
|
+
import { SocketFunction } from "socket-function/SocketFunction";
|
|
24
|
+
import { requiresNetworkTrustHook } from "../-d-trust/NetworkTrust2";
|
|
23
25
|
|
|
24
26
|
export const functionSchema = rawSchema<{
|
|
25
27
|
[domainName: string]: {
|
|
@@ -176,6 +178,7 @@ export class PathFunctionRunner {
|
|
|
176
178
|
PermissionsChecker: PermissionsCheckType | undefined;
|
|
177
179
|
filterSelector?: FilterSelector;
|
|
178
180
|
}) {
|
|
181
|
+
SocketFunction.expose(FunctionPreloadController);
|
|
179
182
|
debugFunctionRunnerShards.push({
|
|
180
183
|
domainName: config.domainName,
|
|
181
184
|
shardRange: config.shardRange,
|
|
@@ -655,4 +658,36 @@ export class PathFunctionRunner {
|
|
|
655
658
|
});
|
|
656
659
|
PathFunctionRunner.RUN_FINISH_COUNT++;
|
|
657
660
|
}
|
|
658
|
-
}
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
export async function preloadFunctions(specs: FunctionSpec[]) {
|
|
664
|
+
let nodeIds = await getControllerNodeIdList(FunctionPreloadController);
|
|
665
|
+
await Promise.allSettled(nodeIds.map(async nodeId => {
|
|
666
|
+
let controller = FunctionPreloadController.nodes[nodeId.nodeId];
|
|
667
|
+
console.log(blue(`Preloading functions on ${nodeId}`));
|
|
668
|
+
await errorToUndefined(controller.preloadFunctions(specs));
|
|
669
|
+
console.log(blue(`Finished preloading functions on ${nodeId}`));
|
|
670
|
+
}));
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
class FunctionPreloaderBase {
|
|
674
|
+
async preloadFunctions(specs: FunctionSpec[]) {
|
|
675
|
+
for (let spec of specs) {
|
|
676
|
+
await getModuleFromSpec(spec);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
const FunctionPreloadController = SocketFunction.register(
|
|
682
|
+
"FunctionPreloader-c966a1a6-5d3f-4453-bd03-ae84b574ec00",
|
|
683
|
+
new FunctionPreloaderBase(),
|
|
684
|
+
() => ({
|
|
685
|
+
preloadFunctions: {},
|
|
686
|
+
}),
|
|
687
|
+
() => ({
|
|
688
|
+
hooks: [requiresNetworkTrustHook],
|
|
689
|
+
}),
|
|
690
|
+
{
|
|
691
|
+
noAutoExpose: true,
|
|
692
|
+
}
|
|
693
|
+
);
|
|
@@ -263,7 +263,6 @@ function getCallstackFiles(): string[] {
|
|
|
263
263
|
async function getModuleFromSpecBase(
|
|
264
264
|
spec: LoadFunctionSpec
|
|
265
265
|
): Promise<NodeJS.Module> {
|
|
266
|
-
everLoadedRepos.add(spec.gitURL);
|
|
267
266
|
let hotReloadPackagePath = "";
|
|
268
267
|
let path = gitURLRefMappings.get(getSpecKey(spec));
|
|
269
268
|
let deployPath = "";
|
|
@@ -430,7 +429,7 @@ async function executeCommand(command: string, args: string[], options?: {
|
|
|
430
429
|
const child = child_process.spawn(resolvedCommandPath, args, {
|
|
431
430
|
cwd: options?.cwd,
|
|
432
431
|
stdio: ["ignore", "pipe", "pipe"],
|
|
433
|
-
shell:
|
|
432
|
+
shell: true,
|
|
434
433
|
});
|
|
435
434
|
|
|
436
435
|
let stdout = "";
|
|
@@ -459,37 +458,3 @@ async function executeCommand(command: string, args: string[], options?: {
|
|
|
459
458
|
});
|
|
460
459
|
});
|
|
461
460
|
}
|
|
462
|
-
|
|
463
|
-
// Helps us exclude non-function loaders (PathValueServer), which really shouldn't
|
|
464
|
-
// be loading code anyways!
|
|
465
|
-
let everLoadedRepos = new Set<string>();
|
|
466
|
-
|
|
467
|
-
export async function preloadFunctions(specs: FunctionSpec[]) {
|
|
468
|
-
let nodeIds = await getControllerNodeIdList(functionPreloadController);
|
|
469
|
-
await Promise.all(nodeIds.map(async nodeId => {
|
|
470
|
-
let controller = functionPreloadController.nodes[nodeId.nodeId];
|
|
471
|
-
console.log(blue(`Preloading functions on ${nodeId}`));
|
|
472
|
-
await errorToUndefined(controller.preloadFunctions(specs));
|
|
473
|
-
console.log(blue(`Finished preloading functions on ${nodeId}`));
|
|
474
|
-
}));
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
class FunctionPreloaderBase {
|
|
478
|
-
async preloadFunctions(specs: FunctionSpec[]) {
|
|
479
|
-
specs = specs.filter(spec => everLoadedRepos.has(spec.gitURL));
|
|
480
|
-
for (let spec of specs) {
|
|
481
|
-
await getModuleFromSpec(spec);
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
const functionPreloadController = SocketFunction.register(
|
|
487
|
-
"FunctionPreloader-c966a1a6-5d3f-4453-bd03-ae84b574ec00",
|
|
488
|
-
new FunctionPreloaderBase(),
|
|
489
|
-
() => ({
|
|
490
|
-
preloadFunctions: {},
|
|
491
|
-
}),
|
|
492
|
-
() => ({
|
|
493
|
-
hooks: [requiresNetworkTrustHook],
|
|
494
|
-
})
|
|
495
|
-
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../inject";
|
|
2
2
|
|
|
3
|
-
import { FunctionSpec } from "../3-path-functions/PathFunctionRunner";
|
|
3
|
+
import { FunctionSpec, preloadFunctions } from "../3-path-functions/PathFunctionRunner";
|
|
4
4
|
import path from "path";
|
|
5
5
|
import { getExportPath, getSchemaObject, PERMISSIONS_FUNCTION_ID } from "../3-path-functions/syncSchema";
|
|
6
6
|
import { getModuleRelativePath } from "../3-path-functions/syncSchema";
|
|
@@ -15,13 +15,20 @@ import yargs from "yargs";
|
|
|
15
15
|
import { isPublic } from "../config";
|
|
16
16
|
import { deployBlock } from "./deployBlock";
|
|
17
17
|
import { LOCAL_DOMAIN } from "../0-path-value-core/PathController";
|
|
18
|
-
import { preloadFunctions } from "../3-path-functions/pathFunctionLoader";
|
|
19
18
|
import { magenta } from "socket-function/src/formatting/logColors";
|
|
20
19
|
import { getGitRef } from "./git";
|
|
21
20
|
import { getGitURL } from "./git";
|
|
22
21
|
import { setLiveDeployedHash } from "./deploySchema";
|
|
22
|
+
import { proxyWatcher } from "../2-proxy/PathValueProxyWatcher";
|
|
23
|
+
import debugbreak from "debugbreak";
|
|
24
|
+
import { timeInHour } from "socket-function/src/misc";
|
|
25
|
+
import { preloadUI } from "./edgeNodes";
|
|
26
|
+
|
|
23
27
|
let yargObj = yargs(process.argv)
|
|
24
28
|
.option("domain", { type: "string", required: true, desc: "Domain to deploy to" })
|
|
29
|
+
.option("deployonlycode", { type: "boolean", desc: "Only deploy code, not ui" })
|
|
30
|
+
.option("deployonlyui", { type: "boolean", desc: "Only deploy ui, not code" })
|
|
31
|
+
.option("notifyrefreshdelay", { type: "number", default: timeInHour * 12, desc: "The time clients have to refresh their UI after a deploy." })
|
|
25
32
|
.argv
|
|
26
33
|
;
|
|
27
34
|
|
|
@@ -57,12 +64,6 @@ export async function deployMain() {
|
|
|
57
64
|
}
|
|
58
65
|
let gitRef = getGitRef(gitDir);
|
|
59
66
|
|
|
60
|
-
|
|
61
|
-
//todonext
|
|
62
|
-
// Flags to set this
|
|
63
|
-
//setLiveDeployedHash(gitRef);
|
|
64
|
-
|
|
65
|
-
|
|
66
67
|
let usedModules = new Map<string, string>();
|
|
67
68
|
|
|
68
69
|
for (let module of Object.values(require.cache)) {
|
|
@@ -118,13 +119,34 @@ export async function deployMain() {
|
|
|
118
119
|
|
|
119
120
|
console.log();
|
|
120
121
|
console.log();
|
|
121
|
-
console.log(magenta(`Preloading ${currentFunctions.length} functions`));
|
|
122
|
-
await
|
|
122
|
+
console.log(magenta(`Preloading ${currentFunctions.length} functions & UI`));
|
|
123
|
+
await Promise.all([
|
|
124
|
+
preloadFunctions(currentFunctions),
|
|
125
|
+
preloadUI(gitRef),
|
|
126
|
+
]);
|
|
123
127
|
|
|
124
128
|
console.log();
|
|
125
129
|
console.log();
|
|
126
130
|
console.log(magenta(`Deploying ${currentFunctions.length} functions`));
|
|
127
|
-
|
|
131
|
+
|
|
132
|
+
let refreshThresholdTime = Date.now() + yargObj.notifyrefreshdelay;
|
|
133
|
+
|
|
134
|
+
debugbreak(2);
|
|
135
|
+
debugger;
|
|
136
|
+
//todonext;
|
|
137
|
+
// VERIFY that the nested commit functions run correctly WITH the correct (atomic) flags
|
|
138
|
+
await proxyWatcher.commitFunction({
|
|
139
|
+
debugName: "setLiveDeployedHash",
|
|
140
|
+
inlineNestedWatchers: true,
|
|
141
|
+
watchFunction: () => {
|
|
142
|
+
if (!yargObj.deployonlycode) {
|
|
143
|
+
void setLiveDeployedHash({ hash: gitRef, refreshThresholdTime, });
|
|
144
|
+
}
|
|
145
|
+
if (!yargObj.deployonlyui) {
|
|
146
|
+
void replaceFunctions({ domainName, functions: currentFunctions, });
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
});
|
|
128
150
|
|
|
129
151
|
console.log(magenta(`FINISHED DEPLOY`));
|
|
130
152
|
}
|
|
@@ -20,15 +20,21 @@ export const deploySchema = rawSchema<{
|
|
|
20
20
|
export interface DeployedHash {
|
|
21
21
|
hash: string;
|
|
22
22
|
time: number;
|
|
23
|
+
refreshThresholdTime: number;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
|
|
26
|
-
export function setLiveDeployedHash(
|
|
27
|
+
export function setLiveDeployedHash(config: {
|
|
28
|
+
hash: string;
|
|
29
|
+
refreshThresholdTime: number;
|
|
30
|
+
}) {
|
|
31
|
+
const { hash, refreshThresholdTime } = config;
|
|
27
32
|
proxyWatcher.writeOnly({
|
|
28
33
|
watchFunction: function writeCall() {
|
|
29
34
|
let hashObj: DeployedHash = {
|
|
30
35
|
hash,
|
|
31
36
|
time: Date.now(),
|
|
37
|
+
refreshThresholdTime,
|
|
32
38
|
};
|
|
33
39
|
deploySchema()[getDomain()].deploy.live = hashObj;
|
|
34
40
|
deploySchema()[getDomain()].deploy.history[nextId()] = hashObj;
|
|
@@ -16,6 +16,10 @@ import { getGitRef, getGitURL } from "./git";
|
|
|
16
16
|
import { getModuleFromConfig } from "../3-path-functions/pathFunctionLoader";
|
|
17
17
|
import path from "path";
|
|
18
18
|
import debugbreak from "debugbreak";
|
|
19
|
+
import { requiresNetworkTrustHook } from "../-d-trust/NetworkTrust2";
|
|
20
|
+
import { getControllerNodeIdList } from "../-g-core-values/NodeCapabilities";
|
|
21
|
+
import { blue } from "socket-function/src/formatting/logColors";
|
|
22
|
+
import { errorToUndefined } from "../errors";
|
|
19
23
|
|
|
20
24
|
const UPDATE_POLL_INTERVAL = timeInMinute;
|
|
21
25
|
const DEAD_NODE_COUNT_THRESHOLD = 15;
|
|
@@ -51,6 +55,7 @@ export type EdgeNodesIndex = {
|
|
|
51
55
|
edgeNodes: EdgeNodeConfig[];
|
|
52
56
|
};
|
|
53
57
|
|
|
58
|
+
|
|
54
59
|
// IMPORTANT! The EdgeNodeConfig MUST be immutable, otherwise every node has to read every EdgeNodeConfig
|
|
55
60
|
// every poll, which is too much reading.
|
|
56
61
|
export type EdgeNodeConfig = {
|
|
@@ -100,17 +105,11 @@ export async function registerEdgeNode(config: {
|
|
|
100
105
|
|
|
101
106
|
await edgeNodeStorage.set(getNextNodePath(), Buffer.from(JSON.stringify(edgeNodeConfig)));
|
|
102
107
|
|
|
103
|
-
|
|
104
|
-
// Testing
|
|
105
|
-
//if (!isLocal())
|
|
106
|
-
{
|
|
108
|
+
if (!isLocal()) {
|
|
107
109
|
await loadEntryPointsByHash({
|
|
108
110
|
host: config.host,
|
|
109
111
|
entryPaths: config.entryPaths,
|
|
110
|
-
|
|
111
|
-
// Testing
|
|
112
|
-
//hash: gitHash,
|
|
113
|
-
hash: "8554dd139250ea3fe11f2f3551e8d59ab7122978",
|
|
112
|
+
hash: gitHash,
|
|
114
113
|
});
|
|
115
114
|
}
|
|
116
115
|
|
|
@@ -131,30 +130,8 @@ async function loadEntryPointsByHash(config: {
|
|
|
131
130
|
gitRef: gitHash,
|
|
132
131
|
FilePath: entryPaths[0],
|
|
133
132
|
FunctionId: "entryPoint",
|
|
134
|
-
//todonext
|
|
135
|
-
// Testing
|
|
136
|
-
noLocal: true,
|
|
137
133
|
});
|
|
138
134
|
|
|
139
|
-
//todonext;
|
|
140
|
-
// 2) Run aipaint normally. This should have a later bootTime, and therefore be picked,
|
|
141
|
-
// so it should test our browser loading other gitHashes
|
|
142
|
-
// 3) Setup the deployMain code to set the live hash
|
|
143
|
-
// - Inside of replaceFunctions, via passing a callback function to it. The nested commits SHOULD
|
|
144
|
-
// just work?
|
|
145
|
-
// - IMPORTANT! Step through the code, to ensure the nested flags are set correctly. If not...
|
|
146
|
-
// update the proxy watcher to set them properly...
|
|
147
|
-
// - With all the flags (that only do one or the other)
|
|
148
|
-
// - Add preloading capability, so we can preload the hashes before we deploy
|
|
149
|
-
// 3) Dynamically watch the live hash, and load new hashes (deploying their services)
|
|
150
|
-
// - Test by pushing, deploying, and refreshing (we should prefer to latest service)
|
|
151
|
-
// 3.1) If local, DO NOT watch the live hash
|
|
152
|
-
// 5) Write the live hash to public backblaze, and have the client read it, and prefer that hash
|
|
153
|
-
// 6) Pass the live hash to the client with the edge node
|
|
154
|
-
// 7) Client live hash watch code + notify + refresh + flag to ignore the baked in live hash + edge node
|
|
155
|
-
// - Test by pushing, deploying, and then we should immediately see a notify to refresh
|
|
156
|
-
|
|
157
|
-
|
|
158
135
|
let depth = entryPaths[0].replaceAll("\\", "/").split("/").filter(x => x && x !== ".").length;
|
|
159
136
|
|
|
160
137
|
let firstPath = path.resolve(module.filename);
|
|
@@ -177,6 +154,8 @@ async function loadEntryPointsByHash(config: {
|
|
|
177
154
|
registeredEdgeNode = edgeNodeConfig;
|
|
178
155
|
|
|
179
156
|
await edgeNodeStorage.set(getNextNodePath(), Buffer.from(JSON.stringify(edgeNodeConfig)));
|
|
157
|
+
|
|
158
|
+
SocketFunction.expose(EdgeNodeController);
|
|
180
159
|
}
|
|
181
160
|
|
|
182
161
|
export const getEdgeNodeConfigURL = lazy(async () => {
|
|
@@ -254,6 +233,46 @@ async function updateEdgeNodesFile() {
|
|
|
254
233
|
await edgeNodeStorage.set("edge-nodes-index.json", Buffer.from(JSON.stringify(newEdgeNodeIndex)));
|
|
255
234
|
}
|
|
256
235
|
|
|
236
|
+
export async function preloadUI(hash: string) {
|
|
237
|
+
let nodeIds = await getControllerNodeIdList(EdgeNodeController);
|
|
238
|
+
await Promise.allSettled(nodeIds.map(async nodeId => {
|
|
239
|
+
let controller = EdgeNodeController.nodes[nodeId.nodeId];
|
|
240
|
+
console.log(blue(`Preloading functions on ${nodeId}`));
|
|
241
|
+
await errorToUndefined(controller.preloadUI({ hash }));
|
|
242
|
+
console.log(blue(`Finished preloading functions on ${nodeId}`));
|
|
243
|
+
}));
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
class EdgeNodeControllerBase {
|
|
247
|
+
public async preloadUI(config: {
|
|
248
|
+
hash: string;
|
|
249
|
+
}) {
|
|
250
|
+
const { hash } = config;
|
|
251
|
+
if (!registeredEdgeNode || !canHaveChildren(registeredEdgeNode)) {
|
|
252
|
+
throw new Error(`Somehow we have no registered edge node. How did we even expose this controller?`);
|
|
253
|
+
}
|
|
254
|
+
await loadEntryPointsByHash({
|
|
255
|
+
host: registeredEdgeNode.host,
|
|
256
|
+
entryPaths: registeredEdgeNode.entryPaths,
|
|
257
|
+
hash,
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
const EdgeNodeController = SocketFunction.register(
|
|
263
|
+
"EdgeNodeController-e0110af9-f8c4-42f3-ad11-633f8e43abdd",
|
|
264
|
+
new EdgeNodeControllerBase(),
|
|
265
|
+
() => ({
|
|
266
|
+
preloadUI: {},
|
|
267
|
+
}),
|
|
268
|
+
() => ({
|
|
269
|
+
hooks: [requiresNetworkTrustHook],
|
|
270
|
+
}),
|
|
271
|
+
{
|
|
272
|
+
noAutoExpose: true,
|
|
273
|
+
}
|
|
274
|
+
);
|
|
275
|
+
|
|
257
276
|
// async function main() {
|
|
258
277
|
// await loadEntryPointsByHash({
|
|
259
278
|
// host: "127-0-0-1.querysub.com:1111",
|
|
@@ -261,4 +280,26 @@ async function updateEdgeNodesFile() {
|
|
|
261
280
|
// hash: "7b1eb4934d5bdfe6d0f7076049c4b7decad4e645",
|
|
262
281
|
// });
|
|
263
282
|
// }
|
|
264
|
-
// main().catch(console.error).finally(() => process.exit());
|
|
283
|
+
// main().catch(console.error).finally(() => process.exit());
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
//todonext;
|
|
288
|
+
// 3) Setup the deployMain code to set the live hash
|
|
289
|
+
// - Flags to decide what to set
|
|
290
|
+
// - Inside of replaceFunctions, via passing a callback function to it. The nested commits SHOULD
|
|
291
|
+
// just work?
|
|
292
|
+
// - IMPORTANT! Step through the code, to ensure the nested flags are set correctly. If not...
|
|
293
|
+
// update the proxy watcher to set them properly...
|
|
294
|
+
// - With all the flags (that only do one or the other)
|
|
295
|
+
// - Add preloading capability, so we can preload the hashes before we deploy
|
|
296
|
+
|
|
297
|
+
// 3) Dynamically watch the live hash, and load new hashes (deploying their services)
|
|
298
|
+
// - Test by pushing, deploying, and refreshing (we should prefer to latest service)
|
|
299
|
+
// 3.1) If local, DO NOT watch the live hash
|
|
300
|
+
|
|
301
|
+
// 5) Write the live hash to public backblaze, and have the client read it, and prefer that hash
|
|
302
|
+
// 6) Pass the live hash to the client with the edge node
|
|
303
|
+
// 7) Client live hash watch code + notify + refresh + flag to ignore the baked in live hash + edge node
|
|
304
|
+
// - Test by pushing, deploying, and then we should immediately see a notify to refresh
|
|
305
|
+
// 8) VERIFY writing and permissions stillw orks
|