fix airgapped test, func rename, update HowTo.md

This commit is contained in:
programmer10110 2020-09-21 11:48:36 +03:00
parent a910eb0fd8
commit 14f31b049f
3 changed files with 7 additions and 4 deletions

View File

@ -88,7 +88,7 @@ Start the airgapped machine:
# First print your node's address; you will be prompted to enter it.
$ ./dc4bc_cli get_address --listen_addr localhost:8080
e0d8083f8a2d18f310bfbdc9649a83664470f46053ab53c105a054b08f9eff85
$ ./dc4bc_airgapped /tmp/dc4bc_john_doe_airgapped_state
$ ./dc4bc_airgapped --db_path /tmp/dc4bc_john_doe_airgapped_state --password_expiration 10m
```
Print your address, communication public key and encryption public key and save it somewhere for later use:
```

View File

@ -4,6 +4,7 @@ import (
"bytes"
"encoding/json"
"fmt"
"os"
"sync"
"testing"
"time"
@ -101,6 +102,7 @@ func createOperation(t *testing.T, opType string, to string, req interface{}) cl
}
func TestAirgappedAllSteps(t *testing.T) {
testDir := "/tmp/airgapped_test"
nodesCount := 10
threshold := 3
participants := make([]string, nodesCount)
@ -110,7 +112,7 @@ func TestAirgappedAllSteps(t *testing.T) {
tr := &Transport{}
for i := 0; i < nodesCount; i++ {
am, err := NewAirgappedMachine(fmt.Sprintf(testDB+"%d", i))
am, err := NewAirgappedMachine(fmt.Sprintf("%s/%s-%d", testDir, testDB, i))
if err != nil {
t.Fatalf("failed to create airgapped machine: %v", err)
}
@ -126,6 +128,7 @@ func TestAirgappedAllSteps(t *testing.T) {
}
tr.nodes = append(tr.nodes, &node)
}
defer os.RemoveAll(testDir)
var initReq responses.SignatureProposalParticipantInvitationsResponse
for _, n := range tr.nodes {

View File

@ -191,7 +191,7 @@ func (t *terminal) run() error {
}
}
func (t *terminal) sensitiveDataDrop(passExpiration time.Duration) {
func (t *terminal) dropSensitiveData(passExpiration time.Duration) {
ticker := time.NewTicker(passExpiration)
for {
select {
@ -225,7 +225,7 @@ func main() {
}
t := NewTerminal(air)
go t.sensitiveDataDrop(passwordLifeDuration)
go t.dropSensitiveData(passwordLifeDuration)
if err = t.run(); err != nil {
log.Fatalf(err.Error())
}