Download orchestrator/gitbucket/external/src/block.rs from Snapkitty/sov-kernel-monster: direct link, hf CLI and curl.
- Browser
- Download file 498 Bytes
-
https://huggingface.co/Snapkitty/sov-kernel-monster/resolve/main/orchestrator/gitbucket/external/src/block.rs
- Command line
-
hf download hf://Snapkitty/sov-kernel-monster/orchestrator/gitbucket/external/src/block.rs
-
curl -L -o block.rs https://huggingface.co/Snapkitty/sov-kernel-monster/resolve/main/orchestrator/gitbucket/external/src/block.rs
498 Bytes
| //! Block | |
| use serde::{Deserialize, Serialize}; | |
| pub struct Block { | |
| pub height: u64, | |
| pub hash: String, | |
| pub prev_hash: String, | |
| pub data: String, | |
| pub nonce: u64, | |
| } | |
| impl Block { | |
| pub fn genesis() -> Self { | |
| use sha2::{Sha256, Digest}; | |
| let hash = format!("{:x}", Sha256::digest(b"GENESIS")); | |
| Self { height: 0, hash: hash.clone(), prev_hash: hash, data: String::new(), nonce: 0 } | |
| } | |
| } | |