SHOWING: First 60
]
[[package]]
name = "signal-hook-registry"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1"
dependencies = [
"libc",
]
[[package]]
name = "simple-mutex"
version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38aabbeafa6f6dead8cebf246fe9fae1f9215c8d29b3a69f93bd62a9e4a3dcd6"
dependencies = [
"event-listener",
]
[[package]]
name = "slab"
version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d"
dependencies = [
"autocfg",
]
[[package]]
name = "smol"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13f2b548cd8447f8de0fdf1c592929f70f4fc7039a05e47404b0d096ec6987a1"
dependencies = [
"async-channel",
"async-executor",
"async-fs",
"async-io",
"async-lock",
"async-net",
"async-process",
"blocking",
"futures-lite",
#44,991,572textcategories of tests: unit, integration and fuzz. Unit tests can usually be found at
the bottom of a file in a mod block called `tests`. If you add or modify a
function please also add a corresponding test. Integration tests try to test
end-to-end functionality by executing a subcommand of the binary. Those can be
found in the [tests](tests) directory. We don't have a lot of fuzzing but the
basic structure of how we do it can be found in the [fuzz](fuzz) directory.
We strongly recommend installing [just](https://github.com/casey/just) to make
running the tests easier. To run our CI test suite you would do:
```
just ci
```
This corresponds to the commands:
```
cargo fmt -- --check
cargo test --all
cargo test --all -- --ignored
```
Have a look at the [justfile](justfile) to see some more helpful recipes
(commands). Here are a couple more good ones:
```
just fmt
just fuzz
just doc
just watch ltest --all
```
If the tests are failing or hanging, you might need to increase the maximum
number of open files by running `ulimit -n 1024` in your shell before you run
#44,990,141text/*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */
/*
Document
========
*/
/**
Use a better box model (opinionated).
*/
*,
::before,
::after {
box-sizing: border-box;
}
/**
1. Correct the line height in all browsers.
2. Prevent adjustments of font size after orientation changes in iOS.
3. Use a more readable tab size (opinionated).
*/
html {
line-height: 1.15; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
-moz-tab-size: 4; /* 3 */
tab-size: 4; /* 3 */
}
/*
Sections
========
*/
/**
1. Remove the margin in all browsers.
2. Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
*/
body {
margin: 0; /* 1 */
font-family:
system-ui,
-apple-system, /* Firefox supports this but not yet `system-ui` */
'Segoe UI',
Roboto,
Helvetica,
Arial,
sans-serif,
'Apple Color Emoji',
'Segoe UI Emoji'; /* 2 */
}
/*
Grouping content
================
*/
/**
1. Add the correct height in Firefox.
#44,987,797text```
Once `ord` is installed, you should be able to run `ord --version` on the
command line.
Building
--------
On Debian and Ubuntu, `ord` requires `libssl-dev` when building from source:
```
sudo apt-get install libssl-dev
```
You'll also need Rust:
```
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
To build `ord` from source:
```
git clone https://github.com/ordinals/ord.git
cd ord
cargo build --release
```
Once built, the `ord` binary can be found at `./target/release/ord`.
`ord` requires `rustc` version 1.67.0 or later. Run `rustc --version` to ensure you have this version. Run `rustup update` to get the latest stable release.
### Homebrew
`ord` is available in [Homebrew](https://brew.sh/):
```
brew install ord
```
### Debian Package
To build a `.deb` package:
```
cargo install cargo-deb
cargo deb
```
Contributing
------------
If you wish to contribute there are a couple things that are helpful to know. We
put a lot of emphasis on proper testing in the code base, with three broad
#44,987,793text[mdBook i18n helper](https://github.com/google/mdbook-i18n-helpers) and that you've clone
this repo.
1. Run the following command to generate a new `pot` file, which is named as
`messages.pot`:
```
MDBOOK_OUTPUT='{"xgettext": {"pot-file": "messages.pot"}}'
mdbook build -d po
```
2. Run `msgmerge` where `xx.po` is your localized language version following
the naming standard of [ISO639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
This process will update the `po` file with the most recent original version:
```
msgmerge --update po/xx.po po/messages.pot
```
3. Look for `#, fuzzy`. The `mdBook-i18n-helper` tool utilizes the `"fuzzy"` tag
to highlight sections that have been recently edited. You can proceed to perform
the translation tasks by editing the `"fuzzy"`part.
4. Execute the `mdbook` command. A demonstration in Chinese (`zh`) is given below:
```
mdbook build docs -d build
MDBOOK_BOOK__LANGUAGE=zh mdbook build docs -d build/zh
mv docs/build/zh/html docs/build/html/zh
python3 -m http.server --directory docs/build/html --bind 127.0.0.1 8080
#44,987,792text
- `ord wallet` commands automatically load the `ord` wallet given by the
`--wallet` option, which defaults to 'ord'. Keep in mind that after running
an `ord wallet` command, an `ord` wallet may be loaded.
- Because `ord` has access to your Bitcoin Core wallets, `ord` should not be
used with wallets that contain a material amount of funds. Keep ordinal and
cardinal wallets segregated.
### Pre-alpha wallet migration
Alpha `ord` wallets are not compatible with wallets created by previous
versions of `ord`. To migrate, use `ord wallet send` from the old wallet to
send sats and inscriptions to addresses generated by the new wallet with `ord
wallet receive`.
Installation
------------
`ord` is written in Rust and can be built from
[source](https://github.com/ordinals/ord). Pre-built binaries are available on the
[releases page](https://github.com/ordinals/ord/releases).
You can install the latest pre-built binary from the command line with:
```sh
curl --proto '=https' --tlsv1.2 -fsLS https://ordinals.com/install.sh | bash -s
#44,987,785text {txid}:0
</a>
<dl>
<dt>value</dt><dd>5000000000</dd>
<dt>script pubkey</dt><dd class=monospace>OP_0</dd>
</dl>
</li>
<li>
<a href=/output/{txid}:1 class=monospace>
{txid}:1
</a>
<dl>
<dt>value</dt><dd>5000000000</dd>
<dt>script pubkey</dt><dd class=monospace>OP_PUSHNUM_1</dd>
</dl>
</li>
</ul>
"
)
.unindent()
);
}
#[test]
fn with_blockhash() {
let transaction = Transaction {
version: 0,
lock_time: LockTime::ZERO,
input: Vec::new(),
output: vec![
TxOut {
value: 50 * COIN_VALUE,
script_pubkey: script::Builder::new().push_int(0).into_script(),
},
TxOut {
value: 50 * COIN_VALUE,
script_pubkey: script::Builder::new().push_int(1).into_script(),
},
],
};
assert_regex_match!(
#44,987,781textuse {super::*, clap::ValueEnum};
#[derive(Default, ValueEnum, Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum Chain {
#[default]
#[value(alias("main"))]
Mainnet,
#[value(alias("test"))]
Testnet,
Signet,
Regtest,
}
impl Chain {
pub(crate) fn network(self) -> Network {
match self {
Self::Mainnet => Network::Bitcoin,
Self::Testnet => Network::Testnet,
Self::Signet => Network::Signet,
Self::Regtest => Network::Regtest,
}
}
pub(crate) fn default_rpc_port(self) -> u16 {
match self {
Self::Mainnet => 8332,
Self::Regtest => 18443,
Self::Signet => 38332,
Self::Testnet => 18332,
}
}
pub(crate) fn inscription_content_size_limit(self) -> Option<usize> {
match self {
Self::Mainnet | Self::Regtest => None,
Self::Testnet | Self::Signet => Some(1024),
}
}
pub(crate) fn first_inscription_height(self) -> u32 {
match self {
Self::Mainnet => 767430,
Self::Regtest => 0,
#44,987,778textuse super::*;
#[derive(Boilerplate)]
pub(crate) struct TransactionHtml {
blockhash: Option<BlockHash>,
chain: Chain,
etching: Option<Rune>,
inscription: Option<InscriptionId>,
transaction: Transaction,
txid: Txid,
}
impl TransactionHtml {
pub(crate) fn new(
transaction: Transaction,
blockhash: Option<BlockHash>,
inscription: Option<InscriptionId>,
chain: Chain,
etching: Option<Rune>,
) -> Self {
Self {
txid: transaction.txid(),
blockhash,
chain,
etching,
inscription,
transaction,
}
}
}
impl PageContent for TransactionHtml {
fn title(&self) -> String {
format!("Transaction {}", self.txid)
}
}
#[cfg(test)]
mod tests {
use {
super::*,
bitcoin::{blockdata::script, locktime::absolute::LockTime, TxOut},
};
#[test]
fn html() {
let transaction = Transaction {
version: 0,
lock_time: LockTime::ZERO,
input: vec![TxIn {
sequence: Default::default(),
previous_output: Default::default(),
#44,987,729text script_sig: Default::default(),
witness: Default::default(),
}],
output: vec![
TxOut {
value: 50 * COIN_VALUE,
script_pubkey: script::Builder::new().push_int(0).into_script(),
},
TxOut {
value: 50 * COIN_VALUE,
script_pubkey: script::Builder::new().push_int(1).into_script(),
},
],
};
let txid = transaction.txid();
pretty_assert_eq!(
TransactionHtml::new(transaction, None, None, Chain::Mainnet, None).to_string(),
format!(
"
<h1>Transaction <span class=monospace>{txid}</span></h1>
<dl>
</dl>
<h2>1 Input</h2>
<ul>
<li><a class=monospace href=/output/0000000000000000000000000000000000000000000000000000000000000000:4294967295>0000000000000000000000000000000000000000000000000000000000000000:4294967295</a></li>
</ul>
<h2>2 Outputs</h2>
<ul class=monospace>
<li>
<a href=/output/{txid}:0 class=monospace>
#44,987,719text "quote",
"unicode-ident",
]
[[package]]
name = "syn"
version = "2.0.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "sync_wrapper"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
[[package]]
name = "synstructure"
version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.109",
"unicode-xid",
]
[[package]]
name = "sysinfo"
version = "0.29.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "165d6d8539689e3d3bc8b98ac59541e1f21c7de7c85d60dc80e43ae0ed2113db"
dependencies = [
"cfg-if",
"core-foundation-sys",
"libc",
"ntapi",
"once_cell",
#44,987,715text -webkit-appearance: button;
}
/**
Remove the inner border and padding in Firefox.
*/
::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
Restore the focus styles unset by the previous rule.
*/
:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
Remove the additional ':invalid' styles in Firefox.
See: https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737
*/
:-moz-ui-invalid {
box-shadow: none;
}
/**
Remove the padding so developers are not caught out when they zero out 'fieldset' elements in all browsers.
*/
legend {
padding: 0;
}
/**
Add the correct vertical alignment in Chrome and Firefox.
*/
progress {
vertical-align: baseline;
}
/**
Correct the cursor style of increment and decrement buttons in Safari.
*/
::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
height: auto;
}
/**
1. Correct the odd appearance in Chrome and Safari.
2. Correct the outline style in Safari.
*/
[type='search'] {
-webkit-appearance: textfield; /* 1 */
#44,987,685text<h1>Output <span class=monospace>{{self.outpoint}}</span></h1>
<dl>
%% if !self.inscriptions.is_empty() {
<dt>inscriptions</dt>
<dd class=thumbnails>
%% for inscription in &self.inscriptions {
{{Iframe::thumbnail(*inscription)}}
%% }
</dd>
%% }
%% if !self.runes.is_empty() {
<dt>runes</dt>
<dd>
<table>
<tr>
<th>rune</th>
<th>balance</th>
</tr>
%% for (rune, balance) in &self.runes {
<tr>
<td><a href=/rune/{{ rune }}>{{ rune }}</a></td>
<td>{{ balance }}</td>
</tr>
%% }
</table>
</dd>
%% }
<dt>value</dt><dd>{{ self.output.value }}</dd>
<dt>script pubkey</dt><dd class=monospace>{{ self.output.script_pubkey.to_asm_string() }}</dd>
%% if let Ok(address) = self.chain.address_from_script(&self.output.script_pubkey ) {
<dt>address</dt><dd class=monospace>{{ address }}</dd>
%% }
<dt>transaction</dt><dd><a class=monospace href=/tx/{{ self.outpoint.txid }}>{{ self.outpoint.txid }}</a></dd>
</dl>
%% if let Some(list) = &self.list {
%% match list {
#44,987,684text