id: 2IZNP...UYGYA
exchpub: WFLMZ...B7NHA
signpub: GTGXG...IE3OA
- noisepub: EQAZM...J3NBA
sendmail: [/usr/sbin/sendmail]
freq: /home/bob/pub
via: [alice]
@table @strong
@item noisepub
-Must be present, but can be dummy (only zeros) if no online
-communication using @ref{Sync, synchronization protocol} will be used.
+If present, then node can be online called using @ref{Sync,
+synchronization protocol}. Contains authentication public key.
@item sendmail
An array containing path to executable and its command line arguments
Id string
ExchPub string
SignPub string
- NoisePub string
+ NoisePub *string `noisepub,omitempty`
Sendmail []string
Incoming *string `incoming,omitempty`
Freq *string `freq,omitempty`
return nil, errors.New("Invalid signPub size")
}
- noisePub, err := FromBase32(yml.NoisePub)
- if err != nil {
- return nil, err
- }
- if len(noisePub) != 32 {
- return nil, errors.New("Invalid noisePub size")
+ var noisePub []byte
+ if yml.NoisePub != nil {
+ noisePub, err = FromBase32(*yml.NoisePub)
+ if err != nil {
+ return nil, err
+ }
+ if len(noisePub) != 32 {
+ return nil, errors.New("Invalid noisePub size")
+ }
}
var incoming *string
Id: nodeId,
ExchPub: new([32]byte),
SignPub: ed25519.PublicKey(signPub),
- NoisePub: new([32]byte),
Sendmail: yml.Sendmail,
Incoming: incoming,
Freq: freq,
Addrs: yml.Addrs,
}
copy(node.ExchPub[:], exchPub)
- copy(node.NoisePub[:], noisePub)
+ if len(noisePub) > 0 {
+ node.NoisePub = new([32]byte)
+ copy(node.NoisePub[:], noisePub)
+ }
return &node, nil
}
}
incoming := "/path/to/upload/dir, omit it to forbid uploading"
freq := "/path/to/freq/able/dir, omit to forbid freqing"
+ noisePub := nncp.ToBase32(nodeOur.NoisePub[:])
cfg := nncp.CfgYAML{
Self: nncp.NodeOurYAML{
Id: nodeOur.Id.String(),
Id: nodeOur.Id.String(),
ExchPub: nncp.ToBase32(nodeOur.ExchPub[:]),
SignPub: nncp.ToBase32(nodeOur.SignPub[:]),
- NoisePub: nncp.ToBase32(nodeOur.NoisePub[:]),
+ NoisePub: &noisePub,
Sendmail: []string{nncp.DefaultSendmailPath},
Incoming: &incoming,
Freq: &freq,