Skip to content

jxzsxsp/pychain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

用Python从零开始创建区块链

安装

  1. 安装 Python 3.6+
  2. 安装 pipenv
$ pip install pipenv 
  1. 创建virtual env,创建好virtual env后会在当前目录生成一个Pipfile文件
$ pipenv --python=python3.6
  1. 安装依赖
  • 单独添加依赖
$ pipenv install flask
$ pipenv install requests
  • 安装Pipfile中已有的依赖
$ pipenv install 
  1. 运行节点:
    • $ pipenv run python server.py
    • $ pipenv run python server.py -p 5001
    • $ pipenv run python server.py --port 5002

Docker运行

  1. 构建docker容器
$ docker build -t jxzsxsp/pychain .
  1. 发布docker容器
$ docker push jxzsxsp/pychain
  1. 克隆docker容器
$ docker pull jxzsxsp/pychain
  1. 运行
$ docker run -itd -p 5000:5000 jxzsxsp/pychain
  1. 添加多个节点:
$ docker run -itd -p 5001:5000 jxzsxsp/pychain
$ docker run -itd -p 5002:5000 jxzsxsp/pychain
$ docker run -itd -p 5003:5000 jxzsxsp/pychain

使用

  1. 注册节点

Request

curl -X POST \
  http://localhost:5000/nodes/register \
  -H 'Content-Type: application/json' \
  -d '{
	"nodes":[
		"http://localhost:5001",
		"http://localhost:5002"
	]
}'

Response

{
    "message": "New nodes added",
    "total_nodes": [
        "localhost:5001",
        "localhost:5002"
    ]
}
  1. 解决冲突

Request

curl -X GET http://localhost:5000/nodes/resolve

Response

