v1.0.1 probe

This commit is contained in:
2025-04-29 23:40:33 +02:00
parent 371b44422b
commit 56c57957c8
4 changed files with 152 additions and 42 deletions
+60 -38
View File
@@ -1,48 +1,57 @@
# 🛰️ Obsero Probe
# 🛰️ Obsero Probe (Full)
Lightweight monitoring agent for generating Proof-of-Observability JSON files.
Obsero Probe is a lightweight Go-based agent that generates cryptographically signed uptime proofs and can optionally upload them to IPFS.
This probe performs HTTP health checks, automatically geolocates itself, and exports signed observation files compliant with the Obsero specification.
---
## 🚀 Features
- HTTP ping with latency measurement
- Automatic geolocation of probe (city, region, country)
- SHA256 hashing of observation data
- EVM-compatible signature using Ethereum private key
- IPFS upload support (`--ipfs`)
- CLI support for target, output, and IPFS toggle
- Cross-platform Makefile for easy builds
---
## ⚙️ Requirements
- Go 1.21+
- Internet access (for geo lookup and ping)
- Local IPFS node (optional, for `--ipfs`)
- Ethereum private key (test key included by default)
---
## 🚀 Quick Start
## 📦 Quick Start
### 1. Clone & Enter
### 1. Install dependencies
```bash
cd probe
```
### 2. Install dependencies
```bash
go mod tidy
```
### 3. Run the probe
### 2. Run a probe
```bash
go run ./cmd/obsero-probe
go run ./cmd/obsero-probe --target https://example.com --output proof_http_signed.json --ipfs
```
This will:
- Ping `https://example.com`
- Auto-detect country, city and region
- Output a file named `proof_http_result.json`
---
## 📄 Output Format
## 🛠️ CLI Options
The output file is a valid Obsero proof:
| Flag | Description |
|------------|------------------------------------|
| `--target` | URL to ping |
| `--output` | Output file name |
| `--ipfs` | Upload the proof to IPFS |
---
## 📄 Proof Format (simplified)
```json
{
@@ -59,34 +68,47 @@ The output file is a valid Obsero proof:
"city": "Paris",
"probe_version": "0.1"
},
"version": "0.1"
"version": "0.1",
"proof": {
"hash": "ab13...cdef",
"signature": "0x..."
}
}
```
---
## 📦 Next steps
- Add CLI support (`--target`, `--output`)
- Add cryptographic signature of the proof
- Upload to IPFS
- Submit hash + CID on Base chain
---
## 📁 Structure
## 📁 Project Structure
```
probe/
├── cmd/
│ └── obsero-probe/
│ └── main.go # CLI entrypoint
│ └── obsero-probe/main.go # CLI entrypoint
├── pkg/
│ ├── geo/ # IP geolocation
│ ├── probe/ # HTTP ping logic
│ └── proof/ # Proof struct + output
├── go.mod
├── go.sum
│ ├── geo/geo.go # Geolocation
│ ├── probe/ping.go # HTTP ping
│ └── proof/format.go # Build, sign and upload proof
├── Makefile # Multi-platform build support
├── go.mod / go.sum
```
---
## 🧱 Next Steps
- ✅ JSON signed and stored locally
- ✅ Upload to IPFS (`--ipfs`)
- 🔗 Submit `submitProof(hash, cid, timestamp)` to a smart contract on Base chain (coming soon)
---
## 🛠️ Makefile Usage
```bash
make build # Build for local platform
make build-linux # Build for Linux amd64
make build-mac # Build for macOS
make build-arm # Build for ARM64 (Raspberry Pi, etc.)
```
---