mirror of
https://github.com/getAlby/hub.git
synced 2026-08-13 12:33:39 +02:00
feat: add chain data source and address to about page (#2013)
* feat: add chain data source and address to about page * fix: only show chainsource for ldk * fix: redact chain-source address secrets and return complete bitcoind endpoint * chore: make sanitize function readable and add tests * fix: align ldk chain data source labels --------- Co-authored-by: anon <anon@anon.com> Co-authored-by: im-adithya <imadithyavardhan@gmail.com>
This commit is contained in:
parent
17d38850f9
commit
e157c288b3
6 changed files with 147 additions and 1 deletions
11
api/api.go
11
api/api.go
|
|
@ -1349,6 +1349,17 @@ func (api *api) GetInfo(ctx context.Context) (*InfoResponse, error) {
|
|||
}
|
||||
|
||||
info.Network = nodeInfo.Network
|
||||
if backendType == config.LDKBackendType {
|
||||
// Only LDK supports this right now. Using a local interface here
|
||||
// so we don't have to bloat the main LNClient interface for everyone else.
|
||||
type chainSourceProvider interface {
|
||||
GetChainDataSource() (string, string)
|
||||
}
|
||||
|
||||
if ldkService, ok := api.svc.GetLNClient().(chainSourceProvider); ok {
|
||||
info.ChainDataSourceType, info.ChainDataSourceAddress = ldkService.GetChainDataSource()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
info.NextBackupReminder, _ = api.cfg.Get("NextBackupReminder", "")
|
||||
|
|
|
|||
|
|
@ -301,6 +301,8 @@ type InfoResponse struct {
|
|||
Relays []InfoResponseRelay `json:"relays"`
|
||||
NodeAlias string `json:"nodeAlias"`
|
||||
MempoolUrl string `json:"mempoolUrl"`
|
||||
ChainDataSourceType string `json:"chainDataSourceType,omitempty"`
|
||||
ChainDataSourceAddress string `json:"chainDataSourceAddress,omitempty"`
|
||||
HideUpdateBanner bool `json:"hideUpdateBanner"`
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue