DNC2 API

新的API版本
v1
API接口
http://chain.darknetspace.org/api/v1

状态{coin}/status

获取已发行安网币统计数据。

请求示例
http://chain.darknetspace.org/api/v1/dnc/status
响应示例
{
    "alias_count": 16,
    "alt_blocks_count": 3,
    "current_blocks_median": 30000,
    "current_network_hashrate_350": 1103277784,
    "current_network_hashrate_50": 971033095,
    "daemon_network_state": 2,
    "difficulty": 68450027407,
    "grey_peerlist_size": 128,
    "height": 119015,
    "incoming_connections_count": 0,
    "max_net_seen_height": 119000,
    "mi": {
        "build_no": 0,
        "mode": 0,
        "ver_major": 0,
        "ver_minor": 0,
        "ver_revision": 0
    },
    "outgoing_connections_count": 8,
    "scratchpad_size": 50458272,
    "status": "OK",
    "synchronization_start_height": 111833,
    "transactions_cnt_per_day": 816,
    "transactions_volume_per_day": 70752110000000000,
    "tx_count": 67337,
    "tx_pool_size": 0,
    "white_peerlist_size": 18
}

区块{coin}/blocks/{from}/{to}

在高度范围内获取块头数据.

请求示例
http://chain.darknetspace.org/api/v1/dnc/blocks/1/10
响应示例
[
    {
        "depth": 118886,
        "difficulty": 1,
        "hash": "8c95e6f30de1a27fd560859d7920ae2fcf68ff2e4d7d27ba806be7cc703b6148",
        "height": 1,
        "major_version": 1,
        "minor_version": 0,
        "nonce": 1942343972,
        "orphan_status": false,
        "prev_hash": "aecf5933feeaf47857d096f82d97de644a25dfa63c47c0118c349d4385400f80",
        "reward": 140736414000000,
        "timestamp": 1413168182
    },
    {
        "depth": 118885,
        "difficulty": 1,
        "hash": "5ecdf53699a98399b7bf68abf5e4290da25adbd69c4ce607131445d28836cca2",
        "height": 2,
        "major_version": 1,
        "minor_version": 0,
        "nonce": 1248828500,
        "orphan_status": false,
        "prev_hash": "8c95e6f30de1a27fd560859d7920ae2fcf68ff2e4d7d27ba806be7cc703b6148",
        "reward": 140735340000000,
        "timestamp": 1413168182
    }
]

区块头信息{coin}/block/{height or hash}/header

按高度或hash值来获取块头数据。

请求示例
http://chain.darknetspace.org/api/v1/dnc/block/1/header
响应示例
{
    "depth": 118886,
    "difficulty": 1,
    "hash": "8c95e6f30de1a27fd560859d7920ae2fcf68ff2e4d7d27ba806be7cc703b6148",
    "height": 1,
    "major_version": 1,
    "minor_version": 0,
    "nonce": 1942343972,
    "orphan_status": false,
    "prev_hash": "aecf5933feeaf47857d096f82d97de644a25dfa63c47c0118c349d4385400f80",
    "reward": 140736414000000,
    "timestamp": 1413168182
}

区块数据{coin}/block/{height or hash}/full

通过高度或散列获取完整的数据。

