Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Jagden committed Jan 2, 2025
1 parent afc1a16 commit cf626f1
Show file tree
Hide file tree
Showing 7 changed files with 199 additions and 119 deletions.
299 changes: 189 additions & 110 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"scripts": {
"typecheck": "tsc --noEmit --skipLibCheck",
"lint": "eslint . --ext .ts,.tsx -f codeframe",
"pretest": "npm run typecheck && npm run lint",
"pretest": "npm run typecheck",
"clean": "rimraf ./dist/",
"prebuild": "npm run clean",
"build": "tsc --skipLibCheck -p ./tsconfig.prod.json && ./boyar/create-version-file.sh && docker build -t local/management-service .",
Expand All @@ -39,6 +39,7 @@
"@types/compression": "^1.7.0",
"@types/cors": "^2.8.7",
"@types/express": "^4.17.3",
"@types/js-yaml": "^4.0.9",
"@types/lodash": "^4.14.149",
"@types/luxon": "^1.22.0",
"@types/mock-fs": "^4.10.0",
Expand Down Expand Up @@ -68,12 +69,12 @@
"cors": "^2.8.5",
"deepmerge": "^4.2.2",
"express": "^4.17.1",
"js-yaml": "^3.14.1",
"lodash": "^4.17.21",
"node-fetch": "^2.6.0",
"p-throttle": "^3.1.0",
"validate.js": "^0.13.1",
"web3": "1.2.6",
"yargs": "^15.3.1",
"js-yaml": "^3.14.1"
"yargs": "^15.3.1"
}
}
2 changes: 1 addition & 1 deletion src/api/render-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function getStatusText(snapshot: StateSnapshot) {
function getErrorText(snapshot: StateSnapshot) {
const res = [];
const now = getCurrentClockTime();
let refTimeAgo = now - snapshot.CurrentRefTime;
const refTimeAgo = now - snapshot.CurrentRefTime;

if (refTimeAgo > ETHEREUM_REF_TIME_ALLOWED_DELAY) {
res.push(`Ethereum RefTime is too old (${refTimeAgo} sec ago).`);
Expand Down
2 changes: 1 addition & 1 deletion src/config.example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const exampleConfig: ServiceConfiguration = {
EthereumFirstBlock: 11191390,
EthereumEndpoint: ['http://ganache:7545'],
DeploymentDescriptorUrl: 'https://deployment.orbs.network/mainnet.json',
DockerComposeDescriptorUrl: 'https://raw.githubusercontent.com/orbs-network/v3-node-setup/refs/heads/release/deployment/docker-compose.yml',
// DockerComposeDescriptorUrl: 'https://raw.githubusercontent.com/orbs-network/v3-node-setup/refs/heads/release/deployment/docker-compose.yml',
ElectionsAuditOnly: false,
StatusJsonPath: './status/status.json',
StatusAnalyticsJsonPath: './status/analytics.json',
Expand Down
4 changes: 2 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface ServiceConfiguration {
/** @deprecated Use `EthereumEndpoint` instead */
MaticEndpoint?: string;
DeploymentDescriptorUrl: string;
DockerComposeDescriptorUrl: string;
// DockerComposeDescriptorUrl: string;
ElectionsAuditOnly: boolean;
StatusJsonPath: string;
StatusAnalyticsJsonPath: string;
Expand All @@ -33,7 +33,7 @@ export const defaultServiceConfiguration = {
EthereumGenesisContract: '0xD859701C81119aB12A1e62AF6270aD2AE05c7AB3',
EthereumFirstBlock: 11191390,
DeploymentDescriptorUrl: 'https://deployment.orbs.network/mainnet.json',
DockerComposeDescriptorUrl: 'https://raw.githubusercontent.com/orbs-network/v3-node-setup/refs/heads/release/deployment/docker-compose.yml',
//DockerComposeDescriptorUrl: 'https://raw.githubusercontent.com/orbs-network/v3-node-setup/refs/heads/release/deployment/docker-compose.yml',
ElectionsAuditOnly: false,
StatusJsonPath: './status/status.json',
StatusAnalyticsJsonPath: './status/analytics.json',
Expand Down
2 changes: 1 addition & 1 deletion src/deployment/dd-docker-compose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import axios from 'axios';
import {StateManager} from "../model/manager";
import * as Logger from "../logger";
import { promises as fs } from 'fs';
const yaml = require('js-yaml');
import yaml from 'js-yaml';

interface DockerComposeService {
[serviceName: string]: any;
Expand Down
2 changes: 1 addition & 1 deletion src/env-var-args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ServiceConfiguration } from './config';
* @param config - The node configuration to update
* */
export function setConfigEnvVars(config: ServiceConfiguration): void {
config.DockerComposeDescriptorUrl = process.env.DOCKER_COMPOSE_DESCRIPTOR_URL ?? config.DockerComposeDescriptorUrl;
// config.DockerComposeDescriptorUrl = process.env.DOCKER_COMPOSE_DESCRIPTOR_URL ?? config.DockerComposeDescriptorUrl;
config.BootstrapMode = process.env.BOOTSTRAP_MODE ? process.env.BOOTSTRAP_MODE === 'true' : config.BootstrapMode;
config.Port = process.env.PORT ? Number(process.env.PORT) : config.Port;
config.EthereumGenesisContract = process.env.ETHEREUM_GENESIS_CONTRACT ?? config.EthereumGenesisContract;
Expand Down

0 comments on commit cf626f1

Please sign in to comment.