Menu Close

Bitcore的功能列表

Bitcore是BitPay提供的一套工具。 其目标是为Bitcoin开发人员提供易于使用的工具。 几乎所有的Bitcore的代码都是用JavaScript编写的。
有一些专门为NodeJS编写的模块。 最后,Bitcore的“节点”模块包括Bitcoin Core的C ++代码。 有关详细信息,请参阅https://bitcore.io

Bitcore的功能列表

Bitcoin full node (bitcore-node)
Block explorer (insight)
Block, transaction, and wallet utilities (bitcore-lib)
Communicating directly with Bitcoin’s P2P network (bitcore-p2p)
Seed entropy mnemonic generation(种子熵助记符) (bitcore-mnemonic)
Payment protocol (bitcore-payment-protocol)
Message verification and signing (bitcore-message)
Elliptic curve Integrated Encryption Scheme(椭圆曲线综合加密方案) (bitcore-ecies)
Wallet service (bitcore-wallet-service)
Wallet client (bitcore-wallet-client)
Playground (bitcore-playground)
Integrating services directly with Bitcoin Core (bitcore-node)

Bitcore库示例

先决条件

NodeJS >= 4.x 或者使用hosted online playground

如果使用NodeJS和节点REPL:

使用bitcore-lib的钱包示例

使用关联的私钥创建新的比特币地址:


创建分层确定性私钥和地址:


从UTXO创建和签署交易:


替换mempool中的最后一个交易(替换费):


将交易广播到比特币网络(注意:仅广播有效交易;请参阅https://bitnodes.21.co/nodes):
将以下代码复制到名为broadcast.js的文件中。
tx和rbfTx变量分别是tx.serialize()和rbfTx.serialize()的输出。
为了更换费用,对等人必须支持bitcoind选项mempoolreplace并将其设置为1。
运行文件节点broadcast.js:


除教程外,本网站大部分文章来自互联网,如果有内容冒犯到你,请联系我们删除!
Posted in 比特币教程

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注