Skip to content

Commit

Permalink
Update default insights node
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroncox committed Jul 19, 2019
1 parent 0b99bbb commit 291c70c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/shared/reducers/blockchains.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const knownChains = [
chainId: 'b042025541e25a472bffde2d62edd457b7e70cee943412b1ea0f044f88591664',
keyPrefix: 'EOS',
name: 'Insights',
node: 'https://ireland-history.insights.network',
node: 'https://instar.greymass.com',
supportedContracts: ['bidname'],
symbol: 'INSTAR',
testnet: false
Expand Down
17 changes: 17 additions & 0 deletions app/shared/store/shared/migrations/016-updateBlockchains.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const update = (blockchains) => {
const newBlockchains = [];
blockchains.forEach((blockchain) => {
const chain = Object.assign({}, blockchain);
// Change default API of insights
if (
chain.chainId === 'b042025541e25a472bffde2d62edd457b7e70cee943412b1ea0f044f88591664'
&& chain.node === 'https://ireland-history.insights.network'
) {
chain.node = 'https://instar.greymass.com';
}
newBlockchains.push(chain);
});
return newBlockchains;
};

export default { update };
9 changes: 8 additions & 1 deletion app/shared/store/shared/persist.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { update as update011 } from './migrations/011-updateBlockchains';
import { update as update012 } from './migrations/012-updateBlockchains';
import { update as update013 } from './migrations/013-updateBlockchains';
import { update as update014 } from './migrations/014-updateBlockchains';
import { update as update016 } from './migrations/016-updateBlockchains';

const defaultChainId = 'aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906';

Expand Down Expand Up @@ -275,11 +276,17 @@ const migrations = {
15: (state) => Object.assign({}, state, {
blockchains: update014(state.blockchains),
}),
/*
16 - Update default insights node
*/
16: (state) => Object.assign({}, state, {
blockchains: update016(state.blockchains),
}),
};

const persistConfig = {
key: 'eos-voter-config',
version: 15,
version: 16,
migrate: createMigrate(migrations, { debug: true }),
storage: createElectronStorage(),
timeout: 0, // The code base checks for falsy, so 0 disables
Expand Down

0 comments on commit 291c70c

Please sign in to comment.