367 lines
14 KiB
HTML
367 lines
14 KiB
HTML
|
||
|
||
<!DOCTYPE html>
|
||
<html class="writer-html5" lang="zh-CN" >
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
|
||
<title>安装说明 — 北大数瑞大数据区块链 V1.0 文档</title>
|
||
|
||
|
||
|
||
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
|
||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||
|
||
|
||
|
||
<link rel="shortcut icon" href="../_static/favicon.ico"/>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<!--[if lt IE 9]>
|
||
<script src="../_static/js/html5shiv.min.js"></script>
|
||
<![endif]-->
|
||
|
||
|
||
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
|
||
<script src="../_static/jquery.js"></script>
|
||
<script src="../_static/underscore.js"></script>
|
||
<script src="../_static/doctools.js"></script>
|
||
<script src="../_static/translations.js"></script>
|
||
|
||
<script type="text/javascript" src="../_static/js/theme.js"></script>
|
||
|
||
|
||
<link rel="index" title="索引" href="../genindex.html" />
|
||
<link rel="search" title="搜索" href="../search.html" />
|
||
</head>
|
||
|
||
<body class="wy-body-for-nav">
|
||
|
||
|
||
<div class="wy-grid-for-nav">
|
||
|
||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||
<div class="wy-side-scroll">
|
||
<div class="wy-side-nav-search" >
|
||
|
||
|
||
|
||
<a href="../index.html">
|
||
|
||
|
||
|
||
|
||
<img src="../_static/logo.png" class="logo" alt="Logo"/>
|
||
|
||
</a>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<div role="search">
|
||
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
|
||
<input type="text" name="q" placeholder="在文档中搜索" />
|
||
<input type="hidden" name="check_keywords" value="yes" />
|
||
<input type="hidden" name="area" value="default" />
|
||
</form>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
|
||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<p class="caption"><span class="caption-text">目录</span></p>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="../Introduction.html">BDContract介绍</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../InstallTips.html">BDContract安装说明</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../IDEUsage.html">BDContract管理界面</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../ContractAPI.html">BDContract SDK</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../YJSInDepth.html">YJS语法</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../YJSAPI.html">YJS SDK</a></li>
|
||
</ul>
|
||
|
||
|
||
|
||
</div>
|
||
|
||
</div>
|
||
</nav>
|
||
|
||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
||
|
||
|
||
<nav class="wy-nav-top" aria-label="top navigation">
|
||
|
||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||
<a href="../index.html">北大数瑞大数据区块链</a>
|
||
|
||
</nav>
|
||
|
||
|
||
<div class="wy-nav-content">
|
||
|
||
<div class="rst-content">
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||
|
||
<ul class="wy-breadcrumbs">
|
||
|
||
<li><a href="../index.html" class="icon icon-home"></a> »</li>
|
||
|
||
<li>安装说明</li>
|
||
|
||
|
||
<li class="wy-breadcrumbs-aside">
|
||
|
||
|
||
<a href="../_sources/markdown_BDWare/InstallTips.md.txt" rel="nofollow"> 查看页面源码</a>
|
||
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
|
||
<hr/>
|
||
</div>
|
||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||
<div itemprop="articleBody">
|
||
|
||
<div class="section" id="id1">
|
||
<h1>安装说明<a class="headerlink" href="#id1" title="永久链接至标题">¶</a></h1>
|
||
<hr class="docutils" />
|
||
<div class="section" id="id2">
|
||
<h2>依赖环境的安装<a class="headerlink" href="#id2" title="永久链接至标题">¶</a></h2>
|
||
<p>1.安装Java1.8环境。</p>
|
||
<p>例如,在Ubuntu下使用apt-get进行安装:</p>
|
||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>apt-get install openjdk-8-jre
|
||
</pre></div>
|
||
</div>
|
||
<p>在Centos环境下,使用yum进行安装:</p>
|
||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>yum install java-1.8.0-openjdk
|
||
</pre></div>
|
||
</div>
|
||
<p>如果是离线环境,可先下载openjdk的安装包后进行离线安装。</p>
|
||
<p>Ubuntu下</p>
|
||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>dpkg -i jdk-8uxxxxx.deb
|
||
</pre></div>
|
||
</div>
|
||
<p>在Centos环境下,使用yum进行离线安装:</p>
|
||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>yum localinstall jdk-8u271-linux-xxx.rpm
|
||
</pre></div>
|
||
</div>
|
||
<p>2.安装wget与unzip。
|
||
例如,在Ubuntu下使用apt-get进行安装:</p>
|
||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>apt-get install unzip
|
||
apt-get install wget
|
||
</pre></div>
|
||
</div>
|
||
</div>
|
||
<hr class="docutils" />
|
||
<div class="section" id="id3">
|
||
<h2>网络拓扑说明<a class="headerlink" href="#id3" title="永久链接至标题">¶</a></h2>
|
||
<p>部署数瑞智能合约引擎最小仅需一个节点,此时可用作调试、测试,不能通过多节点模式来实现可信的计算。
|
||
单节点部署时,可通过配置账本实现”防抵赖”的计算,但不能实现”难篡改”的计算。</p>
|
||
<p>多节点部署时可参考下图,包含三种逻辑节点,同一虚拟机可安装一至三种节点。</p>
|
||
<p>1)账本节点。即数瑞图式账本。</p>
|
||
<p>2)合约节点。运行代码逻辑,并通过内存缓存实现高响应的模块。与其他合约节点组成可信计算网络。</p>
|
||
<p>3)路由节点。各个合约节点的路由信息。一般单个路由节点可支持最高1000合约节点。可视情况部署多个路由节点,并在路由节点之间配置实现更大规模的节点组网。</p>
|
||
<p>一般地,同一虚拟机下,会部署<strong>合约节点与账本节点</strong>。</p>
|
||
<p><img alt="deploytopology" src="markdown_BDWare/_static/imgs/deploytopology.png" /></p>
|
||
</div>
|
||
<hr class="docutils" />
|
||
<div class="section" id="id4">
|
||
<h2>智能合约节点安装<a class="headerlink" href="#id4" title="永久链接至标题">¶</a></h2>
|
||
<p>打开<a class="reference external" href="https://public.internetapi.cn/?dir=releases/bdcontract/newest">安装包下载链接</a>
|
||
其中,下载<code class="docutils literal notranslate"><span class="pre">bdserver-lite.zip</span></code>或<code class="docutils literal notranslate"><span class="pre">bdserver.zip</span></code>,其中,<code class="docutils literal notranslate"><span class="pre">bdserver.zip</span></code>包含更多示例和文档。
|
||
下载之后解压并启动。</p>
|
||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>unzip -d ./bdserver bdserver-lite.zip
|
||
<span class="nb">cd</span> bdserver
|
||
chmod +x *.sh
|
||
sh cmstart.sh
|
||
</pre></div>
|
||
</div>
|
||
</div>
|
||
<hr class="docutils" />
|
||
<div class="section" id="id5">
|
||
<h2>路由准入节点安装<a class="headerlink" href="#id5" title="永久链接至标题">¶</a></h2>
|
||
<p>打开<a class="reference external" href="https://public.internetapi.cn/?dir=releases/bdcontract/newest">安装包下载链接</a>
|
||
其中,下载<code class="docutils literal notranslate"><span class="pre">bdserver-cluster.zip</span></code>。
|
||
下载之后解压并启动。</p>
|
||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>unzip -d ./bdcluster bdserver-cluster.zip
|
||
<span class="nb">cd</span> bdcluster
|
||
chmod +x *.sh
|
||
sh ncstart.sh
|
||
</pre></div>
|
||
</div>
|
||
</div>
|
||
<hr class="docutils" />
|
||
<div class="section" id="id6">
|
||
<h2>文件说明<a class="headerlink" href="#id6" title="永久链接至标题">¶</a></h2>
|
||
<div class="section" id="id7">
|
||
<h3>智能合约节点<a class="headerlink" href="#id7" title="永久链接至标题">¶</a></h3>
|
||
<p><img alt="bdserver目录" src="markdown_BDWare/_static/imgs/dirstructure.png" /></p>
|
||
<p>该目录下的文件说明:</p>
|
||
<p>1.cmstart.sh 该脚本用于启动合约引擎。合约引擎默认监听8080端口,可通过修改cmstart.sh来修改合约引擎的监听端口。</p>
|
||
<p>2.BDWareProjectDir 该目录存放了本节点的所有合约项目。</p>
|
||
<p>3.WebContent 该目录存放了本节点的前端代码。</p>
|
||
<p>4.cp, 该目录存放了yjs.jar,为启动合约实例所需的jar。</p>
|
||
<p>5.bdserver.jar 对外提供http/websocket的服务器逻辑。</p>
|
||
<p>6.updateContract.sh 用于升级的脚本。</p>
|
||
</div>
|
||
<div class="section" id="id8">
|
||
<h3>路由准入节点<a class="headerlink" href="#id8" title="永久链接至标题">¶</a></h3>
|
||
<p>安装脚本会自动下载安装并解压为bdcluster目录。
|
||
该目录下的文件说明:</p>
|
||
<p>1.ncstart.sh 该脚本用于启动节点准入中心。默认监听1718端口。可通过修改ncstart.sh来修改监听的端口。</p>
|
||
<p>2.WebContent 该目录存放了准入中心的前端代码。</p>
|
||
<p>3.bdcluster.jar 准入中心的后端。</p>
|
||
</div>
|
||
</div>
|
||
<hr class="docutils" />
|
||
<div class="section" id="id9">
|
||
<h2>升级流程<a class="headerlink" href="#id9" title="永久链接至标题">¶</a></h2>
|
||
<div class="section" id="id10">
|
||
<h3>合约节点<a class="headerlink" href="#id10" title="永久链接至标题">¶</a></h3>
|
||
<p>在命令行中输入:</p>
|
||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sh updateContract.sh
|
||
</pre></div>
|
||
</div>
|
||
<p>亦可通过<a class="reference external" href="https://public.internetapi.cn/?dir=releases/bdcontract">public.internetapi.cn</a>,下载最新文件,单独升级yjs.zip/bdserver-jar.zip/AgentWebContent来升级。</p>
|
||
</div>
|
||
<div class="section" id="id11">
|
||
<h3>路由准入节点<a class="headerlink" href="#id11" title="永久链接至标题">¶</a></h3>
|
||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sh updateCluster.sh
|
||
</pre></div>
|
||
</div>
|
||
<p>亦可通过<a class="reference external" href="https://public.internetapi.cn/?dir=releases/bdcontract">public.internetapi.cn</a>,下载最新文件,单独升级bdserver-cluster.zip/ClusterWebContent.zip来升级。</p>
|
||
</div>
|
||
</div>
|
||
<hr class="docutils" />
|
||
<div class="section" id="id12">
|
||
<h2>使用说明<a class="headerlink" href="#id12" title="永久链接至标题">¶</a></h2>
|
||
<div class="section" id="id13">
|
||
<h3>通过参考界面使用<a class="headerlink" href="#id13" title="永久链接至标题">¶</a></h3>
|
||
<p>当保留了WebContent目录的情况下,可使用浏览器进行配置。
|
||
更多请使用见左侧文档<a class="reference external" href="./IDEUsage.html">BDContract参考界面使用说明</a>。</p>
|
||
<div class="section" id="bdware-onlineide">
|
||
<h4>BDWare OnlineIDE<a class="headerlink" href="#bdware-onlineide" title="永久链接至标题">¶</a></h4>
|
||
<p>打开<a class="reference external" href="../OnlineIDE.html">BDWare OnlineIDE</a>。</p>
|
||
</div>
|
||
<div class="section" id="bdware-nodeportal">
|
||
<h4>BDWare NodePortal<a class="headerlink" href="#bdware-nodeportal" title="永久链接至标题">¶</a></h4>
|
||
<p>打开<a class="reference external" href="../NodePortal.html">BDWare NodePortal</a>。</p>
|
||
<p>如需组网,使用跨节点功能,则需安装路由准入中心。并按以下步骤进行配置。涉及两组公私钥。
|
||
第一组公私钥为合约节点的、有NodeManager权限的公私钥。
|
||
第二组公私钥为路由准入节点的、有CenterManager权限的公私钥。</p>
|
||
<p>1.打开NodePortal.html,复制该节点的NodeManager公私钥。</p>
|
||
<p>2.打开CenterPortal.html,点击右上角,将上述的NodeManager公私钥导入;并选择”NodeManager”进行身份认证。</p>
|
||
<p>3.在CenterPortal.html中切换CenterManager的公私钥,点左侧的”用户管理”,通过NodeManager的认证请求。</p>
|
||
<p>4.使用NodeManager权限的公私钥打开NodePortal.html,点击:“节点管理”菜单,并配置加入网络。
|
||
其中,加入网络的格式为:ws://centerportal的ip:端口+1。
|
||
<img alt="配置示例" src="markdown_BDWare/_static/imgs/config.png" /></p>
|
||
</div>
|
||
</div>
|
||
<div class="section" id="sdk">
|
||
<h3>通过SDK使用<a class="headerlink" href="#sdk" title="永久链接至标题">¶</a></h3>
|
||
<div class="section" id="id14">
|
||
<h4>基础知识<a class="headerlink" href="#id14" title="永久链接至标题">¶</a></h4>
|
||
<p><a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API">Websocket</a></p>
|
||
<p><a class="reference external" href="https://github.com/JuneAndGreen/sm-crypto">Sm2加密的使用</a></p>
|
||
</div>
|
||
<div class="section" id="id15">
|
||
<h4>SDK下载<a class="headerlink" href="#id15" title="永久链接至标题">¶</a></h4>
|
||
<ol class="simple">
|
||
<li><p>Java版本的客户端下载:<a class="reference external" href="_static/BDWareJavaClient.zip">BDWareJavaClient</a>。具体使用说明请下载后解压,查看README.md,并参考<a class="reference external" href="./ContractAPI.html">ContractAPI</a>。</p></li>
|
||
</ol>
|
||
<p>2.Javascript版本的客户端下载:<a class="reference external" href="_static/BDWareWebClient.zip">BDWareWebClient</a>。具体使用说明请下载后解压,查看README.md,并参考<a class="reference external" href="./ContractAPI.html">ContractAPI</a>。</p>
|
||
<p>3.配置工具<a class="reference external" href="_static/BDWareConfigTool.zip">BDWareConfigTool</a>。具体说明请下载后解压,使用以下命令查看帮助:</p>
|
||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>java -jar java-client.jar -h
|
||
</pre></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
</div>
|
||
<footer>
|
||
|
||
<hr/>
|
||
|
||
<div role="contentinfo">
|
||
<p>
|
||
© 版权所有 2021, Peking University.
|
||
|
||
</p>
|
||
</div>
|
||
|
||
|
||
|
||
利用 <a href="https://www.sphinx-doc.org/">Sphinx</a> 构建,使用了
|
||
|
||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">主题</a>
|
||
|
||
由 <a href="https://readthedocs.org">Read the Docs</a>开发.
|
||
|
||
</footer>
|
||
</div>
|
||
</div>
|
||
|
||
</section>
|
||
|
||
</div>
|
||
|
||
|
||
<script type="text/javascript">
|
||
jQuery(function () {
|
||
SphinxRtdTheme.Navigation.enable(true);
|
||
});
|
||
</script>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</body>
|
||
</html> |