import{_ as i,c as e,a,o as n}from"./app-I9WJttm3.js";const l={};function t(h,s){return n(),e("div",null,[...s[0]||(s[0]=[a(`<h2 id="console-控制台是什么" tabindex="-1"><a class="header-anchor" href="#console-控制台是什么"><span>Console 控制台是什么？</span></a></h2><p>Console 是 FISCO BCOS 官方提供的一个交互式命令行工具，用于直接与区块链节点交互。 主要功能包括：</p><ul><li>查询区块链状态（如区块链高度、节点列表、群组信息）</li><li>部署和调用智能合约（支持 Solidity）</li><li>管理节点（如查看节点共识状态、动态添加节点）</li><li>调试交易和查看回执</li></ul><h2 id="部署-console-控制台" tabindex="-1"><a class="header-anchor" href="#部署-console-控制台"><span>部署 Console 控制台</span></a></h2><p>获取下载脚本：<code>wget https://gitee.com/FISCO-BCOS/console/releases/download/v2.8.0/console.tar.gz</code> 解压控制台安装包：<code>tar -zxf console.tar.gz console/</code></p><p>复制配置文件：<code>cp conf/config-example.toml conf/config.toml</code> 编辑配置文件：<code>vim conf/config.toml</code></p><div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212;"><pre class="shiki shiki-themes vitesse-light vitesse-dark has-highlighted vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD;"># enSslKey = &quot;conf/gm/gmensdk.key&quot;          # GM ssl cert file path</span></span>
<span class="line"><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD;">                                            # default load the GM SSL encryption privateKey from \${certPath}/gm/gmensdk.key</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666;">[</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE;">network</span><span style="--shiki-light:#999999;--shiki-dark:#666666;">]</span></span>
<span class="line"><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD;"># 请确保这里的连接地址都有节点</span></span>
<span class="line highlighted warning"><span style="--shiki-light:#B07D48;--shiki-dark:#BD976A;">peers</span><span style="--shiki-light:#999999;--shiki-dark:#666666;">=</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D;">[</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77;">&quot;</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D;">127.0.0.1:20200</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77;">&quot;</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D;">,</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77;"> &quot;</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D;">127.0.0.1:20201</span><span style="--shiki-light:#B5695977;--shiki-dark:#C98A7D77;">&quot;</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE;">]    </span><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD;"># The peer list to connect</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0ADA0;--shiki-dark:#758575DD;"># Configure a private topic as a topic message sender.</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>复制节点证书到 Console 的配置目录下</p><div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212;"><pre class="shiki shiki-themes vitesse-light vitesse-dark vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665;">cp</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076;"> -r</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D;"> ../nodes/127.0.0.1/sdk/</span><span style="--shiki-light:#A65E2B;--shiki-dark:#C99076;">*</span><span style="--shiki-light:#B56959;--shiki-dark:#C98A7D;"> conf/</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><p>通过 <code>bash start.sh</code> 就可以启动 Console 控制台啦！ <img src="https://image.simengweb.com/notes/ops/blockchain/practice/console-operator/2025-10-03-161500.png" alt="启动Console控制台"></p><h2 id="常用控制台命令" tabindex="-1"><a class="header-anchor" href="#常用控制台命令"><span>常用控制台命令</span></a></h2><p>这里的区块链的搭建是根据前一篇文章中的多机构多群组多节点的关系</p><h3 id="合约相关命令" tabindex="-1"><a class="header-anchor" href="#合约相关命令"><span>合约相关命令</span></a></h3><h3 id="其他命令" tabindex="-1"><a class="header-anchor" href="#其他命令"><span>其他命令</span></a></h3><ul><li>查询区块高度：<code>getBlockNumber</code></li></ul><div class="code-block-title" data-title="output_example"><div class="code-block-title-bar"><span class="title">output_example</span></div><div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212;"><pre class="shiki shiki-themes vitesse-light vitesse-dark vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666;">[</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE;">group:1</span><span style="--shiki-light:#999999;--shiki-dark:#666666;">]</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676;">&gt;</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE;"> getBlockNumber </span></span>
<span class="line"><span style="--shiki-light:#59873A;--shiki-dark:#80A665;">0</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div></div></div></div><ul><li>查看共识节点列表：<code>getSealerList</code></li></ul><div class="code-block-title" data-title="output_example"><div class="code-block-title-bar"><span class="title">output_example</span></div><div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212;"><pre class="shiki shiki-themes vitesse-light vitesse-dark vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666;">[</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE;">group:1</span><span style="--shiki-light:#999999;--shiki-dark:#666666;">]</span><span style="--shiki-light:#AB5959;--shiki-dark:#CB7676;">&gt;</span><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE;"> getSealerList </span></span>
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666;">[</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE;">    d036a22f16909cba4c8521cd3c31db3be381e673c9749e3fd2848ab25eca134ef917cb9306f41893295c535078bce77bdc241eba3f92549a73efe4699d3c0df8,</span></span>
<span class="line"><span style="--shiki-light:#393A34;--shiki-dark:#DBD7CAEE;">    f0535616759000b473a285d60814bc2c5927a9cb897644da46890de71e59df590cd6fe1b226a95e19a566b6fc127fd85032de0d9fdd3d529e5e50cd96ad51f28</span></span>
<span class="line"><span style="--shiki-light:#999999;--shiki-dark:#666666;">]</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div></div>`,18)])])}const p=i(l,[["render",t]]),c=JSON.parse('{"path":"/ops/blockchain/practice/console-operator/","title":"Console 控制台操作","lang":"zh-CN","frontmatter":{"title":"Console 控制台操作","createTime":"2025/10/03 02:55:49","permalink":"/ops/blockchain/practice/console-operator/"},"readingTime":{"minutes":1.15,"words":344},"git":{"createdTime":1759656932000,"updatedTime":1759656932000,"contributors":[{"name":"si-meng-spec","username":"si-meng-spec","email":"simeng@simengweb.com","commits":1,"avatar":"https://avatars.githubusercontent.com/si-meng-spec?v=4","url":"https://github.com/si-meng-spec"}]},"filePathRelative":"notes/ops/blockchain/practice/console-operator.md","headers":[]}');export{p as comp,c as data};
