<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>0xFinian</title>
        <link>https://paragraph.com/@finian</link>
        <description>Web3 Builder | Solopreneur</description>
        <lastBuildDate>Wed, 17 Jun 2026 11:37:47 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[ETH 交易费用组成]]></title>
            <link>https://paragraph.com/@finian/eth</link>
            <guid>9ezF1XiRekcZI0jjLEMX</guid>
            <pubDate>Tue, 28 Feb 2023 05:35:40 GMT</pubDate>
            <description><![CDATA[EIP-1559 前fees = &#x3C;used gas> * &#x3C;gas price> 交易费用等于交易实际使用的 gas 数量，乘于 gas 价格（用户指定），这些钱全部被矿工拿走。 实际使用的 gas 数量不会多于 gas limit，如果所需 gas 数量超过 gas limit，则交易失败（但钱照收）。EIP-1559 后fees = &#x3C;used gas> * (&#x3C;base fee> + &#x3C;priority fee>) 交易费用等于交易实际使用的 gas 数量，乘于 gas 价格，gas 价格由两部分组成：基础费用和优先费用（矿工小费）。基础费用由网络决定，上下浮动，看上一个区块的负载，在 -12.5% ～ 12.5% 之间浮动（空载则下调 12.5%，一半负载则不变，满载则上浮 12.5%），这部分费用直接销毁（通缩）。小费直接给矿工，当然给的越多打包越快。 用户可以设置 max base fee（或叫 max fee）和 max priority fee（或叫 priority fee）。 为什么要设置 max base ...]]></description>
            <content:encoded><![CDATA[<h2 id="h-eip-1559" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">EIP-1559 前</h2><pre data-type="codeBlock" text="fees = &lt;used gas&gt; * &lt;gas price&gt;
"><code>fees <span class="hljs-operator">=</span> <span class="hljs-operator">&#x3C;</span>used gas<span class="hljs-operator">></span> <span class="hljs-operator">*</span> <span class="hljs-operator">&#x3C;</span>gas price<span class="hljs-operator">></span>
</code></pre><p>交易费用等于交易实际使用的 gas 数量，乘于 gas 价格（用户指定），这些钱全部被矿工拿走。 实际使用的 gas 数量不会多于 gas limit，如果所需 gas 数量超过 gas limit，则交易失败（但钱照收）。</p><h2 id="h-eip-1559" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">EIP-1559 后</h2><pre data-type="codeBlock" text="fees = &lt;used gas&gt; * (&lt;base fee&gt; + &lt;priority fee&gt;)
"><code>fees <span class="hljs-operator">=</span> <span class="hljs-operator">&#x3C;</span>used gas<span class="hljs-operator">></span> <span class="hljs-operator">*</span> (<span class="hljs-operator">&#x3C;</span>base fee<span class="hljs-operator">></span> <span class="hljs-operator">+</span> <span class="hljs-operator">&#x3C;</span>priority fee<span class="hljs-operator">></span>)
</code></pre><p>交易费用等于交易实际使用的 gas 数量，乘于 gas 价格，gas 价格由两部分组成：基础费用和优先费用（矿工小费）。基础费用由网络决定，上下浮动，看上一个区块的负载，在 -12.5% ～ 12.5% 之间浮动（空载则下调 12.5%，一半负载则不变，满载则上浮 12.5%），这部分费用直接销毁（通缩）。小费直接给矿工，当然给的越多打包越快。</p><p>用户可以设置 max base fee（或叫 max fee）和 max priority fee（或叫 priority fee）。</p><p>为什么要设置 max base fee？因为 base fee 是浮动的，有可能交易发送后，base fee 连续暴涨（每次涨幅不超过 12.5%），这时候如果之前设置的 max base fee 比较大，能够覆盖此时的 base fee，则更有可能被打包（当然还要看给的小费多少）。很容易计算得出，如果 max base fee 设为 base fee 的两倍，则在未来 6 个区块中，即使负载暴涨，也能覆盖此时的 base fee。</p><p>那矿工能拿多少呢？不会超过你设置的 priority fee。用 max base fee（max fee）减去实际 base fee，剩下的就给矿工，但最多不超过 priority fee。</p><p>举个例子，某次交易，假设被打包时 base fee 是 20，max base fee 设置为 20.5，max priority fee 设置为 1，则矿工拿走小费 0.5。那如果 max base fee 和 base fee 相同，矿工岂不是拿不到小费？这种情况，矿工应该会等到 base fee 小于 max base fee 时再打包吧，或者优先打包其他能赚到小费的。（测试了一下，在小狐狸设置小费为 0，交易一直 pending 没发出去，最终经过 3 小时成功打包，也就是没有小费矿工也会选择打包）</p><p>所以打价格战时，激进一点的做法是，查看当前 gas 情况（比如用插件 Blocknative Gas Fee Estimator），按照「Max price in pending block」的数值，设置 max base fee 和 max priority fee，比如 Max price in pending block 的数值为 50，则设置 max base fee 和 max priority fee 都为 50，则极大概率能将交易在当前区块送出去，当然这时你的花费就是 50 了（base fee 以外的全给矿工了）</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">参考</h2><blockquote><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://metamask.io/1559/">https://metamask.io/1559/</a> <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.blocknative.com/blog/eip-1559-fees">https://www.blocknative.com/blog/eip-1559-fees</a></p></blockquote>]]></content:encoded>
            <author>finian@newsletter.paragraph.com (0xFinian)</author>
        </item>
        <item>
            <title><![CDATA[Bitcoin 全节点服务器搭建教程]]></title>
            <link>https://paragraph.com/@finian/bitcoin</link>
            <guid>u0IRkcFD9wMtyvjAkDII</guid>
            <pubDate>Fri, 10 Feb 2023 18:02:00 GMT</pubDate>
            <description><![CDATA[最近 BTC 的 NFT 很火（Ordinals 协议），参与需要有自己的 BTC 全节点，虽然也可以花钱找机器人代打，但是人多了会不稳定。下面介绍一下在服务器中如何搭建 BTC 的全节点。注 1：以下所有命令以 Debian 11.6 以及 root 账户为例。 注 2：bitcoin-core 版本请相应换为最新的。写文章时，最新版本为 24.0.1。 注 3：全节点大小大概 450 G，注意硬盘空间大小。安装与运行下载：wget https://bitcoincore.org/bin/bitcoin-core-24.0.1/bitcoin-24.0.1-x86_64-linux-gnu.tar.gz 解压：tar xvzf bitcoin-24.0.1-x86_64-linux-gnu.tar.gz 安装：install -m 0755 -o root -g root -t /usr/local/bin bitcoin-24.0.1/bin/* 创建配置文件：vim ~/.bitcoin/bitcoin.conf 内容如下：txindex=1 dbcache=16384 运...]]></description>
            <content:encoded><![CDATA[<p>最近 BTC 的 NFT 很火（Ordinals 协议），参与需要有自己的 BTC 全节点，虽然也可以花钱找机器人代打，但是人多了会不稳定。下面介绍一下在服务器中如何搭建 BTC 的全节点。</p><blockquote><p>注 1：以下所有命令以 Debian 11.6 以及 root 账户为例。 注 2：bitcoin-core 版本请相应换为最新的。写文章时，最新版本为 24.0.1。 注 3：全节点大小大概 450 G，注意硬盘空间大小。</p></blockquote><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">安装与运行</h3><p>下载：</p><pre data-type="codeBlock" text="wget https://bitcoincore.org/bin/bitcoin-core-24.0.1/bitcoin-24.0.1-x86_64-linux-gnu.tar.gz
"><code>wget https://bitcoincore.org/bin/bitcoin-core-24.0.1/bitcoin-24.0.1-x86_64-linux-gnu.tar.gz
</code></pre><p>解压：</p><pre data-type="codeBlock" text="tar xvzf bitcoin-24.0.1-x86_64-linux-gnu.tar.gz
"><code>tar xvzf bitcoin<span class="hljs-number">-24.0</span><span class="hljs-number">.1</span><span class="hljs-operator">-</span>x86_64<span class="hljs-operator">-</span>linux<span class="hljs-operator">-</span>gnu.tar.gz
</code></pre><p>安装：</p><pre data-type="codeBlock" text="install -m 0755 -o root -g root -t /usr/local/bin bitcoin-24.0.1/bin/*
"><code>install <span class="hljs-operator">-</span>m 0755 <span class="hljs-operator">-</span>o root <span class="hljs-operator">-</span>g root <span class="hljs-operator">-</span>t <span class="hljs-operator">/</span>usr<span class="hljs-operator">/</span>local<span class="hljs-operator">/</span>bin bitcoin<span class="hljs-number">-24.0</span><span class="hljs-number">.1</span><span class="hljs-operator">/</span>bin<span class="hljs-comment">/*
</span></code></pre><p>创建配置文件：</p><pre data-type="codeBlock" text="vim ~/.bitcoin/bitcoin.conf
"><code>vim <span class="hljs-operator">~</span><span class="hljs-operator">/</span>.bitcoin/bitcoin.conf
</code></pre><p>内容如下：</p><pre data-type="codeBlock" text="txindex=1
dbcache=16384
"><code><span class="hljs-attr">txindex</span>=<span class="hljs-number">1</span>
<span class="hljs-attr">dbcache</span>=<span class="hljs-number">16384</span>
</code></pre><p>运行：</p><pre data-type="codeBlock" text="bitcoind -daemon
"><code>bitcoind <span class="hljs-operator">-</span>daemon
</code></pre><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">查看区块同步进度</h3><p>如何查看区块同步进度呢？有以下几种方法。</p><ul><li><p>查看调试输出日志</p></li></ul><pre data-type="codeBlock" text="tail ~/.bitcoin/debug.log
"><code>tail <span class="hljs-operator">~</span><span class="hljs-operator">/</span>.bitcoin/debug.log
</code></pre><p>日志内容示例：</p><pre data-type="codeBlock" text="...
...
2023-02-10T17:08:49Z UpdateTip: new best=00000000000000002f8f9102e45bc9d067bde6f3363b1601216d3eac2a75cb9e height=298458 version=0x00000002 log2_work=78.308530 tx=37841638 date=&apos;2014-04-30T13:46:19Z&apos; progress=0.047178 cache=1515.8MiB(11587473txo)
"><code>...
...
<span class="hljs-number">2023</span><span class="hljs-operator">-</span>02<span class="hljs-operator">-</span>10T17:08:49Z UpdateTip: <span class="hljs-keyword">new</span> best<span class="hljs-operator">=</span>00000000000000002f8f9102e45bc9d067bde6f3363b1601216d3eac2a75cb9e height<span class="hljs-operator">=</span><span class="hljs-number">298458</span> version<span class="hljs-operator">=</span><span class="hljs-number">0x00000002</span> log2_work<span class="hljs-operator">=</span><span class="hljs-number">78.308530</span> <span class="hljs-built_in">tx</span><span class="hljs-operator">=</span><span class="hljs-number">37841638</span> date<span class="hljs-operator">=</span><span class="hljs-string">'2014-04-30T13:46:19Z'</span> progress<span class="hljs-operator">=</span><span class="hljs-number">0</span><span class="hljs-number">.047178</span> cache<span class="hljs-operator">=</span><span class="hljs-number">1515</span>.8MiB(11587473txo)
</code></pre><p>从 <code>date</code> 和 <code>progress</code> 等字段能看出同步进度。</p><ul><li><p>对比区块数</p></li></ul><pre data-type="codeBlock" text="wget -q -O- https://blockchain.info/q/getblockcount; echo
775906
bitcoin-cli getblockcount
310627
"><code>wget <span class="hljs-operator">-</span>q <span class="hljs-operator">-</span>O<span class="hljs-operator">-</span> https:<span class="hljs-comment">//blockchain.info/q/getblockcount; echo</span>
<span class="hljs-number">775906</span>
bitcoin<span class="hljs-operator">-</span>cli getblockcount
<span class="hljs-number">310627</span>
</code></pre><ul><li><p>通过以下脚本输出</p></li></ul><pre data-type="codeBlock" text="#!/bin/bash
count=$(bitcoin-cli getblockcount);
echo &quot;block count: $count&quot;;

hash=$(bitcoin-cli getblockhash $count);
echo &quot;block hash: $hash&quot;;

t=$(bitcoin-cli getblock &quot;$hash&quot; | grep &apos;&quot;time&quot;&apos; | awk &apos;{print $2}&apos; | sed -e &apos;s/,$//g&apos;);
echo &quot;block timestamp is: $t&quot;;

cur_t=$(date +%s);
diff_t=$[$cur_t - $t];
echo -n &quot;Difference is: &quot;;
echo $diff_t | awk &apos;{printf &quot;%d days, %d:%d:%d\n&quot;,$1/(60*60*24),$1/(60*60)%24,$1%(60*60)/60,$1%60}&apos;;
"><code><span class="hljs-meta">#!/bin/bash</span>
count=$(bitcoin-cli getblockcount);
<span class="hljs-built_in">echo</span> <span class="hljs-string">"block count: <span class="hljs-variable">$count</span>"</span>;

<span class="hljs-built_in">hash</span>=$(bitcoin-cli getblockhash <span class="hljs-variable">$count</span>);
<span class="hljs-built_in">echo</span> <span class="hljs-string">"block hash: <span class="hljs-variable">$hash</span>"</span>;

t=$(bitcoin-cli getblock <span class="hljs-string">"<span class="hljs-variable">$hash</span>"</span> | grep <span class="hljs-string">'"time"'</span> | awk <span class="hljs-string">'{print $2}'</span> | sed -e <span class="hljs-string">'s/,$//g'</span>);
<span class="hljs-built_in">echo</span> <span class="hljs-string">"block timestamp is: <span class="hljs-variable">$t</span>"</span>;

cur_t=$(<span class="hljs-built_in">date</span> +%s);
diff_t=$[<span class="hljs-variable">$cur_t</span> - <span class="hljs-variable">$t</span>];
<span class="hljs-built_in">echo</span> -n <span class="hljs-string">"Difference is: "</span>;
<span class="hljs-built_in">echo</span> <span class="hljs-variable">$diff_t</span> | awk <span class="hljs-string">'{printf "%d days, %d:%d:%d\n",$1/(60*60*24),$1/(60*60)%24,$1%(60*60)/60,$1%60}'</span>;
</code></pre><p>输出示例：</p><pre data-type="codeBlock" text="block count: 324393
block hash: 00000000000000001aced2606293f68082f20d54b68c281778a608f3a522ada9
block timestamp is: 1412760302
Difference is: 3047 days, 7:52:20
"><code><span class="hljs-built_in">block</span> count: <span class="hljs-number">324393</span>
<span class="hljs-built_in">block</span> hash: 00000000000000001aced2606293f68082f20d54b68c281778a608f3a522ada9
<span class="hljs-built_in">block</span> timestamp <span class="hljs-keyword">is</span>: <span class="hljs-number">1412760302</span>
Difference <span class="hljs-keyword">is</span>: <span class="hljs-number">3047</span> <span class="hljs-literal">days</span>, <span class="hljs-number">7</span>:<span class="hljs-number">52</span>:<span class="hljs-number">20</span>
</code></pre><p>全节点同步完估计要一天多，have fun :-P</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">参考</h3><blockquote><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/dotta/status/1622994717897285632">https://twitter.com/dotta/status/1622994717897285632</a> <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://vhernando.github.io/run-bitcoin-node-debian-how-to">https://vhernando.github.io/run-bitcoin-node-debian-how-to</a> <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/bitcoin/bitcoin">https://github.com/bitcoin/bitcoin</a></p></blockquote>]]></content:encoded>
            <author>finian@newsletter.paragraph.com (0xFinian)</author>
        </item>
    </channel>
</rss>