比特币 Insight API 接口用于其它虚拟币/山寨币

1. 更新配置文件:
insight/node_modules/insight-bitcore-api/config/config.js

修改端口号和数据文件目录。

2. 更新文件 networks.js 中的 exports.livenet 部分:
insight/node_modules/bitcore/networks.js

Litecoin 莱特币的参数:

exports.livenet = {
  name: 'livenet',
  magic: hex('fbc0b6db'),
  addressVersion: 0x30,
  privKeyVersion: 0xb0,
  P2SHVersion: 5,
  hkeyPublicVersion: 0x0488c42e,
  hkeyPrivateVersion: 0x0488e1f4,
  genesisBlock: {
    hash: hex('E2BF047E7E5A191AA4EF34D314979DC9986E0F19251EDABA5940FD1FE365A712'),
    merkle_root: hex('D9CED4ED1130F7B7FAAD9BE25323FFAFA33232A17C3EDF6CFD97BEE6BAFBDD97'),
    height: 0,
    nonce: 2084524493,
    version: 1,
    prev_hash: buffertools.fill(new Buffer(32), 0),
    timestamp: 1317972665,
    bits: 504365040,
  },
  dnsSeeds: [
    'dnsseed.litecointools.com',
    'dnsseed.litecoinpool.org',
    'dnsseed.ltc.xurious.com',
    'dnsseed.koin-project.com',
    'dnsseed.weminemnc.com'
  ],
  defaultClientPort: 9333
};

Dogecoin 狗狗币的参数:

exports.livenet = {
  name: 'livenet',
  magic: hex('c0c0c0c0'),
  addressVersion: 0x1e,
  privKeyVersion: 0x9e,
  P2SHVersion: 5,
  hkeyPublicVersion: 0x0488c42e,
  hkeyPrivateVersion: 0x0488e1f4,
  genesisBlock: {
    hash: hex('9156352c1818b32e90c9e792efd6a11a82fe7956a630f03bbee236cedae3911a'),
    merkle_root: hex('696ad20e2dd4365c7459b4a4a5af743d5e92c6da3229e6532cd605f6533f2a5b'),
    height: 0,
    nonce: 99943,
    version: 1,
    prev_hash: buffertools.fill(new Buffer(32), 0),
    timestamp: 1386325540,
    bits: 504365040,
  },
  dnsSeeds: [
    'seed.dogecoin.com',
    'seed.mophides.com',
    'seed.dglibrary.org',
    'seed.dogechain.info'
  ],
  defaultClientPort: 22556
};

3. 更新 PROTOCOL_VERSION 版本号后才能接受 RPC 连接。

打开文件:
insight/node_modules/bitcore/lib/Connection.js

修改:
var PROTOCOL_VERSION = 70000;

为:
var PROTOCOL_VERSION = 70003;

狗狗币区块链浏览工具实例: http://dogecoin.biteast.com
比特币区块链浏览工具实例: http://bitcoin.biteast.com

7 thoughts on “比特币 Insight API 接口用于其它虚拟币/山寨币

  • 星期六 一月 30th, 2016 at 16:20
    Permalink

    Calculator Hash for Dogecoin config:
    echo -n ‘1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691’ | dd conv=swab | rev

    Output: 9156352c1818b32e90c9e792efd6a11a82fe7956a630f03bbee236cedae3911a

    Reply
  • 星期六 一月 30th, 2016 at 16:23
    Permalink

    Calculator merkle_root for Dogecoin config:
    echo -n ‘5b2a3f53f605d62c53e62932dac6925e3d74afa5a4b459745c36d42d0ed26a69’ | dd conv=swab | rev

    Output: 696ad20e2dd4365c7459b4a4a5af743d5e92c6da3229e6532cd605f6533f2a5b

    Reply
  • 星期六 一月 30th, 2016 at 16:26
    Permalink

    magic number for Dogecoin config:

    located at src/chainparams.cpp

    pchMessageStart[0] = 0xc0;
    pchMessageStart[1] = 0xc0;
    pchMessageStart[2] = 0xc0;
    pchMessageStart[3] = 0xc0;

    Reply
  • 星期六 一月 30th, 2016 at 16:28
    Permalink

    addressVersion for Dogecoin config:

    located at src/chainparams.cpp

    base58Prefixes[PUBKEY_ADDRESS] = std::vector(1,30); // 0x1e

    Reply
  • 星期六 一月 30th, 2016 at 16:29
    Permalink

    privKeyVersion for Dogecoin config:

    addressVersion + 128 = 0x1e + 0x80 = 0x9e

    Reply
  • 星期五 九月 23rd, 2016 at 04:52
    Permalink

    Hi,
    I’m new to this, now i’m trying to setup litecoin full node with insight api, I finished litecoin node setup, but no luck with insight api, please some one help me on this, Thanks in advance.

    Reply
    • 星期四 四月 6th, 2017 at 23:53
      Permalink

      Hi Ananth,

      I am also trying to make isight API work for dogecoin, i found few solutions but none of them is working for me. If I get some solution, I will definitely let you know.

      Thank you,

      Reply

黄忠进行回复 取消回复

电子邮件地址不会被公开。 必填项已用*标注