Skip to content

Commit

Permalink
Added deployment config for Rinkeby
Browse files Browse the repository at this point in the history
  • Loading branch information
scheuclu committed Feb 23, 2022
1 parent fb802cb commit ed6c8bb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,3 @@ truffle compile
truffle migrate --reset --network rinkeby
```
The contract address is [0x4e9757b26374b166c69eb5443952560b6a18d93b](https://rinkeby.etherscan.io/address/0x4e9757b26374b166c69eb5443952560b6a18d93b)

### IPFS
The website itself will be hosted on IPFS, making this a truly decentralized service.
4 changes: 2 additions & 2 deletions project-6/src/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ App = {
var processId = parseInt($(event.target).data('id'));

App.contracts.SupplyChain.deployed().then(function(instance) {
const productPrice = web3.toWei(1, "ether");
const productPrice = web3.toWei(0.0001, "ether");
console.log('productPrice',productPrice);
return instance.sellItem(App.upc, App.productPrice, {from: App.metamaskAccountID});
}).then(function(result) {
Expand All @@ -236,7 +236,7 @@ App = {
var processId = parseInt($(event.target).data('id'));

App.contracts.SupplyChain.deployed().then(function(instance) {
const walletValue = web3.toWei(3, "ether");
const walletValue = web3.toWei(0.002, "ether");
return instance.buyItem(App.upc, {from: App.metamaskAccountID, value: walletValue});
}).then(function(result) {
$("#ftc-item").text(result);
Expand Down
14 changes: 13 additions & 1 deletion project-6/truffle.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
const HDWalletProvider = require('truffle-hdwallet-provider');
const infuraKey = "<infura-key>";
//
// const fs = require('fs');
const mnemonic = "mnemonic>";

module.exports = {
// contracts_directory: "./contracts/coffeeaccesscontrol/",
networks: {
development: {
host: "127.0.0.1",
port: 8545,
network_id: "*" // Match any network id
}
},
rinkeby: {
provider: () => new HDWalletProvider(mnemonic, `https://rinkeby.infura.io/v3/${infuraKey}`),
network_id: 4, // rinkeby's id
gas: 4500000, // rinkeby has a lower block limit than mainnet
gasPrice: 10000000000
},
},
compilers: {
solc: {
Expand Down

0 comments on commit ed6c8bb

Please sign in to comment.