Skip to content

Commit

Permalink
switch to simple mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
KONFeature committed May 29, 2024
1 parent e45fdb0 commit 061533f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
context: .
platforms: linux/arm64
push: true
tags: 262732185023.dkr.ecr.eu-west-1.amazonaws.com/indexer-cache:latest
tags: 262732185023.dkr.ecr.eu-west-1.amazonaws.com/indexer:latest

- name: "🚀 SST Deploy"
run: |
Expand Down
22 changes: 11 additions & 11 deletions ponder.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,41 @@ const pollingConfig = {
maxRequestsPerSecond: 1,
} as const;

function getConfigOrEnv(key: string): string | undefined {
return process.env[key] ?? process.env[`${key}_FALLBACK`] ?? undefined;
}

export default createConfig({
// todo: Disabled for now to just have a successfully deployment
// database: {
// kind: "postgres",
// connectionString: process.env.DATABASE_URL,
// },
database: {
kind: "postgres",
connectionString: getConfigOrEnv("DATABASE_URL"),
kind: "sqlite",
},
networks: {
// Mainnets
arbitrum: {
chainId: 42161,
transport: http(getConfigOrEnv("PONDER_RPC_URL_ARB")),
transport: http(process.env.PONDER_RPC_URL_ARB),
...pollingConfig,
},
base: {
chainId: 8453,
transport: http(getConfigOrEnv("PONDER_RPC_URL_BASE")),
transport: http(process.env.PONDER_RPC_URL_BASE),
...pollingConfig,
},
optimism: {
chainId: 10,
transport: http(getConfigOrEnv("PONDER_RPC_URL_OPTIMISM")),
transport: http(process.env.PONDER_RPC_URL_OPTIMISM),
...pollingConfig,
},
polygon: {
chainId: 137,
transport: http(getConfigOrEnv("PONDER_RPC_URL_POLYGON")),
transport: http(process.env.PONDER_RPC_URL_POLYGON),
...pollingConfig,
},
// Testnets
arbitrumSepolia: {
chainId: 421614,
transport: http(getConfigOrEnv("PONDER_RPC_URL_ARB_SEPOLIA")),
transport: http(process.env.PONDER_RPC_URL_ARB_SEPOLIA),
...pollingConfig,
},
},
Expand Down
35 changes: 3 additions & 32 deletions sst.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Port, SecurityGroup } from "aws-cdk-lib/aws-ec2";
import { Repository } from "aws-cdk-lib/aws-ecr";
import { ContainerImage, Secret } from "aws-cdk-lib/aws-ecs";
import { StringParameter } from "aws-cdk-lib/aws-ssm";
Expand Down Expand Up @@ -61,8 +60,8 @@ function IndexerStack({ app, stack }: StackContext) {
stack,
"IndexerEcr",
{
repositoryArn: `arn:aws:ecr:eu-west-1:${app.account}:repository/indexer-cache`,
repositoryName: "indexer-cache",
repositoryArn: `arn:aws:ecr:eu-west-1:${app.account}:repository/indexer`,
repositoryName: "indexer",
}
);
const indexerImage = ContainerImage.fromEcrRepository(
Expand Down Expand Up @@ -124,7 +123,7 @@ function IndexerStack({ app, stack }: StackContext) {
});

// Set up connections to database via the security group
const cluster = indexerService.cdk?.cluster;
/*const cluster = indexerService.cdk?.cluster;
if (cluster) {
// Get the security group for the database and link to it
const databaseSecurityGroup = SecurityGroup.fromLookupById(
Expand All @@ -133,34 +132,6 @@ function IndexerStack({ app, stack }: StackContext) {
"sg-0cbbb98322234113f"
);
databaseSecurityGroup.connections.allowFrom(cluster, Port.tcp(5432));
}

// Find the container
/*const containerName = indexerService.getConstructMetadata().data.container;
if (!containerName) {
console.error("Failed to find container name");
return;
}
const container =
// Try to find the container via it's name
indexerService.cdk?.taskDefinition?.findContainer(containerName) ??
// Otherwise, get the default one
indexerService.cdk?.taskDefinition?.defaultContainer;
if (!container) {
console.error("Failed to find container");
return;
}
console.log(
`Found container: ${containerName}: ${container.containerName}`
);
// Add all the secrets directly to the container environment
for (const secretName of Object.keys(cdkSecretsMap)) {
const secret = cdkSecretsMap[secretName];
if (!secret) continue;
container.addSecret(secretName, secret);
}*/
}

Expand Down

0 comments on commit 061533f

Please sign in to comment.