Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validators info expansion #273

Merged
merged 59 commits into from
Oct 18, 2024
Merged

Validators info expansion #273

merged 59 commits into from
Oct 18, 2024

Conversation

owl352
Copy link
Collaborator

@owl352 owl352 commented Oct 5, 2024

Issue

For new design of validator page #232, we need some additional data for validators.
And some tiny improvments

Things done

  • Added connection info for validator ports (only for validators by pro_tx_hash).
  • Added total and epoch rewards.
  • Added current epoch info. (/epoch without param /:index)
  • Added identity and identity balance fields.
  • Updated readme.md and integration tests for validators and identities.
  • Withdrawals info (only for validators by pro_tx_hash).
  • Masternode voting decoding & unit test
  • Added last withdrawal time
  • Added new endpoint for identities withdrawals (/identity/:identifier/withdrawals)
  • Added integration tests for identities withdrawals

reponse examples

validator/8ECA4BCBB3A124AB283AFD42DAD3BDB2077B3809659788A0F1DAFFCE5B9F001F

{
  "proTxHash": "8ECA4BCBB3A124AB283AFD42DAD3BDB2077B3809659788A0F1DAFFCE5B9F001F",
  "isActive": false,
  "proposedBlocksAmount": 159,
  "lastProposedBlockHeader": {
    "hash": "8CEED1EFE0B8CBF09F0E39D0937613D24729AE88ED6A52FC3AA9FE8B56CCD8DD",
    "height": 4847,
    "timestamp": "2024-09-03T16:31:57.275Z",
    "blockVersion": 14,
    "appVersion": 1,
    "l1LockedHeight": 1096045,
    "validator": "8ECA4BCBB3A124AB283AFD42DAD3BDB2077B3809659788A0F1DAFFCE5B9F001F"
  },
  "proTxInfo": {
    "type": "Evo",
    "collateralHash": "6ce8545e25d4f03aba1527062d9583ae01827c65b234bd979aca5954c6ae3a59",
    "collateralIndex": 14,
    "collateralAddress": "yU8gE6mYzrkdyYUVZvUqoBNJ2jJbjiDeJt",
    "operatorReward": 0,
    "confirmations": 267820,
    "state": {
      "version": 2,
      "service": "54.68.235.201:19999",
      "registeredHeight": 850334,
      "lastPaidHeight": 1118062,
      "consecutivePayments": 0,
      "PoSePenalty": 0,
      "PoSeRevivedHeight": 1083083,
      "PoSeBanHeight": -1,
      "revocationReason": 0,
      "ownerAddress": "yaCBsm8dFrNuy8hgDQyzV29MZvqQBRkdxv",
      "votingAddress": "yaCBsm8dFrNuy8hgDQyzV29MZvqQBRkdxv",
      "platformNodeID": "c075993a8336f93a13bb7bbb7e0e89928be4aafb",
      "platformP2PPort": 36656,
      "platformHTTPPort": 1443,
      "payoutAddress": "yeRZBWYfeNE4yVUHV4ZLs83Ppn9aMRH57A",
      "pubKeyOperator": "b942e2e50c5cf9d9fe81119cc5379057c05fe15134f85847356b5d1f6a21f29f4a53f61f03338d056edc15a8c63fbbe8",
      "endpoints": {
        "coreP2P": {
          "host": "35.165.50.126:19999",
          "status": "OK"
        },
        "platformP2P": {
          "host": "35.165.50.126:36656",
          "status": "OK"
        },
        "platformGrpc": {
          "host": "35.165.50.126:1443",
          "status": "OK"
        }
      }
    }
  },
  "identity": "AcPogCxrxeas7jrWYG7TnLHKbsA5KLHGfvg6oYgANZ8J",
  "identityBalance": 66271532855718,
  "epochInfo": {
    "number": 1982,
    "firstBlockHeight": 31976,
    "firstCoreBlockHeight": 1118131,
    "startTime": 1728488466559,
    "feeMultiplier": 1,
    "endTime": 1728492066559
  },
  "totalReward": 1694373420,
  "epochReward": 0,
  "withdrawalsCount": 1,
  "lastWithdrawal": "01FE1F00379C66C6E3BFD81A088E57E17613EC36E4FF812458535A8ABCB84047",
  "lastWithdrawalTime": "2024-10-12T03:15:19.257Z"
}
/identity/78nGoakMPbYKFLCgkt2qUXfZmw7ycESxQrx8k4deEBRt/withdrawals

{
    pagination: {
        page: 1,
        limit: 10,
        total: 10
    },
    resultSet: [
    {
      "amount": 10000000,
      "owner": "78nGoakMPbYKFLCgkt2qUXfZmw7ycESxQrx8k4deEBRt",
      "txHash": "47122C74C071288F7F0576DF2084F74A8B470EFFF35DD703F96DCAE7F21484EB",
      "timestamp": "2024-10-09T17:52:24.151Z",
      "blockHash": "B3655E797107BC970188055BBDBBDC785B6386BED7D26AC46468D736386E1042"
    }, ...
    ]
}

@owl352 owl352 added the backend Related to backend (API) label Oct 5, 2024
@owl352 owl352 self-assigned this Oct 5, 2024
Copy link

vercel bot commented Oct 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
platform-explorer-mainnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 18, 2024 7:50pm
platform-explorer-testnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 18, 2024 7:50pm

@pshenmic pshenmic merged commit 747e9b9 into master Oct 18, 2024
9 checks passed
@pshenmic pshenmic deleted the feat/validators-info branch October 18, 2024 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to backend (API)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants