main.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:raiden-token 作者: raiden-network 项目源码 文件源码
def main(sample_period, auction_address, chain_name, state_file, host, port):
    from gevent.pywsgi import WSGIServer
    app = Flask(__name__)
    api = Api(app)
    project = Project()
    with project.get_chain(chain_name) as chain:
        Auction = chain.provider.get_contract_factory('DutchAuction')
        auction_contract = Auction(address=auction_address)
        sampler = EventSampler(auction_address, chain, state_file_path=state_file)
        api.add_resource(AuctionStatus, "/status",
                         resource_class_kwargs={'auction_contract': auction_contract,
                                                'sampler': sampler})
        rest_server = WSGIServer((host, port), app)
        server_greenlet = gevent.spawn(rest_server.serve_forever)
        server_greenlet.join()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号