# You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # from flask import render_template, Flask, Blueprint, jsonify from werkzeug.serving import run_simple from werkzeug.wsgi import DispatcherMiddleware from bts_tools import core, init, seednodes, network_utils from bts_tools.frontend import format_datetime, sanitize_output, add_ip_flag from collections import defaultdict import bts_tools import threading import logging log = logging.getLogger(__name__) init() DEBUG = core.config['wsgi_debug'] bp = Blueprint('web', __name__, static_folder='static', template_folder='templates') chain = 'steem' @bp.route('/') def view_seed_nodes(): headers = ['seed host', 'status', 'provided by'] data = seednodes.get_seeds_view_data(chain, cached=True) headers *= (len(data[0]) // len(headers)) peers = seednodes.get_seeds_as_peers(chain) points = network_utils.get_world_map_points_from_peers(peers)
# You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # from flask import render_template, Flask, Blueprint, jsonify from werkzeug.serving import run_simple from werkzeug.wsgi import DispatcherMiddleware from bts_tools import core, init, seednodes, network_utils from bts_tools.frontend import format_datetime, hide_private_key, add_ip_flag from collections import defaultdict import bts_tools import threading import logging log = logging.getLogger(__name__) init() DEBUG = core.config['wsgi_debug'] bp = Blueprint('web', __name__, static_folder='static', template_folder='templates') chain = 'muse' @bp.route('/') def view_seed_nodes(): headers = ['seed host', 'status', 'provided by'] data = seednodes.get_seeds_view_data(chain, cached=True) headers *= (len(data[0]) // len(headers)) peers = seednodes.get_seeds_as_peers(chain) points = network_utils.get_world_map_points_from_peers(peers)
# -*- coding: utf-8 -*- # import this module using # >>> import bts_tools.repl # to set up a (dummy) flask context to allow you to access the DB # from bts_tools.wsgi import application # ctx = application.app.test_request_context() # # import bts_tools.rpcutils as rpc # import bts_tools.core as core # # ctx.push() import bts_tools bts_tools.init()