V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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 · Mar 13, 2018 · 4035 views
    This topic created in 2981 days ago, the information mentioned may be changed or developed.

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

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

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

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

    欢迎 star&fork !

    7 replies    2018-03-13 23:04:08 +08:00
    shadownet
        1
    shadownet  
       Mar 13, 2018 via iPhone
    不错 你这视频用什么软件做的?
    simpleapples
        2
    simpleapples  
    OP
       Mar 13, 2018
    @shadownet LiceCap
    mingyun
        3
    mingyun  
       Mar 13, 2018
    $ 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
       Mar 13, 2018
    @mingyun 需要用 python3 运行哈
    mingyun
        5
    mingyun  
       Mar 13, 2018
    @simpleapples 就是 py3
    sunwei0325
        6
    sunwei0325  
       Mar 13, 2018
    f''语法是 3.6 的
    @mingyun
    simpleapples
        7
    simpleapples  
    OP
       Mar 13, 2018
    @mingyun 不好意思 忘记说明是 3.6 了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1724 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 16:22 · PVG 00:22 · LAX 09:22 · JFK 12:22
    ♥ Do have faith in what you're doing.