mod.rs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /// Block definition
  2. pub mod block;
  3. pub use block::{Block, BlockInfo, BlockProposal, ProposalChain};
  4. /// Consensus metadata
  5. pub mod metadata;
  6. pub use metadata::{Metadata, StreamletMetadata};
  7. /// Consensus participant
  8. pub mod participant;
  9. pub use participant::Participant;
  10. /// Consensus vote
  11. pub mod vote;
  12. pub use vote::Vote;
  13. /// Consensus state
  14. pub mod state;
  15. pub use state::{ValidatorState, ValidatorStatePtr};
  16. /// Utility functions and types
  17. use crate::util::time::Timestamp;
  18. /// P2P net protocols
  19. pub mod proto;
  20. /// async tasks to utilize the protocols
  21. pub mod task;
  22. use lazy_static::lazy_static;
  23. lazy_static! {
  24. /// Genesis hash for the mainnet chain
  25. pub static ref MAINNET_GENESIS_HASH_BYTES: blake3::Hash = blake3::hash(b"darkfi_mainnet");
  26. /// Genesis timestamp for the mainnet chain
  27. pub static ref MAINNET_GENESIS_TIMESTAMP: Timestamp = Timestamp(1650887115);
  28. /// Genesis hash for the testnet chain
  29. pub static ref TESTNET_GENESIS_HASH_BYTES: blake3::Hash = blake3::hash(b"darkfi_testnet");
  30. /// Genesis timestamp for the testnet chain
  31. pub static ref TESTNET_GENESIS_TIMESTAMP: Timestamp = Timestamp(1650887115);
  32. /// Block version number
  33. pub static ref BLOCK_VERSION: u8 = 1;
  34. }