Skip to content

Commit

Permalink
enable_logging on pg
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-iohk committed Oct 22, 2024
1 parent b4b4610 commit 3375290
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
3 changes: 2 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
"dl:mainnet": "deno task dl:devnet --network mainnet",
"pg:init": "docker run -d --name mina-archive-db -p 5432:5432 -v $(pwd)/sql_scripts:/docker-entrypoint-initdb.d -e POSTGRES_PASSWORD=whatever -e POSTGRES_USER=mina postgres",
"pg:wait": "deno run -A ./tasks/pg_wait.ts",
"pg:enable_logging": "deno run -A ./tasks/enable_logging.ts",
"pg:up": "docker start mina-archive-db",
"pg:down": "docker kill mina-archive-db",
"pg:rm": "docker rm mina-archive-db",
"dev:init": "deno task dl:devnet && deno task pg:init && deno task pg:wait",
"dev:init": "deno task dl:devnet && deno task pg:enable_logging && deno task pg:init && deno task pg:wait",
"dev": "cargo run serve --playground"
},
"imports": {
Expand Down
5 changes: 0 additions & 5 deletions tasks/dl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,3 @@ await new Deno.Command("tar", {
cwd: destDir,
}).output()

// TODO: automatically enable? (thoughts piotr-iohk?)
// await Deno.copyFile(
// import.meta.resolve("./enable_logging.sh"),
// path.join(destDir, "enable_logging.sh"),
// )
12 changes: 12 additions & 0 deletions tasks/enable_logging.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

import * as path from "@std/path"

const destDir = path.join(Deno.cwd(), "sql_scripts")

await Deno.copyFile(
path.join(path.dirname(path.fromFileUrl(import.meta.url)), "enable_logging.sh"),
path.join(destDir, "enable_logging.sh"),
)

console.log("Copied enable_logging.sh to", destDir)
console.log("In order to apply the changes, restart the Postgres server. (deno task pg:init)")

0 comments on commit 3375290

Please sign in to comment.