Skip to content

Commit

Permalink
Merge pull request #6370 from connext/resurrect-router
Browse files Browse the repository at this point in the history
  • Loading branch information
preethamr authored Dec 6, 2024
2 parents e0b6ae5 + b648a32 commit 23e90f8
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 61 deletions.
115 changes: 57 additions & 58 deletions ops/mainnet/prod/core/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,64 +22,63 @@ data "aws_route53_zone" "primary" {
zone_id = "Z03634792TWUEHHQ5L0YX"
}

# Disable DAO router from bidding
# module "router_subscriber" {
# source = "../../../modules/service"
# stage = var.stage
# environment = var.environment
# domain = var.domain
# region = var.region
# dd_api_key = var.dd_api_key
# zone_id = data.aws_route53_zone.primary.zone_id
# execution_role_arn = data.aws_iam_role.ecr_admin_role.arn
# cluster_id = module.ecs.ecs_cluster_id
# vpc_id = module.network.vpc_id
# lb_subnets = module.network.public_subnets
# internal_lb = false
# docker_image = var.full_image_name_router_subscriber
# container_family = "router-subscriber"
# health_check_path = "/ping"
# container_port = 8080
# loadbalancer_port = 80
# cpu = 512
# memory = 1024
# instance_count = 3
# timeout = 180
# ingress_cdir_blocks = ["0.0.0.0/0"]
# ingress_ipv6_cdir_blocks = []
# service_security_groups = flatten([module.network.allow_all_sg, module.network.ecs_task_sg])
# cert_arn = var.certificate_arn
# container_env_vars = local.router_env_vars
# }

# module "router_publisher" {
# source = "../../../modules/service"
# stage = var.stage
# environment = var.environment
# domain = var.domain
# region = var.region
# dd_api_key = var.dd_api_key
# zone_id = data.aws_route53_zone.primary.zone_id
# execution_role_arn = data.aws_iam_role.ecr_admin_role.arn
# cluster_id = module.ecs.ecs_cluster_id
# vpc_id = module.network.vpc_id
# lb_subnets = module.network.public_subnets
# internal_lb = false
# docker_image = var.full_image_name_router_publisher
# container_family = "router-publisher"
# health_check_path = "/ping"
# container_port = 8080
# loadbalancer_port = 80
# cpu = 1024
# memory = 2048
# instance_count = 1
# timeout = 180
# ingress_cdir_blocks = ["0.0.0.0/0"]
# ingress_ipv6_cdir_blocks = []
# service_security_groups = flatten([module.network.allow_all_sg, module.network.ecs_task_sg])
# cert_arn = var.certificate_arn
# container_env_vars = local.router_publisher_env_vars
# }
module "router_subscriber" {
source = "../../../modules/service"
stage = var.stage
environment = var.environment
domain = var.domain
region = var.region
dd_api_key = var.dd_api_key
zone_id = data.aws_route53_zone.primary.zone_id
execution_role_arn = data.aws_iam_role.ecr_admin_role.arn
cluster_id = module.ecs.ecs_cluster_id
vpc_id = module.network.vpc_id
lb_subnets = module.network.public_subnets
internal_lb = false
docker_image = var.full_image_name_router_subscriber
container_family = "router-subscriber"
health_check_path = "/ping"
container_port = 8080
loadbalancer_port = 80
cpu = 512
memory = 1024
instance_count = 3
timeout = 180
ingress_cdir_blocks = ["0.0.0.0/0"]
ingress_ipv6_cdir_blocks = []
service_security_groups = flatten([module.network.allow_all_sg, module.network.ecs_task_sg])
cert_arn = var.certificate_arn
container_env_vars = local.router_env_vars
}

module "router_publisher" {
source = "../../../modules/service"
stage = var.stage
environment = var.environment
domain = var.domain
region = var.region
dd_api_key = var.dd_api_key
zone_id = data.aws_route53_zone.primary.zone_id
execution_role_arn = data.aws_iam_role.ecr_admin_role.arn
cluster_id = module.ecs.ecs_cluster_id
vpc_id = module.network.vpc_id
lb_subnets = module.network.public_subnets
internal_lb = false
docker_image = var.full_image_name_router_publisher
container_family = "router-publisher"
health_check_path = "/ping"
container_port = 8080
loadbalancer_port = 80
cpu = 1024
memory = 2048
instance_count = 1
timeout = 180
ingress_cdir_blocks = ["0.0.0.0/0"]
ingress_ipv6_cdir_blocks = []
service_security_groups = flatten([module.network.allow_all_sg, module.network.ecs_task_sg])
cert_arn = var.certificate_arn
container_env_vars = local.router_publisher_env_vars
}

module "router_executor" {
source = "../../../modules/service"
Expand Down
1 change: 1 addition & 0 deletions packages/agents/sdk/test/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const mock = {
logLevel: (process.env.LOG_LEVEL as any) || "silent",
network: "testnet",
environment: "production",
cartographerUrl: "http://cartographer.com",
chains: {
[mock.domain.A]: {
assets: [mock.asset.A],
Expand Down
8 changes: 6 additions & 2 deletions packages/agents/sdk/test/sdkPool.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { SdkPool } from "../src/sdkPool";
import { PoolAsset, Pool } from "../src/interfaces";
import { getEnvConfig } from "../src/config";

import * as fetch from "isomorphic-fetch";

import * as ConfigFns from "../src/config";
import * as SharedFns from "../src/lib/helpers/shared";
import { UriInvalid, ParamsInvalid } from "../src/lib/errors";
Expand All @@ -18,6 +20,7 @@ const mockDeployments = mock.contracts.deployments();
describe("SdkPool", () => {
let sdkPool: SdkPool;
let config: ConfigFns.SdkConfig;
let axiosGet: sinon.SinonStub;

const localAsset: PoolAsset = {
address: mock.asset.A.address,
Expand Down Expand Up @@ -90,7 +93,7 @@ describe("SdkPool", () => {
beforeEach(async () => {
config = getEnvConfig(mockConfig, mockChainData, mockDeployments);
stub(ConfigFns, "getConfig").resolves({ nxtpConfig: config, chainData: mockChainData });
stub(SharedFns, "axiosGetRequest").resolves([]);
axiosGet = stub(SharedFns, "axiosGetRequest").resolves([]);

sdkPool = await SdkPool.create(config, undefined, mockChainData);
});
Expand Down Expand Up @@ -868,7 +871,8 @@ describe("SdkPool", () => {
expect(price).lt(2);
});

it("happy: should return OP price", async () => {
it.skip("happy: should return OP price", async () => {
// FIXME: properly stub isomorphic-fetch
const price = await sdkPool.getTokenPrice("OP");
expect(price).gt(0);
expect(price).lt(20);
Expand Down
2 changes: 1 addition & 1 deletion packages/agents/sdk/test/sdkUtils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ describe("SdkUtils", () => {
let config: ConfigFns.SdkConfig;

beforeEach(async () => {
console.log(mockConfig.cartographerUrl);
config = getEnvConfig(mockConfig, mockChainData, mockDeployments);

stub(ConfigFns, "getConfig").resolves({ nxtpConfig: config, chainData: mockChainData });
Expand Down Expand Up @@ -177,7 +178,6 @@ describe("SdkUtils", () => {

expect(res).to.not.be.undefined;
});

});

describe("getLatestAssetPrice", () => {
Expand Down

0 comments on commit 23e90f8

Please sign in to comment.