-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetting-started.yml
More file actions
169 lines (118 loc) Β· 5.07 KB
/
getting-started.yml
File metadata and controls
169 lines (118 loc) Β· 5.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# DAppNode Pathfinder Package - Getting Started Guide
## π Prerequisites
- **DAppNode**: This package requires a running DAppNode
- **Ethereum Node**: An Ethereum L1 node is required for L1 state verification
- Can use a DAppNode execution client (recommended)
- Or external providers like Infura, Alchemy, etc.
## βοΈ Configuration
During installation, you'll need to configure:
### Required Settings
- **Ethereum API URL**: URL of your Ethereum L1 node for state verification
- DAppNode execution client: `ws://execution.{network}.dncore.dappnode:8555`
- Infura WebSocket: `wss://mainnet.infura.io/ws/v3/YOUR-PROJECT-ID`
- Other providers: Any valid HTTP/WebSocket URL
### Optional Settings
- **Log Level**: Choose verbosity level (error, warn, info, debug, trace)
- Default: `info` (recommended for most users)
## π Network Variants
This package supports multiple StarkNet networks:
| Network | Package | RPC Port | Monitor Port | RPC Endpoint | WebSocket Endpoint |
|---------|---------|----------|----------------|--------------|--------------|-------------------|
| **Mainnet** | `pathfinder.dnp.dappnode.eth` | 6060 | 9547 | `http://pathfinder.dappnode:6060/` | `ws://pathfinder.dappnode:6061/` |
| **Sepolia** | `pathfinder-sepolia.dnp.dappnode.eth` | 6060 | 9547 | `http://pathfinder-sepolia.dappnode:6060/` | `ws://pathfinder-sepolia.dappnode:6061/` |
> **Note**: The Monitor port is used for metrics and health check endpoints for monitoring and observability.
## π API Usage
### JSON-RPC Interface
The Pathfinder node exposes a StarkNet JSON-RPC API compatible with the official specification:
```bash
# Mainnet - Get the latest block
curl -X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"starknet_blockNumber","params":[],"id":1}' \
http://pathfinder.dappnode:6060/
# Sepolia - Get chain ID
curl -X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"starknet_chainId","params":[],"id":1}' \
http://pathfinder-sepolia.dappnode:6060/
```
### WebSocket Interface
```javascript
// Mainnet WebSocket
const wsMainnet = new WebSocket('ws://pathfinder.dappnode:6060/');
// Sepolia WebSocket
const wsSepolia = new WebSocket('ws://pathfinder-sepolia.dappnode:6061/');
wsMainnet.onopen = function() {
wsMainnet.send(JSON.stringify({
jsonrpc: '2.0',
method: 'starknet_subscribeEvents',
params: {},
id: 1
}));
};
```
## π Monitoring
The package includes a Grafana dashboard for monitoring:
- Node synchronization status
- Block height and sync progress
- RPC call metrics
- Resource usage (CPU, memory, disk)
- Network connectivity
## π³ Technical Details
### Docker Configuration
- **Base Image**: `eqlabs/pathfinder`
- **Data Persistence**: Node data stored in persistent Docker volume
- **Environment Variables**:
- `PATHFINDER_ETHEREUM_API_URL`: L1 Ethereum node URL
- `PATHFINDER_NETWORK`: StarkNet network (mainnet/sepolia-testnet)
- `RUST_LOG`: Logging level
- `PATHFINDER_DB_DIR`: Database directory
### Storage Requirements
- **Initial Sync**: ~50GB+ (varies by network and state size)
- **Ongoing Growth**: Several GB per month
- **Recommended**: SSD storage for optimal performance
## π§ Troubleshooting
### Common Issues
1. **Sync Problems**
- Ensure Ethereum API URL is correct and accessible
- Check that the L1 node is fully synced
- Verify network connectivity
2. **Performance Issues**
- Ensure sufficient RAM (8GB+ recommended)
- Use SSD storage for better I/O performance
- Monitor CPU usage during initial sync
3. **API Connection Issues**
- Verify the node is running and healthy
- Check port accessibility from client applications
- Ensure firewall rules allow connections
### Logs Access
View logs through the DAppNode interface:
1. Go to Packages β Pathfinder
2. Click on "Logs" tab
3. Adjust log level in configuration if needed
## π€ Contributing
We welcome contributions! Please feel free to submit issues and pull requests.
### Development Setup
```bash
# Clone the repository
git clone https://github.com/dappnode/DAppNodePackage-pathfinder-generic.git
cd DAppNodePackage-pathfinder-generic
# Build the package
npx @dappnode/dappnodesdk build
# Build specific variant
npx @dappnode/dappnodesdk build --variant sepolia
```
## π Resources
- **Pathfinder Documentation**: [GitHub Repository](https://github.com/eqlabs/pathfinder)
- **StarkNet Documentation**: [Official Docs](https://docs.starknet.io/)
- **DAppNode Documentation**: [DAppNode Docs](https://docs.dappnode.io/)
- **StarkNet JSON-RPC Spec**: [API Specification](https://github.com/starkware-libs/starknet-specs)
## π License
This project is licensed under the GPL-3.0 License - see the [LICENSE](LICENSE) file for details.
## π Acknowledgments
- [Equilibrium Labs](https://github.com/eqlabs) for developing Pathfinder
- [StarkWare](https://starkware.co/) for the StarkNet protocol
- [DAppNode](https://dappnode.io/) community for package maintenance
---
**Made with β€οΈ by the DAppNode Association**
For support, join our [Discord](https://discord.gg/dappnode).