Manually set networkId
By default kredits-contracts gets the networkId from the web3 object. This causes some random JSON RPC errors when using MetaMask: https://github.com/MetaMask/metamask-plugin/issues/1538 This set the default networkId to 17 which is our custom private network. For development purposes the networkId can also be set dynamically through the config:networkId local storage entry.
This commit is contained in:
@@ -52,6 +52,9 @@ export default Service.extend({
|
||||
let contract = null;
|
||||
|
||||
if (isPresent(config.contractMetadata)) {
|
||||
if (localStorage.getItem('config:networkId')) {
|
||||
config.contractMetadata['networkId'] = localStorage.getItem('config:networkId');
|
||||
}
|
||||
contract = kreditsContracts(this.get('web3'), config.contractMetadata)['Kredits'];
|
||||
} else {
|
||||
contract = kreditsContracts(this.get('web3'))['Kredits'];
|
||||
|
||||
Reference in New Issue
Block a user