blockchain/blockchain/__init__.py

36 lines
519 B
Python
Raw Permalink Normal View History

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
2020-03-15 22:14:31 +01:00
from uuid import uuid4
2020-03-15 22:14:31 +01:00
from fastapi import FastAPI
2020-03-15 22:14:31 +01:00
from .blockchain import Blockchain
2020-03-15 22:14:31 +01:00
blockchain = Blockchain()
identifier = str(uuid4()).replace('-', '')
2020-03-15 22:14:31 +01:00
def init_routers(app):
from .routers import misc
app.include_router(
misc.router,
prefix='',
tags=['misc'],
)
from .routers import nodes
app.include_router(
nodes.router,
prefix='/nodes',
tags=['nodes'],
)
def create_app():
app = FastAPI()
init_routers(app)
return app