|
|
@ -347,10 +347,11 @@ export function iguanaAddCoin(coin, mode, acData) { |
|
|
|
|
|
|
|
if (mode === 0) { |
|
|
|
return dispatch => { |
|
|
|
startIguanaInstance('basilisk', 'basilisk') |
|
|
|
return _iguanaAddCoin(dispatch); |
|
|
|
/*startIguanaInstance('basilisk', 'basilisk') |
|
|
|
.then(function(json) { |
|
|
|
_iguanaAddCoin(dispatch); |
|
|
|
}); |
|
|
|
});*/ |
|
|
|
} |
|
|
|
} else { |
|
|
|
return dispatch => { |
|
|
@ -2004,7 +2005,6 @@ function connectAllNotaryNodes(json, dispatch) { |
|
|
|
} |
|
|
|
|
|
|
|
export function startIguanaInstance(mode, coin) { |
|
|
|
console.log('startIguanaInstance', mode + ' ' + coin); |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/forks', { |
|
|
|
method: 'POST', |
|
|
@ -2025,6 +2025,44 @@ export function startIguanaInstance(mode, coin) { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
export function getIguanaInstancesList() { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/forks', { |
|
|
|
method: 'GET', |
|
|
|
headers: { |
|
|
|
'Content-Type': 'application/json', |
|
|
|
}, |
|
|
|
}) |
|
|
|
.catch(function(error) { |
|
|
|
console.log(error); |
|
|
|
dispatch(triggerToaster(true, 'getIguanaInstanceList', 'Error', 'error')); |
|
|
|
}) |
|
|
|
.then(response => response.json()) |
|
|
|
.then(json => resolve(json)) |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
export function restartIguanaInstance(pmid) { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/forks/restart?pmid=' + pmid, { |
|
|
|
method: 'GET', |
|
|
|
headers: { |
|
|
|
'Content-Type': 'application/json', |
|
|
|
}, |
|
|
|
/*body: JSON.stringify({ |
|
|
|
mode, |
|
|
|
coin |
|
|
|
}),*/ |
|
|
|
}) |
|
|
|
.catch(function(error) { |
|
|
|
console.log(error); |
|
|
|
dispatch(triggerToaster(true, 'restartIguanaInstance', 'Error', 'error')); |
|
|
|
}) |
|
|
|
.then(response => response.json()) |
|
|
|
.then(json => resolve(json)) |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
export function connectNotaries() { |
|
|
|
const payload = { |
|
|
|
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|
|
|