Skip to content

Commit

Permalink
handle versioning of nodes that make use of custom identity --identity
Browse files Browse the repository at this point in the history
  • Loading branch information
ziogaschr committed Oct 6, 2023
1 parent de2acbb commit 9017f60
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions scss/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ table {
max-width: 300px !important;
}

.v-navigation-drawer__content .v-data-table__wrapper {
overflow: inherit;
}

// borders & strips

// table of content
Expand Down
16 changes: 15 additions & 1 deletion store/nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,14 @@ export const actions = {
const { data } = await axios.get('https://peers.etccore.in/v5/nodes.json')

const { nodes, clients, forks, protocols, countries } = parseNodes(data)

// sort clients by count
const sortedClients = Object.fromEntries(
Object.entries(clients).sort(([, a], [, b]) => b - a)
)

commit('SET_NODES', nodes)
commit('SET_CLIENTS', clients)
commit('SET_CLIENTS', sortedClients)
commit('SET_FORKIDS', forks)
commit('SET_PROTOCOLS', protocols)
commit('SET_COUNTRIES', countries)
Expand All @@ -99,6 +105,14 @@ const parseNodes = function (nodes) {
// filter out any nodes that didnt get past handshake.
if (node.protocols.eth !== 'handshake' && node.protocols.eth.version > 0) {
const name = node.name.split('/')

// check if nodes have set a custom identity name under versioning string
const semver = /v\d+\.\d+\.\d+/
if (name && name[1] && !semver.test(name[1])) {
name[0] += '/' + name[1]
name.splice(1, 1)
}

node.client = {
name: name[0] ? name[0] : '-',
release: name[1] ? name[1] : '-',
Expand Down

0 comments on commit 9017f60

Please sign in to comment.