Add email to self node info (#2171)
This commit is contained in:
parent
f624b213a3
commit
252c8ac189
@ -139,6 +139,7 @@ func New(log *zap.Logger, full *identity.FullIdentity, db DB, config Config, ver
|
|||||||
},
|
},
|
||||||
Type: pb.NodeType_BOOTSTRAP,
|
Type: pb.NodeType_BOOTSTRAP,
|
||||||
Operator: pb.NodeOperator{
|
Operator: pb.NodeOperator{
|
||||||
|
Email: config.Operator.Email,
|
||||||
Wallet: config.Operator.Wallet,
|
Wallet: config.Operator.Wallet,
|
||||||
},
|
},
|
||||||
Version: *pbVersion,
|
Version: *pbVersion,
|
||||||
|
@ -135,7 +135,7 @@ func (discovery *Discovery) refresh(ctx context.Context) (err error) {
|
|||||||
discovery.log.Error("could not update node uptime in cache", zap.String("ID", ping.Id.String()), zap.Error(err))
|
discovery.log.Error("could not update node uptime in cache", zap.String("ID", ping.Id.String()), zap.Error(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
// update wallet with correct info
|
// update node info
|
||||||
info, err := discovery.kad.FetchInfo(ctx, node.Node)
|
info, err := discovery.kad.FetchInfo(ctx, node.Node)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
discovery.log.Warn("could not fetch node info", zap.String("ID", ping.GetAddress().String()))
|
discovery.log.Warn("could not fetch node info", zap.String("ID", ping.GetAddress().String()))
|
||||||
|
@ -209,3 +209,25 @@ func TestIsVetted(t *testing.T) {
|
|||||||
assert.False(t, reputable)
|
assert.False(t, reputable)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestNodeInfo(t *testing.T) {
|
||||||
|
testplanet.Run(t, testplanet.Config{
|
||||||
|
SatelliteCount: 1, StorageNodeCount: 1, UplinkCount: 0,
|
||||||
|
}, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) {
|
||||||
|
planet.StorageNodes[0].Storage2.Monitor.Loop.Pause()
|
||||||
|
planet.Satellites[0].Discovery.Service.Refresh.Pause()
|
||||||
|
|
||||||
|
node, err := planet.Satellites[0].Overlay.Service.Get(ctx, planet.StorageNodes[0].ID())
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
assert.Equal(t, pb.NodeType_STORAGE, node.Type)
|
||||||
|
assert.NotEmpty(t, node.Operator.Email)
|
||||||
|
assert.NotEmpty(t, node.Operator.Wallet)
|
||||||
|
assert.Equal(t, planet.StorageNodes[0].Local().Operator, node.Operator)
|
||||||
|
assert.NotEmpty(t, node.Capacity.FreeBandwidth)
|
||||||
|
assert.NotEmpty(t, node.Capacity.FreeDisk)
|
||||||
|
assert.Equal(t, planet.StorageNodes[0].Local().Capacity, node.Capacity)
|
||||||
|
assert.NotEmpty(t, node.Version.Version)
|
||||||
|
assert.Equal(t, planet.StorageNodes[0].Local().Version.Version, node.Version.Version)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -278,6 +278,7 @@ func New(log *zap.Logger, full *identity.FullIdentity, db DB, config *Config, ve
|
|||||||
},
|
},
|
||||||
Type: pb.NodeType_SATELLITE,
|
Type: pb.NodeType_SATELLITE,
|
||||||
Operator: pb.NodeOperator{
|
Operator: pb.NodeOperator{
|
||||||
|
Email: config.Operator.Email,
|
||||||
Wallet: config.Operator.Wallet,
|
Wallet: config.Operator.Wallet,
|
||||||
},
|
},
|
||||||
Version: *pbVersion,
|
Version: *pbVersion,
|
||||||
|
@ -169,6 +169,7 @@ func New(log *zap.Logger, full *identity.FullIdentity, db DB, config Config, ver
|
|||||||
},
|
},
|
||||||
Type: pb.NodeType_STORAGE,
|
Type: pb.NodeType_STORAGE,
|
||||||
Operator: pb.NodeOperator{
|
Operator: pb.NodeOperator{
|
||||||
|
Email: config.Operator.Email,
|
||||||
Wallet: config.Operator.Wallet,
|
Wallet: config.Operator.Wallet,
|
||||||
},
|
},
|
||||||
Version: *pbVersion,
|
Version: *pbVersion,
|
||||||
|
Loading…
Reference in New Issue
Block a user