Skip to content

Commit

Permalink
duniter/blockchain: pageNb is set downto 256000, which is sufficient …
Browse files Browse the repository at this point in the history
…for a fast execution.

duniterClient/qualitiesPrint: lists are given with equally-ranked members.
duniterClient/wotWizardPrint & duniterClient/wwViews: 'PrintDossier' is rewritten.
  • Loading branch information
gerard94 committed Jul 8, 2021
1 parent 5d8187c commit 48ec977
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 41 deletions.
Binary file modified Help/Manual.en.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion src/duniter/blockchain/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const (
secureGap = 100

// Number of pages used by UtilBTree
pageNb = 512000
pageNb = 256000

// Numbers of the places of the indexes in dBase
timePlace = iota // Index timeT
Expand Down
2 changes: 1 addition & 1 deletion src/duniter/run/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (

const (

version = "5.3.1"
version = "5.3.2"

)

Expand Down
8 changes: 7 additions & 1 deletion src/duniterClient/qualitiesPrint/qualitiesPrint.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,14 @@ var (
props, propsId := count(qual == distancesName, d.Identities)
m := len(props)
qs := make(Quals, m)
pp := -1.0
ii := 0
for i, p := range props {
qs[i] = fmt.Sprintf("%v    %05.2f    %v", i + 1, p.prop, p.id)
if p.prop != pp {
pp = p.prop
ii = i
}
qs[i] = fmt.Sprintf("%v    %05.2f    %v", ii + 1, pp, p.id)
}
qsId := make(Quals, m)
for i, p := range propsId {
Expand Down
2 changes: 1 addition & 1 deletion src/duniterClient/run/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (

const (

version = "5.3.1"
version = "5.3.2"

)

Expand Down
8 changes: 8 additions & 0 deletions src/duniterClient/static/vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ certificationsFrom Certifications From Members
56certificationsTo Informations: Certifications To Members
certificationsTo Certifications To Members
34certLim Limits: Certifications Limits Dates by Dates
certsNb ^0 certifications
Client Client Version:
Computation_duration Computation Duration
Day Day
day day(s)
Delay Delay (days)
Distance Distance Rule
distanceRule Distance Rule: ^0%
20distances Properties: Distances (rule)
distances Distances (rule)
Distribution Distribution
Expand Down Expand Up @@ -105,6 +107,7 @@ MembersFluxPM Flux of Members per Member
402membersLossT Evolution: Losses (list)
MembersNb Number of members
33memLim Limits: Memberships Limits Date by Date
minApplicationDate Wait at least two months between two applications
minute minute(s)
Missing Excluded Identities - Needing a new application
52missingIdentities Informations: List of Excluded Identities - Needing a new application
Expand Down Expand Up @@ -133,6 +136,7 @@ Pubkey Public Key
21qualities Properties: Qualities
qualities Qualities
Quality Quality
requiredCertsNb ^0 certifications, at least ^1 needed for distance rule
Revoked Revoked
51revokedIdentities Informations: List of Revoked Identities
RevokedM Revoked Identities
Expand Down Expand Up @@ -187,12 +191,14 @@ certificationsFrom Certifications depuis les membres
56certificationsTo Informations : Certifications vers les membres
certificationsTo Certifications vers les membres
34certLim Limites : Limites des certifications par date
certsNb ^0 certifications
Client Version client :
Computation_duration Durée du calcul
Day Jour
day jour(s)
Delay Durée (jours)
Distance Règle de distance
distanceRule Règle de distance: ^0%
20distances Propriétés : Distances (règle de)
distances Distances (règle de)
Distribution Distribution
Expand Down Expand Up @@ -253,6 +259,7 @@ MembersFluxPM Flux de membres par membre
402membersLossT Evolution : Pertes (liste)
MembersNb Nombre de membres
33memLim Limites : Limites des adhésions par date
minApplicationDate Au moins deux mois d'attente entre deux adhésions
minute minute(s)
Missing Exclu(e)s en attente de réadhésion
52missingIdentities Informations : Liste des identités exclues en attente de réadhésion
Expand Down Expand Up @@ -281,6 +288,7 @@ Pubkey Clef publique
21qualities Propriétés : Qualités
qualities Qualités
Quality Qualité
requiredCertsNb ^0 certifications, ^1 au moins nécessaires pour la règle de distance
Revoked Révoqué(e)
51revokedIdentities Informations : Liste des identités révoquées
RevokedM Identités révoquées
Expand Down
2 changes: 1 addition & 1 deletion src/duniterClient/web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func manageIndex (name string, temp *template.Template, _ *http.Request, w http.
}

j := GS.Send(nil, versionDoc); M.Assert(j != nil, 100)
err := temp.ExecuteTemplate(w, name, &output{VersionS: j.(*J.Object).Fields[0].Value.(*J.JsonVal).Json.(*J.Object).Fields[0].Value.(*J.String).S,VersionC: Version, P: packagesD})
err := temp.ExecuteTemplate(w, name, &output{VersionS: j.(*J.Object).Fields[0].Value.(*J.JsonVal).Json.(*J.Object).Fields[0].Value.(*J.String).S, VersionC: Version, P: packagesD})
M.Assert(err == nil, err, 101)
}

Expand Down
40 changes: 23 additions & 17 deletions src/duniterClient/wotWizardPrint/wotWizardPrint.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ package wotWizardPrint
import (

BA "duniterClient/basicPrint"
G "util/graphQL"
GS "duniterClient/gqlSender"
J "util/json"
M "util/misc"
SM "util/strMapping"
W "duniterClient/web"
"fmt"
"net/http"
S "strconv"
"strings"
"html/template"

Expand Down Expand Up @@ -114,13 +114,13 @@ const (
{{if .Second}}
<br>
{{.Second}}
<blockquote>
{{range .Certs}}
{{.}}
<br>
{{end}}
</blockquote>
{{end}}
<blockquote>
{{range .Certs}}
{{.}}
<br>
{{end}}
</blockquote>
</p>
{{end}}
<p>
Expand Down Expand Up @@ -314,9 +314,8 @@ type (

var (

wwFileDoc,
wwPermsDoc *G.Document
voidJson J.Json
wwFileDoc = GS.ExtractDocument(queryWWFile)
wwPermsDoc = GS.ExtractDocument(queryWWPerms)

)

Expand Down Expand Up @@ -353,15 +352,24 @@ func printFile (f *File, lang *SM.Lang) *DispF {
} //PrintCerts

//PrintDossier
fi := fmt.Sprint(d.Main_certifs, " ", d.Newcomer.Uid, " (", BA.Ts2s(d.Date, lang), " ", BA.Ts2s(d.MinDate, lang), ")")
fi := fmt.Sprint(d.Newcomer.Uid, " ", BA.Ts2s(d.Date, lang), " (→ ", BA.Ts2s(d.Expires_on, lang), ") ", lang.Map("#duniterClient:distanceRule", S.Itoa(int(d.Newcomer.Distance.Value))))
w := new(strings.Builder)
fmt.Fprint(w, "(→ ", BA.Ts2s(d.Expires_on, lang), ") (", int(d.Newcomer.Distance.Value), "%) (")
if d.Main_certifs >= sigQty {
fmt.Fprint(w, lang.Map("#duniterClient:requiredCertsNb", S.Itoa(len(d.Certifications)), S.Itoa(d.Main_certifs)))
} else {
fmt.Fprint(w, lang.Map("#duniterClient:certsNb", S.Itoa(len(d.Certifications))))
}
if d.Date == d.MinDate && d.Date >= f.Data.Now.Bct {
fmt.Fprint(w, ". ", lang.Map("#duniterClient:minApplicationDate"))
}
if d.Newcomer.Distance.Dist_ok && d.Main_certifs >= sigQty {
fmt.Fprint(w, lang.Map("#duniterClient:OK"))
fmt.Fprint(w, ". ", lang.Map("#duniterClient:OK"))
} else {
fmt.Fprint(w, lang.Map("#duniterClient:KO"))
fmt.Fprint(w, ". ", lang.Map("#duniterClient:KO"))
if !d.Newcomer.Distance.Dist_ok && d.Main_certifs >= sigQty {
fmt.Fprint(w, " (", lang.Map("#duniterClient:Distance"), ")")
}
}
fmt.Fprint(w, ") |")
sd := w.String()
return &DossCertT{First: fi, Second: sd, Certs: PrintCerts(d.Certifications)}
} //PrintDossier
Expand Down Expand Up @@ -464,8 +472,6 @@ func endP (name string, temp *template.Template, _ *http.Request, w http.Respons
} //endP

func init() {
wwFileDoc = GS.ExtractDocument(queryWWFile)
wwPermsDoc = GS.ExtractDocument(queryWWPerms)
W.RegisterPackage(wwFileName, htmlWWFile, endF, true)
W.RegisterPackage(wwPermsName, htmlWWPerms, endP, true)
} //init
25 changes: 15 additions & 10 deletions src/duniterClient/wwViews/wwViews.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
W "duniterClient/web"
"fmt"
"net/http"
S "strconv"
"strings"
"html/template"

Expand Down Expand Up @@ -107,7 +108,6 @@ const (
from {
uid
}
pending
expires_on
}
}
Expand Down Expand Up @@ -174,13 +174,13 @@ const (
{{if .Second}}
<br>
{{.Second}}
<blockquote>
{{range .Certs}}
{{.}}
<br>
{{end}}
</blockquote>
{{end}}
<blockquote>
{{range .Certs}}
{{.}}
<br>
{{end}}
</blockquote>
</p>
{{end}}
{{end}}
Expand Down Expand Up @@ -420,8 +420,13 @@ func printMeta (cds Certifs_DossiersT, lang *SM.Lang) DossCertsT {
} //PrintCerts

//PrintDossier
fi := fmt.Sprint(d.Main_certifs, " ", d.Newcomer.Uid, " (", BA.Ts2s(d.Date, lang), " ≥ ", BA.Ts2s(d.MinDate, lang), ")")
sd := fmt.Sprint("(→ ", BA.Ts2s(d.Expires_on, lang), ") (", int(d.Newcomer.Distance.Value), "%) |")
fi := fmt.Sprint(d.Newcomer.Uid, " ", BA.Ts2s(d.Date, lang), " (→ ", BA.Ts2s(d.Expires_on, lang), ") ", lang.Map("#duniterClient:distanceRule", S.Itoa(int(d.Newcomer.Distance.Value))))
w := new(strings.Builder)
fmt.Fprint(w, lang.Map("#duniterClient:requiredCertsNb", S.Itoa(len(d.Certifications)), S.Itoa(d.Main_certifs)))
if d.Date == d.MinDate {
fmt.Fprint(w, ". ", lang.Map("#duniterClient:minApplicationDate"))
}
sd := w.String()
return &DossCertT{First: fi, Second: sd, Certs: PrintCerts(d.Certifications)}
} //PrintDossier

Expand All @@ -433,7 +438,7 @@ func printMeta (cds Certifs_DossiersT, lang *SM.Lang) DossCertsT {
return &DossCertT{First: PrintCertif(cd.DatedCertification), Second: ""}
} //PrintCertOrDoss

//printFile
//printMeta
dcs := make(DossCertsT, len(cds))
for i, cd := range cds {
dcs[i] = *PrintCertOrDoss(&cd)
Expand Down
12 changes: 3 additions & 9 deletions src/util/gbTree/gbTree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ import (
)

const (

maxInt = 0x7FFFFFFF

nbPages = 32000

)

Expand Down Expand Up @@ -237,7 +239,6 @@ func TestG1 (tt *testing.T) {
taMax = 1000

nomBase = "BaseL2.dat"
nbPages = 2000

)
fmt.Println("TestG1, AllocateSize")
Expand Down Expand Up @@ -294,7 +295,6 @@ func TestG2 (tt *testing.T) {
taMax = 1000

nomBase = "BaseLL2.dat"
nbPages = 2000

)

Expand Down Expand Up @@ -354,7 +354,6 @@ func TestG3 (tt *testing.T) {
gen.Randomize(3)
const (
nomBase = "BaseC2.dat"
nbPages = 2000
maxCles = 100
nbCles = 20000
)
Expand Down Expand Up @@ -429,7 +428,6 @@ func TestG4 (tt *testing.T) {
gen.Randomize(4)
const (
nomBase = "BaseI2.dat"
nbPages = 2000
nbCles = 20000
)
Fac.CloseBase(nomBase)
Expand Down Expand Up @@ -487,7 +485,6 @@ func TestG5 (tt *testing.T) {
taMin = 1
taMax = 100
nomBase = "BaseM2.dat"
nbPages = 2000
)
t := L.New()
Fac.CloseBase(nomBase)
Expand Down Expand Up @@ -553,7 +550,6 @@ func TestG6 (tt *testing.T) {
taMin = 1
taMax = 100
nomBase = "BaseN2.dat"
nbPages = 2000
)
t := L.New()
Fac.CloseBase(nomBase)
Expand Down Expand Up @@ -611,7 +607,6 @@ func TestG7 (tt *testing.T) {
gen.Randomize(7)
const (
nomBase = "BaseJ2.dat"
nbPages = 2000
nbCles = 20000
)
Fac.CloseBase(nomBase)
Expand Down Expand Up @@ -665,7 +660,6 @@ func TestG8 (tt *testing.T) {
taMin = 1
taMax = 100
nomBase = "BaseCC2.dat"
nbPages = 2000
minChar = 'a'
nbChar = 26
pAlpha = 0.8
Expand Down

0 comments on commit 48ec977

Please sign in to comment.