mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
25 lines
560 B
Python
25 lines
560 B
Python
from flask import current_app
|
|
from flask_restful import Resource
|
|
|
|
from bigchaindb.web.views.base import make_error
|
|
|
|
|
|
class ValidatorsApi(Resource):
|
|
def get(self):
|
|
"""API endpoint to get validators set.
|
|
|
|
Return:
|
|
A JSON string containing the validator set of the current node.
|
|
"""
|
|
|
|
pool = current_app.config['bigchain_pool']
|
|
|
|
try:
|
|
with pool() as bigchain:
|
|
validators = bigchain.get_validators()
|
|
|
|
return validators
|
|
|
|
except:
|
|
return make_error(500)
|