diff --git a/deno.json b/deno.json index 379ae70..c94c259 100644 --- a/deno.json +++ b/deno.json @@ -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": { diff --git a/tasks/dl.ts b/tasks/dl.ts index a454823..54cc534 100644 --- a/tasks/dl.ts +++ b/tasks/dl.ts @@ -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"), -// ) diff --git a/tasks/enable_logging.ts b/tasks/enable_logging.ts new file mode 100644 index 0000000..c22db3f --- /dev/null +++ b/tasks/enable_logging.ts @@ -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)") \ No newline at end of file