Functional loopback code

This commit is contained in:
Asim Aslam
2019-07-03 19:26:24 +01:00
parent 7008809eff
commit e54de56376
5 changed files with 313 additions and 137 deletions

View File

@@ -45,7 +45,7 @@ type network struct {
// lease generates a new lease with a node id/address
// TODO: use a consensus mechanism, pool or some deterministic
// unique addressing method.
func (n *network) lease() *pb.Lease {
func (n *network) lease(muid string) *pb.Lease {
// create the id
id := uuid.New().String()
// create a timestamp
@@ -62,6 +62,7 @@ func (n *network) lease() *pb.Lease {
Id: id,
Timestamp: now,
Node: &pb.Node{
Muid: muid,
Id: id,
Address: address,
Network: n.id,