Merge branch 'master' into rename-truffle-kredits-to-kredits-contracts
# Conflicts: # README.md # package-lock.json # package.json
This commit is contained in:
@@ -22,7 +22,8 @@ You will need the following things properly installed on your computer.
|
|||||||
|
|
||||||
## Running / Development
|
## Running / Development
|
||||||
|
|
||||||
* `ember serve`
|
|
||||||
|
* `ember serve` - by default kredits-web connects to the Ethreum Kovan network
|
||||||
* Visit your app at [http://localhost:4200](http://localhost:4200).
|
* Visit your app at [http://localhost:4200](http://localhost:4200).
|
||||||
* Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests).
|
* Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests).
|
||||||
|
|
||||||
@@ -89,8 +90,8 @@ Get your local Ethereum development node running.
|
|||||||
|
|
||||||
With IPFS and Ethereum/ganache running, you can now start this Ember app.
|
With IPFS and Ethereum/ganache running, you can now start this Ember app.
|
||||||
|
|
||||||
* `npm link kredits-contracts` - link the local `kredits-contracts` package (it will become `kredits-contracts` soon)
|
* `npm link kredits-contracts` - link the local `kredits-contracts` package
|
||||||
* `npm start`
|
* `npm run start:local` - NETWORK_ID=100 and WEB3_PROVIDER_URL=http://localhost:7545 must be set for local settings
|
||||||
|
|
||||||
#### IPFS
|
#### IPFS
|
||||||
|
|
||||||
|
|||||||
+14
-10
@@ -38,34 +38,38 @@ export default Service.extend({
|
|||||||
);
|
);
|
||||||
ethProvider.listAccounts().then((accounts) => {
|
ethProvider.listAccounts().then((accounts) => {
|
||||||
this.set('currentUserAccounts', accounts);
|
this.set('currentUserAccounts', accounts);
|
||||||
resolve(ethProvider);
|
const ethSigner = accounts.length === 0 ? null : ethProvider.getSigner();
|
||||||
|
resolve({
|
||||||
|
ethProvider,
|
||||||
|
ethSigner
|
||||||
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.debug('[kredits] Creating new instance from npm module class');
|
console.debug('[kredits] Creating new instance from npm module class');
|
||||||
networkId = parseInt(config.contractMetadata.networkId);
|
networkId = parseInt(config.contractMetadata.networkId);
|
||||||
|
console.debug(`[kredits] networkId=${networkId} providerURL: ${config.web3ProviderUrl}`);
|
||||||
ethProvider = new ethers.providers.JsonRpcProvider(
|
ethProvider = new ethers.providers.JsonRpcProvider(
|
||||||
config.web3ProviderUrl,
|
config.web3ProviderUrl,
|
||||||
{ chainId: networkId }
|
{ chainId: networkId }
|
||||||
);
|
);
|
||||||
resolve(ethProvider);
|
resolve({
|
||||||
|
ethProvider: ethProvider,
|
||||||
|
ethSigner: null
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
return this.getEthProvider().then((ethProvider) => {
|
return this.getEthProvider().then((providerAndSigner) => {
|
||||||
let ethSigner;
|
|
||||||
|
|
||||||
if (ethProvider.getSigner) {
|
let kredits = new Kredits(providerAndSigner.ethProvider, providerAndSigner.ethSigner, {
|
||||||
ethSigner = ethProvider.getSigner();
|
ipfsConfig: config.ipfs
|
||||||
}
|
});
|
||||||
|
|
||||||
let kredits = new Kredits(ethProvider, ethSigner);
|
|
||||||
return kredits
|
return kredits
|
||||||
.init()
|
.init()
|
||||||
.then((kredits) => {
|
.then((kredits) => {
|
||||||
this.set('kredits', kredits);
|
this.set('kredits', kredits);
|
||||||
|
|
||||||
if (this.currentUserAccounts && this.currentUserAccounts.length > 0) {
|
if (this.currentUserAccounts && this.currentUserAccounts.length > 0) {
|
||||||
this.getCurrentUser.then((contributorData) => {
|
this.getCurrentUser.then((contributorData) => {
|
||||||
this.set('currentUser', contributorData);
|
this.set('currentUser', contributorData);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ module.exports = function(environment) {
|
|||||||
|
|
||||||
contractMetadata: { networkId: '42' },
|
contractMetadata: { networkId: '42' },
|
||||||
|
|
||||||
web3ProviderUrl: 'https://parity.kosmos.org:8545',
|
web3ProviderUrl: 'https://kovan.infura.io/keUVk6OMaAvpmRF3m57n',
|
||||||
|
|
||||||
ipfs: {
|
ipfs: {
|
||||||
host: 'ipfs.kosmos.org',
|
host: 'ipfs.kosmos.org',
|
||||||
@@ -52,8 +52,8 @@ module.exports = function(environment) {
|
|||||||
// ENV.APP.LOG_TRANSITIONS = true;
|
// ENV.APP.LOG_TRANSITIONS = true;
|
||||||
// ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
|
// ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
|
||||||
// ENV.APP.LOG_VIEW_LOOKUPS = true;
|
// ENV.APP.LOG_VIEW_LOOKUPS = true;
|
||||||
ENV.contractMetadata['networkId'] = '100';
|
ENV.contractMetadata['networkId'] = '42';
|
||||||
ENV.web3ProviderUrl = 'http://localhost:7545';
|
ENV.web3ProviderUrl = 'https://kovan.infura.io/keUVk6OMaAvpmRF3m57n';
|
||||||
|
|
||||||
ENV.ipfs = {
|
ENV.ipfs = {
|
||||||
host: 'localhost',
|
host: 'localhost',
|
||||||
|
|||||||
Generated
+3
-1
@@ -13484,7 +13484,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"kredits-contracts": {
|
"kredits-contracts": {
|
||||||
"version": "github:67P/kredits-contracts#8a7abba4861b8a3a73449693a8bd226bdecae553",
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/kredits-contracts/-/kredits-contracts-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-QF8j0Wu3/XTzlas4u2bmLgsCchouQH+sxM1ewnA4X16FmlbguMJfVPPnIrlX2ptmVUOXMOU+9zKy9SQquJjjqg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"ethers": "3.0.15",
|
"ethers": "3.0.15",
|
||||||
|
|||||||
+2
-2
@@ -13,7 +13,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"lint:js": "eslint ./*.js app config lib server tests",
|
"lint:js": "eslint ./*.js app config lib server tests",
|
||||||
"start": "ember serve",
|
"start": "ember serve",
|
||||||
"kovan": "NETWORK_ID=42 ember serve",
|
"start:local": "NETWORK_ID=100 WEB3_PROVIDER_URL=http://localhost:7545 ember s",
|
||||||
"test": "ember test",
|
"test": "ember test",
|
||||||
"build": "ember build",
|
"build": "ember build",
|
||||||
"build-prod": "ember build --environment production",
|
"build-prod": "ember build --environment production",
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
"eslint-plugin-ember": "^5.0.0",
|
"eslint-plugin-ember": "^5.0.0",
|
||||||
"ethers": "3.0.15",
|
"ethers": "3.0.15",
|
||||||
"kosmos-schemas": "^1.1.2",
|
"kosmos-schemas": "^1.1.2",
|
||||||
"kredits-contracts": "github:67P/kredits-contracts",
|
"kredits-contracts": "^3.x",
|
||||||
"loader.js": "^4.2.3",
|
"loader.js": "^4.2.3",
|
||||||
"tv4": "^1.3.0"
|
"tv4": "^1.3.0"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user