-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add blob sink to docker compose and sandbox
- Loading branch information
Showing
20 changed files
with
241 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## TODO THIS | ||
|
||
FROM aztecprotocol/yarn-project AS yarn-project | ||
|
||
RUN apt update | ||
|
||
ENTRYPOINT ["node", "/usr/src/yarn-project/blob-sink/dest/bin/run.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,30 @@ | ||
import { type DataStoreConfig } from '@aztec/kv-store/config'; | ||
import { type ConfigMappingsType, getConfigFromMappings } from '@aztec/foundation/config'; | ||
import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config'; | ||
|
||
export interface BlobSinkConfig { | ||
export type BlobSinkConfig = { | ||
port?: number; | ||
dataStoreConfig?: DataStoreConfig; | ||
otelMetricsCollectorUrl?: string; | ||
// otelMetricsCollectorUrl?: string; | ||
} & DataStoreConfig; | ||
|
||
export const blobSinkConfigMappings: ConfigMappingsType<BlobSinkConfig> = { | ||
port: { | ||
env: 'BLOB_SINK_PORT', | ||
description: 'The port to run the blob sink server on', | ||
}, | ||
...dataConfigMappings, | ||
|
||
// TODO: bring otel endpoints back | ||
// otelMetricsCollectorUrl: { | ||
// env: 'OTEL_METRICS_COLLECTOR_URL', | ||
// description: 'The URL of the OTLP metrics collector', | ||
// }, | ||
}; | ||
|
||
/** | ||
* Returns the blob sink configuration from the environment variables. | ||
* Note: If an environment variable is not set, the default value is used. | ||
* @returns The blob sink configuration. | ||
*/ | ||
export function getBlobSinkConfigFromEnv(): BlobSinkConfig { | ||
return getConfigFromMappings<BlobSinkConfig>(blobSinkConfigMappings); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Run a standalone blob sink server | ||
import { createLogger } from '@aztec/foundation/log'; | ||
|
||
import { getBlobSinkConfigFromEnv } from './config.js'; | ||
import { BlobSinkServer } from './server.js'; | ||
|
||
const logger = createLogger('aztec:blob-sink'); | ||
|
||
async function main() { | ||
const config = getBlobSinkConfigFromEnv(); | ||
const blobSinkServer = new BlobSinkServer(config); | ||
|
||
await blobSinkServer.start(); | ||
|
||
const stop = async () => { | ||
logger.debug('Stopping Blob Sink...'); | ||
await blobSinkServer.stop(); | ||
logger.info('Node stopped'); | ||
process.exit(0); | ||
}; | ||
process.on('SIGTERM', stop); | ||
process.on('SIGINT', stop); | ||
} | ||
|
||
void main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
yarn-project/end-to-end/scripts/native-network/blob-sink.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
REPO=$(git rev-parse --show-toplevel) | ||
|
||
# Starts the Blob Sink | ||
export PORT=${BLOB_SINK_PORT:-5052} | ||
export DEBUG=${DEBUG:-"aztec:*"} | ||
export DEBUG_COLORS=${DEBUG_COLORS:-1} | ||
|
||
node --no-warnings "$REPO"/yarn-project/blob-sink/dest/run.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters