SHOWING: First 60
"you should leave `bitcoind` running in the background when you're using "
"`ord`."
msgstr ""
"像区块链浏览器[the mempool.space block explorer](https://mempool.space/)一样"
"对区块进行记述. `ord`同`bitcoind`进行交互, 所以你在使用`ord`时候需要让"
"`bitcoind` 在后台运行。"
#: src/guides/inscriptions.md:92
msgid ""
"The blockchain takes about 600GB of disk space. If you have an external "
"drive you want to store blocks on, use the configuration option "
"`blocksdir=<external_drive_path>`. This is much simpler than using the "
"`datadir` option because the cookie file will still be in the default "
"location for `bitcoin-cli` and `ord` to find."
msgstr ""
"T区块链占用约600GB的磁盘空间。如果你有一个外接硬盘来存储区块,可以使用配置选项"
"`blocksdir=<external_drive_path>`. 这比使用`datadir` 选项更简单, "
"`bitcoin-cli` 和 `ord` 可以在默认的位置找到cookie文件"
#: src/guides/inscriptions.md:98 src/guides/collecting/sparrow-wallet.md:173
msgid "Troubleshooting"
msgstr "故障排除"
#: src/guides/inscriptions.md:101
msgid ""
"Make sure you can access `bitcoind` with `bitcoin-cli -getinfo` and that it "
"is fully synced."
#44,990,748text<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="#a1adb8"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc. --><path d="M256 0a256 256 0 1 1 0 512A256 256 0 1 1 256 0zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"/></svg>
#44,990,727textpub(crate) use {
super::*,
bitcoin::{
blockdata::{opcodes, script, script::PushBytesBuf},
ScriptBuf, Witness,
},
pretty_assertions::assert_eq as pretty_assert_eq,
std::iter,
test_bitcoincore_rpc::TransactionTemplate,
unindent::Unindent,
};
macro_rules! assert_regex_match {
($value:expr, $pattern:expr $(,)?) => {
let regex = Regex::new(&format!("^(?s){}$", $pattern)).unwrap();
let string = $value.to_string();
if !regex.is_match(string.as_ref()) {
panic!(
"Regex:\n\n{}\n\n…did not match string:\n\n{}",
regex, string
);
}
};
}
macro_rules! assert_matches {
($expression:expr, $( $pattern:pat_param )|+ $( if $guard:expr )? $(,)?) => {
match $expression {
$( $pattern )|+ $( if $guard )? => {}
left => panic!(
"assertion failed: (left ~= right)\n left: `{:?}`\n right: `{}`",
left,
stringify!($($pattern)|+ $(if $guard)?)
),
}
}
}
pub(crate) fn blockhash(n: u64) -> BlockHash {
let hex = format!("{n:x}");#44,987,345text });
let id = InscriptionId { txid, index: 0 };
server.mine_blocks(1);
server.assert_response_regex(
format!("/inscription/{id}"),
StatusCode::OK,
format!(
".*<h1>Inscription -1</h1>.*
<dl>
<dt>id</dt>
<dd class=monospace>{id}</dd>
<dt>charms</dt>
<dd>
<span title=cursed>👹</span>
</dd>
.*
</dl>
.*
"
),
);
}
#[test]
fn charm_uncommon() {
let server = TestServer::new_with_regtest_with_index_sats();
server.mine_blocks(2);
let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate {
inputs: &[(1, 0, 0, inscription("text/plain", "foo").to_witness())],
..Default::default()
});
let id = InscriptionId { txid, index: 0 };
server.mine_blocks(1);
server.assert_response_regex(
format!("/inscription/{id}"),
StatusCode::OK,
format!(
".*<h1>Inscription 0</h1>.*
<dl>
<dt>id</dt>
<dd class=monospace>{id}</dd>
<dt>charms</dt>
<dd>
<span title=uncommon>🌱</span>
#44,986,828text lock_time: locktime::absolute::LockTime::ZERO,
version: 0,
});
match result {
Ok(_) => panic!("expected error"),
Err(Error::Varint) => {}
Err(err) => panic!("unexpected error: {err}"),
}
}
#[test]
fn deciphering_non_empty_runestone_is_successful() {
let payload = payload(&[0, 1, 2, 3]);
let payload: &PushBytes = payload.as_slice().try_into().unwrap();
assert_eq!(
Runestone::decipher(&Transaction {
input: Vec::new(),
output: vec![TxOut {
script_pubkey: script::Builder::new()
.push_opcode(opcodes::all::OP_RETURN)
.push_slice(b"RUNE_TEST")
.push_slice(payload)
.into_script(),
value: 0
}],
lock_time: locktime::absolute::LockTime::ZERO,
version: 0,
}),
Ok(Some(Runestone {
edicts: vec![Edict {
id: 1,
amount: 2,
output: 3,
}],
..Default::default()
}))
);
}
#[test]
#44,985,726text
server.assert_response_regex(
format!("/inscription/{id}"),
StatusCode::OK,
format!(
".*<h1>Inscription -1</h1>.*
<dl>
<dt>id</dt>
<dd class=monospace>{id}</dd>
<dt>charms</dt>
<dd>
<span title=cursed>👹</span>
<span title=unbound>🔓</span>
</dd>
.*
</dl>
.*
"
),
);
}
#[test]
fn charm_lost() {
let server = TestServer::new_with_regtest();
server.mine_blocks(1);
let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate {
inputs: &[(1, 0, 0, inscription("text/plain", "foo").to_witness())],
..Default::default()
});
let id = InscriptionId { txid, index: 0 };
server.mine_blocks(1);
server.assert_response_regex(
format!("/inscription/{id}"),
StatusCode::OK,
format!(
".*<h1>Inscription 0</h1>.*
<dl>
<dt>id</dt>
<dd class=monospace>{id}</dd>
<dt>output value</dt>
<dd>5000000000</dd>
.*
</dl>
.*
"
),
);
server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate {
#44,985,635textdmt-mint.nat#44,315,208tapdmt-mint.nat#44,315,199tapdmt-mint.nat#44,315,174tapdmt-mint.nat#44,315,166tapdmt-mint.nat#44,315,164tapdmt-mint.nat#44,315,140tapdmt-mint.nat#44,315,122tapdmt-mint.nat#44,315,099tapdmt-mint.nat#44,315,094tapdmt-mint.nat#44,315,092tapdmt-mint.nat#44,315,091tapdmt-mint.nat#44,315,086tapdmt-mint.nat#44,315,055tapdmt-mint.nat#44,315,054tapdmt-mint.nat#44,315,051tapdmt-mint.nat#44,315,037tap