{
    "chain": [
        {
            "index": 1,
            "previous_hash": "1",
            "proof": 100,
            "timestamp": 1529859376.5881078,
            "transactions": []
        },
        {
            "index": 2,
            "previous_hash": "ddcef81014e470ba2ceb5b0a8aad912e55eaf493ca5c9ead15b0081868445eb8",
            "proof": 226,
            "timestamp": 1529859429.7640576,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 3,
            "previous_hash": "1315ac99f105d696a821df585815c0af08f8f463f7d252d07ece7cd539fb8414",
            "proof": 346,
            "timestamp": 1529859452.0837927,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 4,
            "previous_hash": "e8738fd266ef7896b9b98e4976aa741f7f916dc692cfaf444ddb108f280a86de",
            "proof": 57,
            "timestamp": 1529859452.6275938,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 5,
            "previous_hash": "970728e879b725c3b9c29dc42f43aa495d8963bdaf93a5ef4db65dae03fb89c9",
            "proof": 289,
            "timestamp": 1529859453.3966124,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 6,
            "previous_hash": "d5b5bcb6f8bd7739765d924288a1bb53c9985dc4eb5b614f8ae2b41ad7578247",
            "proof": 175,
            "timestamp": 1529859453.6964805,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 7,
            "previous_hash": "3d0d4662cca1207e0ac6e71b13f72e488e21f5273dd302bf0941e66c56572177",
            "proof": 27,
            "timestamp": 1529859454.3320074,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 8,
            "previous_hash": "b987e6afdb9e28c89493a585b1fcef999509410a1d747e3fa42f26d3f39fd1fa",
            "proof": 26,
            "timestamp": 1529859454.9836872,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 9,
            "previous_hash": "ba1a6b386d4cbd3b988b0a6ec2a7c6c0a4d82bca2d7729e276861a9327fa8505",
            "proof": 50,
            "timestamp": 1529859455.8681195,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 10,
            "previous_hash": "d31587c692ad6d7e6172e609c720e015b1d983153ec666c918f82036863e1ea7",
            "proof": 329,
            "timestamp": 1529859456.7799404,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 11,
            "previous_hash": "df7da6708940bb1f1297ae879b447a69121f31a68e1a27c1c1482a6852cc0a6a",
            "proof": 555,
            "timestamp": 1529859458.2551394,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 12,
            "previous_hash": "3c74f62f796b81af5d63df7212daf5e296a566abcc169d643b19cb7e03908dac",
            "proof": 85,
            "timestamp": 1529859459.6046097,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 13,
            "previous_hash": "8515567d55c792e7e3a9da36f647bfdd38c025d51fefa9f666248ef36d16e561",
            "proof": 36,
            "timestamp": 1529859460.5006695,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 14,
            "previous_hash": "842e90e18032f5c54dbbf7bbe20d4a6f7a4c6db2a97299c86dd1eb045f5e72ab",
            "proof": 27,
            "timestamp": 1529859461.2274797,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 15,
            "previous_hash": "133f899890e7896a1787866e7c826f40e77c623a5a98fa2781c2db4424d70977",
            "proof": 26,
            "timestamp": 1529859461.9414406,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 16,
            "previous_hash": "86f5651515bc7005f2316630bac8122785464af790a03ba8b27ee77e9827ca2c",
            "proof": 50,
            "timestamp": 1529859462.6605353,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 17,
            "previous_hash": "c5567fdc16cafb1063054c2ef0f101304bffb0368efd20a2b2baab1cf35f2342",
            "proof": 329,
            "timestamp": 1529859463.3512006,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 18,
            "previous_hash": "62df7bf4de5c79f150a4d4288fb9055feeb6af63904a8aed8dacc40e3208ab9c",
            "proof": 555,
            "timestamp": 1529859464.0180788,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 19,
            "previous_hash": "1f78b17d17a8aad2f7d4a52cb10efb3f93d0f14cbaed53e3190b93df80c2d1ad",
            "proof": 85,
            "timestamp": 1529859465.0934887,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 20,
            "previous_hash": "9dcc765b90da26211482780fb90b1644dd743d234e7e2f25d0d775e123a97ee5",
            "proof": 36,
            "timestamp": 1529859466.197829,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 21,
            "previous_hash": "26143c802b4ca4e0177a852b054abb5b9de1b82c2e73205689c16a854d8f4f75",
            "proof": 27,
            "timestamp": 1529859467.540586,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 22,
            "previous_hash": "b68b4a3240851124e61cfbdb50a03e98ae0c4374e52c54f440e207ddacde264f",
            "proof": 26,
            "timestamp": 1529859468.3743403,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 23,
            "previous_hash": "ee3e5591644928fb039a3e1ed21bc1e53083816b10f7dfbe77f8e3b4c7413127",
            "proof": 50,
            "timestamp": 1529859469.110071,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 24,
            "previous_hash": "42b51c1c1e41321a8149b7803f4355b454113d2aff0cacc9c97cb3694b155f2a",
            "proof": 329,
            "timestamp": 1529859469.843673,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 25,
            "previous_hash": "8d1e8837631f2871138ebce1a72d37db292eb3685f1cb70fa55ce1469ee5e0e3",
            "proof": 555,
            "timestamp": 1529859470.7403576,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 26,
            "previous_hash": "f3f87ea63c4d3160d86ef11a35597a70f7c4414ad8828330ed5b3533007133f8",
            "proof": 85,
            "timestamp": 1529859471.7978132,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 27,
            "previous_hash": "0a9086808c10b8256950a45e3aaee39994666ad46a15f3c5e40250fba6c88dcb",
            "proof": 36,
            "timestamp": 1529859474.1005394,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 28,
            "previous_hash": "259b0b6b9f67b657cbbec1f6b45ab7aab512bf6e1b915c5fd8dd4d613377b23b",
            "proof": 27,
            "timestamp": 1529860206.4522548,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 29,
            "previous_hash": "5f0a00e15488c699308fca26ade8b2df6e71e1bc0272428a272e941a9cb173fc",
            "proof": 26,
            "timestamp": 1529860208.362724,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 30,
            "previous_hash": "0599b06c949388ba0db9d3e89c7eb03333100195c334d66a2c52c0874ae76b8a",
            "proof": 50,
            "timestamp": 1529860209.5371869,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 31,
            "previous_hash": "142f55f5428e4f785eac28ed27649b13a80fde440feac3af6a823d7fbf1b7607",
            "proof": 329,
            "timestamp": 1529860210.4460797,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 32,
            "previous_hash": "7952ca597123ecd3e600fdea7b57ae9ed6b60faf42db5479e149adfeb571fd37",
            "proof": 555,
            "timestamp": 1529860910.1199336,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "82391a1fc0864806bad2233a3368fc50",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 33,
            "previous_hash": "813cbac7c742f33a16ac9957a0c60ba12955942313e4f666416d347049817980",
            "proof": 85,
            "timestamp": 1529861200.2055418,
            "transactions": [
                {
                    "amount": 0.5,
                    "recipient": "6f48664b72ac487f96792c824921cbb4",
                    "sender": "82391a1fc0864806bad2233a3368fc50"
                },
                {
                    "amount": 1,
                    "recipient": "82391a1fc0864806bad2233a3368fc50",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 34,
            "previous_hash": "25dde41295b2c6cb5099f65339f8527d82fe0d6b9729c18f349fe18da796d82e",
            "proof": 36,
            "timestamp": 1529868720.2428322,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "82391a1fc0864806bad2233a3368fc50",
                    "sender": "0"
                }
            ]
        }
    ],
    "message": "Our chain is authoritative"
}
  1. 挖矿

