Skip to content

Commit

Permalink
WIP: implemented ns-protocol v0
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Dec 7, 2023
1 parent 0db2ec8 commit bdb6f10
Show file tree
Hide file tree
Showing 10 changed files with 820 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI
on:
push:
branches: ['main']
pull_request:
branches: ['main']
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run clippy
run: cargo clippy --verbose --all-targets --all-features
- name: Run tests
run: cargo test --verbose --workspace -- --nocapture
- name: Run all tests
run: cargo test --verbose --workspace -- --nocapture --include-ignored
63 changes: 63 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[package]
name = "ns-rs"
version = "0.1.0"
edition = "2021"
rust-version = "1.64"
description = ""
publish = false
repository = "https://github.com/ldclabs/ns-rs"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[workspace]
members = ["crates/*"]

[workspace.dependencies]
anyhow = "1"
async-trait = "0.1"
axum = { version = "0.6", features = [
"headers",
"http1",
"http2",
"json",
"macros",
"matched-path",
"tokio",
"query",
], default-features = true }
bytes = "1"
base64 = "0.21"
ciborium = "0.2"
ciborium-io = "0.2"
ed25519-dalek = "2"
libflate = "1"
log = "0.4"
mime = "0.3"
serde = "1"
serde_json = { version = "1", features = ["preserve_order"] }
structured-logger = "1"
tokio = { version = "1", features = [
"fs",
"io-util",
"io-std",
"macros",
"net",
"parking_lot",
"process",
"rt",
"rt-multi-thread",
"signal",
"sync",
"time",
], default-features = true }

[dev-dependencies]
faster-hex = "0.8"
hex-literal = "0.4"

[[bin]]
name = "ns-indexer"
path = "crates/ns-indexer/bin/main.rs"

[profile.release]
lto = true
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# options
ignore_output = &> /dev/null

.PHONY: run-dev test build docker

run-dev:
@cargo run

test:
@cargo test --workspace -- --nocapture

test-all:
@cargo test --workspace -- --nocapture --include-ignored

lint:
@cargo clippy --all-targets --all-features --workspace --tests

fix:
@cargo clippy --fix --workspace --tests
1 change: 1 addition & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
msrv = "1.64"
19 changes: 19 additions & 0 deletions crates/ns-indexer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "ns-indexer"
version = "0.1.0"
edition = "2021"
rust-version = "1.64"
description = ""
publish = false
repository = "https://github.com/ldclabs/ns-rs/crates/ns-indexer"
license = "CC0 1.0 Universal"

[lib]

[dependencies]
anyhow = { workspace = true }
bytes = { workspace = true }
base64 = { workspace = true }
ciborium = { workspace = true }
ciborium-io = { workspace = true }
serde = { workspace = true }
3 changes: 3 additions & 0 deletions crates/ns-indexer/bin/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("ToDO");
}
1 change: 1 addition & 0 deletions crates/ns-indexer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

25 changes: 25 additions & 0 deletions crates/ns-protocol/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[package]
name = "ns-protocol"
version = "0.1.0"
edition = "2021"
rust-version = "1.64"
description = ""
publish = true
repository = "https://github.com/ldclabs/ns-rs/crates/ns-protocol"
license = "CC0 1.0 Universal"

[lib]

[dependencies]
anyhow = { workspace = true }
bytes = { workspace = true }
base64 = { workspace = true }
ciborium = { workspace = true }
ciborium-io = { workspace = true }
ed25519-dalek = { workspace = true }
serde = { workspace = true }
finl_unicode = "1.2.0"

[dev-dependencies]
faster-hex = "0.8"
hex-literal = "0.4"
1 change: 1 addition & 0 deletions crates/ns-protocol/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod ns;
Loading

0 comments on commit bdb6f10

Please sign in to comment.