Browse Source

start basilisk instance on add coin

all-modes
pbca26 8 years ago
parent
commit
5e5497c312
  1. 40
      react/src/actions/actionCreators.js
  2. 2
      react/src/components/dashboard/walletsData.js

40
react/src/actions/actionCreators.js

@ -332,7 +332,7 @@ export function addCoin(coin, mode) {
} }
export function iguanaAddCoin(coin, mode, acData) { export function iguanaAddCoin(coin, mode, acData) {
return dispatch => { function _iguanaAddCoin(dispatch) {
return fetch('http://127.0.0.1:' + Config.iguanaCorePort, { return fetch('http://127.0.0.1:' + Config.iguanaCorePort, {
method: 'POST', method: 'POST',
body: JSON.stringify(acData), body: JSON.stringify(acData),
@ -344,6 +344,19 @@ export function iguanaAddCoin(coin, mode, acData) {
.then(response => response.json()) .then(response => response.json())
.then(json => dispatch(addCoinResult(coin, mode, acData))); .then(json => dispatch(addCoinResult(coin, mode, acData)));
} }
if (mode === 0) {
return dispatch => {
startIguanaInstance('basilisk', 'basilisk')
.then(function(json) {
_iguanaAddCoin(dispatch);
});
}
} else {
return dispatch => {
return _iguanaAddCoin(dispatch);
}
}
} }
export function shepherdHerd(coin, mode, path) { export function shepherdHerd(coin, mode, path) {
@ -653,6 +666,7 @@ export function getPeersListState(json) {
} }
} }
export function getFullTransactionsList(coin) {
/*params = { /*params = {
'userpass': tmpIguanaRPCAuth, 'userpass': tmpIguanaRPCAuth,
'agent': 'dex', 'agent': 'dex',
@ -662,8 +676,6 @@ export function getPeersListState(json) {
'skip': 0, 'skip': 0,
'symbol': coin 'symbol': coin
};*/ };*/
export function getFullTransactionsList(coin) {
const payload = { const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), 'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
'coin': coin, 'coin': coin,
@ -1991,6 +2003,28 @@ 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',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
mode,
coin
}),
})
.catch(function(error) {
console.log(error);
dispatch(triggerToaster(true, 'startIguanaInstance', 'Error', 'error'));
})
.then(response => response.json())
.then(json => resolve(json))
});
}
export function connectNotaries() { export function connectNotaries() {
const payload = { const payload = {
'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), 'userpass': 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),

2
react/src/components/dashboard/walletsData.js

@ -461,7 +461,7 @@ class WalletsData extends React.Component {
<label className="padding-top-3" htmlFor="edexcoin_cache_api" onClick={this.toggleCacheApi}>Use cache</label> <label className="padding-top-3" htmlFor="edexcoin_cache_api" onClick={this.toggleCacheApi}>Use cache</label>
</div> </div>
</div> </div>
<div className="row"> <div className="row" style={{padding: '20px 0 10px 0'}}>
<div className="col-sm-6"> <div className="col-sm-6">
{this.renderPaginationItemsPerPageSelector()} {this.renderPaginationItemsPerPageSelector()}
</div> </div>

Loading…
Cancel
Save