Tether USDT 节点钱包的安装与使用 https://blog.csdn.net/guokaikevin/article/details/79440230 对USDT描述比较清楚的说明: https://www.jianshu.com/p/bd573e2df746 https://www.jianshu.com/p/3aa3ab01b296 Bitcoin RPC-API https://bitcoincore.org/en/doc/0.16.0/rpc/blockchain/getblock/ https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list Tether RPC-API https://github.com/OmniLayer/omnicore/blob/master/src/omnicore/doc/rpc-api.md 创建原始交易、签名、广播。https://github.com/OmniLayer/omnicore/wiki/Use-the-raw-transaction-API-to-create-a-Simple-Send-transaction 为什么发送USDT要消耗BTC:https://github.com/OmniLayer/omnicore/wiki/Why-do-I-need-bitcoin-to-create-Omni-transactions%3F 接收USDT的准备工作:https://github.com/OmniLayer/omnicore/wiki/Integrate-Omni-Core-to-receive-payments 下面的链接是官方提供的准备工作: https://github.com/OmniLayer/omnicore/blob/master/doc/build-unix.md 比特币节点启动参数: https://blog.csdn.net/abcdad/article/details/80390898 准备工作完毕后,正式部署: https://github.com/OmniLayer/omnicore/blob/master/README.md 完整的JSON-RPC接口定义描述: https://github.com/OmniLayer/omnicore/blob/master/src/omnicore/doc/rpc-api.md 以上是准备工作,下面开始部署阶段: 第一阶段是安装比特币节点。 $sudo yum install -y boost-devel qt-devel protobuf-devel qrencode-devel libevent-devel libtool openssl-devel glibc-headers gcc-c++ $mkdir /app $sudo git clone https://github.com/bitcoin/bitcoin.git download the berkeley-db http://download.oracle.com/otn/berkeley-db/db-6.2.32.NC.tar.gz upzip the package $tar -xf db-6.2.32.NC.tar.gz $cd db-6.2.32.NC/build_unix/ $../dist/configure --enable-cxx --disable-shared --with-pic --prefix=/usr/local $sudo make install build the bitcoin $cd ~/Workdir/bitcoin $sh autogen.sh $./configure --with-incompatible-bdb --with-gui=no (--disable-wallet --disable-tests) --prefix=/app/bitcoinapp $sudo make install 会报一堆告警信息,但是不用理会,最终运行echo $?,看一眼有没有报错即可,如果显示0,就是没报错 安装完毕后,会在/usr/local/bin/目录下,多出7个文件,分别是比特币的运行文件和测试文件,这里,我们运行测试文件test_bitcoin,来测试安装是否完整 $cd /usr/local/bin $test_bitcoin $/usr/local/bin/bitcoin- qt BlockDataDir -> /home/pangxie/.bitcoin 第二阶段是部署Tether节点: Second Setup the tether project. $git clone https://github.com/OmniLayer/omnicore.git $cd omnicore/ $./autogen.sh $./configure IF configure: error: Found Berkeley DB other than 4.8, required for portable wallets (--with-incompatible-bdb to ignore or --disable-wallet to disable wallet functionality) THEN $./configure --with-incompatible-bdb --with-gui=no --prefx=/app/omnicoreapp $make 编译完成之后,在omnicore/src/会有omnicored, omnicore-cli等可执行文件。其来执行方式与bitcoin一样,需要一个名为bitcoin.conf的配置文件。 比特币原始配置文件地址:https://github.com/bitcoin/bitcoin/blob/master/share/examples/bitcoin.conf And start Omni Core using ./omnicored (or ./qt/omnicore-qt if built with UI). The inital parse step for a first time run will take up to 60 minutes or more, during this time your client will scan the blockchain for Omni Layer transactions. You can view the output of the parsing at any time by viewing the log located in your datadir, by default: ~/.bitcoin/omnicore.log. Omni Core requires the transaction index to be enabled. Add an entry to your bitcoin.conf file for txindex=1 to enable it or Omni Core will refuse to start. If a message is returned asking you to reindex, pass the -reindex flag as startup option. The reindexing process can take serveral hours. To issue RPC commands to Omni Core you may add the -server=1 CLI flag or add an entry to the bitcoin.conf file (located in ~/.bitcoin/ by default). 启动命令如下所示: $./omnicored -conf=%PATH TO bitcon.conf% -datadir=%PATH TO DATA DIR% & $./omnicored -conf="/home/pangxie/.bitcoin/bitcoin.conf" -datadir="~/.omnidata" 如果想启用JSON-RPC 就需要配置/home/pangxie/.bitcoin/bitcoin.conf如下: txindex=1 server=1 rpcpassword=spider 启动后,重新打开一个新的终端,执行如下命令测试RPC $/home/pangxie/Workdir/omnicore/src/omnicore-cli omni_getinfo 输出如下: { "omnicoreversion_int": 30000000, "omnicoreversion": "0.3.0", "mastercoreversion": "0.3.0", "bitcoincoreversion": "0.13.2", "block": 55166, "blocktime": 1273417370, "blocktransactions": 0, "totaltrades": 0, "totaltransactions": 0, "alerts": [ ] } 以上是节点的部署阶段,之后开始进行客户端的实现: 下面是收集相关的资料: http://demontf.github.io/2017/02/07/txAnalysis-1/ usdt和Bitcoin都提供RPC-JSON接口和Nodejs版本的客户端连接,所以之后的任务就是把以Nodejs版本的客户端,对外提供RESTfulAPI 以下是客户端的接口定义: https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list https://github.com/OmniLayer/omnicore/blob/master/src/omnicore/doc/rpc-api.md https://github.com/OmniLayer/OmniClientJS/blob/master/lib/OmniClient.js https://npm.taobao.org/package/bitcoin 2018.7.8 REST好像不用自己封装了,官方提供了,下面是地址: https://github.com/OmniLayer/omnicore/blob/master/doc/REST-interface.md 扫块相关的函数: omni_listtransactions omni_listblocktransactions omni_listpendingtransactions 获取测试网络的比特币和Omni 先从下面网站获取比特币: http://bitcoinfaucet.uo1.net/send.php