cryptape / bft-rs Goto Github PK
View Code? Open in Web Editor NEWAn efficient and stable Rust library of BFT protocol for distributed system.
License: MIT License
An efficient and stable Rust library of BFT protocol for distributed system.
License: MIT License
pub fn send_status(&mut self, status: BftMsg) -> Result<()>{ match status { BftMsg::Status(s) => Ok(s), _ => Err(BftError::MsgTypeErr), } .and_then(|s| { if s.height >= self.height { self.height = s.height + 1; } self.sender .send(BftMsg::Status(s)) .map_err(|_| BftError::SendMsgErr) }) }
If the sender occurs an error, the height of BftActuator may different from Bft. Why not straightly expose Bft's height?
Hello,
I'd like to get in touch with @KaoImin . I was wondering if there's any contact information that can be provided.
Please email at [email protected]
Best,
Andres.
Why should I learn how to use the channel?
Recommend the API to be changed to the following.
pub trait BFT {
fn set_proposal(p: Proposal) -> BFTResult<bool, Error>;
fn set_vote(v: Vote) -> BFTResult<bool, Error>;
fn start();
}
pub trait BFTProvider: Send + Sync {
fn package_proposal(height: u64) -> BFTResult<Proposal, Error>;
fn validate_proposal(p: Prposal) -> BFTResult<bool, Error>;
fn commit(cm: CommitBlock) -> BFTResult<(), Error>;
fn udpate_validate(height: u64) -> BFTResult<Vec<Validate>, Error>;
// Broadcast blocks or votes can be split into two function.
fn broadcast() -> BFTResult<(), Error>;
}
let provider = BFTProvider::new();
let bft = BFT::new(provider, signer);
bft.start();
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.