eosnetworkfoundation / docsgen

Scripts for creating docs.eosnetwork.com pulls from various eos nf repos and builds static HTML to power website
Other
3 stars 0 forks source link

correct the get_producers endpoint returned json and support for get_producer_schedule #131

Closed iamveritas closed 1 year ago

iamveritas commented 1 year ago

correct the get_producers endpoint returned json; add also support for get_producer_schedule which will use ProducerSchedule.yaml and both are using the ProducerAuthorityList.yaml

here's the out of the get_producers:

curl --request POST \
--url https://eos.greymass.com/v1/chain/get_producers \
--header 'content-type: application/json' \
--data '{
  "limit": "25"
  "lower_bound": "0",
  "json": 1,
}'

result:

{
  "rows": [
    {
      "owner": "atticlabeosb",
      "producer_authority": [
        0,
        {
          "threshold": 1,
          "keys": [
            {
              "key": "EOS7PfA3A4UdfMu2wKbuXdbHn8EWAxbMnFoFWui4X2zsr2oPwdQJP",
              "weight": 1
            }
          ]
        }
      ],
      "url": "",
      "total_votes": "0.00000000000000000",
      "producer_key": "EOS7PfA3A4UdfMu2wKbuXdbHn8EWAxbMnFoFWui4X2zsr2oPwdQJP"
    },
    {
      "owner": "aus1genereos",
      "producer_authority": [
        0,
        {
          "threshold": 1,
          "keys": [
            {
              "key": "EOS6on4KsoQ3cjhXLixNQxB3jwYhmUhNK9rKTABdmBBZWbfNmhTeU",
              "weight": 1
            }
          ]
        }
      ],
      "url": "",
      "total_votes": "0.00000000000000000",
      "producer_key": "EOS6on4KsoQ3cjhXLixNQxB3jwYhmUhNK9rKTABdmBBZWbfNmhTeU"
    }
  ],
  "total_producer_vote_weight": "0.00000000000000000",
  "more": ""
}

and result for get_producer_schedule

curl --request POST \
--url https://eos.greymass.com/v1/chain/get_producer_schedule \
--header 'content-type: application/json'

result

{
  "active": {
    "version": 2072,
    "producers": [
      {
        "producer_name": "atticlabeosb",
        "authority": [
          0,
          {
            "threshold": 1,
            "keys": [
              {
                "key": "EOS7PfA3A4UdfMu2wKbuXdbHn8EWAxbMnFoFWui4X2zsr2oPwdQJP",
                "weight": 1
              }
            ]
          }
        ]
      },
      {
        "producer_name": "aus1genereos",
        "authority": [
          0,
          {
            "threshold": 1,
            "keys": [
              {
                "key": "EOS6on4KsoQ3cjhXLixNQxB3jwYhmUhNK9rKTABdmBBZWbfNmhTeU",
                "weight": 1
              }
            ]
          }
        ]
      }
    ]
  },
  "pending": null,
  "proposed": null
}