You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor README for clarity and detail, including updates to project purpose, system architecture, configuration instructions, and usage steps. Enhanced feature descriptions and added information on subgraph health monitoring.
Copy file name to clipboardExpand all lines: README.md
+26-53Lines changed: 26 additions & 53 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,47 +3,32 @@
3
3
## 1. Project Overview
4
4
5
5
### Purpose
6
-
The Giveth Economy Subgraph is a Graph Protocol subgraph that indexes and makes queryable the Giveth Economy smart contracts. It provides a way to efficiently query blockchain data related to GIV token locking, staking, rewards distribution, and Uniswap V3 integration.
6
+
The Giveth Economy Subgraph is a Graph Protocol subgraph that is built for the Giveth Economy smart contracts. It is used to index and make queryable the Giveth Economy smart contracts.
7
7
8
8
### Key Features
9
-
- Tracks GIV token locking and unlocking events
10
-
- Monitors Uniswap V3 liquidity positions and staking
11
-
- Records token distributions and allocations
12
-
- Tracks user balances and rewards across different pools
9
+
- Supports GIVeconomy DeFi protocol variety of balances, e.g. GIV Power, GIV Token Lock, GIV Merkle Distro, GIV Uniswap V3 Liquidity Mining, Givers PFP, etc.
-`subgraph.template.yaml`: Template for subgraph configuration
82
-
-`networks.yaml`: Network-specific contract addresses and configurations
83
-
- Environment variables for deployment keys
65
+
-`subgraph.template.yaml`: Template for subgraph configuration. No need to write manually if you use the networks.yaml file and the generate-manifests command.
66
+
-`networks.yaml`: A template to configure contract addresses and start blocks for each network. This will be processed by the generate-manifests command to create the subgraph deployment yaml file.
84
67
85
68
## 4. Usage Instructions
86
69
87
70
### Running the Application
88
71
To build and deploy the subgraph:
89
72
90
-
1. Generate manifests:
91
-
```bash
92
-
yarn generate-manifests
93
-
```
73
+
1. Update the networks.yaml file with the correct contract addresses and start blocks for each network.
94
74
95
-
2. Buildthe subgraph:
75
+
2. Build: This will generate the subgraph deployment yaml file and subgraph code.
96
76
```bash
97
77
yarn build
98
78
```
99
79
100
-
3. Deploy to specific network:
80
+
3. Deploy to specific network:
101
81
```bash
102
82
# For Gnosis Chain
103
83
yarn deploy:gnosis:production
104
84
105
85
# For Mainnet
106
86
yarn deploy:mainnet:production
107
87
```
88
+
Look at the corresponding scripts in the package.json to customize it for new networks.
108
89
109
90
### Testing
110
91
The subgraph includes linting and type checking:
111
92
```bash
112
93
yarn lint
113
94
```
114
95
115
-
### Common Tasks
116
-
- Generate TypeScript types:
96
+
### Build Issues
97
+
Test type and build issues with build command.
117
98
```bash
118
-
yarn codegen:deployment-7
119
-
```
120
-
121
-
- Build specific deployment:
122
-
```bash
123
-
yarn build:deployment-7
99
+
yarn build
124
100
```
125
101
126
102
## 5. Deployment Process
127
103
128
-
### Environments
129
-
- Production (Mainnet & Gnosis Chain)
130
-
- Staging (Various test networks)
131
-
- Development (Local development)
132
-
133
104
### Deployment Steps
134
105
1. Update contract addresses in `networks.yaml` if needed
135
106
2. Generate manifests with updated configurations
@@ -146,23 +117,25 @@ Deployments are managed through GitHub Actions in the `.github/workflows` direct
146
117
- Check network configuration in `networks.yaml`
147
118
- Verify contract addresses and start blocks
148
119
- Ensure proper authentication with The Graph
120
+
- Check the graph hosted service accessability
149
121
150
122
2.**Query Errors**
151
123
- Verify entity schema matches the GraphQL schema
152
-
- Check event handler implementations
153
-
- Ensure proper indexing of events
124
+
- Check subgraph health, i.e. sync status, indexing status, etc.
154
125
155
126
### Logs and Debugging
156
127
- Use Graph Protocol's dashboard to monitor indexing status
157
128
- Check deployment logs in The Graph's hosted service
158
-
- Monitor subgraph health through GraphQL queries
129
+
- Monitor subgraph health through GraphQL queries, e.g. block number,...
130
+
- Unreliable subgraph results due to malfunctioning subgraph nodes
159
131
160
132
## Schema Documentation
161
133
162
134
The subgraph defines several key entities:
163
135
164
136
### Core Entities
165
-
-`GIVPower`: Tracks overall GIV Power statistics
137
+
-`GIVPower`: Tracks overall GIV Power balances
138
+
-`ERC20`: Tracks ERC20 token balances, i.e. simple tokens and LP tokens
0 commit comments