Closed fernandomg closed 4 years ago
Maybe adding one more level to the configs makes a bit more sense (added environments
and generics
).
/*
* xDai
*/
const xDai = {
network: {
ID: 100,
COLOR: '#48A8A6',
LABEL: 'xDai STAKE',
// mocks the structure of `Token` in `src/logic/tokens/store/model/token.ts`
NATIVE_COIN: {
// address mocks the ETH_ADDRESS in `src/logic/tokens/utils/tokenHelpers.ts`
address: '0x000',
name: 'xDai',
symbol: 'xDai',
decimals: 18,
logoUri: '',
},
},
/*
feature: {
// something around this to display or not some critical sections in the app, depending on the network support
// I listed the ones that may conflict with the network.
// If non is present, all the sections are available.
DISABLE: {
SAFE_APPS: true,
COLLECTIBLES: true,
CONTRACT_INTERACTION: true,
},
},
*/
environment: {
dev: {},
staging: {},
production: {
TX_SERVICE_HOST: 'https://safe-transaction.xdai.gnosis.io/api/v1/',
// Shall we keep a reference to the relay?
RELAY_API_URL: null,
// won't be used in xDai, for the first iteration
SAFE_APPS_URL: null,
// mainnet+rinkeby: ethgasstation,
// xDai: Ask Richard about the oracle for the gasPrice
GAS_PRICE_ORACLE_URL: '',
// mainnet+rinkeby: infura,
// for infura there's a REST API Token required stored in: `REACT_APP_INFURA_TOKEN`
// xDai: `rpc.xdaichain.com` among others
// see: https://www.xdaichain.com/for-developers/developer-resources#json-rpc-endpoints
RPC_SERVICE_URL: '',
// mainnet+rinkeby uses etherscan,
// xDai uses:
// - `blockscout.com/poa/xdai/api`
// - `blockscout.com/poa/xdai/api/eth-rpc`
// This API is provided to support some rpc methods
// in the exact format specified for ethereum nodes
NETWORK_EXPLORER_URL: '',
},
}
}
The aim of this task is to create a configuration setup that will ease the addition of networks to the Safe.
an initial sketch:
An example of how the current configurations would look with the said "generic network configuration".
Finally, the env variables (the ones listed in the
.env.example
file), need to be revisited along with this change too.A commented list of the env vars: