diff --git a/bin/benchmark b/bin/benchmark index a159a6444e..78370f784d 100755 --- a/bin/benchmark +++ b/bin/benchmark @@ -12,4 +12,4 @@ cp $INDEX_SNAPSHOT tmp/benchmark/index.redb cargo build --release -time ./target/release/ord --data-dir tmp/benchmark --height-limit $HEIGHT_LIMIT index +time ./target/release/ord --datadir tmp/benchmark --height-limit $HEIGHT_LIMIT index diff --git a/bin/flamegraph b/bin/flamegraph index fe4a3b9f61..e81ccdb4d6 100755 --- a/bin/flamegraph +++ b/bin/flamegraph @@ -13,7 +13,7 @@ sudo \ --bin ord \ -- \ --chain signet \ - --data-dir . \ + --datadir . \ --height-limit 0 \ index @@ -27,7 +27,7 @@ rm -f flamegraph.svg --bin ord \ -- \ --chain signet \ - --data-dir . \ + --datadir . \ --height-limit 5000 \ index diff --git a/deploy/ord.service b/deploy/ord.service index d43f14b810..883b54db59 100644 --- a/deploy/ord.service +++ b/deploy/ord.service @@ -12,7 +12,7 @@ ExecStart=/usr/local/bin/ord \ --bitcoin-data-dir /var/lib/bitcoind \ --chain ${CHAIN} \ --config-dir /var/lib/ord \ - --data-dir /var/lib/ord \ + --datadir /var/lib/ord \ --index-runes \ --index-sats \ server \ diff --git a/docs/po/de.po b/docs/po/de.po index 44fcb7ee00..1665df9082 100644 --- a/docs/po/de.po +++ b/docs/po/de.po @@ -5111,11 +5111,11 @@ msgstr "" #: src\guides/reindexing.md:29 msgid "" "You can of course also set the location of the data directory yourself with " -"`ord --data-dir index run` or give it a specific filename and path " +"`ord --datadir index run` or give it a specific filename and path " "with `ord --index index run`." msgstr "" "Sie können natürlich auch den Speicherort des Dataverzeichnisses selbst " -"festlegen, indem Sie `ord --data-dir index run` verwenden oder ihm " +"festlegen, indem Sie `ord --datadir index run` verwenden oder ihm " "einen bestimmten Dateinamen und path mit `ord --index index run` " "zuweisen." diff --git a/docs/po/es.po b/docs/po/es.po index b08e7c1872..79b2199fc1 100644 --- a/docs/po/es.po +++ b/docs/po/es.po @@ -5062,11 +5062,11 @@ msgstr "" #: src/guides/reindexing.md:29 msgid "" "You can of course also set the location of the data directory yourself with " -"`ord --data-dir index update` or give it a specific filename and path " +"`ord --datadir index update` or give it a specific filename and path " "with `ord --index index update`." msgstr "" "También tienes la opción de determinar la ubicación del directorio de datos " -"utilizando el comando `ord --data-dir index update` o asignarle un nombre " +"utilizando el comando `ord --datadir index update` o asignarle un nombre " "de archivo y ruta específicos utilizando el comando `ord --index " "index update`." diff --git a/docs/po/fil.po b/docs/po/fil.po index 96b41c8586..7353a349f9 100644 --- a/docs/po/fil.po +++ b/docs/po/fil.po @@ -5078,11 +5078,11 @@ msgstr "" #: src/guides/reindexing.md:29 msgid "" "You can of course also set the location of the data directory yourself with " -"`ord --data-dir index update` or give it a specific filename and path " +"`ord --datadir index update` or give it a specific filename and path " "with `ord --index index update`." msgstr "" "Siyempre maaari mo ring itakda ang lokasyon ng direktoryo ng data sa iyong " -"sarili gamit ang `ord --data-dir index update` o bigyan ito ng " +"sarili gamit ang `ord --datadir index update` o bigyan ito ng " "partikular na filename at path na may `ord --index index update`." #: src/bounties.md:1 diff --git a/docs/po/fr.po b/docs/po/fr.po index 73f45a1a06..f4b71d221d 100644 --- a/docs/po/fr.po +++ b/docs/po/fr.po @@ -5192,10 +5192,10 @@ msgstr "" #: src\guides/reindexing.md:29 msgid "" "You can of course also set the location of the data directory yourself with " -"`ord --data-dir index update` or give it a specific filename and path " +"`ord --datadir index update` or give it a specific filename and path " "with `ord --index index update`." msgstr "" -"Vous pouvez bien sûr aussi définir `ord --data-dir index update` ou " +"Vous pouvez bien sûr aussi définir `ord --datadir index update` ou " "lui donner un nom de fichier et un chemin d’accès spécifiques avec `ord --" "index index update`." diff --git a/docs/po/hi.po b/docs/po/hi.po index d79a1db059..da73433841 100644 --- a/docs/po/hi.po +++ b/docs/po/hi.po @@ -4863,10 +4863,10 @@ msgstr "" #: src/guides/reindexing.md:29 msgid "" "You can of course also set the location of the data directory yourself with " -"`ord --data-dir index update` or give it a specific filename and path " +"`ord --datadir index update` or give it a specific filename and path " "with `ord --index index update`." msgstr "" -"आप निस्‍संदेह `ord --data-dir index update` के साथ डेटा निर्देशिका का स्थान स्वयं भी सेट " +"आप निस्‍संदेह `ord --datadir index update` के साथ डेटा निर्देशिका का स्थान स्वयं भी सेट " "कर सकते हैं या इसे `ord --index index update` के साथ एक विशिष्ट फ़ाइल नाम और " "पथ भी दे सकते हैं।" diff --git a/docs/po/it.po b/docs/po/it.po index 4c42b9c909..bfecbbb7b1 100644 --- a/docs/po/it.po +++ b/docs/po/it.po @@ -6062,11 +6062,11 @@ msgstr "" #: src/guides/reindexing.md:29 msgid "" "You can of course also set the location of the data directory yourself with " -"`ord --data-dir index update` or give it a specific filename and path " +"`ord --datadir index update` or give it a specific filename and path " "with `ord --index index update`." msgstr "" "Naturalmente potete anche impostare la posizione della directory dei dati " -"con `ord --data-dir index update` o assegnare un nome di file e un percorso " +"con `ord --datadir index update` o assegnare un nome di file e un percorso " "specifici con `ord --index index update`." #: src/bounties.md:1 diff --git a/docs/po/ja.po b/docs/po/ja.po index 3ff53a1196..4385552f4c 100644 --- a/docs/po/ja.po +++ b/docs/po/ja.po @@ -4775,10 +4775,10 @@ msgstr "" #: src/guides/reindexing.md:29 msgid "" "You can of course also set the location of the data directory yourself with " -"`ord --data-dir index update` or give it a specific filename and path " +"`ord --datadir index update` or give it a specific filename and path " "with `ord --index index update`." msgstr "" -"もちろん自分でデータの目録の位置を設置することができます,`ord --data-dir " +"もちろん自分でデータの目録の位置を設置することができます,`ord --datadir " " index update` または指定された特定のファイル名とパスに‘ord --index " "で索引運行します’。" diff --git a/docs/po/ko.po b/docs/po/ko.po index b57e95c68d..e9ebe8903c 100644 --- a/docs/po/ko.po +++ b/docs/po/ko.po @@ -4794,10 +4794,10 @@ msgstr "" #: /workspaces/ord_ko/docs/src/guides/reindexing.md:29 msgid "" "You can of course also set the location of the data directory yourself with " -"`ord --data-dir index update` or give it a specific filename and path " +"`ord --datadir index update` or give it a specific filename and path " "with `ord --index index update`." msgstr "" -"물론 `ord --data-dir index update`로 데이터 디렉터리의 위치를 직접 설정" +"물론 `ord --datadir index update`로 데이터 디렉터리의 위치를 직접 설정" "하거나 `ord --index index update`로 특정 파일 이름과 경로를 지정" "할 수도 있다." diff --git a/docs/po/pt.po b/docs/po/pt.po index 7353e02070..46eec0d143 100644 --- a/docs/po/pt.po +++ b/docs/po/pt.po @@ -5006,10 +5006,10 @@ msgstr "" #: src/guides/reindexing.md:29 msgid "" "You can of course also set the location of the data directory yourself with " -"`ord --data-dir index update` or give it a specific filename and path " +"`ord --datadir index update` or give it a specific filename and path " "with `ord --index index update`." msgstr "" -"É claro que você também pode definir a localização do diretório de dados com `ord --data-dir index update` " +"É claro que você também pode definir a localização do diretório de dados com `ord --datadir index update` " "ou fornecer um nome de arquivo e caminho específicos com `ord --index index update`." #: src/bounties.md:1 diff --git a/docs/po/ru.po b/docs/po/ru.po index 6f91e6bd85..15a7e5228a 100644 --- a/docs/po/ru.po +++ b/docs/po/ru.po @@ -4024,10 +4024,10 @@ msgstr "" #: src/guides/reindexing.md:29 msgid "" -"You can of course also set the location of the data directory yourself with `ord --data-dir index run` or give it a specific filename and path with `ord " +"You can of course also set the location of the data directory yourself with `ord --datadir index run` or give it a specific filename and path with `ord " "--index index run`." msgstr "" -"Конечно, можно также самостоятельно задать расположение директории данных командой `ord --data-dir index run` или указать ему конкретное имя файла и путь " +"Конечно, можно также самостоятельно задать расположение директории данных командой `ord --datadir index run` или указать ему конкретное имя файла и путь " "к нему командой `ord --index index run`." #: src/bounties.md:1 diff --git a/docs/po/zh.po b/docs/po/zh.po index e0871b9c07..701db155e6 100644 --- a/docs/po/zh.po +++ b/docs/po/zh.po @@ -5211,10 +5211,10 @@ msgstr "" #: src/guides/reindexing.md:29 msgid "" "You can of course also set the location of the data directory yourself with " -"`ord --data-dir index update` or give it a specific filename and path " +"`ord --datadir index update` or give it a specific filename and path " "with `ord --index index update`." msgstr "" -"您当然也可以自己设置数据目录的位置,`ord --data-dir index update` 或为其" +"您当然也可以自己设置数据目录的位置,`ord --datadir index update` 或为其" "指定特定的文件名和路径,使用‘ord --index 索引运行’。" #: src/bounties.md:1 diff --git a/docs/src/guides/reindexing.md b/docs/src/guides/reindexing.md index 97aaba20e9..093d8b1c78 100644 --- a/docs/src/guides/reindexing.md +++ b/docs/src/guides/reindexing.md @@ -27,5 +27,5 @@ ord index update ``` You can of course also set the location of the data directory yourself with `ord ---data-dir index update` or give it a specific filename and path with `ord +--datadir index update` or give it a specific filename and path with `ord --index index update`. diff --git a/docs/src/guides/settings.md b/docs/src/guides/settings.md index ba6f893199..ca9e15c771 100644 --- a/docs/src/guides/settings.md +++ b/docs/src/guides/settings.md @@ -11,17 +11,17 @@ The path to the configuration file can be given with `--config `. `ord` will error if `` doesn't exist. The path to a directory containing a configuration file name named `ord.yaml` -can be given with `--config-dir ` or `--data-dir +can be given with `--config-dir ` or `--datadir ` in which case the config path is `/ord.yaml` or `/ord.yaml`. It is not an error if it does not exist. -If none of `--config`, `--config-dir`, or `--data-dir` are given, and a file +If none of `--config`, `--config-dir`, or `--datadir` are given, and a file named `ord.yaml` exists in the default data directory, it will be loaded. For a setting named `--setting-name` on the command line, the environment variable will be named `ORD_SETTING_NAME`, and the config file field will be named `setting_name`. For example, the data directory can be configured with -`--data-dir` on the command line, the `ORD_DATA_DIR` environment variable, or +`--datadir` on the command line, the `ORD_DATA_DIR` environment variable, or `data_dir` in the config file. See `ord --help` for documentation of all the settings. diff --git a/docs/src/guides/testing.md b/docs/src/guides/testing.md index f1f1fa070c..9218c7e1a1 100644 --- a/docs/src/guides/testing.md +++ b/docs/src/guides/testing.md @@ -39,7 +39,7 @@ bitcoin-cli -datadir=env` And the `ord` will be: ``` -ord --data-dir env +ord --datadir env ``` Test Networks diff --git a/src/index/testing.rs b/src/index/testing.rs index 7788480a02..701e24c681 100644 --- a/src/index/testing.rs +++ b/src/index/testing.rs @@ -25,7 +25,7 @@ impl ContextBuilder { "ord".into(), "--bitcoin-rpc-url".into(), rpc_server.url().into(), - "--data-dir".into(), + "--datadir".into(), tempdir.path().into(), "--cookie-file".into(), cookie_file.into(), diff --git a/src/options.rs b/src/options.rs index 9a93442f4e..b77002d6d6 100644 --- a/src/options.rs +++ b/src/options.rs @@ -34,7 +34,7 @@ pub struct Options { pub(crate) config_dir: Option, #[arg(long, help = "Load Bitcoin Core RPC cookie file from .")] pub(crate) cookie_file: Option, - #[arg(long, help = "Store index in .")] + #[arg(long, alias = "datadir", help = "Store index in .")] pub(crate) data_dir: Option, #[arg( long, diff --git a/src/settings.rs b/src/settings.rs index 34d8e41309..339ae2eb7e 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -780,7 +780,7 @@ mod tests { #[test] fn network_is_joined_with_data_dir() { - let data_dir = parse(&["--chain=signet", "--data-dir=foo"]) + let data_dir = parse(&["--chain=signet", "--datadir=foo"]) .data_dir() .display() .to_string(); @@ -1065,7 +1065,7 @@ mod tests { "--config=config", "--config-dir=config dir", "--cookie-file=cookie file", - "--data-dir=/data/dir", + "--datadir=/data/dir", "--first-inscription-height=2", "--height-limit=3", "--index-cache-size=4", diff --git a/src/subcommand/env.rs b/src/subcommand/env.rs index 2a04aef1bc..a8931d6c5a 100644 --- a/src/subcommand/env.rs +++ b/src/subcommand/env.rs @@ -91,7 +91,7 @@ rpcport={bitcoind_port} let _ord = KillOnDrop( Command::new(&ord) - .arg("--data-dir") + .arg("--datadir") .arg(&absolute) .arg("server") .arg("--polling-interval=100ms") @@ -104,7 +104,7 @@ rpcport={bitcoind_port} if !absolute.join("regtest/wallets/ord").try_exists()? { let status = Command::new(&ord) - .arg("--data-dir") + .arg("--datadir") .arg(&absolute) .arg("wallet") .arg("create") @@ -113,7 +113,7 @@ rpcport={bitcoind_port} ensure!(status.success(), "failed to create wallet: {status}"); let output = Command::new(&ord) - .arg("--data-dir") + .arg("--datadir") .arg(&absolute) .arg("wallet") .arg("receive") @@ -153,7 +153,7 @@ rpcport={bitcoind_port} bitcoin_cli_command: vec!["bitcoin-cli".into(), format!("-datadir={relative}")], ord_wallet_command: vec![ ord.to_str().unwrap().into(), - "--data-dir".into(), + "--datadir".into(), absolute.to_str().unwrap().into(), "wallet".into(), ], @@ -166,7 +166,7 @@ rpcport={bitcoind_port} {} bitcoin-cli -datadir='{relative}' getblockchaininfo {} -{} --data-dir '{relative}' wallet balance", +{} --datadir '{relative}' wallet balance", "`ord` server URL:".blue().bold(), "Example `bitcoin-cli` command:".blue().bold(), "Example `ord` command:".blue().bold(), diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs index 78d21ca48a..d76b4101b7 100644 --- a/src/subcommand/server.rs +++ b/src/subcommand/server.rs @@ -1875,7 +1875,7 @@ mod tests { args.push("--cookie-file".into()); args.push(cookiefile.to_str().unwrap().into()); - args.push("--data-dir".into()); + args.push("--datadir".into()); args.push(tempdir.path().to_str().unwrap().into()); if !self.ord_args.contains_key("--chain") { @@ -2234,7 +2234,7 @@ mod tests { #[test] fn acme_cache_defaults_to_data_dir() { - let arguments = Arguments::try_parse_from(["ord", "--data-dir", "foo", "server"]).unwrap(); + let arguments = Arguments::try_parse_from(["ord", "--datadir", "foo", "server"]).unwrap(); let settings = Settings::from_options(arguments.options) .or_defaults() @@ -2254,7 +2254,7 @@ mod tests { #[test] fn acme_cache_flag_is_respected() { let arguments = - Arguments::try_parse_from(["ord", "--data-dir", "foo", "server", "--acme-cache", "bar"]) + Arguments::try_parse_from(["ord", "--datadir", "foo", "server", "--acme-cache", "bar"]) .unwrap(); let settings = Settings::from_options(arguments.options) diff --git a/tests/command_builder.rs b/tests/command_builder.rs index 7a03d1a5d8..5747f3aee5 100644 --- a/tests/command_builder.rs +++ b/tests/command_builder.rs @@ -172,7 +172,7 @@ impl CommandBuilder { .stdout(Stdio::piped()) .stderr(Stdio::piped()) .current_dir(&*self.tempdir) - .arg("--data-dir") + .arg("--datadir") .arg(self.tempdir.path()) .args(&args); diff --git a/tests/test_server.rs b/tests/test_server.rs index 03781b33e0..776f77e774 100644 --- a/tests/test_server.rs +++ b/tests/test_server.rs @@ -44,7 +44,7 @@ impl TestServer { .port(); let (settings, server) = parse_ord_server_args(&format!( - "ord --bitcoin-rpc-url {} --cookie-file {} --bitcoin-data-dir {} --data-dir {} {} server {} --http-port {port} --address 127.0.0.1", + "ord --bitcoin-rpc-url {} --cookie-file {} --bitcoin-data-dir {} --datadir {} {} server {} --http-port {port} --address 127.0.0.1", bitcoin_rpc_server.url(), cookiefile.to_str().unwrap(), tempdir.path().display(),