Skip to content

Commit

Permalink
mmx-node update
Browse files Browse the repository at this point in the history
  • Loading branch information
madMAx43v3r committed May 2, 2023
1 parent a7bbb6b commit 3430e3c
Show file tree
Hide file tree
Showing 18 changed files with 962 additions and 208 deletions.
Binary file modified mmx-node/linux/x86_64/bin/mmx_node
Binary file not shown.
2 changes: 2 additions & 0 deletions mmx-node/linux/x86_64/data/testnet9/rewards.json

Large diffs are not rendered by default.

622 changes: 622 additions & 0 deletions mmx-node/linux/x86_64/data/testnet9/rewards.txt

Large diffs are not rendered by default.

Binary file modified mmx-node/linux/x86_64/lib/libmmx_modules.so
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "GIT_COMMIT_HASH": "2a85f9ae465ec27ea38a00995bc0835621f726d2" }
{ "GIT_COMMIT_HASH": "6fa16aadff16a2eae1510becd27d7e89ba5878df" }
35 changes: 6 additions & 29 deletions mmx-node/linux/x86_64/www/web-gui/public/explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Vue.component('explore-menu', {
<v-tabs class="mb-2">
<v-tab to="/explore/blocks">{{ $t('explore_menu.blocks') }}</v-tab>
<v-tab to="/explore/transactions">{{ $t('explore_menu.transactions') }}</v-tab>
<v-tab to="/explore/farmers">Farmers</v-tab>
<v-tab to="/explore/farmers">{{ $t('explore_menu.farmers') }}</v-tab>
</v-tabs>
</div>
`
Expand All @@ -66,8 +66,8 @@ Vue.component('blocks-table', {
{ text: this.$t('explore_blocks.score'), value: 'score' },
{ text: this.$t('explore_blocks.reward'), value: 'reward' },
{ text: "TX Fees", value: 'tx_fees' },
{ text: "Size", value: 'static_cost_ratio' },
{ text: "Cost", value: 'total_cost_ratio' },
{ text: this.$t('explore_blocks.size'), value: 'static_cost_ratio' },
{ text: this.$t('explore_blocks.cost'), value: 'total_cost_ratio' },
{ text: this.$t('explore_blocks.hash'), value: 'hash' },
]
}
Expand Down Expand Up @@ -246,8 +246,8 @@ Vue.component('explore-farmers', {
computed: {
headers() {
return [
{ text: "No. Blocks", value: 'block_count'},
{ text: "Farmer Key", value: 'farmer_key'},
{ text: this.$t('explore_farmers.no_blocks'), value: 'block_count'},
{ text: this.$t('explore_farmers.farmer_key'), value: 'farmer_key'},
]
}
},
Expand Down Expand Up @@ -456,29 +456,6 @@ Vue.component('block-view', {
</v-simple-table>
</v-card>
<v-card class="my-2">
<v-simple-table v-if="data.tx_base">
<template v-slot:default>
<thead>
<tr>
<th class="key-cell"></th>
<th>{{ $t('block_view.amount') }}</th>
<th></th>
<th>{{ $t('block_view.address') }}</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in data.tx_base.outputs" :key="index">
<td class="key-cell">{{ $t('block_view.reward') }}[{{index}}]</td>
<td><b>{{item.value}}</b></td>
<td>{{item.symbol}}</td>
<td><router-link :to="'/explore/address/' + item.address">{{item.address}}</router-link></td>
</tr>
</tbody>
</template>
</v-simple-table>
</v-card>
<v-card class="my-2">
<v-simple-table v-if="data.tx_list.length">
<thead>
Expand Down Expand Up @@ -581,7 +558,7 @@ Vue.component('transaction-view', {
<template v-if="data.height">
<router-link :to="'/explore/block/height/' + data.height">{{data.height}}</router-link>
</template>
<template v-if="!data.height"><i>pending</i></template>
<template v-if="!data.height"><i>{{ $t('common.pending') }}</i></template>
</td>
</tr>
<tr v-if="data.did_fail" class="red--text">
Expand Down
4 changes: 2 additions & 2 deletions mmx-node/linux/x86_64/www/web-gui/public/farmer.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Vue.component('farmer-plots', {
},
headers2() {
return [
{ text: "Harvester", value: 'name' },
{ text: this.$t('common.harvester'), value: 'name' },
{ text: this.$t('farmer_info.physical_size'), value: 'bytes' },
]
}
Expand Down Expand Up @@ -281,7 +281,7 @@ Vue.component('farmer-blocks', {
</template>
<template v-slot:item.reward="{ item }">
<b>{{item.tx_base && item.tx_base.exec_result ? item.tx_base.exec_result.total_fee_value : 0}}</b> MMX
<b>{{item.reward_amount.value}}</b> MMX
</template>
<template v-slot:item.tx_fees="{ item }">
Expand Down
2 changes: 1 addition & 1 deletion mmx-node/linux/x86_64/www/web-gui/public/i18n.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function loadLanguageAsync(locale) {

if (availableLanguages.filter( lang => lang.code == locale ).length > 0 ) {
return fetch(`./locales/${locale}.json`).then(
response => response.json()
response => response.json()
).then(
messages => {
messages = customFallback(messages);
Expand Down
8 changes: 4 additions & 4 deletions mmx-node/linux/x86_64/www/web-gui/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/@mdi/[email protected]/css/materialdesignicons.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected].10/dist/vuetify.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected].15/dist/vuetify.min.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">

<script src="https://cdn.jsdelivr.net/npm/[email protected].10/dist/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-i18n@8.27.2/dist/vue-i18n.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected].14/dist/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-i18n@8.28.2/dist/vue-i18n.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue-router.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected].10/dist/vuetify.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected].15/dist/vuetify.min.js"></script>

<script src="assets/plotly-2.9.0.min.js"></script>
<script src="vue-plotly.js" defer></script>
Expand Down
77 changes: 42 additions & 35 deletions mmx-node/linux/x86_64/www/web-gui/public/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const AccountPlots = {
template: `
<div>
<router-link :to="'/wallet/account/' + index + '/create/virtualplot'">
<v-btn outlined>New Plot</v-btn>
<v-btn outlined>{{ this.$t('account_plots.new_plot') }}</v-btn>
</router-link>
<account-plots class="my-2" :index="index"></account-plots>
</div>
Expand Down Expand Up @@ -496,13 +496,13 @@ Vue.component('main-menu', {
},
template: `
<v-tabs>
<status/>
<node-status/>
<v-tab to="/node">{{ $t('main_menu.node') }}</v-tab>
<v-tab to="/wallet">{{ $t('main_menu.wallet') }}</v-tab>
<v-tab to="/farmer">{{ $t('main_menu.farmer') }}</v-tab>
<v-tab to="/explore">{{ $t('main_menu.explore') }}</v-tab>
<v-tab to="/market">{{ $t('main_menu.market') }}</v-tab>
<v-tab to="/swap">Swap</v-tab>
<v-tab to="/swap">{{ $t('main_menu.swap') }}</v-tab>
<v-spacer></v-spacer>
<v-tab to="/settings">{{ $t('main_menu.settings') }}</v-tab>
<template v-if="!$route.meta.is_login && !$isWinGUI">
Expand All @@ -512,17 +512,16 @@ Vue.component('main-menu', {
`
})

const AppStatus = {
DisconnectedFromNode: "Disconnected from node",
LoggedOff: "Logged off",
Connecting: "Connecting",
Syncing: "Syncing",
Synced: "Synced"
}

Vue.component('status', {
Vue.component('node-status', {
data() {
return {
node_status: {
DisconnectedFromNode: this.$t('node_status.disconnected'),
LoggedOff: this.$t('node_status.logged_off'),
Connecting: this.$t('node_status.connecting'),
Syncing: this.$t('node_status.syncing'),
Synced: this.$t('node_status.synced')
},
timer: null,
session_fails: 99,
peer_fails: 99,
Expand All @@ -532,14 +531,14 @@ Vue.component('status', {
methods: {
async update() {

if(this.status = AppStatus.LoggedOff || this.status == AppStatus.DisconnectedFromNode
|| this.status == AppStatus.Connecting) {
if(this.status = this.node_status.LoggedOff || this.status == this.node_status.DisconnectedFromNode
|| this.status == node_status.Connecting) {
await fetch('/server/session')
.then( () => this.session_fails = 0 )
.catch( () => this.session_fails++ );
}

if(this.status == AppStatus.Connecting || this.status == AppStatus.Syncing) {
if(this.status == this.node_status.Connecting || this.status == this.node_status.Syncing) {
await fetch('/api/router/get_peer_info')
.then( response => response.json() )
.then( data => {
Expand All @@ -552,8 +551,8 @@ Vue.component('status', {
.catch( () => this.peer_fails++ );
}

if(this.status == AppStatus.Connecting || this.status == AppStatus.Syncing
|| this.status == AppStatus.Synced) {
if(this.status == this.node_status.Connecting || this.status == this.node_status.Syncing
|| this.status == this.node_status.Synced) {
await fetch('/wapi/node/info')
.then( response => response.json() )
.then( data => {
Expand All @@ -567,7 +566,7 @@ Vue.component('status', {
.catch( () => {
this.synced_fails++;
this.$root.nodeInfo = null;
} );
} );
}

// console.log('--------------------------------');
Expand Down Expand Up @@ -595,19 +594,19 @@ Vue.component('status', {
return this.synced_fails == 0;
},
status() {
let result = AppStatus.DisconnectedFromNode
let result = this.node_status.DisconnectedFromNode
if(this.connectedToNode) {
if(this.loggedIn) {
result = AppStatus.Connecting;
if(this.loggedIn) {
result = this.node_status.Connecting;
if(this.connectedToNetwork) {
result = AppStatus.Syncing;
result = this.node_status.Syncing;
}

if(this.synced) {
result = AppStatus.Synced;
result = this.node_status.Synced;
}
} else {
result = AppStatus.LoggedOff;
result = this.node_status.LoggedOff;
}
}
//console.log(result)
Expand All @@ -626,25 +625,25 @@ Vue.component('status', {
<git-update-checker class="pr-5"/>
<t-icon v-if="status == AppStatus.Connecting"
<t-icon v-if="status == node_status.Connecting"
color="red"
:tooltip="AppStatus.Connecting">mdi-connection</t-icon>
:tooltip="node_status.Connecting">mdi-connection</t-icon>
<t-icon v-else-if="status == AppStatus.Syncing"
<t-icon v-else-if="status == node_status.Syncing"
color="yellow darken-3"
:tooltip="AppStatus.Syncing">mdi-sync</t-icon>
:tooltip="node_status.Syncing">mdi-sync</t-icon>
<t-icon v-else-if="status == AppStatus.Synced"
<t-icon v-else-if="status == node_status.Synced"
color="green"
:tooltip="AppStatus.Synced">mdi-cloud-check</t-icon>
:tooltip="node_status.Synced">mdi-cloud-check</t-icon>
<t-icon v-else-if="status == AppStatus.LoggedOff"
<t-icon v-else-if="status == node_status.LoggedOff"
color="red"
:tooltip="AppStatus.LoggedOff">mdi-shield-key</t-icon>
:tooltip="node_status.LoggedOff">mdi-shield-key</t-icon>
<t-icon v-else
color="red"
:tooltip="AppStatus.DisconnectedFromNode">mdi-emoticon-dead</t-icon>
:tooltip="node_status.DisconnectedFromNode">mdi-emoticon-dead</t-icon>
</div>
`
Expand Down Expand Up @@ -679,7 +678,12 @@ Vue.component('git-update-checker', {
this.commit_status_message = '';
this.show = false;
fetch('GIT_COMMIT_HASH.json')
.then( response => response.json() )
.then( response => {
if (!response.ok) {
throw Error(response.statusText);
}
return response.json();
})
.then( data => {
var hash = data.GIT_COMMIT_HASH;
if(hash) {
Expand All @@ -699,9 +703,12 @@ Vue.component('git-update-checker', {
}

}
});
})
}
})
.catch((err) => {
console.log(`git-update-checker: ${err}`);
});
}
},
created() {
Expand Down
24 changes: 19 additions & 5 deletions mmx-node/linux/x86_64/www/web-gui/public/locales/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,22 @@ const commonLocale = {
"block_size": "@:node_common.block_size"
},

"node_log": {
"node_log": {
"wallet": "@:common.wallet",
"node": "@:common.node"
"node": "@:common.node",
"harvester": "@:common.harvester",
},

"harvester_settings": {
"harvester": "@:common.harvester"
},

"node_log_table": {
"time": "@:common.time",
},

"node_peers": {
"ip": "IP",
"ip": "IP",
"height": "@:common.height",
"type": "@:common.type"
},
Expand Down Expand Up @@ -95,6 +100,11 @@ const commonLocale = {
"contract": "@:balance_table.contract"
},

"account_plots": {
"balance": "@:common.balance",
"address": "@:common.address"
},

"account_history": {
"height": "@:common.height",
"type": "@:common.type",
Expand All @@ -121,6 +131,7 @@ const commonLocale = {
"height": "@:common.height",
"address": "@:common.address",
"time": "@:common.time",
"deposit": "@:common.deposit",
},

"account_offer_form": {
Expand Down Expand Up @@ -191,7 +202,10 @@ const commonLocale = {
"they_ask": "@:market_menu.they_ask",
"time": "@:common.time",
"link": "@:common.link",
"address": "@:common.address"
"address": "@:common.address",

"accept": "@:common.accept",
"cancel": "@:common.cancel"
},

"account_history_form": {
Expand All @@ -212,7 +226,7 @@ const commonLocale = {
"sdiff": "@:explore_blocks.sdiff",
"time": "@:common.time",
"plot_id": "@:block_view.plot_id",
"harvester": "@:node_log.harvester"
"harvester": "@:common.harvester"
}

}
Loading

0 comments on commit 3430e3c

Please sign in to comment.