-
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.
- Soon each node will serve the dapp individually the canonical dapp url will resolve to a random node serving the dapp.
- Loading branch information
1 parent
334248d
commit 9fd1c27
Showing
19 changed files
with
330 additions
and
35 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,6 +1,23 @@ | ||
cargo-features = ["edition2024"] | ||
|
||
[package] | ||
name = "kimlikdao-node" | ||
version = "0.1.0" | ||
edition = "2021" | ||
version = "0.0.1" | ||
edition = "2024" | ||
|
||
[[bin]] | ||
name = "crate_server" | ||
path = "rust/crate_server/main.rs" | ||
|
||
[dependencies] | ||
hyper = { version = "0.14.12", features = ["http1", "server", "tcp"] } | ||
lazy_static = "1.5.0" | ||
phf = { version = "0.11.2", features = ["macros"] } | ||
serde = { version = "1.0", features = ["derive"] } | ||
serde_yaml = "0.9" | ||
tokio = { version = "1", features = ["full"] } | ||
|
||
[profile.release] | ||
opt-level = 3 | ||
lto = "fat" | ||
codegen-units = 1 |
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
Empty file.
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import ipfs from '@kimlikdao/lib/node/ipfs'; | ||
import ipfs from "/lib/node/ipfs"; | ||
|
||
/** | ||
* @param {!Request} req | ||
|
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,10 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"paths": { | ||
"/*": [ | ||
"*" | ||
] | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -24,5 +24,4 @@ const LightNodeWorker = { | |
} | ||
}; | ||
|
||
globalThis["LightNodeWorker"] = LightNodeWorker; | ||
export default LightNodeWorker; |
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
6 changes: 3 additions & 3 deletions
6
mina/test/MerkleTree.compiled-test.js → mina/test/MerkleTree.test.js
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,55 @@ | ||
use serde::Deserialize; | ||
use std::collections::HashMap; | ||
use std::fs; | ||
use std::fs::File; | ||
|
||
#[derive(Debug, Deserialize)] | ||
struct CrateRecipe { | ||
dizin: String, | ||
sayfalar: Vec<Sayfa>, | ||
} | ||
|
||
#[derive(Debug, Deserialize)] | ||
struct Sayfa { | ||
tr: String, | ||
en: String, | ||
} | ||
|
||
pub fn load(path: &str) -> HashMap<String, &'static [u8]> { | ||
let mut files = HashMap::new(); | ||
for entry in fs::read_dir(path).unwrap() { | ||
let entry = entry.unwrap(); | ||
let path = entry.path(); | ||
if path.is_file() { | ||
let filename = path.file_name().unwrap().to_string_lossy().to_string(); | ||
let content: &'static [u8] = Box::leak(fs::read(&path).unwrap().into_boxed_slice()); | ||
files.insert(filename, content); | ||
} | ||
} | ||
let file = File::open("./crate/crate.yaml").unwrap(); | ||
let recipe: CrateRecipe = serde_yaml::from_reader(file).unwrap(); | ||
|
||
let mut insert_alias = |alias: &str, key_base: &str, lang: &str, ext: &str| { | ||
if let Some(&content) = files.get(&format!("{}-{}.html{}", key_base, lang, ext)) { | ||
files.insert(format!("{}{}", alias, ext), content); | ||
} | ||
}; | ||
|
||
insert_alias("?en", &recipe.dizin, "en", ""); | ||
insert_alias("?en", &recipe.dizin, "en", ".br"); | ||
insert_alias("?en", &recipe.dizin, "en", ".gz"); | ||
insert_alias("?tr", &recipe.dizin, "tr", ""); | ||
insert_alias("?tr", &recipe.dizin, "tr", ".br"); | ||
insert_alias("?tr", &recipe.dizin, "tr", ".gz"); | ||
|
||
for sayfa in &recipe.sayfalar { | ||
insert_alias(&sayfa.en, &sayfa.tr, "en", ""); | ||
insert_alias(&sayfa.tr, &sayfa.tr, "tr", ""); | ||
insert_alias(&sayfa.en, &sayfa.tr, "en", ".br"); | ||
insert_alias(&sayfa.tr, &sayfa.tr, "tr", ".br"); | ||
insert_alias(&sayfa.en, &sayfa.tr, "en", ".gz"); | ||
insert_alias(&sayfa.tr, &sayfa.tr, "tr", ".gz"); | ||
} | ||
|
||
files | ||
} |
Oops, something went wrong.