Skip to content

Commit

Permalink
Update Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamzaahmed742 committed Apr 5, 2019
2 parents 959fa03 + 8dcad0c commit 72e2c01
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 19 deletions.
4 changes: 1 addition & 3 deletions src/common/loadingProgress.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ const chainErrorHandle = () => {
let osType = os.type();
switch (osType) {
case "Linux":
shell.cd(".expanse");
console.log(shell.ls(''));
shell.cd("/.expanse");
exec('rm -rf gexp', {maxBuffer: 1024 * 5000}, (err, stdout, stderr) => {
if (err) {
console.log(`error: ${err}`);
Expand All @@ -181,7 +180,6 @@ const chainErrorHandle = () => {
break;
case "Darwin":
shell.cd("Library/Expanse");
console.log(shell.ls(''));
exec('rm -rf gexp', {maxBuffer: 1024 * 5000}, (err, stdout, stderr) => {
if (err) {
console.log(`error: ${err}`);
Expand Down
6 changes: 2 additions & 4 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ const runGexp = (path) => {
let textChunk = data.toString('utf8');
if(mainWindow){
mainWindow.webContents.send('gexpLogsstder', JSON.stringify(textChunk));
if(data.toString('utf8') && data.toString('utf8').split(' ')[2] === "Head" && data.toString('utf8').split(' ')[3] === "state" && data.toString('utf8').split(' ')[4] === "missing," && data.toString('utf8').split(' ')[5] === "repairing" && data.toString('utf8').split(' ')[6] === "chain"){
// if(data.toString('utf8') && data.toString('utf8').split(' ')[2] === "UDP" && data.toString('utf8').split(' ')[3] === "listener" && data.toString('utf8').split(' ')[4] === "up"){
if(textChunk.includes('Rewinding blockchain')){
// if(data.toString('utf8') && data.toString('utf8').split(' ')[2] === "Head" && data.toString('utf8').split(' ')[3] === "state" && data.toString('utf8').split(' ')[4] === "missing," && data.toString('utf8').split(' ')[5] === "repairing" && data.toString('utf8').split(' ')[6] === "chain"){
console.log("chainrRepairError ");
chainError = true;
gexpProc.kill();
Expand All @@ -146,8 +146,6 @@ const runGexp = (path) => {
}
}
// process utf8 text chunk


});
}catch(e){
console.log("Error",e);
Expand Down
8 changes: 5 additions & 3 deletions src/renderer/components/DasboardComponents/Header/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,15 @@
},
currenciesData: function(){
this.currency = this.$store.state.currencies;
var curNew= this.currency;
got('https://min-api.cryptocompare.com/data/pricemultifull?fsyms=EXP&tsyms=USD,BTC,EXP', {
json: true
}).then(response => {
curNew = response.body.DISPLAY.EXP;
this.currency = response.body.DISPLAY.EXP;
$(".currValue").text(curNew['USD'].PRICE);
},(error) => {
});
// console.log(this.currency, "currency");
return this.currency;
},
totalBalanceData: function(){
Expand Down Expand Up @@ -215,7 +217,7 @@
// console.log(this.$store.state.gexpSync)
// console.log(this.currenciesData, "currencies")
if(this.$store.state.gexpSync){
console.log(this.$store.state.gexpSync, "this.$store.state.gexpSync.currentBlock")
// console.log(this.$store.state.gexpSync, "this.$store.state.gexpSync.currentBlock")
web3.eth.getBlock(this.$store.state.gexpSync.currentBlock).then((res) => {
this.timeStamp = moment(res.timestamp * 1000).fromNow();
});
Expand All @@ -241,7 +243,7 @@
},
methods: {
handleCurrency(curr){
console.log("web3 this.curr", curr);
// console.log("web3 this.curr", curr);
if(curr == 'USD'){
this.defaultCurrencySign = '$';
}else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ let Lab_balance = 0;
let PEX_balance = 0;

const fixpath = () =>{
if((shell.ls('') && shell.ls('')[0]) === 'gexp'){
// console.log("check path", shell.ls(''), shell.ls('') && shell.ls('').find((ele)=> console.log(ele)));
if(shell.ls('') && shell.ls('').find((ele)=> ele === "gexp.exe")){
// console.log("check path", shell.ls(''));
shell.cd('..');
shell.cd('..');
}
Expand Down
26 changes: 24 additions & 2 deletions src/renderer/components/SplashScreen/SplashScreen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
d="M16.134,17.749L16.76,4.884H12.273L12.9,17.749h3.237Zm-1.617,1.419a2.454,2.454,0,0,0-2.557,2.584,2.456,2.456,0,0,0,2.5,2.586h0.057a2.445,2.445,0,0,0,2.525-2.586A2.444,2.444,0,0,0,14.516,19.168Z"/>
</svg>
</div>
<label>Expanse node broken chain error</label>
<label>Chain rewinding error</label>
<label>Retrying to install again</label>
</div>
</div>
Expand Down Expand Up @@ -278,6 +278,9 @@
return {
activeScreen: this.$store.state.screenState,
networkSetting: true,
cb: 0,
totalblock: 0,
hb: 0,
};
},
created(){
Expand All @@ -287,7 +290,26 @@
// console.log(this.activeScreen,"activeScreenAPP")
},
computed:
{
{
currentblockData: function(){
// console.log(this.$store.state.gexpSync,"this.$/ store.state.peerCount");
if(this.$store.state.gexpSync.currentBlock){
this.cb = this.$store.state.gexpSync.currentBlock;
this.totalblock = this.$store.state.gexpSync.currentBlock;
} else {
this.cb = this.$store.state.currentblock;
this.totalblock = this.$store.state.currentblock;
}
return this.cb;
},
highestblockData: function(){
if(this.$store.state.gexpSync.currentBlock){
this.hb = this.$store.state.gexpSync.highestBlock;
} else {
this.hb = this.$store.state.currentblock;
}
return this.hb;
},
chainErrorData() {
ipcRenderer.on('chainrRepairError', (event, res) => {
console.log(res, 'chainrRepairError------01');
Expand Down
16 changes: 10 additions & 6 deletions src/renderer/views/SplashApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@
import * as child_process from 'child_process';
const clientBinariesGexp = clientBinaries.clients.Gexp;
const localGethVersion = clientBinariesGexp.version;
let localGethVersion = clientBinariesGexp.version;
const platForms = clientBinariesGexp.platforms;
let newClinetBinaries = clientBinaries;
var versionUpdate = false;
export default {
name: 'lunawalletvuetest',
created(){
this.chekAppInfo();
ExpApi();
},
data() {
Expand Down Expand Up @@ -75,6 +75,8 @@
if(production){
shell.cd(clientInfo.appPath);
gexpPath = clientInfo.dirPath;
var data = fs.readFileSync('./clientBinaries.json', 'utf8');
localGethVersion = JSON.parse(data).clients.Gexp.version;
}
else
{
Expand All @@ -96,6 +98,8 @@
else
cmd = 'ping -c 1 www.google.com';
var data=fs.readFileSync('./clientBinaries.json', 'utf8');
var words=JSON.parse(data);
var child = exec(cmd, function(er, stdout, stderr){
if(er !== null){
console.log("error founds");
Expand All @@ -111,9 +115,9 @@
.then(response => {
let latestGethVersion = response.body.tag_name;
newClinetBinaries.clients.Gexp.version = latestGethVersion;
// console.log(latestGethVersion, "ulatestGethVersionrl1---------------------------");
// console.log( localGethVersion, "localGethVersion", latestGethVersion, "ulatestGethVersionrl1---------------------------");
// console.log(response.body.tag_name, "urresponsel1---------------------------");
if(response.body.tag_name !== localGethVersion){
if(response.body.tag_name != localGethVersion){
versionUpdate = true;
console.log('update binaries files');
// For each platform/arch in clientBinaries.json
Expand Down Expand Up @@ -147,8 +151,8 @@
} // if ended -- if(response.body.tag_name !== localGethVersion)
}).then(res => {
console.log("versionUpdate", versionUpdate);
if (versionUpdate === true) {
// console.log("versionUpdate", versionUpdate, newClinetBinaries);
if (versionUpdate == true) {
// console.log(shell.ls(''),"shellls in writeFile clientBinaries");
fs.writeFile(
'./clientBinaries.json',
Expand Down

0 comments on commit 72e2c01

Please sign in to comment.