change xmr_nodes json route
This commit is contained in:
parent
9e28068226
commit
cbc6022a43
|
@ -54,33 +54,19 @@ def index():
|
||||||
form=form
|
form=form
|
||||||
)
|
)
|
||||||
|
|
||||||
@app.route("/nodes.json")
|
@app.route("/xmr_nodes.json")
|
||||||
def nodes_json():
|
def xmr_nodes_json():
|
||||||
nodes = Node.select().where(
|
nodes = Node.select().where(
|
||||||
Node.validated==True
|
Node.validated==True
|
||||||
|
).where(
|
||||||
|
Node.nettype=="mainnet"
|
||||||
|
).where(
|
||||||
|
Node.crypto=="monero"
|
||||||
)
|
)
|
||||||
nodes = [n for n in nodes]
|
nodes = [n for n in nodes]
|
||||||
xmr_nodes = [n for n in nodes if n.crypto == "monero"]
|
|
||||||
wow_nodes = [n for n in nodes if n.crypto == "wownero"]
|
|
||||||
return jsonify({
|
return jsonify({
|
||||||
"monero": {
|
"clear": [n.url for n in nodes if n.is_tor == False],
|
||||||
"mainnet": {
|
"onion": [n.url for n in nodes if n.is_tor == True]
|
||||||
"healthy": [n.url for n in xmr_nodes if n.available and n.nettype == "mainnet"],
|
|
||||||
"unhealthy": [n.url for n in xmr_nodes if not n.available and n.nettype == "mainnet"],
|
|
||||||
},
|
|
||||||
"stagenet": {
|
|
||||||
"healthy": [n.url for n in xmr_nodes if n.available and n.nettype == "stagenet"],
|
|
||||||
"unhealthy": [n.url for n in xmr_nodes if not n.available and n.nettype == "stagenet"],
|
|
||||||
},
|
|
||||||
"testnet": {
|
|
||||||
"healthy": [n.url for n in xmr_nodes if n.available and n.nettype == "testnet"],
|
|
||||||
"unhealthy": [n.url for n in xmr_nodes if not n.available and n.nettype == "testnet"],
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"wownero": {
|
|
||||||
"healthy": [n.url for n in wow_nodes if n.available],
|
|
||||||
"unhealthy": [n.url for n in wow_nodes if not n.available],
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@app.route("/resources")
|
@app.route("/resources")
|
||||||
|
|
Loading…
Reference in New Issue