SHOWING: First 60
#65,793,365text#65,793,245text#59,566,608gltf#59,566,606gltfuse super::*;
fn target_as_block_hash(target: bitcoin::Target) -> BlockHash {
BlockHash::from_raw_hash(Hash::from_byte_array(target.to_le_bytes()))
}
#[derive(Boilerplate)]
pub(crate) struct BlockHtml {
hash: BlockHash,
target: BlockHash,
best_height: Height,
block: Block,
height: Height,
inscription_count: usize,
featured_inscriptions: Vec<InscriptionId>,
}
impl BlockHtml {
pub(crate) fn new(
block: Block,
height: Height,
best_height: Height,
inscription_count: usize,
featured_inscriptions: Vec<InscriptionId>,
) -> Self {
Self {
hash: block.header.block_hash(),
target: target_as_block_hash(block.header.target()),
block,
height,
best_height,
inscription_count,
featured_inscriptions,
}
}
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct BlockJson {
pub hash: BlockHash,
pub target: BlockHash,
pub best_height: u32,
pub height: u32,
pub inscriptions: Vec<InscriptionId>,
}
impl BlockJson {
pub(crate) fn new(#44,995,152textReindexing
==========
Sometimes the `ord` database must be reindexed, which means deleting the
database and restarting the indexing process with either `ord index update` or
`ord server`. Reasons to reindex are:
1. A new major release of ord, which changes the database scheme
2. The database got corrupted somehow
The database `ord` uses is called [redb](https://github.com/cberner/redb),
so we give the index the default file name `index.redb`. By default we store this
file in different locations depending on your operating system.
|Platform | Value | Example |
| ------- | ------------------------------------------------ | -------------------------------------------- |
| Linux | `$XDG_DATA_HOME`/ord or `$HOME`/.local/share/ord | /home/alice/.local/share/ord |
| macOS | `$HOME`/Library/Application Support/ord | /Users/Alice/Library/Application Support/ord |
| Windows | `{FOLDERID_RoamingAppData}`\ord | C:\Users\Alice\AppData\Roaming\ord |
#44,990,222text let reveal_address = recipient();
let (_commit_tx, reveal_tx, _private_key, _) = Batch {
satpoint,
parent_info: None,
inscriptions: vec![inscription],
destinations: vec![reveal_address],
commit_fee_rate: FeeRate::try_from(1.0).unwrap(),
reveal_fee_rate: FeeRate::try_from(1.0).unwrap(),
no_limit: true,
reinscribe: false,
postage: TransactionBuilder::TARGET_POSTAGE,
mode: Mode::SharedOutput,
..Default::default()
}
.create_batch_inscription_transactions(
BTreeMap::new(),
Chain::Mainnet,
BTreeSet::new(),
utxos.into_iter().collect(),
[commit_address, change(1)],
)
.unwrap();
assert!(reveal_tx.size() >= MAX_STANDARD_TX_WEIGHT as usize);
}
#[test]
fn cbor_and_json_metadata_flags_conflict() {
assert_regex_match!(
Arguments::try_parse_from([
"ord",
"wallet",
"inscribe",
"--cbor-metadata",
"foo",
"--json-metadata",
"bar",
"--file",#44,988,983texttransfer400.bpix#37,015,236brc-20