Request

curl -X GET http://localhost:5000/mine

Response

{
    "index": 35,
    "message": "New block forged",
    "previous_hash": "94ec311ad9596a9aa7b584308c4fcfba2ae8464cebf3d80496efef7ab24e4c3a",
    "proof": 27,
    "transactions": [
        {
            "amount": 0.5,
            "recipient": "6f48664b72ac487f96792c824921cbb4",
            "sender": "82391a1fc0864806bad2233a3368fc50"
        },
        {
            "amount": 0.5,
            "recipient": "6f48664b72ac487f96792c824921cbb4",
            "sender": "82391a1fc0864806bad2233a3368fc50"
        },
        {
            "amount": 1,
            "recipient": "82391a1fc0864806bad2233a3368fc50",
            "sender": "0"
        }
    ]
}
  1. 交易

Request

curl -X POST \
  http://localhost:5000/transaction/new \
  -H 'Content-Type: application/json' \
  -d '{
	"sender": "82391a1fc0864806bad2233a3368fc50", 
	"recipient": "6f48664b72ac487f96792c824921cbb4", 
	"amount": 0.5
}'

Response

{
    "message": "Transaction will be added to block 35"
}
  1. 区块链信息

Request

curl -X GET http://localhost:5000/chain

Response

{
    "chain": [
        {
            "index": 1,
            "previous_hash": "1",
            "proof": 100,
            "timestamp": 1529859376.5881078,
            "transactions": []
        },
        {
            "index": 2,
            "previous_hash": "ddcef81014e470ba2ceb5b0a8aad912e55eaf493ca5c9ead15b0081868445eb8",
            "proof": 226,
            "timestamp": 1529859429.7640576,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 3,
            "previous_hash": "1315ac99f105d696a821df585815c0af08f8f463f7d252d07ece7cd539fb8414",
            "proof": 346,
            "timestamp": 1529859452.0837927,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 4,
            "previous_hash": "e8738fd266ef7896b9b98e4976aa741f7f916dc692cfaf444ddb108f280a86de",
            "proof": 57,
            "timestamp": 1529859452.6275938,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 5,
            "previous_hash": "970728e879b725c3b9c29dc42f43aa495d8963bdaf93a5ef4db65dae03fb89c9",
            "proof": 289,
            "timestamp": 1529859453.3966124,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 6,
            "previous_hash": "d5b5bcb6f8bd7739765d924288a1bb53c9985dc4eb5b614f8ae2b41ad7578247",
            "proof": 175,
            "timestamp": 1529859453.6964805,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 7,
            "previous_hash": "3d0d4662cca1207e0ac6e71b13f72e488e21f5273dd302bf0941e66c56572177",
            "proof": 27,
            "timestamp": 1529859454.3320074,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 8,
            "previous_hash": "b987e6afdb9e28c89493a585b1fcef999509410a1d747e3fa42f26d3f39fd1fa",
            "proof": 26,
            "timestamp": 1529859454.9836872,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 9,
            "previous_hash": "ba1a6b386d4cbd3b988b0a6ec2a7c6c0a4d82bca2d7729e276861a9327fa8505",
            "proof": 50,
            "timestamp": 1529859455.8681195,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 10,
            "previous_hash": "d31587c692ad6d7e6172e609c720e015b1d983153ec666c918f82036863e1ea7",
            "proof": 329,
            "timestamp": 1529859456.7799404,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 11,
            "previous_hash": "df7da6708940bb1f1297ae879b447a69121f31a68e1a27c1c1482a6852cc0a6a",
            "proof": 555,
            "timestamp": 1529859458.2551394,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 12,
            "previous_hash": "3c74f62f796b81af5d63df7212daf5e296a566abcc169d643b19cb7e03908dac",
            "proof": 85,
            "timestamp": 1529859459.6046097,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 13,
            "previous_hash": "8515567d55c792e7e3a9da36f647bfdd38c025d51fefa9f666248ef36d16e561",
            "proof": 36,
            "timestamp": 1529859460.5006695,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 14,
            "previous_hash": "842e90e18032f5c54dbbf7bbe20d4a6f7a4c6db2a97299c86dd1eb045f5e72ab",
            "proof": 27,
            "timestamp": 1529859461.2274797,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 15,
            "previous_hash": "133f899890e7896a1787866e7c826f40e77c623a5a98fa2781c2db4424d70977",
            "proof": 26,
            "timestamp": 1529859461.9414406,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 16,
            "previous_hash": "86f5651515bc7005f2316630bac8122785464af790a03ba8b27ee77e9827ca2c",
            "proof": 50,
            "timestamp": 1529859462.6605353,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 17,
            "previous_hash": "c5567fdc16cafb1063054c2ef0f101304bffb0368efd20a2b2baab1cf35f2342",
            "proof": 329,
            "timestamp": 1529859463.3512006,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 18,
            "previous_hash": "62df7bf4de5c79f150a4d4288fb9055feeb6af63904a8aed8dacc40e3208ab9c",
            "proof": 555,
            "timestamp": 1529859464.0180788,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 19,
            "previous_hash": "1f78b17d17a8aad2f7d4a52cb10efb3f93d0f14cbaed53e3190b93df80c2d1ad",
            "proof": 85,
            "timestamp": 1529859465.0934887,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 20,
            "previous_hash": "9dcc765b90da26211482780fb90b1644dd743d234e7e2f25d0d775e123a97ee5",
            "proof": 36,
            "timestamp": 1529859466.197829,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 21,
            "previous_hash": "26143c802b4ca4e0177a852b054abb5b9de1b82c2e73205689c16a854d8f4f75",
            "proof": 27,
            "timestamp": 1529859467.540586,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 22,
            "previous_hash": "b68b4a3240851124e61cfbdb50a03e98ae0c4374e52c54f440e207ddacde264f",
            "proof": 26,
            "timestamp": 1529859468.3743403,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 23,
            "previous_hash": "ee3e5591644928fb039a3e1ed21bc1e53083816b10f7dfbe77f8e3b4c7413127",
            "proof": 50,
            "timestamp": 1529859469.110071,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 24,
            "previous_hash": "42b51c1c1e41321a8149b7803f4355b454113d2aff0cacc9c97cb3694b155f2a",
            "proof": 329,
            "timestamp": 1529859469.843673,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 25,
            "previous_hash": "8d1e8837631f2871138ebce1a72d37db292eb3685f1cb70fa55ce1469ee5e0e3",
            "proof": 555,
            "timestamp": 1529859470.7403576,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 26,
            "previous_hash": "f3f87ea63c4d3160d86ef11a35597a70f7c4414ad8828330ed5b3533007133f8",
            "proof": 85,
            "timestamp": 1529859471.7978132,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 27,
            "previous_hash": "0a9086808c10b8256950a45e3aaee39994666ad46a15f3c5e40250fba6c88dcb",
            "proof": 36,
            "timestamp": 1529859474.1005394,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 28,
            "previous_hash": "259b0b6b9f67b657cbbec1f6b45ab7aab512bf6e1b915c5fd8dd4d613377b23b",
            "proof": 27,
            "timestamp": 1529860206.4522548,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 29,
            "previous_hash": "5f0a00e15488c699308fca26ade8b2df6e71e1bc0272428a272e941a9cb173fc",
            "proof": 26,
            "timestamp": 1529860208.362724,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 30,
            "previous_hash": "0599b06c949388ba0db9d3e89c7eb03333100195c334d66a2c52c0874ae76b8a",
            "proof": 50,
            "timestamp": 1529860209.5371869,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 31,
            "previous_hash": "142f55f5428e4f785eac28ed27649b13a80fde440feac3af6a823d7fbf1b7607",
            "proof": 329,
            "timestamp": 1529860210.4460797,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "5ac8e3980fbd4260ba5acaaf74bd675e",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 32,
            "previous_hash": "7952ca597123ecd3e600fdea7b57ae9ed6b60faf42db5479e149adfeb571fd37",
            "proof": 555,
            "timestamp": 1529860910.1199336,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "82391a1fc0864806bad2233a3368fc50",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 33,
            "previous_hash": "813cbac7c742f33a16ac9957a0c60ba12955942313e4f666416d347049817980",
            "proof": 85,
            "timestamp": 1529861200.2055418,
            "transactions": [
                {
                    "amount": 0.5,
                    "recipient": "6f48664b72ac487f96792c824921cbb4",
                    "sender": "82391a1fc0864806bad2233a3368fc50"
                },
                {
                    "amount": 1,
                    "recipient": "82391a1fc0864806bad2233a3368fc50",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 34,
            "previous_hash": "25dde41295b2c6cb5099f65339f8527d82fe0d6b9729c18f349fe18da796d82e",
            "proof": 36,
            "timestamp": 1529868720.2428322,
            "transactions": [
                {
                    "amount": 1,
                    "recipient": "82391a1fc0864806bad2233a3368fc50",
                    "sender": "0"
                }
            ]
        },
        {
            "index": 35,
            "previous_hash": "94ec311ad9596a9aa7b584308c4fcfba2ae8464cebf3d80496efef7ab24e4c3a",
            "proof": 27,
            "timestamp": 1529870342.4516928,
            "transactions": [
                {
                    "amount": 0.5,
                    "recipient": "6f48664b72ac487f96792c824921cbb4",
                    "sender": "82391a1fc0864806bad2233a3368fc50"
                },
                {
                    "amount": 0.5,
                    "recipient": "6f48664b72ac487f96792c824921cbb4",
                    "sender": "82391a1fc0864806bad2233a3368fc50"
                },
                {
                    "amount": 1,
                    "recipient": "82391a1fc0864806bad2233a3368fc50",
                    "sender": "0"
                }
            ]
        }
    ],
    "length": 35
}
  1. 查询余额

Request


Response


About

用Python从零开始创建区块链

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages