Skip to content

Commit c0f0bd9

Browse files
committed
feat: add node providers wallet addresses to the providers view
1 parent 989d3af commit c0f0bd9

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

internal/db/storageproviders/dynamodb.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func (d *DynamoStorageProviderTable) Get(ctx context.Context, provider did.DID)
3030
Key: map[string]types.AttributeValue{
3131
"provider": &types.AttributeValueMemberS{Value: provider.String()},
3232
},
33-
ProjectionExpression: aws.String("provider, operatorEmail, endpoint"),
33+
ProjectionExpression: aws.String("provider, address, operatorEmail, endpoint"),
3434
})
3535
if err != nil {
3636
return nil, fmt.Errorf("getting storage provider: %w", err)
@@ -46,7 +46,7 @@ func (d *DynamoStorageProviderTable) Get(ctx context.Context, provider did.DID)
4646
func (d *DynamoStorageProviderTable) GetAll(ctx context.Context, limit int, startToken *string) (*GetAllResult, error) {
4747
input := &dynamodb.ScanInput{
4848
TableName: aws.String(d.tableName),
49-
ProjectionExpression: aws.String("provider, operatorEmail, endpoint"),
49+
ProjectionExpression: aws.String("provider, address, operatorEmail, endpoint"),
5050
Limit: aws.Int32(int32(limit)),
5151
}
5252

@@ -93,6 +93,7 @@ func (d *DynamoStorageProviderTable) GetAll(ctx context.Context, limit int, star
9393
// We only unmarshal the fields we need
9494
type storageProviderRecord struct {
9595
Provider string `dynamodbav:"provider"`
96+
Address string `dynamodbav:"address"`
9697
OperatorEmail string `dynamodbav:"operatorEmail"`
9798
Endpoint string `dynamodbav:"endpoint"`
9899
}
@@ -110,6 +111,7 @@ func (d *DynamoStorageProviderTable) unmarshalRecord(item map[string]types.Attri
110111

111112
return &StorageProviderRecord{
112113
Provider: provider,
114+
WalletAddress: record.Address,
113115
OperatorEmail: record.OperatorEmail,
114116
Endpoint: record.Endpoint,
115117
}, nil

internal/db/storageproviders/storageproviders.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99

1010
type StorageProviderRecord struct {
1111
Provider did.DID
12+
WalletAddress string
1213
OperatorEmail string
1314
Endpoint string
1415
}

web/templates/admin.html.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
<tr>
5858
<th class="col-operator">Operator Email</th>
5959
<th class="col-provider">Node</th>
60+
<th class="col-wallet">Wallet Address</th>
6061
<th class="col-stat">Current Day</th>
6162
<th class="col-stat">Current Week</th>
6263
<th class="col-stat">Current Month</th>
@@ -68,6 +69,7 @@
6869
<tr>
6970
<td class="operator-email">{{.Provider.OperatorEmail}}</td>
7071
<td class="provider-did" title="{{.Provider.Endpoint}}">{{.Provider.Provider.String}}</td>
72+
<td class="wallet-address">{{.Provider.WalletAddress}}</td>
7173
{{if .StatsError}}
7274
<td colspan="4" class="stats-error">Error: {{.StatsError.Error}}</td>
7375
{{else if .Stats}}

0 commit comments

Comments
 (0)