-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: split a subfile_server package
- Loading branch information
Showing
22 changed files
with
951 additions
and
534 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
[workspace] | ||
members = [ | ||
"subfile-exchange", | ||
"subfile-service", | ||
] | ||
resolver = "2" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use ethers::signers::{ | ||
coins_bip39::English, LocalWallet, MnemonicBuilder, Signer, Wallet, WalletError, | ||
}; | ||
use ethers_core::k256::ecdsa::SigningKey; | ||
|
||
/// Build Wallet from Private key or Mnemonic | ||
pub fn build_wallet(value: &str) -> Result<Wallet<SigningKey>, WalletError> { | ||
value | ||
.parse::<LocalWallet>() | ||
.or(MnemonicBuilder::<English>::default().phrase(value).build()) | ||
} | ||
|
||
/// Get wallet public address to String | ||
pub fn wallet_address(wallet: &Wallet<SigningKey>) -> String { | ||
format!("{:?}", wallet.address()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
[package] | ||
name = "subfile-service" | ||
version = "0.0.1" | ||
edition = "2021" | ||
authors = ["hopeyen <[email protected]>"] | ||
rust-version = "1.72" | ||
description = "Subfile data service" | ||
readme = "README.md" | ||
license = "Apache-2.0" | ||
|
||
[[bin]] | ||
name = "subfile-service" | ||
path = "src/main.rs" | ||
|
||
[dependencies] | ||
subfile-exchange = { path = "../subfile-exchange" } | ||
alloy-sol-types = { version = "0.5.0", features = ["eip712-serde"] } | ||
alloy-primitives = { version = "0.5.0", features = ["serde"] } | ||
anyhow = "1.0" | ||
base64 = "0.21" | ||
build-info = "0.0.34" | ||
bytes = "1.0" | ||
chrono = "0.4.31" | ||
clap = { version = "4.4", features = ["cargo", "unstable-doc"] } | ||
confy = "0.5" | ||
derive-getters = "0.3.0" | ||
dotenv = "0.15" | ||
ethers = "2.0.10" | ||
ethers-core = "2.0.10" | ||
futures = { version = "0.3", features = ["compat"] } | ||
hex = "0.4.3" | ||
http = "0.2" | ||
hyper = { version = "0.14.27", features = [ "server" ]} | ||
ipfs-api-backend-hyper = "0.6" | ||
ipfs-api-prelude = "0.6" | ||
merkle-cbt = "0.3.2" | ||
rand = "0.8.4" | ||
reqwest = { version = "0.11", features = ["json", "stream", "multipart"] } | ||
rustls = "0.21.8" | ||
rustls-pemfile = "1.0.3" | ||
secp256k1 = "0.28.0" | ||
serde = { version = "1.0", features = ["derive"] } | ||
serde_json = "1.0" | ||
serde_yaml = "0.9" | ||
sha2 = "0.10.8" | ||
tap_core = { version = "0.7.0", git = "https://github.com/semiotic-ai/timeline-aggregation-protocol" } | ||
tempfile = "3.2.0" | ||
tokio = { version = "1.28", features = ["time", "sync", "macros", "test-util", "rt-multi-thread"] } | ||
tokio-retry = "0.3" | ||
toml = "0.7.4" | ||
tracing = "0.1" | ||
tracing-subscriber = { version = "0.3", features = [ | ||
"env-filter", | ||
"ansi", | ||
"fmt", | ||
"std", | ||
"json", | ||
] } | ||
|
||
[dev-dependencies] | ||
criterion = "0.5" | ||
|
||
[dev-dependencies.cargo-husky] | ||
version = "1" | ||
default-features = false | ||
features = ["precommit-hook", "run-cargo-fmt", "run-cargo-clippy"] | ||
|
||
[build-dependencies] | ||
build-info-build = "0.0.34" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
use build_info_build::DependencyDepth; | ||
|
||
fn main() { | ||
build_info_build::build_script().collect_dependencies(DependencyDepth::Depth(1)); | ||
} |
Oops, something went wrong.