Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/processor/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export * from "./Processor";
export * from "./ProcessorModule";
export * from "./handlers/HandlersExecutor";
export * from "./handlers/BasePrismaClient";
export * from "./storage/Database";
export * from "./triggers/TimedProcessorTrigger";
export * from "./indexer/BlockFetching";
Expand Down
7 changes: 6 additions & 1 deletion packages/stack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,19 @@
"@proto-kit/protocol": "*",
"@proto-kit/sdk": "*",
"@proto-kit/sequencer": "*",
"@proto-kit/indexer": "*",
"@proto-kit/processor": "*",
"o1js": "^2.10.0",
"tsyringe": "^4.10.0"
},
"devDependencies": {
"@jest/globals": "^29.5.0"
},
"dependencies": {
"reflect-metadata": "^0.1.13"
"reflect-metadata": "^0.1.13",
"@prisma/client": "^5.19.1",
"mina-fungible-token": "^1.1.0",
"type-graphql": "2.0.0-rc.2"
},
"gitHead": "397881ed5d8f98f5005bcd7be7f5a12b3bc6f956"
}
4 changes: 4 additions & 0 deletions packages/stack/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
export * from "./scripts/graphql/server";
export * from "./presets/config";
export * from "./presets/modules/types";
export * from "./presets/modules/utils";
export * from "./presets/modules";
184 changes: 184 additions & 0 deletions packages/stack/src/presets/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
export const inmemoryConfig = {
blockInterval: 5000,
graphqlHost: "localhost",
graphqlPort: 8080,
graphiqlEnabled: true,
};
export const developmentConfig = {
proofsEnabled: false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't like that we are redefining all these configuration options here. Because we already have them defined on a module level - ConfigurableModule allows us to extract config typing.
I would queue a followup PR where we try to remove this middle layer and reuse the config types directly. Obviously we need some translation layer from ENV variables -> configs - we can think about how to best do this.
We should also separate clearly between mandatory configs, which we have to set in the starter kit (things like ports, connection strings, etc. - these will mostly be env variables as well) and then non-mandatory configuration, of which we have a quite a few as well, but which aren't included in here at all yet - that's where reusing the module's config types comes in handy


shouldAttemptDbMigration: true,
shouldAttemptIndexerDbMigration: true,
shouldAttemptProcessorDbMigration: true,

pruneOnStartup: false,

blockInterval: 30000,
settlementInterval: 60000,
settlementEnabled: true,

redisHost: "localhost",
redisPort: 6379,
redisPassword: "password",

databaseUrl:
"postgresql://admin:password@localhost:5432/protokit?schema=public",

indexerDatabaseUrl:
"postgresql://admin:password@localhost:5433/protokit-indexer?schema=public",

processorDatabaseUrl:
"postgresql://admin:password@localhost:5434/protokit-processor?schema=public",

graphqlHost: "0.0.0.0",
graphqlPort: 8080,
graphiqlEnabled: true,

indexerGraphqlHost: "0.0.0.0",
indexerGraphqlPort: 8081,
indexerGraphqlEnabled: true,

processorGraphqlHost: "0.0.0.0",
processorGraphqlPort: 8082,
processorGraphqlEnabled: true,

processorIndexerGraphqlHost: "0.0.0.0",

minaNetwork: "lightnet",
minaNodeGraphqlHost: "http://localhost",
minaNodeGraphqlPort: 8083,

minaArchiveGraphqlHost: "http://localhost",
minaArchiveGraphqlPort: 8085,

minaAccountManagerHost: "http://localhost",
minaAccountManagerPort: 8084,
minaExplorerPort: 3001,

transactionFeeRecipientPrivateKey:
"EKEssvj33MMBCg2tcybTzL32nTKbbwFHm6yUxd3JassdhL3J5aT8",
transactionFeeRecipientPublicKey:
"B62qk4sNnzZqqjHp8YQXZUV3dBpnjiNieJVnsuh7mD2bMJ9PdbskH5H",

sequencerPrivateKey: "EKEdKhgUHMuDvwWJEg2TdCMCeiTSd9hh2HrEr6uYJfPVuwur1s43",
sequencerPublicKey: "B62qizW6aroTxQorJz4ywVNZom4jA6W4QPPCK3wLeyhnJHtVStUNniL",

settlementContractPrivateKey:
"EKErS9gYHZNawqKuwfMiwYYJtNptCrvca491QEvB3tz8sFsS5w66",
settlementContractPublicKey:
"B62qjKhzrvDgTPXCp34ozmpFSx4sC9owZe6eDzhdGPdoiUbGPmBkHTt",

dispatcherContractPrivateKey:
"EKF9Ei5G9PeB5ULMh9R6P5LfWX2gs15XxPNsect1pbcbMY9vs6v7",
dispatcherContractPublicKey:
"B62qmAzUJ1jqcsEf2V3K1k2Ec4MLsEKnodEvvJ5uweTFSLYEUALe1zs",

minaBridgeContractPrivateKey:
"EKFKTGqWU2egLKhMgoxX8mQ21zXSE1RZYkY82mmK9F3BxdSA7E5M",
minaBridgeContractPublicKey:
"B62qn8XRkWcaBvv6F7kvarKs4cViaKRMbTUHT8FrDXLnvxuV6n7CHsN",

customTokenPrivateKey: "EKFZHQSo5YdrcU7neDaNZruYHvCiNncvdZyKXuS6MDCW1fyCFKDP",

customTokenAdminPrivateKey:
"EKENQ2QRc4gAJkZjQXU86ZS9MDm1e7HFiNN6LgRJnniHJt1WXDn1",

customTokenBridgePrivateKey:
"EKENQ2QRc4gAJkZjQXU86ZS9MDm1e7HFiNN6LgRJnniHJt1WXDn1",

testAccount1PrivateKey:
"EKF5p3wQTFd4tRBiGicRf93yXK82bcRryokC1qoazRM6wq6gMzWJ",
testAccount1PublicKey:
"B62qkVfEwyfkm5yucHEqrRjxbyx98pgdWz82pHv7LYq9Qigs812iWZ8",

openTelemetryTracingEnabled: true,
openTelemetryTracingUrl: "http://localhost:4318",

openTelemetryMetricsEnabled: true,
openTelemetryMetricsHost: "0.0.0.0",
openTelemetryMetricsPort: 4320,
openTelemetryMetricsScrapingFrequency: 10,
};
export const sovereignConfig = {
blockInterval: 10000,
settlementInterval: 30000,
settlementEnabled: true,

shouldAttemptDbMigration: true,
shouldAttemptIndexerDbMigration: true,
shouldAttemptProcessorDbMigration: true,

pruneOnStartup: false,

redisHost: "redis",
redisPort: 6379,
redisPassword: "password",

databaseUrl:
"postgresql://admin:password@postgres:5432/protokit?schema=public",

indexerDatabaseUrl:
"postgresql://admin:password@indexer-postgres:5432/protokit-indexer?schema=public",

processorDatabaseUrl:
"postgresql://admin:password@processor-postgres:5432/protokit-processor?schema=public",

graphqlHost: "0.0.0.0",
graphqlPort: 8080,
graphiqlEnabled: true,

indexerGraphqlHost: "0.0.0.0",
indexerGraphqlPort: 8081,
indexerGraphqlEnabled: true,

processorGraphqlHost: "0.0.0.0",
processorGraphqlPort: 8082,
processorGraphqlEnabled: true,
processorIndexerGraphqlHost: "indexer",

minaNetwork: "lightnet",
minaNodeGraphqlHost: "http://lightnet",
minaNodeGraphqlPort: 8080,

minaArchiveGraphqlHost: "http://lightnet",
minaArchiveGraphqlPort: 8282,

minaAccountManagerHost: "http://lightnet",
minaAccountManagerPort: 8084,
minaExplorerPort: 3001,
transactionFeeRecipientPrivateKey:
"EKEssvj33MMBCg2tcybTzL32nTKbbwFHm6yUxd3JassdhL3J5aT8",
transactionFeeRecipientPublicKey:
"B62qk4sNnzZqqjHp8YQXZUV3dBpnjiNieJVnsuh7mD2bMJ9PdbskH5H",

sequencerPrivateKey: "EKEdKhgUHMuDvwWJEg2TdCMCeiTSd9hh2HrEr6uYJfPVuwur1s43",
sequencerPublicKey: "B62qizW6aroTxQorJz4ywVNZom4jA6W4QPPCK3wLeyhnJHtVStUNniL",

settlementContractPrivateKey:
"EKErS9gYHZNawqKuwfMiwYYJtNptCrvca491QEvB3tz8sFsS5w66",
settlementContractPublicKey:
"B62qjKhzrvDgTPXCp34ozmpFSx4sC9owZe6eDzhdGPdoiUbGPmBkHTt",

dispatcherContractPrivateKey:
"EKF9Ei5G9PeB5ULMh9R6P5LfWX2gs15XxPNsect1pbcbMY9vs6v7",
dispatcherContractPublicKey:
"B62qmAzUJ1jqcsEf2V3K1k2Ec4MLsEKnodEvvJ5uweTFSLYEUALe1zs",

minaBridgeContractPrivateKey:
"EKFKTGqWU2egLKhMgoxX8mQ21zXSE1RZYkY82mmK9F3BxdSA7E5M",
minaBridgeContractPublicKey:
"B62qn8XRkWcaBvv6F7kvarKs4cViaKRMbTUHT8FrDXLnvxuV6n7CHsN",

testAccount1PrivateKey:
"EKF5p3wQTFd4tRBiGicRf93yXK82bcRryokC1qoazRM6wq6gMzWJ",
testAccount1PublicKey:
"B62qkVfEwyfkm5yucHEqrRjxbyx98pgdWz82pHv7LYq9Qigs812iWZ8",

openTelemetryTracingEnabled: true,
openTelemetryTracingUrl: "http://otel-collector:4317",

openTelemetryMetricsEnabled: true,
openTelemetryMetricsHost: "0.0.0.0",
openTelemetryMetricsPort: 4320,
openTelemetryMetricsScrapingFrequency: 10,
};
Loading