This commit is contained in:
Dmitry Zuikov 2024-09-02 14:00:39 +03:00
parent 5796ea3c73
commit d9785f1930
2 changed files with 22 additions and 9 deletions

View File

@ -59,4 +59,4 @@ fixme-comments ";" "--"
(define (stage) (fixme:stage:show)) (define (stage) (fixme:stage:show))
(refchan 3WtddmcE8zzgBAPR7Bu7mKMaVMTN423NNXSPUJp3Hx42) (refchan 3WtddmcE8zzgBAPR7Bu7mKMaVMTN423NNXSPUJp3Hx42)

View File

@ -427,6 +427,27 @@ runTop forms = do
entry $ bindMatch "init" $ nil_ $ const $ do entry $ bindMatch "init" $ nil_ $ const $ do
lift init lift init
entry $ bindMatch "refchan:sync" $ nil_ $ const do
notice "running export to refchan"
rchan <- lift $ asks fixmeEnvRefChan
>>= readTVarIO
>>= orThrowUser "refchan is not set"
notice $ "1. read refchan" <+> pretty (AsBase58 rchan)
fxs <- lift $ selectFixmeThin ()
for_ fxs $ \(FixmeThin x) -> void $ runMaybeT do
h <- HM.lookup "fixme-hash" x & toMPlus
notice $ pretty h
notice "2. read issues from state"
notice "3. discover new issues"
notice "3. save merkle tree of new issues"
notice "4. post refchan tx"
pure ()
brief "initializes a new refchan" $ brief "initializes a new refchan" $
desc ( vcat [ desc ( vcat [
"Refchan is an ACL-controlled CRDT channel useful for syncronizing" "Refchan is an ACL-controlled CRDT channel useful for syncronizing"
@ -532,14 +553,6 @@ runTop forms = do
, mkSym (show $ pretty (AsBase58 refchan)) ] , mkSym (show $ pretty (AsBase58 refchan)) ]
) )
pure ()
-- notice $ yellow "2. generate refchan head"
-- notice $ yellow "3. subscribe peer to this refchan"
-- notice $ yellow "4. post refcha head"
-- notice $ yellow "5. add def-refchan ins to the config"
-- notice $ green "6. we're done"
entry $ bindMatch "set-template" $ nil_ \case entry $ bindMatch "set-template" $ nil_ \case
[SymbolVal who, SymbolVal w] -> do [SymbolVal who, SymbolVal w] -> do