mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-21 08:35:40 +00:00
prepping for releasing rc6 (#6922)
* Bump version * update test-utils crates to be ready for publishing * adding changelog * Adding automaticly generated READMEs * fixing versions * another version mishap
This commit is contained in:
committed by
GitHub
parent
6f59c95c89
commit
2416aa7999
@@ -0,0 +1,32 @@
|
||||
Basic implementation of block-authoring logic.
|
||||
|
||||
# Example
|
||||
|
||||
```rust
|
||||
// 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(&BlockId::number(0)).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),
|
||||
RecordProof::Yes,
|
||||
);
|
||||
|
||||
// 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
|
||||
Reference in New Issue
Block a user