Skip to content

Commit

Permalink
fix: p2p-bootstrap ECS command + /status route (#4682)
Browse files Browse the repository at this point in the history
  • Loading branch information
spypsy authored Feb 20, 2024
1 parent 1abae28 commit 21ec23d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 7 additions & 3 deletions yarn-project/aztec/src/cli/cli.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fileURLToPath } from '@aztec/aztec.js';
import { ServerList, createNamespacedJsonRpcServer } from '@aztec/foundation/json-rpc/server';
import { ServerList, createNamespacedJsonRpcServer, createStatusRouter } from '@aztec/foundation/json-rpc/server';
import { DebugLogger, LogFn } from '@aztec/foundation/log';

import { Command } from 'commander';
Expand All @@ -10,7 +10,7 @@ import { dirname, resolve } from 'path';
import { cliTexts } from './texts.js';
import { installSignalHandlers } from './util.js';

const { AZTEC_PORT = '8080' } = process.env;
const { AZTEC_PORT = '8080', API_PREFIX = '' } = process.env;

/**
* Returns commander program that defines the 'aztec' command line interface.
Expand Down Expand Up @@ -59,7 +59,11 @@ export function getProgram(userLog: LogFn, debugLogger: DebugLogger): Command {
if (services.length) {
const rpcServer = createNamespacedJsonRpcServer(services, debugLogger);

const app = rpcServer.getApp();
const app = rpcServer.getApp(API_PREFIX);
// add status route
const statusRouter = createStatusRouter(API_PREFIX);
app.use(statusRouter.routes()).use(statusRouter.allowedMethods());

const httpServer = http.createServer(app.callback());
httpServer.listen(options.port);
userLog(`Aztec Server listening on port ${options.port}`);
Expand Down
1 change: 0 additions & 1 deletion yarn-project/p2p-bootstrap/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ resource "aws_ecs_task_definition" "p2p-bootstrap" {
"image": "${var.DOCKERHUB_ACCOUNT}/aztec:${var.DEPLOY_TAG}",
"command": ["start", "--p2p-bootstrap"],
"essential": true,
"command": ["start"],
"memoryReservation": 3776,
"portMappings": [
{
Expand Down

0 comments on commit 21ec23d

Please sign in to comment.