hello everyone :
i have spent a lot of time to read juno code and run the test in my computer
i am trying to implement persistence feature myself, and this is my idea and plan:
1. change Seq LogEntry to Seq (LogIndex, LogEntry), all unapplyed command stay in memory, and all applied command save to database.
2. declare PLogEntry , means persisntent LogEntry:
-- 只保存已经确认并已apply的LogEntry
share [mkPersist sqlSettings, mkMigrate "migrateBlockchain"] [persistLowerCase|
PLogEntry
index Int
term Int
clientId ByteString
requestId ByteString
commandEntry ByteString
commandSig ByteString
quorum_votes ByteString
sig ByteString
hash ByteString
commandResult ByteString
deriving Show
|]
3. when server start , i need to load latest logentry to memory(LastAppliedIndex, LastCommitIndex...)
4. when a command is confirmed and applied, i need to write it to the database
of course it need modify a lot of code ,
is this idea works? or any better idea?
by the way , can i join the dev team and do some develop work? and how?
hello everyone : i have spent a lot of time to read juno code and run the test in my computer i am trying to implement persistence feature myself, and this is my idea and plan: