Skip to content

Commit

Permalink
update node
Browse files Browse the repository at this point in the history
  • Loading branch information
AstaFrode committed Dec 29, 2023
1 parent 7b774ec commit 3c4694a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions node/filetag.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ func (n *Node) serviceTag(ch chan<- bool) {
}
}
}
n.Stag("info", fmt.Sprintf("[Cache.Has(%s, %s)", fid, Cach_prefix_Tag+fragmentHash))
continue
}

Expand Down Expand Up @@ -239,9 +240,11 @@ func (n *Node) serviceTag(ch chan<- bool) {
}
tagSigInfo.Miner = types.AccountID(n.GetSignatureAccPulickey())
tagSigInfo.TeeAcc = types.AccountID(teeAccountID)
n.Stag("info", fmt.Sprintf("Will report tag: %s.%s", fid, fragmentHash))
for j := 0; j < 10; j++ {
txhash, err = n.ReportTagCalculated(teeSign, tagSigInfo)
if err != nil || txhash == "" {
n.Stag("err", fmt.Sprintf("ReportTagCalculated[%s.%s]: [%s] %v", fid, fragmentHash, txhash, err))
time.Sleep(pattern.BlockInterval)
fmeta, err := n.QueryFileMetadata(fid)
if err == nil {
Expand Down Expand Up @@ -279,6 +282,7 @@ func (n *Node) serviceTag(ch chan<- bool) {
time.Sleep(time.Minute)
continue
}
n.Stag("info", fmt.Sprintf("ReportTagCalculated[%s.%s]: [%s]", fid, fragmentHash, txhash))
blocknumber, err = n.QueryBlockHeight(txhash)
if err != nil {
n.Stag("err", fmt.Sprintf("[QueryBlockHeight(%s)] %v", txhash, err))
Expand All @@ -289,6 +293,7 @@ func (n *Node) serviceTag(ch chan<- bool) {
n.Stag("err", fmt.Sprintf("[Cache.Put(%s, %s)] %v", Cach_prefix_Tag+fragmentHash, fmt.Sprintf("%d", blocknumber), err))
break
}
n.Stag("info", fmt.Sprintf("Cach.Put[%s.%s]: [%d]", fid, fragmentHash, blocknumber))
}
break
}
Expand Down
3 changes: 2 additions & 1 deletion node/serviceChallenge.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ func (n *Node) calcSigma(
if !isChall {
continue
}
n.Schal("info", fmt.Sprintf("chall go on: %s.%s", roothash, fragmentHash))
} else {
n.Schal("info", fmt.Sprintf("calc file: %s.%s", roothash, fragmentHash))
block, err := n.Get([]byte(Cach_prefix_Tag + fragmentHash))
Expand All @@ -340,7 +341,7 @@ func (n *Node) calcSigma(
return names, us, mus, sigma, usig, err
}
}

n.Schal("info", fmt.Sprintf("[%s] Read tag file: %s", roothash, serviceTagPath))
var tag = &TagFileType{}
err = json.Unmarshal(buf, tag)
if err != nil {
Expand Down

0 comments on commit 3c4694a

Please sign in to comment.