# WINDOWS下BTC全节点铸造sats域名

By [Untitled](https://paragraph.com/@0x4a61adeb889012caeefc944ea9571f155ae84240) · 2023-03-09

---

前言
==

     迫于第三方工具铸造BTC NFT手续费较高，批量注册成本较大，远不如花几百块买个固态硬盘同步全节点自己铸造，自己动手丰衣足食。

     记录一下从下载BTC core钱包同步全节点到铸造一枚sats域名的全过程（铸造图片同理），及过程中碰到的一些问题和解决方法。

     如果对你有所帮助，[点个关注](https://twitter.com/jack_yc) : )

[https://twitter.com/jack\_yc](https://twitter.com/jack_yc)

下载BTC core钱包，同步全节点
==================

从[官网下载](https://bitcoincore.org/en/download/)BTC core钱包并安装，建议安装在单独的固态硬盘(容量1TB及以上)内，等待全节点同步完成。

![同步全节点后](https://storage.googleapis.com/papyrus_images/e0f0f0db99669cf5217f26f623a68a95f2e2d27e735baa1e8546bf5dff2b73a3.png)

同步全节点后

启用RPC服务器

![启用RPC服务器](https://storage.googleapis.com/papyrus_images/c4237e02948eec03e0b245d5dfd18f36662d02a9a1ca479aee5b4110e0ff28f1.png)

启用RPC服务器

使用ord铸造sats/图片
--------------

从github下载[ord](https://github.com/casey/ord/releases/)，下载完成后鼠标右键在当前目录打开命令行（如果没有打开命令行选项，尝试shift+鼠标右键）

![](https://storage.googleapis.com/papyrus_images/377207fae0bd7470ea49ada562fd0a8e1fc556bc53f0c65c631e0eab53d762c4.png)

*   创建供ord使用的BTC钱包
    
    > 创建钱包命令： `ord.exe wallet create`(powershell命令行下，ord.exe换为.\\ord.exe)
    
*   生成Taproot格式 地址，往该地址转入任意金额btc供后续使用。
    
    > 生成Taproot格式 地址命令：`ord.exe --bitcoin-data-dir "E:\Bitcoin\blocks" --cookie-file "E:\Bitcoin\.cookie" wallet receive`
    
*   铸造铭文
    
    > 命令：`ord.exe --bitcoin-data-dir "E:\Bitcoin\blocks" --cookie-file "E:\Bitcoin\.cookie" wallet inscribe "E:\Bitcoin\nftFiles\xxxx.sats.txt" --fee-rate 5`
    > 
    > E:\\Bitcoin\\nftFiles\\xxxx.sats.txt 为你stats文件的文件地址（换成图片地址，就是铸造图片）
    > 
    > \-fee-rate 5 为费率，一般填5-25之间
    > 
    > xxxx.sats.txt为sats域名文件，xxxx为你要注册的域名，内容如下：
    > 
    > { "p": "sns", "op": "reg", "name": "xxx.sats" }
    

![铸造bypass.sats](https://storage.googleapis.com/papyrus_images/f44e778a16ee5c129ad524417834ccbfcfdc433fac316a2e95c84d552a34becb.png)

铸造bypass.sats

![铸造成功](https://storage.googleapis.com/papyrus_images/f836062edbe73be6a696581fd60a39c8445e3defd03e74186e8c7836182a290f.png)

铸造成功

*   查询域名是否被注册
    
    > 铸造sats域名前先到官网查一下是否已被注册，查询方式：[https://api.sats.id/names/xxx.sats](https://api.sats.id/names/payload.sats)，xxx即为你要注册的域名，显示{"error":"xxx.sats not found"}则表示该域名尚未被注册。
    

![payload.sats未被注册](https://storage.googleapis.com/papyrus_images/c994ddccc2fb1446454e7f23ff217b213eb530c09564c243d6662d360ab3ea1a.png)

payload.sats未被注册

可能遇到的一些报错
---------

一、执行 `ord.exe wallet create`等命令时，报错 `error: failed to connect to Bitcoin Core RPC at 127.0.0.1:8332/wallet/ord using cookie file`

![](https://storage.googleapis.com/papyrus_images/c12f4a064f04ee2576e4ffca5d6fdf0b3119441925b134c0194d24ed8ead1478.png)

> 解决方法：
> 
> 在btc core钱包安装目录下找到`.cookie`文件和`blocks`文件夹，右键复制文件地址分别填入`--cookie-file`和 `--bitcoin-data-dir`参数后，命令示例：`ord.exe --bitcoin-data-dir "E:\Bitcoin\blocks" --cookie-file "E:\Bitcoin\.cookie" wallet create`

二、铸造铭文时报错：`ERROR ord::index::updater] Couldn't receive txs Failed to fetch raw transaction: code -5 message No such mempool transaction. Use -txindex or provide a block hash to enable blockchain transaction queries. Use gettransaction for wallet transactions.`

![](https://storage.googleapis.com/papyrus_images/73a6f3de00fe05dce0e7e4cd0feb9037ffe855d3373519480f3c4675d8c199c4.png)

> 解决方法：
> 
> 同步比特币区块链，执行`bitcoind.exe -txindex(或bitcoind.exe --datadir=E:\Bitcoin)`和`bitcoin-cli.exe getblockcount`。
> 
> `bitcoind.exe`和`bitcoin-cli.exe`在BTC core安装目录的`daemon`目录下。(若执行报错，或未解决问题，试一下问题三的解决方法)

三、执行`bitcoind.exe`和`bitcoin-cli.exe` 命令时报错

![](https://storage.googleapis.com/papyrus_images/c5bd40961ab368672b52dd77e0082bf19145abd65b6365b89536843bbf622154.png)

![](https://storage.googleapis.com/papyrus_images/92dd52e3b202d96fbf85fbb421e493d5dee938f1f25a81a9476bfb07c997cea6.png)

> 解决方法：
> 
> 在BTC core安装目录找到`bitcoin.conf`文件(没有就新建一个)，输入以下内容：
> 
> rpcallowip=127.0.0.1 rpcbind=127.0.0.1:8332 rpcport=8332 server=1 datadir=E:\\Bitcoin txindex=1
> 
> `datadir` 参数为你的BTC core钱包的安装目录，保存文件后，重启BTC core钱包。如果执行`bitcoind.exe --datadir=E:\Bitcoin`仍然提示错误如下：

![](https://storage.googleapis.com/papyrus_images/0cf789f8a93cdce2fb8371c58565dfe272a6a8502d534df671eeb8f32a7f9de3.png)

> 关闭BTC core钱包，执行命令`bitcoind.exe --datadir=E:\Bitcoin`，成功开始同步区块后再打开BTC core钱包。（关键点是关闭BTC core钱包防止占用端口，`bitcoind.exe`同步完成后再打开钱包）

![](https://storage.googleapis.com/papyrus_images/dadb0b2b15ec77acb9c1bca529a86408e4eaeadd1350c6b9f141b6da27718a7b.png)

![](https://storage.googleapis.com/papyrus_images/b308a739f0ce80acb35ad542f655421dc78406512c26690b406ce3a07cedbe19.png)

> 执行命令`bitcoin-cli.exe -datadir=E:\Bitcoin getblockcount`获取最新区块高度

![](https://storage.googleapis.com/papyrus_images/92a32bacd9e0c0c21ae543e7c1ebceb52ccdeb2542271192ede57c6e116500ae.png)

四、报错：`error: JSON-RPC error: RPC error response: RpcError { code: -18, message: "Wallet file verification failed. Failed to load database path 'E:\\Bitcoin\\ord'. Data is not in recognized format.", data: None }`

![](https://storage.googleapis.com/papyrus_images/47e68953235fdf4045243efb0037a5b51b4c0485451a9ff8ae873e2e13ddeb13.png)

> 解决方法：
> 
> 找到wallet.dat和wallet.dat-journal文件(非必须)，放入ord目录，如：E:\\\\Bitcoin\\\\ord目录

![](https://storage.googleapis.com/papyrus_images/05cb47806a40913811726fbf8ddd8a680e2d7bb4120bf04bbf2d55264cdf4f9f.png)

常用链接：
-----

[https://mempool.space/zh/](https://mempool.space/zh/)

< [https://hub.cryptocell.guru/ordinalsturbo/>](https://hub.cryptocell.guru/ordinalsturbo/%3E)

[https://ordinals.com/](https://ordinals.com/)

---

*Originally published on [Untitled](https://paragraph.com/@0x4a61adeb889012caeefc944ea9571f155ae84240/windows-btc-sats)*
