|
@ -20,90 +20,72 @@ import { |
|
|
} from '../../components/addcoin/payload'; |
|
|
} from '../../components/addcoin/payload'; |
|
|
|
|
|
|
|
|
export function addCoin(coin, mode, syncOnly, port) { |
|
|
export function addCoin(coin, mode, syncOnly, port) { |
|
|
if (Config && |
|
|
if (mode === '-1') { |
|
|
Config.iguanaLessMode && |
|
|
|
|
|
mode !== '-1') { |
|
|
|
|
|
return dispatch => { |
|
|
return dispatch => { |
|
|
startIguanaInstance('main', coin) |
|
|
dispatch(shepherdGetConfig(coin, mode)); |
|
|
.then(function(json) { |
|
|
|
|
|
setTimeout(function() { |
|
|
|
|
|
console.log(`started ${coin} / main`, json); |
|
|
|
|
|
_addCoin(); |
|
|
|
|
|
}, 2000); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
_addCoin(); |
|
|
if (checkCoinType(coin) === 'currency_ac') { |
|
|
} |
|
|
const _acData = startCurrencyAssetChain('', coin, mode); |
|
|
|
|
|
|
|
|
function _addCoin() { |
|
|
|
|
|
if (mode === '-1') { |
|
|
|
|
|
return dispatch => { |
|
|
return dispatch => { |
|
|
dispatch(shepherdGetConfig(coin, mode)); |
|
|
dispatch(iguanaAddCoin(coin, mode, _acData)); |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} |
|
|
if (checkCoinType(coin) === 'currency_ac') { |
|
|
if (checkCoinType(coin) === 'ac') { |
|
|
const _acData = startCurrencyAssetChain('', coin, mode); |
|
|
const _acData = startAssetChain('', coin, mode); |
|
|
|
|
|
|
|
|
return dispatch => { |
|
|
|
|
|
dispatch(iguanaAddCoin(coin, mode, _acData)); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (checkCoinType(coin) === 'ac') { |
|
|
|
|
|
const _acData = startAssetChain('', coin, mode); |
|
|
|
|
|
|
|
|
|
|
|
return dispatch => { |
|
|
return dispatch => { |
|
|
dispatch(iguanaAddCoin(coin, mode, _acData)); |
|
|
dispatch(iguanaAddCoin(coin, mode, _acData)); |
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
if (checkCoinType(coin) === 'crypto') { |
|
|
} |
|
|
const _acData = startCrypto('', coin, mode); |
|
|
if (checkCoinType(coin) === 'crypto') { |
|
|
|
|
|
const _acData = startCrypto('', coin, mode); |
|
|
|
|
|
|
|
|
if (syncOnly) { |
|
|
if (syncOnly) { |
|
|
const modeToValue = { |
|
|
const modeToValue = { |
|
|
'1': 'full', |
|
|
'1': 'full', |
|
|
'0': 'basilisk', |
|
|
'0': 'basilisk', |
|
|
'-1': 'native' |
|
|
'-1': 'native' |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
return dispatch => { |
|
|
return dispatch => { |
|
|
startIguanaInstance(`${modeToValue[mode]}/sync`, coin) |
|
|
startIguanaInstance(`${modeToValue[mode]}/sync`, coin) |
|
|
.then(function(json) { |
|
|
.then(function(json) { |
|
|
setTimeout(function() { |
|
|
setTimeout(function() { |
|
|
console.log(`started ${coin} / ${modeToValue[mode]} fork`, json); |
|
|
console.log(`started ${coin} / ${modeToValue[mode]} fork`, json); |
|
|
dispatch( |
|
|
|
|
|
iguanaAddCoin( |
|
|
|
|
|
coin, |
|
|
|
|
|
mode, |
|
|
|
|
|
_acData, |
|
|
|
|
|
json.result |
|
|
|
|
|
) |
|
|
|
|
|
); |
|
|
|
|
|
}, 2000); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
if (port) { |
|
|
|
|
|
return dispatch => { |
|
|
|
|
|
dispatch( |
|
|
dispatch( |
|
|
iguanaAddCoin( |
|
|
iguanaAddCoin( |
|
|
coin, |
|
|
coin, |
|
|
mode, |
|
|
mode, |
|
|
_acData, |
|
|
_acData, |
|
|
port |
|
|
json.result |
|
|
) |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
return dispatch => { |
|
|
|
|
|
dispatch( |
|
|
|
|
|
iguanaAddCoin( |
|
|
|
|
|
coin, |
|
|
|
|
|
mode, |
|
|
|
|
|
_acData |
|
|
|
|
|
) |
|
|
) |
|
|
); |
|
|
); |
|
|
} |
|
|
}, 2000); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
if (port) { |
|
|
|
|
|
return dispatch => { |
|
|
|
|
|
dispatch( |
|
|
|
|
|
iguanaAddCoin( |
|
|
|
|
|
coin, |
|
|
|
|
|
mode, |
|
|
|
|
|
_acData, |
|
|
|
|
|
port |
|
|
|
|
|
) |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
return dispatch => { |
|
|
|
|
|
dispatch( |
|
|
|
|
|
iguanaAddCoin( |
|
|
|
|
|
coin, |
|
|
|
|
|
mode, |
|
|
|
|
|
_acData |
|
|
|
|
|
) |
|
|
|
|
|
); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|