From 4fd1a9aaf9107db84d076c7ed1e27a9542c3f89c Mon Sep 17 00:00:00 2001 From: Tristan Date: Fri, 22 Dec 2023 20:25:36 +0000 Subject: [PATCH 1/4] Support COOKIE_FILE env var --- modules/main_index/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/main_index/index.js b/modules/main_index/index.js index aceacd5..b5da0c6 100644 --- a/modules/main_index/index.js +++ b/modules/main_index/index.js @@ -35,6 +35,7 @@ var chain_folder = process.env.BITCOIN_CHAIN_FOLDER || "~/.bitcoin/" var ord_binary = process.env.ORD_BINARY || "ord" var ord_folder = process.env.ORD_FOLDER || "../../ord/target/release/" var ord_datadir = process.env.ORD_DATADIR || "." +var cookie_file = process.env.COOKIE_FILE || "" const first_inscription_height = parseInt(process.env.FIRST_INSCRIPTION_HEIGHT || "767430") function delay(sec) { @@ -78,9 +79,11 @@ async function main_index() { ord_end_block_height = ord_last_block_height + 1000 } + let cookie_arg = cookie_file ? ` --cookie-file=${cookie_file} ` : "" + let current_directory = process.cwd() process.chdir(ord_folder); - let ord_index_cmd = ord_binary + " --bitcoin-data-dir " + chain_folder + " --data-dir " + ord_datadir + " --height-limit " + (ord_end_block_height) + " index run" + let ord_index_cmd = ord_binary + " --bitcoin-data-dir " + chain_folder + " --data-dir " + ord_datadir + " --height-limit " + cookie_arg + (ord_end_block_height) + " index run" try { execSync(ord_index_cmd, {stdio: 'inherit'}) From b1791d78336486c2fb7cb78fa5b173ec769ce876 Mon Sep 17 00:00:00 2001 From: Tristan Date: Fri, 22 Dec 2023 20:31:44 +0000 Subject: [PATCH 2/4] Fix position of cookie arg --- modules/main_index/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/main_index/index.js b/modules/main_index/index.js index b5da0c6..e11f650 100644 --- a/modules/main_index/index.js +++ b/modules/main_index/index.js @@ -83,7 +83,7 @@ async function main_index() { let current_directory = process.cwd() process.chdir(ord_folder); - let ord_index_cmd = ord_binary + " --bitcoin-data-dir " + chain_folder + " --data-dir " + ord_datadir + " --height-limit " + cookie_arg + (ord_end_block_height) + " index run" + let ord_index_cmd = ord_binary + " --bitcoin-data-dir " + chain_folder + " --data-dir " + ord_datadir + cookie_arg + " --height-limit " + (ord_end_block_height) + " index run" try { execSync(ord_index_cmd, {stdio: 'inherit'}) From c67bf95da6543b5af12db3a9aa3f40103795c541 Mon Sep 17 00:00:00 2001 From: "Tristan (t4t5)" Date: Mon, 15 Jan 2024 20:48:04 +0000 Subject: [PATCH 3/4] Don't update schema version --- ord/src/index.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ord/src/index.rs b/ord/src/index.rs index c84f8a6..e9dc916 100644 --- a/ord/src/index.rs +++ b/ord/src/index.rs @@ -41,7 +41,7 @@ mod updater; #[cfg(test)] pub(crate) mod testing; -const SCHEMA_VERSION: u64 = 99000016; +const SCHEMA_VERSION: u64 = 16; macro_rules! define_table { ($name:ident, $key:ty, $value:ty) => { From e73ac33db7eab78b5cb69a1db84f0d9c24f3bd09 Mon Sep 17 00:00:00 2001 From: Tristan Date: Mon, 22 Jan 2024 07:58:18 +0000 Subject: [PATCH 4/4] remove first_inscription_height --- modules/main_index/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/main_index/index.js b/modules/main_index/index.js index 6a5c13f..55a7127 100644 --- a/modules/main_index/index.js +++ b/modules/main_index/index.js @@ -40,7 +40,6 @@ var ord_folder = process.env.ORD_FOLDER || "../../ord/target/release/" var ord_datadir = process.env.ORD_DATADIR || "." var cookie_file = process.env.COOKIE_FILE || "" -const first_inscription_height = parseInt(process.env.FIRST_INSCRIPTION_HEIGHT || "767430") const network_type = process.env.NETWORK_TYPE || "mainnet" var network = null @@ -567,4 +566,4 @@ async function check_db() { } } -main_index() \ No newline at end of file +main_index()