-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpackage.json
68 lines (68 loc) · 11.9 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{
"name": "folioblocks-out-of-scope-script",
"Description": "A set of commands that contains a set of redundant commands that I can run later. Note that, we should run these commands only when we are in the project root directory.",
"scripts": {
"_backend-master": "python node/main.py -ll DEBUG -nh 127.0.0.1 -np 6001 -nr MASTER_NODE",
"_backend-archival-1": "python node/main.py -ll DEBUG -nh 127.0.0.1 -np 5001 -nr ARCHIVAL_MINER_NODE -th 127.0.0.1 -tp 6001",
"_backend-archival-2": "python node/main.py -ll DEBUG -nh 127.0.0.1 -np 5002 -nr ARCHIVAL_MINER_NODE -th 127.0.0.1 -tp 6001",
"_backend-archival-3": "python node/main.py -ll DEBUG -nh 127.0.0.1 -np 5003 -nr ARCHIVAL_MINER_NODE -th 127.0.0.1 -tp 6001",
"backend-master": "pwsh -Command clear; npm run _backend-master;",
"backend-archival-1": "pwsh -Command clear; npm run _backend-archival-1;",
"backend-archival-2": "pwsh -Command clear; npm run _backend-archival-2;",
"backend-archival-3": "pwsh -Command clear; npm run _backend-archival-3;",
"clear-deployed-nodes": "pwsh -Command az acr repository delete --name folio --repository folioblocks-node-master --yes; az acr repository delete --name folio --repository folioblocks-node-archival-1 --yes; az acr repository delete --name folio --repository folioblocks-node-archival-2 --yes; az acr repository delete --name folio --repository folioblocks-node-archival-3 --yes;",
"clean-logs": "rmdir /s /q logs",
"clear-node-files": "pwsh -Command Remove-Item -Force -Path ./folioblocks-chain.json, ./folioblocks-node.db, ./node-env.vars",
"clean-processes": "taskkill /im python.exe /f",
"delete-deployed-containers": "pwsh -Command az acr login --name folio; az container delete --name folioblocks --resource-group folio-proto --yes",
"deploy-to-local": "pwsh -Command npm run docker-node-master; npm run docker-node-archival-miner-1; npm run docker-node-archival-miner-2; npm run docker-node-archival-miner-3; npm run exit-on-success",
"deploy-to-azure-aci-rebuild": "pwsh -Command clear; az acr login --name folio; npm run clear-deployed-nodes; npm run deploy-master-node; npm run deploy-archival-miner-node-1; npm run deploy-archival-miner-node-2; npm run deploy-archival-miner-node-3; npm run exit-on-success",
"deploy-to-azure-aci-existing": "pwsh -Command clear; az acr login --name folio; npm run clear-deployed-nodes; npm run deploy-master-node; npm run deploy-archival-miner-node-1; npm run deploy-archival-miner-node-2; npm run deploy-archival-miner-node-3; npm run exit-on-success",
"deploy-master-node": "pwsh -Command az acr repository delete --name folio --repository folioblocks-node-master --yes; npm run docker-node-master-clear; npm run docker-node-master-build-to-deploy; docker tag folioblocks-node-master folio.azurecr.io/folioblocks-node-master:latest; docker push folio.azurecr.io/folioblocks-node-master:latest",
"deploy-archival-miner-node-1": "pwsh -Command npm run docker-node-archival-miner-1-clear; npm run docker-node-archival-miner-1-build-to-deploy; npm run exit-on-failure; docker tag folioblocks-node-archival-1 folio.azurecr.io/folioblocks-node-archival-1:latest; docker push folio.azurecr.io/folioblocks-node-archival-1:latest",
"deploy-archival-miner-node-2": "pwsh -Command npm run docker-node-archival-miner-2-clear; npm run docker-node-archival-miner-2-build-to-deploy; npm run exit-on-failure; docker tag folioblocks-node-archival-2 folio.azurecr.io/folioblocks-node-archival-2; docker push folio.azurecr.io/folioblocks-node-archival-2:latest",
"deploy-archival-miner-node-3": "pwsh -Command npm run docker-node-archival-miner-3-clear; npm run docker-node-archival-miner-3-build-to-deploy; npm run exit-on-failure; docker tag folioblocks-node-archival-3 folio.azurecr.io/folioblocks-node-archival-3; docker push folio.azurecr.io/folioblocks-node-archival-3:latest",
"deploy-existing-archival-miner-node-1": "pwsh -Command az acr repository delete --name folio --repository folioblocks-node-archival-1 --yes; docker tag folioblocks-node-archival-1 folio.azurecr.io/folioblocks-node-archival-1:latest; docker push folio.azurecr.io/folioblocks-node-archival-1:latest",
"deploy-existing-archival-miner-node-2": "pwsh -Command az acr repository delete --name folio --repository folioblocks-node-archival-2 --yes; docker tag folioblocks-node-archival-2 folio.azurecr.io/folioblocks-node-archival-2; docker push folio.azurecr.io/folioblocks-node-archival-2:latest",
"deploy-existing-archival-miner-node-3": "pwsh -Command az acr repository delete --name folio --repository folioblocks-node-archival-3 --yes; docker tag folioblocks-node-archival-3 folio.azurecr.io/folioblocks-node-archival-3; docker push folio.azurecr.io/folioblocks-node-archival-3:latest",
"docker-node-master": "pwsh -Command clear; npm run docker-node-master-clear; npm run docker-node-master-build; npm run nxit_on_failure; npm run docker-node-master-run",
"docker-node-master-build-to-local": "pwsh -Command docker build --file Dockerfile-node --network=host --build-arg NODE_HOST=0.0.0.0 --build-arg NODE_LOG_LEVEL=DEBUG --build-arg NODE_PORT=6001 --build-arg NODE_ROLE=MASTER_NODE -t folioblocks-node-master .",
"docker-node-master-build-to-deploy": "pwsh -Command docker build --file Dockerfile-node --network=host --build-arg NODE_HOST=0.0.0.0 --build-arg NODE_LOG_LEVEL=INFO --build-arg NODE_PORT=6001 --build-arg NODE_ROLE=MASTER_NODE -t folioblocks-node-master .",
"docker-node-master-clear": "pwsh -Command docker stop folioblocks-master-instance; docker rm folioblocks-master-instance",
"docker-node-master-run": "docker run -t -d -p 6001:6001 --network=host --name folioblocks-master-instance folioblocks-node-master",
"docker-node-archival-miner-1": "pwsh -Command clear; npm run docker-node-archival-miner-1-clear; npm run docker-node-archival-miner-1-build-to-local; npm run exit-on-failure; npm run docker-node-archival-miner-1-run",
"docker-node-archival-miner-1-build-to-local": "pwsh -Command docker build --file Dockerfile-node --network=host --build-arg NODE_HOST=0.0.0.0 --build-arg NODE_LOG_LEVEL=DEBUG --build-arg NODE_PORT=5001 --build-arg NODE_ROLE=ARCHIVAL_MINER_NODE --build-arg NTH_NODE=1 -t folioblocks-node-archival-1 .",
"docker-node-archival-miner-1-build-to-deploy": "pwsh -Command docker build --file Dockerfile-node --network=host --build-arg NODE_HOST=0.0.0.0 --build-arg NODE_LOG_LEVEL=INFO --build-arg NODE_PORT=5001 --build-arg NODE_ROLE=ARCHIVAL_MINER_NODE --build-arg NTH_NODE=1 -t folioblocks-node-archival-1 .",
"docker-node-archival-miner-1-clear": "pwsh -Command docker stop folioblocks-archival-miner-1-instance; docker rm folioblocks-archival-miner-1-instance",
"docker-node-archival-miner-1-run": "docker run -t -d -p 5001:5001 --network=host --name folioblocks-archival-miner-1-instance folioblocks-node-archival-1",
"docker-node-archival-miner-2": "pwsh -Command clear; npm run docker-node-archival-miner-2-clear; npm run docker-node-archival-miner-2-build-to-local; npm run exit-on-failure; npm run docker-node-archival-miner-2-run",
"docker-node-archival-miner-2-build-to-local": "pwsh -Command docker build --file Dockerfile-node --network=host --build-arg NODE_HOST=0.0.0.0 --build-arg NODE_LOG_LEVEL=DEBUG --build-arg NODE_PORT=5002 --build-arg NODE_ROLE=ARCHIVAL_MINER_NODE --build-arg NTH_NODE=2 -t folioblocks-node-archival-2 .",
"docker-node-archival-miner-2-build-to-deploy": "pwsh -Command docker build --file Dockerfile-node --network=host --build-arg NODE_HOST=0.0.0.0 --build-arg NODE_LOG_LEVEL=INFO --build-arg NODE_PORT=5002 --build-arg NODE_ROLE=ARCHIVAL_MINER_NODE --build-arg NTH_NODE=2 -t folioblocks-node-archival-2 .",
"docker-node-archival-miner-2-clear": "pwsh -Command docker stop folioblocks-archival-miner-2-instance; docker rm folioblocks-archival-miner-2-instance",
"docker-node-archival-miner-2-run": "docker run -t -d -p 5002:5002 --network=host --name folioblocks-archival-miner-2-instance folioblocks-node-archival-2",
"docker-node-archival-miner-3": "pwsh -Command clear; npm run docker-node-archival-miner-3-clear; npm run docker-node-archival-miner-3-build-to-local; npm run exit-on-failure; npm run docker-node-archival-miner-3-run",
"docker-node-archival-miner-3-build-to-local": "pwsh -Command docker build --file Dockerfile-node --network=host --build-arg NODE_HOST=0.0.0.0 --build-arg NODE_LOG_LEVEL=DEBUG --build-arg NODE_PORT=5003 --build-arg NODE_ROLE=ARCHIVAL_MINER_NODE --build-arg NTH_NODE=3 -t folioblocks-node-archival-3 .",
"docker-node-archival-miner-3-build-to-deploy": "pwsh -Command docker build --file Dockerfile-node --network=host --build-arg NODE_HOST=0.0.0.0 --build-arg NODE_LOG_LEVEL=INFO --build-arg NODE_PORT=5003 --build-arg NODE_ROLE=ARCHIVAL_MINER_NODE --build-arg NTH_NODE=3 -t folioblocks-node-archival-3 .",
"docker-node-archival-miner-3-clear": "pwsh -Command docker stop folioblocks-archival-miner-3-instance; docker rm folioblocks-archival-miner-3-instance",
"docker-node-archival-miner-3-run": "docker run -t -d -p 5003:5003 --network=host --name folioblocks-archival-miner-3-instance folioblocks-node-archival-3",
"exit-on-failure": "pwsh -Command if (($LASTEXITCODE -ge 1) -or ($LASTEXITCODE -le -1)) {echo 'There was an error when processing the commands. Please check previous outputs.'; exit 1;} else {'Exited Gracefully.'}",
"exit-on-success": "pwsh -Command echo 'Process successful! If this was deployed over the cloud, ensure that you run the `deploy-aci.yaml` with the command `az container create --resource-group folio-proto --file deploy-aci.yaml` to deploy the containers, if otherwise, do something whatever it is.'",
"reload-master-node": "pwsh -Command clear; npm run clear-node-files; cp backup/master/** .; npm run backend-master",
"reload-archival-node-1": "pwsh -Command clear; npm run clear-node-files; cp backup/archival/1/** .; npm run backend-archival-1",
"reload-archival-node-2": "pwsh -Command clear; npm run clear-node-files; cp backup/archival/2/** .; npm run backend-archival-2",
"reload-archival-node-3": "pwsh -Command clear; npm run clear-node-files; cp backup/archival/3/** .; npm run backend-archival-3",
"reset-master-node": "pwsh -Command clear; npm run clear-node-files; npm run backend-master",
"reset-archival-node-1": "pwsh -Command clear; npm run clear-node-files; npm run backend-archival-1",
"reset-archival-node-2": "pwsh -Command clear; npm run clear-node-files; npm run backend-archival-2",
"reset-archival-node-3": "pwsh -Command clear; npm run clear-node-files; npm run backend-archival-3",
"run-totp": "python node/proto_totp.py",
"view-master-node-log": "pwsh -Command clear; az container logs --resource-group folio-proto --name folioblocks --container folioblocks-master-node;",
"view-master-node-live-log": "pwsh -Command clear; az container logs --resource-group folio-proto --name folioblocks --container folioblocks-master-node --follow",
"view-archival-miner-node-1-log": "pwsh -Command clear; az container logs --resource-group folio-proto --name folioblocks --container folioblocks-archival-miner-node-1",
"view-archival-miner-node-1-live-log": "pwsh -Command clear; az container logs --resource-group folio-proto --name folioblocks --container folioblocks-archival-node-1 --follow",
"view-archival-miner-node-2-log": "pwsh -Command clear; az container logs --resource-group folio-proto --name folioblocks --container folioblocks-archival-miner-node-2",
"view-archival-miner-node-2-live-log": "pwsh -Command clear; az container logs --resource-group folio-proto --name folioblocks --container folioblocks-archival-node-2 --follow",
"view-archival-miner-node-3-log": "pwsh -Command clear; az container logs --resource-group folio-proto --name folioblocks --container folioblocks-archival-miner-node-2",
"view-archival-miner-node-3-live-log": "pwsh -Command clear; az container logs --resource-group folio-proto --name folioblocks --container folioblocks-archival-node-3 --follow"
}
}