mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-05 15:08:24 +00:00
Migrate the ngit-grasp library and all non-test source code from
rust-nostr 0.44.x (git rev) to crates.io 0.45.0-alpha.1.
Key API changes adopted:
- nostr-sdk root no longer re-exports core types; switch to
nostr_sdk::prelude::* / nostr::*.
- TagKind removed: Tag::custom now takes impl Into<String>; tag.kind()
returns &str. All TagKind::{custom,Custom,d,Clone,Relays} usages
converted to string literals.
- EventBuilder: sign_with_keys -> finalize, build(pk) ->
finalize_unsigned(pk).
- MemoryDatabase moved to nostr-memory crate (bounded/unbounded builder).
- Client API: new() is no-arg (NIP-42 auth now via
ClientBuilder::authenticator(SignerAuthenticator::new(keys)));
subscribe(filter) / sync(filter) builders; Output.val -> Output.value.
- RelayPoolNotification -> RelayNotification / ClientNotification;
Shutdown relay variant removed; Message carries Box<RelayMessage>;
notifications() is now a Stream (use .next()); relay() returns
Result<Option<Relay>>.
- sync() now returns SyncSummary (remote is HashMap<EventId, ..>).
Also adopts NIP-01 machine-readable reject prefixes via the new
mandatory WritePolicyResult prefix field.
Tests and grasp-audit migration follow in subsequent commits.
84 lines
1.6 KiB
TOML
84 lines
1.6 KiB
TOML
[package]
|
|
name = "ngit-grasp"
|
|
version = "1.1.0"
|
|
edition = "2021"
|
|
authors = ["ngit-grasp contributors"]
|
|
license = "MIT"
|
|
description = "A GRASP (Git Relays Authorized via Signed-Nostr Proofs) implementation in Rust"
|
|
repository = "https://gitworkshop.dev/ngit-grasp"
|
|
|
|
[dependencies]
|
|
# Async runtime
|
|
tokio = { version = "1.35", features = ["full"] }
|
|
|
|
# HTTP server (hyper for relay integration)
|
|
hyper = { version = "1.4", features = ["full"] }
|
|
hyper-util = { version = "0.1", features = ["tokio", "server", "http1", "http2"] }
|
|
http-body-util = "0.1"
|
|
|
|
# Nostr relay
|
|
nostr-relay-builder = "0.45.0-alpha.1"
|
|
|
|
# Nostr
|
|
nostr = "0.45.0-alpha.1"
|
|
nostr-sdk = "0.45.0-alpha.1"
|
|
nostr-lmdb = "0.45.0-alpha.1"
|
|
nostr-memory = "0.45.0-alpha.1"
|
|
|
|
# Utilities
|
|
futures-util = "0.3"
|
|
base64 = "0.22"
|
|
flate2 = "1.0"
|
|
|
|
# Metrics
|
|
prometheus = "0.13"
|
|
dashmap = "5"
|
|
lazy_static = "1.4"
|
|
|
|
# Data structures
|
|
indexmap = "2"
|
|
|
|
# Random (for startup jitter)
|
|
rand = "0.8"
|
|
|
|
# Serialization
|
|
serde = { version = "1.0", features = ["derive"] }
|
|
serde_json = "1.0"
|
|
|
|
# Logging
|
|
tracing = "0.1"
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
|
|
|
# Configuration
|
|
dotenvy = "0.15"
|
|
clap = { version = "4.5", features = ["derive", "env"] }
|
|
|
|
# Error handling
|
|
anyhow = "1.0"
|
|
|
|
# Async traits
|
|
async-trait = "0.1"
|
|
|
|
# Temporary directories (used for GRASP-06 empty-repo synthesis)
|
|
tempfile = "3"
|
|
|
|
# Git (for future use)
|
|
# git-http-backend = "0.3"
|
|
|
|
[dev-dependencies]
|
|
# Testing
|
|
grasp-audit = { path = "grasp-audit" }
|
|
tempfile = "3"
|
|
reqwest = "0.12"
|
|
|
|
[lib]
|
|
name = "ngit_grasp"
|
|
path = "src/lib.rs"
|
|
|
|
[[bin]]
|
|
name = "ngit-grasp"
|
|
path = "src/main.rs"
|
|
|
|
[workspace]
|
|
members = [".", "grasp-audit"]
|