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

Move endpoints out of protx in the validators #287

Merged
merged 1 commit into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions packages/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ GET /validators
withdrawalsCount: null,
lastWithdrawal: null,
lastWithdrawalTime: null,
endpoints: null
}, ...
],
pagination: {
Expand Down Expand Up @@ -334,23 +335,6 @@ GET /validator/F60A6BF9EC0794BB0CFD1E0F2217933F4B33EDE6FE810692BC275CA18148AEF0
platformHTTPPort: 1443,
payoutAddress: "yeRZBWYfeNE4yVUHV4ZLs83Ppn9aMRH57A",
pubKeyOperator: "b928fa4e127214ccb2b5de1660b5e371d2f3c9845077bc3900fc6aabe82ddd2e61530be3765cea15752e30fc761ab730",
endpoints: {
coreP2PPortStatus: {
host: '52.33.28.41',
port: 19999,
status: 'ERROR'
},
platformP2PPortStatus: {
host: '52.33.28.41',
port: 36656,
status: 'ERROR'
},
platformGrpcPortStatus: {
host: '52.33.28.41',
port: 1443,
status: 'ERROR'
}
}
}
},
identity: "8tsWRSwsTM5AXv4ViCF9gu39kzjbtfFDM6rCyL2RcFzd",
Expand All @@ -367,7 +351,24 @@ GET /validator/F60A6BF9EC0794BB0CFD1E0F2217933F4B33EDE6FE810692BC275CA18148AEF0
epochReward: 0,
withdrawalsCount: 1,
lastWithdrawal: "01FE1F00379C66C6E3BFD81A088E57E17613EC36E4FF812458535A8ABCB84047",
lastWithdrawalTime: "2024-10-12T03:15:19.257Z"
lastWithdrawalTime: "2024-10-12T03:15:19.257Z",
endpoints: {
coreP2PPortStatus: {
host: '52.33.28.41',
port: 19999,
status: 'ERROR'
},
platformP2PPortStatus: {
host: '52.33.28.41',
port: 36656,
status: 'ERROR'
},
platformGrpcPortStatus: {
host: '52.33.28.41',
port: 1443,
status: 'ERROR'
}
}
}
```
---
Expand Down
11 changes: 3 additions & 8 deletions packages/api/src/controllers/ValidatorsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,11 @@ class ValidatorsController {
{
...validator,
isActive,
proTxInfo: ProTxInfo.fromObject({
...proTxInfo,
state: {
...proTxInfo.state,
endpoints
}
}),
proTxInfo: ProTxInfo.fromObject(proTxInfo),
identifier,
identityBalance,
epochInfo
epochInfo,
endpoints
}
)
)
Expand Down
11 changes: 8 additions & 3 deletions packages/api/src/models/Validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = class Validator {
withdrawalsCount
lastWithdrawal
lastWithdrawalTime
endpoints

constructor (
proTxHash,
Expand All @@ -29,7 +30,8 @@ module.exports = class Validator {
lastWithdrawalTime,
identifier,
identityBalance,
epochInfo
epochInfo,
endpoints
) {
this.proTxHash = proTxHash ?? null
this.isActive = isActive ?? null
Expand All @@ -44,6 +46,7 @@ module.exports = class Validator {
this.withdrawalsCount = withdrawalsCount ?? null
this.lastWithdrawal = lastWithdrawal ?? null
this.lastWithdrawalTime = lastWithdrawalTime ?? null
this.endpoints = endpoints ?? null
}

static fromRow ({
Expand Down Expand Up @@ -99,7 +102,8 @@ module.exports = class Validator {
lastWithdrawalTime,
identifier,
identityBalance,
epochInfo
epochInfo,
endpoints
}) {
return new Validator(
proTxHash,
Expand All @@ -114,7 +118,8 @@ module.exports = class Validator {
lastWithdrawalTime,
identifier,
identityBalance,
epochInfo
epochInfo,
endpoints
)
}
}
Loading
Loading