forked from FactomProject/FactomCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.go
More file actions
46 lines (34 loc) · 1016 Bytes
/
data.go
File metadata and controls
46 lines (34 loc) · 1016 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package main
import (
"fmt"
"time"
"strconv"
"github.com/FactomProject/FactomCode/notaryapi"
)
func doEntry(cid *notaryapi.Hash, data []byte) {
fmt.Println("doEntry: ", string(data))
entry := new (notaryapi.Entry)
var hash = notaryapi.Hash {Bytes: cid.Bytes,}
entry.ChainID = hash
entry.Data = data
_, err := processNewEntry(entry)
if err != nil {
fmt.Println(err.Error())
}
}
func doEntries() {
fmt.Println("** chainmap.len=", len(chainIDMap))
chash := make([]*notaryapi.Hash, 0, len(chainIDMap))
for _, v := range chainIDMap {
chash = append(chash, v.ChainID)
if v.ChainID == nil {fmt.Println("chainid is nil")}
}
for i:=0; i<10; i++ { //10 round of 2 minutes cycle to generate FB
for j:=0; j<5; j++ { //5 entries generated per minute
doEntry(chash[0], []byte("Apple." + strconv.Itoa(i) + "." + strconv.Itoa(j)))
doEntry(chash[1], []byte("Banana." + strconv.Itoa(i) + "." + strconv.Itoa(j)))
time.Sleep(12 * time.Second)
}
}
time.Sleep(15 * time.Minute)
}