Sigil documentation
ReferenceRust referencesigil-cli

sigil-cli · genesis_ceremony

Source declarations, signatures and documentation for genesis_ceremony.

Source: sigil/node/sigil-cli/src/genesis_ceremony.rs. SHA-256: 7890ff2a602cad285c769a26003ac14eb339e7d853292d1591af56c5348ec72e.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

genesis_ceremony::GenesisCeremonyError

#[derive(Debug, thiserror::Error)]
pub enum GenesisCeremonyError {
    #[error("missing CSV header")]
    MissingCsvHeader,
    #[error("missing field {field} on CSV line {line}")]
    MissingField { line: usize, field: &'static str },
    #[error("invalid generation on CSV line {line}: {value}")]
    InvalidGeneration { line: usize, value: String },
    #[error("invalid stake on CSV line {line}: {value}")]
    InvalidStake { line: usize, value: String },
    #[error("invalid validator mode on CSV line {line}: {value}")]
    InvalidMode { line: usize, value: String },
    #[error("claim chain_id {actual} does not match expected {expected}")]
    ClaimChainIdMismatch { expected: String, actual: String },
    #[error("duplicate validator DID in ceremony claims: {0}")]
    DuplicateValidatorDid(String),
    #[error("invalid hex field {field}: {reason}")]
    InvalidHex { field: &'static str, reason: String },
    #[error("invalid validator possession signature for {did}: {field}")]
    InvalidSignature { did: String, field: &'static str },
    #[error("duplicate commit/reveal id: {0}")]
    DuplicateCommitmentId(String),
    #[error("missing reveal for commitment id: {0}")]
    MissingReveal(String),
    #[error("unexpected reveal without commitment id: {0}")]
    UnexpectedReveal(String),
    #[error("commitment mismatch for id {id}: expected {expected}, got {actual}")]
    CommitmentMismatch {
        id: String,
        expected: String,
        actual: String,
    },
    #[error("invalid signature threshold {threshold} for {signer_count} signer(s)")]
    InvalidThreshold {
        threshold: usize,
        signer_count: usize,
    },
    #[error("duplicate ceremony signer id: {0}")]
    DuplicateSignerId(String),
    #[error("duplicate genesis signature from signer id: {0}")]
    DuplicateGenesisSignature(String),
    #[error("genesis signature references unknown signer id: {0}")]
    UnknownGenesisSigner(String),
    #[error(
        "genesis signature bundle hash {bundle_hash} does not match genesis hash {genesis_hash}"
    )]
    GenesisSignatureHashMismatch {
        bundle_hash: String,
        genesis_hash: String,
    },
    #[error("genesis signature threshold not met: valid {valid}, required {threshold}")]
    GenesisSignatureThresholdNotMet { valid: usize, threshold: usize },
    #[error("genesis validation failed: {0}")]
    GenesisValidation(#[from] GenesisValidationError),
    #[error("invalid Vigil event source kind: {0}")]
    InvalidVigilSourceKind(String),
    #[error("system contract {id} code hash mismatch: expected {expected}, got {actual}")]
    SystemContractHashMismatch {
        id: String,
        expected: String,
        actual: String,
    },
    #[error("unknown live system contract id in registry: {0}")]
    UnknownSystemContractId(String),
    #[error("genesis serialization failed: {0}")]
    GenesisSerialization(#[from] sigil_core::error::CoreError),
    #[error("I/O error: {0}")]
    Io(#[from] std::io::Error),
    #[error("JSON error: {0}")]
    Json(#[from] serde_json::Error),
}

Source line: 22.

genesis_ceremony::CeremonyValidator

#[derive(Debug, Clone, PartialEq)]
pub struct CeremonyValidator {
pub validator: GenesisValidator,
pub operator: String,
pub jurisdiction: String,
pub hmr: String
}

Source line: 94.

genesis_ceremony::CeremonyAllocation

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct CeremonyAllocation {
pub did: String,
pub amount: u64
}

Source line: 102.

genesis_ceremony::UnsignedValidatorClaim

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct UnsignedValidatorClaim {
pub chain_id: String,
pub did: String,
pub human_root_did: String,
pub generation: u32,
pub stake: u64,
pub mode: String,
pub consensus_pubkey: String,
pub network_pubkey: String,
pub operator: String,
pub jurisdiction: String,
pub hmr: String
}

Source line: 108.

genesis_ceremony::SignedValidatorClaim

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct SignedValidatorClaim {
pub claim: UnsignedValidatorClaim,
pub consensus_signature: String,
pub network_signature: String
}

Source line: 123.

genesis_ceremony::CommitmentRecord

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct CommitmentRecord {
pub id: String,
pub commitment_hash: String
}

Source line: 130.

genesis_ceremony::RevealRecord

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct RevealRecord {
pub id: String,
pub value: serde_json::Value,
pub salt_hex: String
}

Source line: 136.

genesis_ceremony::CeremonySigner

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct CeremonySigner {
pub signer_id: String,
pub did: String,
pub public_key: String
}

Source line: 143.

genesis_ceremony::GenesisHashSignature

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct GenesisHashSignature {
pub signer_id: String,
pub signature: String
}

Source line: 150.

genesis_ceremony::GenesisSignatureBundle

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct GenesisSignatureBundle {
pub chain_id: String,
pub genesis_hash: String,
pub threshold: usize,
pub signers: Vec<CeremonySigner>,
pub signatures: Vec<GenesisHashSignature>
}

Source line: 156.

genesis_ceremony::CeremonyInputs

#[derive(Debug, Clone)]
pub struct CeremonyInputs {
pub chain_id: String,
pub genesis_time: u64,
pub validators: Vec<CeremonyValidator>,
pub allocations: Vec<CeremonyAllocation>,
pub challenge_resolver_dids: Vec<String>,
pub proposer_dids: Vec<String>,
pub beacon_dids: Vec<String>,
pub system_contracts_activation_height: Option<u64>,
pub system_contract_artifact_root: Option<PathBuf>,
pub vigils_params: Option<VigilsParams>
}

Source line: 165.

genesis_ceremony::CeremonyTranscript

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CeremonyTranscript {
pub chain_id: String,
pub genesis_hash: String,
pub validator_count: usize,
pub allocation_count: usize,
pub challenge_resolver_dids: Vec<String>,
pub proposer_dids: Vec<String>,
pub beacon_dids: Vec<String>,
pub contract_params: Option<ContractParams>,
pub vigils_params: Option<VigilsParams>,
pub note: String
}

Source line: 179.

genesis_ceremony::parse_validator_roster_csv

pub fn parse_validator_roster_csv(
    csv: &str,
) -> Result<Vec<CeremonyValidator>, GenesisCeremonyError>;

Source line: 192.

genesis_ceremony::assemble_genesis_from_inputs

pub fn assemble_genesis_from_inputs(
    inputs: CeremonyInputs,
) -> Result<GenesisConfig, GenesisCeremonyError>;

Source line: 271.

genesis_ceremony::system_reference_contracts_from_registry

pub fn system_reference_contracts_from_registry(
    artifact_root: &Path,
) -> Result<Vec<GenesisReferenceContract>, GenesisCeremonyError>;

Source line: 320.

genesis_ceremony::parse_vigil_source_kinds

pub fn parse_vigil_source_kinds(raw: &str) -> Result<Vec<EventSourceKind>, GenesisCeremonyError>;

Source line: 415.

genesis_ceremony::genesis_hash_hex

pub fn genesis_hash_hex(genesis: &GenesisConfig) -> Result<String, GenesisCeremonyError>;

Source line: 455.

genesis_ceremony::validator_claim_signing_bytes

pub fn validator_claim_signing_bytes(
    claim: &UnsignedValidatorClaim,
) -> Result<Vec<u8>, GenesisCeremonyError>;

Source line: 460.

genesis_ceremony::verify_signed_validator_claims

pub fn verify_signed_validator_claims(
    claims: &[SignedValidatorClaim],
    expected_chain_id: &str,
) -> Result<Vec<CeremonyValidator>, GenesisCeremonyError>;

Source line: 472.

genesis_ceremony::validator_roster_csv_from_claims

pub fn validator_roster_csv_from_claims(validators: &[CeremonyValidator]) -> String;

Source line: 526.

genesis_ceremony::read_signed_validator_claims

pub fn read_signed_validator_claims(
    path: &Path,
) -> Result<Vec<SignedValidatorClaim>, GenesisCeremonyError>;

Source line: 550.

genesis_ceremony::read_commitments

pub fn read_commitments(path: &Path) -> Result<Vec<CommitmentRecord>, GenesisCeremonyError>;

Source line: 557.

genesis_ceremony::read_reveals

pub fn read_reveals(path: &Path) -> Result<Vec<RevealRecord>, GenesisCeremonyError>;

Source line: 562.

genesis_ceremony::read_genesis_signature_bundle

pub fn read_genesis_signature_bundle(
    path: &Path,
) -> Result<GenesisSignatureBundle, GenesisCeremonyError>;

Source line: 567.

genesis_ceremony::genesis_hash_signing_bytes

pub fn genesis_hash_signing_bytes(
    chain_id: &str,
    genesis_hash: &str,
) -> Result<Vec<u8>, GenesisCeremonyError>;

Source line: 574.

genesis_ceremony::normalized_genesis_hash_hex

pub fn normalized_genesis_hash_hex(genesis_hash: &str) -> Result<String, GenesisCeremonyError>;

Source line: 591.

genesis_ceremony::verify_genesis_signature_bundle_for_hash

pub fn verify_genesis_signature_bundle_for_hash(
    bundle: &GenesisSignatureBundle,
    expected_genesis_hash: &str,
) -> Result<usize, GenesisCeremonyError>;

Source line: 596.

genesis_ceremony::verify_genesis_signature_bundle

pub fn verify_genesis_signature_bundle(
    bundle: &GenesisSignatureBundle,
) -> Result<usize, GenesisCeremonyError>;

Source line: 612.

genesis_ceremony::commitment_hash_hex

pub fn commitment_hash_hex(
    id: &str,
    value: &serde_json::Value,
    salt_hex: &str,
) -> Result<String, GenesisCeremonyError>;

Source line: 668.

genesis_ceremony::verify_commit_reveal

pub fn verify_commit_reveal(
    commitments: &[CommitmentRecord],
    reveals: &[RevealRecord],
) -> Result<(), GenesisCeremonyError>;

Source line: 685.

genesis_ceremony::write_collect_template

pub fn write_collect_template(path: &Path) -> Result<(), GenesisCeremonyError>;

Source line: 730.

genesis_ceremony::read_allocations

pub fn read_allocations(path: &Path) -> Result<Vec<CeremonyAllocation>, GenesisCeremonyError>;

Source line: 736.

genesis_ceremony::transcript_for_genesis

pub fn transcript_for_genesis(
    genesis: &GenesisConfig,
    allocation_count: usize,
    challenge_resolver_dids: Vec<String>,
    proposer_dids: Vec<String>,
    beacon_dids: Vec<String>,
) -> Result<CeremonyTranscript, GenesisCeremonyError>;

Source line: 767.

On this page