请求示例
http://chain.darknetspace.org/api/v1/dnc/block/1/full
响应示例
{
    "major_version": 1,
    "nonce": 1942343972,
    "prev_id": "aecf5933feeaf47857d096f82d97de644a25dfa63c47c0118c349d4385400f80",
    "minor_version": 0,
    "timestamp": 1413168182,
    "flags": 0,
    "miner_tx": {
        "version": 1,
        "unlock_time": 61,
        "vin": [
            {
                "gen": {
                    "height": 1
                }
            }
        ],
        "vout": [
            {
                "amount": 4000000,
                "target": {
                    "key": "e98b02bafa31a4921c6200b52cda256dfa6c537b83d353ebc0465585a5aed86d00"
                }
            },
            {
                "amount": 10000000,
                "target": {
                    "key": "8563dc31fa326dfe4a6bf30c2ff27369f472d7ab1c281ca9bb164b4c9392530b00"
                }
            },
            {
                "amount": 400000000,
                "target": {
                    "key": "83b523c31bda90f448d79f6dee78057b508982a068c6959d311769d4e9ca9c2900"
                }
            },
            {
                "amount": 6000000000,
                "target": {
                    "key": "438a520f7af03b3130a13208d46b1e78122548caf2267868a4618a2823e48b9f00"
                }
            },
            {
                "amount": 30000000000,
                "target": {
                    "key": "91c27387f37cbc4b5a1f5e8009a2a74eb157b43f25e30052d6e6bbcadebd7beb00"
                }
            },
            {
                "amount": 700000000000,
                "target": {
                    "key": "c9cae4a93bb40a513ee1f879265d8a48a5f2ea944759c80887c4aa68397926cf00"
                }
            },
            {
                "amount": 40000000000000,
                "target": {
                    "key": "29156832784bc82bdade8f8e10d416487a0659a2ec6a0ec6430706c82785ab9f00"
                }
            },
            {
                "amount": 100000000000000,
                "target": {
                    "key": "25278601b11ad1f9dbd3f98135230ff6b6afcd484fb91781cfe549f55c87c86000"
                }
            }
        ],
        "extra": [
            1,
            156,
            120,
            15,
            125,
            34,
            192,
            108,
            30,
            122,
            163,
            226,
            102,
            176,
            206,
            24,
            16,
            6,
            12,
            37,
            24,
            154,
            159,
            190,
            110,
            194,
            19,
            221,
            174,
            134,
            92,
            168,
            135,
            2,
            23,
            48,
            46,
            54,
            46,
            53,
            46,
            49,
            48,
            40,
            48,
            46,
            49,
            45,
            103,
            52,
            48,
            98,
            56,
            57,
            102,
            48,
            41,
            124
        ],
        "signatures": []
    },
    "tx_hashes": []
}

交易信息{coin}/tx/{hash}

通过交易hash获取数据。

请求示例
http://chain.darknetspace.org/api/v1/dnc/tx/9332b412a36b611859b5761b3f8e17999b5c78ae07ceee80373279ee9965fab5
响应示例
{
    "version": 1,
    "unlock_time": 0,
    "vin": [
        {
            "key": {
                "amount": 3000000000000,
                "key_offsets": [
                    11891
                ],
                "k_image": "204bf11f34ac4adf26cbb62dd14fb3bdd5fde59f89db61e9bf0a2f8b898cfa2a"
            }
        }
    ],
    "vout": [
        {
            "amount": 1000000000,
            "target": {
                "key": "351d760acc3e5f4187539846bc8ef6f5743932e27d90ff6fb585d627927dd59800"
            }
        },
        {
            "amount": 3000000000,
            "target": {
                "key": "71a7c42e591fbaff24c64c35c6054b2b3f08d16114aebbe8bde86f51c17cc1aa00"
            }
        },
        {
            "amount": 10000000000,
            "target": {
                "key": "f4d68200173f09a5da887fa9cf572bcec26d7ab2e609111ed3800c37264bdd8500"
            }
        },
        {
            "amount": 80000000000,
            "target": {
                "key": "243ebc098626d3a0ba1c636de25f4ab86ae30b588b7678f2f3f353a96935e7e400"
            }
        },
        {
            "amount": 90000000000,
            "target": {
                "key": "42d54683aaf5b71208952532084a5cb498e2aaad4e4de104c1c4813cf0b57eda00"
            }
        },
        {
            "amount": 800000000000,
            "target": {
                "key": "becdc5e09b50a66c47a611e9de37df4fd2497083d95c2a788e3e8192ad5a9e8500"
            }
        },
        {
            "amount": 2000000000000,
            "target": {
                "key": "ffd6d7adee2be848c3aac5b149a03abe7ab536fef03aeacf271c374b9c8ed34400"
            }
        }
    ],
    "extra": [
        1,
        1,
        102,
        135,
        32,
        195,
        59,
        130,
        100,
        243,
        221,
        161,
        150,
        153,
        248,
        161,
        37,
        48,
        131,
        22,
        1,
        143,
        218,
        74,
        207,
        171,
        74,
        55,
        212,
        81,
        238,
        210,
        206
    ],
    "signatures": []
}

© SafeNetSpace 2016-2017