mirror of
https://gitlab.com/pezkuwichain/pezkuwi-sdk.git
synced 2026-11-06 02:41:09 +00:00
- Add tags: [pezkuwi-runner] to .test-base, wasm-check, test-doc - Set CARGO_TARGET_DIR to /var/cache/cargo-target/<hash>/<job-name> on VPS2 - Hash is md5(Cargo.lock + rust-toolchain.toml) — auto-deletes old keys - Set CARGO_HOME: /root/.cargo (persistent volume, skip GitLab cache upload) - Disable GitLab registry cache for self-hosted jobs (cache: []) - Fix basic-authorship doc test: mark as no_run (requires compiled WASM at runtime)
Basic implementation of block-authoring logic.
Example
// The first step is to create a `ProposerFactory`.
let mut proposer_factory = ProposerFactory::new(client.clone(), txpool.clone(), None);
// From this factory, we create a `Proposer`.
let proposer = proposer_factory.init(
&client.header(client.chain_info().genesis_hash).unwrap().unwrap(),
);
// The proposer is created asynchronously.
let proposer = futures::executor::block_on(proposer).unwrap();
// This `Proposer` allows us to create a block proposition.
// The proposer will grab transactions from the transaction pool, and put them into the block.
let future = proposer.propose(
Default::default(),
Default::default(),
Duration::from_secs(2),
);
// We wait until the proposition is performed.
let block = futures::executor::block_on(future).unwrap();
println!("Generated block: {:?}", block.block);
License: GPL-3.0-or-later WITH Classpath-exception-2.0