Skip to content

Commit

Permalink
chore: update rpcURL
Browse files Browse the repository at this point in the history
  • Loading branch information
albttx committed Jan 26, 2024
1 parent 414cf6d commit 1c101a8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
4 changes: 2 additions & 2 deletions misc/loop/cmd/portalloopd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func (s *service) execBackup(ctx context.Context, args []string) error {
return err
}

return s.portalLoop.backupTXs(ctx)
return s.portalLoop.backupTXs(ctx, s.portalLoopURL)
}

func (s *service) startPortalLoop(ctx context.Context, force bool) error {
Expand Down Expand Up @@ -227,7 +227,7 @@ func (s *service) startPortalLoop(ctx context.Context, force bool) error {

l.Info("Backup txs")
// 5. Backup TXs
err = s.portalLoop.backupTXs(ctx)
err = s.portalLoop.backupTXs(ctx, s.portalLoopURL)
if err != nil {
return err
}
Expand Down
5 changes: 3 additions & 2 deletions misc/loop/cmd/portalloopd/snapshotter.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (s snapshotter) startPortalLoopContainer(ctx context.Context) (*types.Conta
return nil, fmt.Errorf("container not found")
}

func (s snapshotter) backupTXs(ctx context.Context) error {
func (s snapshotter) backupTXs(ctx context.Context, rpcURL string) error {
cfg := backup.DefaultConfig()
cfg.FromBlock = 1
cfg.Watch = false
Expand All @@ -202,7 +202,8 @@ func (s snapshotter) backupTXs(ctx context.Context) error {
defer instanceBackupFile.Close()

w := legacy.NewWriter(instanceBackupFile)
client := http.NewClient(s.cfg.rpcAddr)
// client := http.NewClient(s.cfg.rpcAddr)
client := http.NewClient(rpcURL)

backupService := backup.NewService(client, w)

Expand Down
4 changes: 3 additions & 1 deletion misc/loop/docker-compose.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ networks:
portal-loop:
name: portal-loop
driver: bridge
ipam:
config:
- subnet: 172.177.0.0/16

services:
traefik:
Expand Down Expand Up @@ -73,7 +76,6 @@ services:
portalloopd:
image: ghcr.io/albttx/gno/portalloopd
restart: unless-stopped
working_dir: /app
volumes:
- ./scripts:/scripts
- ./backups:/backups
Expand Down
4 changes: 4 additions & 0 deletions misc/loop/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ networks:
portal-loop:
name: portal-loop
driver: bridge
ipam:
driver: default
config:
- subnet: 172.42.0.0/16

services:
traefik:
Expand Down
7 changes: 4 additions & 3 deletions misc/loop/traefik/gno.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ http:
ipWhiteList:
sourceRange:
- "127.0.0.1/32"
- "172.42.0.1/32"

routers:
gno-portal-loop-local:
service: gno-portal-loop
rule: "Host(`rpc.portal.gno.local`)"
entrypoints: ["web", "private"]
rule: "PathPrefix(`/`)"
entrypoints: ["private"]
middlewares: []

gno-portal-loop:
Expand All @@ -25,4 +26,4 @@ http:
gno-portal-loop:
loadBalancer:
servers:
- url: "http://localhost:32780"
- url: "http://172.42.0.6:26657"

0 comments on commit 1c101a8

Please sign in to comment.