Skip to content

Commit

Permalink
feat: switch explorer to d1
Browse files Browse the repository at this point in the history
  • Loading branch information
rvcas committed Jul 6, 2024
1 parent e41e650 commit fb3c691
Show file tree
Hide file tree
Showing 20 changed files with 678 additions and 1,237 deletions.
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
KUPO_URL=""
OGMIOS_URL=""
OGMIOS_URL=""
CLOUDFLARE_ACCOUNT_ID=
CLOUDFLARE_DATABASE_ID=
CLOUDFLARE_D1_TOKEN=
264 changes: 0 additions & 264 deletions Cargo.lock

This file was deleted.

19 changes: 0 additions & 19 deletions Cargo.toml

This file was deleted.

5 changes: 0 additions & 5 deletions build.rs

This file was deleted.

13 changes: 13 additions & 0 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineConfig } from 'drizzle-kit';

export default defineConfig({
schema: './src/lib/server/schema.sql.ts',
out: './migrations',
dialect: 'sqlite',
driver: 'd1-http',
dbCredentials: {
accountId: process.env.CLOUDFLARE_ACCOUNT_ID!,
databaseId: process.env.CLOUDFLARE_DATABASE_ID!,
token: process.env.CLOUDFLARE_D1_TOKEN!,
},
});
11 changes: 11 additions & 0 deletions migrations/0000_mushy_red_ghost.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CREATE TABLE `blocks` (
`number` integer PRIMARY KEY NOT NULL,
`hash` text(64) NOT NULL,
`leading_zeros` integer NOT NULL,
`target_number` integer NOT NULL,
`epoch_time` integer NOT NULL,
`current_posix_time` integer NOT NULL,
`nonce` text(32)
);
--> statement-breakpoint
CREATE UNIQUE INDEX `blocks_hash_unique` ON `blocks` (`hash`);
Loading

0 comments on commit fb3c691

Please sign in to comment.