Skip to content

Commit

Permalink
removed .secret from setup instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
dabit3 committed Jul 6, 2021
1 parent 474bc94 commit c34fcc2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,29 @@ npm install
yarn
```

2. Create a file named `.secret` in the root directory of the project. Either leave it blank or paste in a test account private key if you are going to be deploying to Matic Mumbai.

_Consider using an environment variable if working on Matic Mainnet with real tokens and not storing them in a file associated with the project._

3. Start the local Hardhat node
2. Start the local Hardhat node

```sh
npx hardhat node
```

4. With the network running, deploy the contracts to the local network in a separate terminal window
3. With the network running, deploy the contracts to the local network in a separate terminal window

```sh
npx hardhat run scripts/deploy.js --network localhost
```

5. Rename __config.example.js__ to __config.js__ and copy the `nftmarketaddress` and `nftaddress` values to it.
4. Rename __config.example.js__ to __config.js__ and copy the `nftmarketaddress` and `nftaddress` values to it.

6. Start the app
5. Start the app

```
npm run dev
```

### Configuration

The main configuration for this project to work successfully on Polygon is located in __hardhat.config.js__:
To deploy to Polygon test or main networks, update the configurations located in __hardhat.config.js__ to use a private key and, optionally, deploy to a private RPC like Infura.

```javascript
require("@nomiclabs/hardhat-waffle");
Expand Down Expand Up @@ -88,4 +84,4 @@ module.exports = {
};
```

If using Infura, update __.infuraid__ with your [Infura](https://infura.io/) project ID and, if you are planning on deploying to the main network, update __.secret__ with the Private Key of the account that you would like to use to deploy.
If using Infura, update __.infuraid__ with your [Infura](https://infura.io/) project ID.
22 changes: 11 additions & 11 deletions hardhat.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require("@nomiclabs/hardhat-waffle");
const fs = require('fs');
const privateKey = fs.readFileSync(".secret").toString().trim() || "";
// const fs = require('fs');
// const privateKey = fs.readFileSync(".secret").toString().trim() || "";
// const infuraId = fs.readFileSync(".infuraid").toString().trim() || "";

module.exports = {
Expand All @@ -9,15 +9,15 @@ module.exports = {
hardhat: {
chainId: 1337
},
mumbai: {
url: "https://rpc-mumbai.matic.today",
accounts: [privateKey]
},
matic: {
// url: `https://polygon-mainnet.infura.io/v3/${infuraId}`,
url: "https://rpc-mainnet.maticvigil.com",
accounts: [privateKey]
}
// mumbai: {
// url: "https://rpc-mumbai.matic.today",
// accounts: [privateKey]
// },
// matic: {
// // url: `https://polygon-mainnet.infura.io/v3/${infuraId}`,
// url: "https://rpc-mainnet.maticvigil.com",
// accounts: [privateKey]
// }
},
solidity: {
version: "0.8.4",
Expand Down

0 comments on commit c34fcc2

Please sign in to comment.