-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed9f8c6
commit 71a32b8
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Graph NFT Marketplace FCC | ||
|
||
_Be sure to double check if Rinkeby or Goerli is best for learning as Rinkeby is getting sunset_ | ||
|
||
# Quickstart | ||
|
||
1. Install Subgraph CLI | ||
|
||
``` | ||
yarn global add @graphprotocol/graph-cli | ||
``` | ||
|
||
2. Log into [the graph UI](https://thegraph.com/studio/subgraph) and create a new Subgraph. | ||
|
||
Use Goerli as the network. | ||
|
||
3. Initialize Subgraph | ||
|
||
``` | ||
graph init --studio nft-marketplace | ||
``` | ||
|
||
4. Authenticate CLI | ||
|
||
``` | ||
graph auth --studio YOUR_DEPLOY_KEY_HERE | ||
``` | ||
|
||
5. Update your `subgraph.yaml` | ||
|
||
- Update the `address` with your NftMarketplace Address | ||
- Update the `startBlock` with the block right before your contract was deployed | ||
|
||
6. Build graph locally | ||
|
||
``` | ||
graph codegen && graph build | ||
``` | ||
|
||
- `graph codegen`: Generates code in the `generated` folder based on your `schema.graphql` | ||
- `graph build`: Generates the build that will be uploaded to the graph | ||
|
||
7. Deploy subgraph | ||
|
||
Replace `VERSION_NUMBER_HERE` with a version number like `0.0.1`. | ||
|
||
``` | ||
graph deploy --studio nft-marketplace -l VERSION_NUMBER_HERE | ||
``` | ||
|
||
8. View your UI | ||
|
||
Back in your hardhat project, mint and list an NFT with: | ||
|
||
``` | ||
yarn hardhat run scripts/mint-and-list-item.js --network goerli | ||
``` |