V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
simpleapples
V2EX  ›  Python

用 300 行 Python 代码实现了一个区块链 CLI

  •  1
     
  •   simpleapples · 2018-03-13 15:34:05 +08:00 · 3424 次点击
    这是一个创建于 2207 天前的主题,其中的信息可能已经有所发展或是发生改变。

    项目地址:https://github.com/simpleapples/py-blockchain-cli

    最近区块链比较火,我也趁机学习了一丢丢,顺手撸了一个区块链 CLI

    可以以 CLI 的方式开节点,连接节点,挖矿(节点间会自动同步)

    并且可以以表格形式看到整条区块链的信息,如图

    欢迎 star&fork !

    7 条回复    2018-03-13 23:04:08 +08:00
    shadownet
        1
    shadownet  
       2018-03-13 21:23:35 +08:00 via iPhone
    不错 你这视频用什么软件做的?
    simpleapples
        2
    simpleapples  
    OP
       2018-03-13 22:33:28 +08:00
    @shadownet LiceCap
    mingyun
        3
    mingyun  
       2018-03-13 22:43:07 +08:00
    $ python main.py
    Traceback (most recent call last):
    File "main.py", line 1, in <module>
    from cli.interface import Interface
    File "e:\py-blockchain-cli\cli\interface.py", line 3, in <modul
    e>
    from cli.command import Command
    File "e:\py-blockchain-cli\cli\command.py", line 13
    print(f'Peer running at {host}:{port}')
    ^
    SyntaxError: invalid syntax
    simpleapples
        4
    simpleapples  
    OP
       2018-03-13 22:48:36 +08:00
    @mingyun 需要用 python3 运行哈
    mingyun
        5
    mingyun  
       2018-03-13 22:51:50 +08:00
    @simpleapples 就是 py3
    sunwei0325
        6
    sunwei0325  
       2018-03-13 22:57:23 +08:00
    f''语法是 3.6 的
    @mingyun
    simpleapples
        7
    simpleapples  
    OP
       2018-03-13 23:04:08 +08:00
    @mingyun 不好意思 忘记说明是 3.6 了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   960 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 21:52 · PVG 05:52 · LAX 14:52 · JFK 17:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.