SHOWING: First 60
#69,710,080text#67,040,526text#![no_main]
use {
arbitrary::Arbitrary,
bitcoin::{
address::{Address, NetworkUnchecked},
Amount, OutPoint,
},
libfuzzer_sys::fuzz_target,
ord::{FeeRate, SatPoint, Target, TransactionBuilder},
std::collections::BTreeMap,
};
#[derive(Clone, Debug, Arbitrary)]
struct Input {
output_value: Option<u64>,
fee_rate: f64,
utxos: Vec<u64>,
}
fuzz_target!(|input: Input| {
let outpoint = "1111111111111111111111111111111111111111111111111111111111111111:1"
.parse::<OutPoint>()
.unwrap();
let satpoint = "1111111111111111111111111111111111111111111111111111111111111111:1:0"
.parse::<SatPoint>()
.unwrap();
let inscription_id = "1111111111111111111111111111111111111111111111111111111111111111i1"
.parse()
.unwrap();
let mut inscriptions = BTreeMap::new();
inscriptions.insert(satpoint, inscription_id);
let mut amounts = BTreeMap::new();
amounts.insert(outpoint, Amount::from_sat(1_000_000));
for (i, value) in input.utxos.into_iter().enumerate() {
amounts.insert(
#45,023,046text"mediawiki) for the technical details, and the [ord repo](https://github.com/"
"ordinals/ord) for the `ord` wallet and block explorer."
msgstr ""
"关于序数理论的更多信息,请查阅[FAQ](./faq.md) 来获取概述;查阅[BIP](https://"
"github.com/ordinals/ord/blob/master/bip.mediawiki) 来获取技术细节查阅[ord "
"repo](https://github.com/ordinals/ord)来获取`ord`钱包和浏览器的信息."
#: src/bounties.md:14
msgid ""
"Satoshi was the original developer of ordinal theory. However, he knew that "
"others would consider it heretical and dangerous, so he hid his knowledge, "
"and it was lost to the sands of time. This potent theory is only now being "
"rediscovered. You can help by researching rare satoshis."
msgstr ""
"中本聪是序数理论的原始开发者。然而,他知道其他人可能会认为这是异端邪说并且危"
"险,因此他隐藏了自己的知识,使其在时间的沙漠里失传。现在,这个强大的理论被重"
"新发现。您可以通过研究稀有的聪来帮助我们。"
#: src/bounties.md:19
msgid "Good luck and godspeed!"
msgstr "祝您一切顺利,好运!"
#: src/bounty/0.md:1
msgid "Ordinal Bounty 0"
msgstr "赏金任务 0"
#: src/bounty/0.md:4 src/bounty/1.md:4 src/bounty/2.md:4 src/bounty/3.md:4
msgid "Criteria"
msgstr "标准"
#: src/bounty/0.md:7
#45,021,975textcategories 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,996,970text ..Default::default()
});
context.mine_blocks(1);
let inscription_id = InscriptionId { txid, index: 0 };
context.index.assert_inscription_location(
inscription_id,
SatPoint {
outpoint: OutPoint { txid, vout: 0 },
offset: 0,
},
Some(50 * COIN_VALUE),
);
}
}
#[test]
fn inscription_with_pointer_into_fee_ignored_and_assigned_default_location() {
for context in Context::configurations() {
context.mine_blocks(1);
let inscription = Inscription {
content_type: Some("text/plain".into()),
body: Some("hello".into()),
pointer: Some((25 * COIN_VALUE).to_le_bytes().to_vec()),
..Default::default()
};
let txid = context.rpc_server.broadcast_tx(TransactionTemplate {
inputs: &[(1, 0, 0, inscription.to_witness())],
fee: 25 * COIN_VALUE,
..Default::default()
});
context.mine_blocks(1);
let inscription_id = InscriptionId { txid, index: 0 };#44,996,756text .index
.get_children_by_inscription_id(parent_inscription_id)
.unwrap(),
vec![child_inscription_id]
);
}
}
#[test]
fn inscriptions_in_same_input_with_pointers_to_same_output() {
for context in Context::configurations() {
context.mine_blocks(1);
let builder = script::Builder::new();
let builder = Inscription {
pointer: Some(100u64.to_le_bytes().to_vec()),
..Default::default()
}
.append_reveal_script_to_builder(builder);
let builder = Inscription {
pointer: Some(300_000u64.to_le_bytes().to_vec()),
..Default::default()
}
.append_reveal_script_to_builder(builder);
let builder = Inscription {
pointer: Some(1_000_000u64.to_le_bytes().to_vec()),
..Default::default()
}
.append_reveal_script_to_builder(builder);
let witness = Witness::from_slice(&[builder.into_bytes(), Vec::new()]);
let txid = context.rpc_server.broadcast_tx(TransactionTemplate {#44,996,749text
`ord` makes RPC calls to `bitcoind`, which usually requires a username and
password.
By default, `ord` looks a username and password in the cookie file created by
`bitcoind`.
The cookie file path can be configured using `--cookie-file`:
```
ord --cookie-file /path/to/cookie/file server
```
Alternatively, `ord` can be supplied with a username and password on the
command line:
```
ord --bitcoin-rpc-user foo --bitcoin-rpc-pass bar server
```
Using environment variables:
```
export ORD_BITCOIN_RPC_USER=foo
export ORD_BITCOIN_RPC_PASS=bar
ord server
```
Or in the config file:
```yaml
bitcoin_rpc_user: foo
bitcoin_rpc_pass: bar
```
Logging
--------
`ord` uses [env_logger](https://docs.rs/env_logger/latest/env_logger/). Set the
`RUST_LOG` environment variable in order to turn on logging. For example, run
the server and show `info`-level log messages and above:
```
$ RUST_LOG=info cargo run server
```
New Releases
------------
Release commit messages use the following template:
```
Release x.y.z
- Bump version: x.y.z → x.y.z
#44,995,326text"determinada NFT do Ethereum está armazenada."
#: src/faq.md:147
msgid "_Inscriptions are much simpler._"
msgstr "_As inscrições são muito mais simples._"
#: src/faq.md:149
msgid ""
"Ethereum NFTs depend on the Ethereum network and virtual machine, which are "
"highly complex, constantly changing, and which introduce changes via "
"backwards-incompatible hard forks."
msgstr ""
"As NFTs do Ethereum dependem da rede Ethereum e da máquina virtual, que são "
"altamente complexas, estão em constante mudança e introduzem mudanças por meio "
"de hard forks incompatíveis com versões anteriores."
#: src/faq.md:153
msgid ""
"Inscriptions, on the other hand, depend on the Bitcoin blockchain, which is "
"relatively simple and conservative, and which introduces changes via "
"backwards-compatible soft forks."
msgstr ""
"As inscrições, por outro lado, dependem da blockchain do Bitcoin, que é "
"relativamente simples e conservadora, e que introduz mudanças por meio de "
"soft forks, compatíveis com versões anteriores."
#44,992,651textmsgid "Create an inscribe transaction T as usual for C."
msgstr "Создайте транзакцию надписи T, как обычно, для C."
#: src/inscriptions/provenance.md:19
msgid "Spend the parent P in one of the inputs of T."
msgstr "Проведите parent P по одному из входов T."
#: src/inscriptions/provenance.md:20
msgid ""
"Include tag `3`, i.e. `OP_PUSH 3`, in C, with the value of the serialized binary inscription ID of P, serialized as the 32-byte `TXID`, followed by the four-"
"byte little-endian `INDEX`, with trailing zeroes omitted."
msgstr ""
"Включите в C тег `3`, т.е. `OP_PUSH 3`, со значением сериализованного двоичного ID надписи P, сериализованного как 32-байтовый `TXID`, за которым следует "
"четырехбайтовый little-endian `INDEX`, с опущенными задними нулями."
#: src/inscriptions/provenance.md:24
msgid "_NB_ The bytes of a bitcoin transaction ID are reversed in their text representation, so the serialized transaction ID will be in the opposite order."
msgstr ""
"_NB_ В текстовом представлении байты ID транзакции биткоина расположены в обратном порядке, поэтому сериализованные ID транзакции будут расположены в обратном "
#44,992,650textmsgid "First the string `ord` is pushed, to disambiguate inscriptions from other uses of envelopes."
msgstr "Сначала вводится строка `ord`, чтобы отделить надписи от других видов использования конвертов."
#: src/inscriptions.md:56
msgid ""
"`OP_PUSH 1` indicates that the next push contains the content type, and `OP_PUSH 0`indicates that subsequent data pushes contain the content itself. Multiple "
"data pushes must be used for large inscriptions, as one of taproot's few restrictions is that individual data pushes may not be larger than 520 bytes."
msgstr ""
"`OP_PUSH 1` указывает, что следующий push содержит тип содержимого, а `OP_PUSH 0` - что последующие push-файлы содержат само содержимое. Для больших надписей "
"необходимо использовать несколько push данных, так как одно из немногих ограничений taproot заключается в том, что размер отдельных push данных не может "
"превышать 520 байт."
#: src/inscriptions.md:62
msgid ""
"The inscription content is contained within the input of a reveal transaction, and the inscription is made on the first sat of its input. This sat can then be "
#44,992,647textuse {super::*, crate::wallet::Wallet};
#[derive(Debug, Parser)]
pub(crate) struct Sats {
#[arg(
long,
help = "Find satoshis listed in first column of tab-separated value file <TSV>."
)]
tsv: Option<PathBuf>,
}
#[derive(Serialize, Deserialize)]
pub struct OutputTsv {
pub sat: String,
pub output: OutPoint,
}
#[derive(Serialize, Deserialize)]
pub struct OutputRare {
pub sat: Sat,
pub output: OutPoint,
pub offset: u64,
pub rarity: Rarity,
}
impl Sats {
pub(crate) fn run(&self, options: Options) -> SubcommandResult {
let index = Index::open(&options)?;
if !index.has_sat_index() {
bail!("sats requires index created with `--index-sats` flag");
}
index.update()?;
let utxos = index.get_unspent_output_ranges(Wallet::load(&options)?)?;
if let Some(path) = &self.tsv {
let mut output = Vec::new();
for (outpoint, sat) in sats_from_tsv(
utxos,
&fs::read_to_string(path)
.with_context(|| format!("I/O error reading `{}`", path.display()))?,#44,992,644text