Skip to content

Commit

Permalink
fix(misc/loop): fix portal loop post goreleaser (gnolang#2185)
Browse files Browse the repository at this point in the history
<!-- please provide a detailed description of the changes made in this
pull request. -->

<details><summary>Contributors' checklist...</summary>

- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>
  • Loading branch information
albttx authored May 24, 2024
1 parent a548238 commit 6bbd31d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions misc/loop/cmd/snapshotter.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func NewSnapshotter(dockerClient *client.Client, cfg config) (*snapshotter, erro

// pullLatestImage get latest version of the docker image
func (s snapshotter) pullLatestImage(ctx context.Context) (bool, error) {
reader, err := s.dockerClient.ImagePull(ctx, "ghcr.io/gnolang/gno", types.ImagePullOptions{})
reader, err := s.dockerClient.ImagePull(ctx, "ghcr.io/gnolang/gno/gnoland", types.ImagePullOptions{})
if err != nil {
return false, err
}
Expand Down Expand Up @@ -139,15 +139,16 @@ func (s snapshotter) startPortalLoopContainer(ctx context.Context) (*types.Conta

// Run Docker container
container, err := s.dockerClient.ContainerCreate(ctx, &container.Config{
Image: "ghcr.io/gnolang/gno",
Image: "ghcr.io/gnolang/gno/gnoland",
Labels: map[string]string{
"the-portal-loop": s.containerName,
},
WorkingDir: "/gnoroot",
Env: []string{
"MONIKER=the-portal-loop",
"GENESIS_BACKUP_FILE=/backups/backup.jsonl",
},
Cmd: []string{"/scripts/start.sh"},
Entrypoint: []string{"/scripts/start.sh"},
ExposedPorts: nat.PortSet{
"26656/tcp": struct{}{},
"26657/tcp": struct{}{},
Expand Down
8 changes: 4 additions & 4 deletions misc/loop/scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ GENESIS_BACKUP_FILE=${GENESIS_BACKUP_FILE:-""}
SEEDS=${SEEDS:-""}
PERSISTENT_PEERS=${PERSISTENT_PEERS:-""}

echo "" >> /opt/gno/src/gno.land/genesis/genesis_txs.jsonl
cat ${GENESIS_BACKUP_FILE} >> /opt/gno/src/gno.land/genesis/genesis_txs.jsonl
echo "" >> /gnoroot/gno.land/genesis/genesis_txs.jsonl
cat ${GENESIS_BACKUP_FILE} >> /gnoroot/gno.land/genesis/genesis_txs.jsonl

gnoland start \
/gnoland start \
--chainid="${CHAIN_ID}" \
--skip-start=true \
--skip-failing-genesis-txs
Expand All @@ -26,4 +26,4 @@ sed -i "s#laddr = \".*:26657\"#laddr = \"${RPC_LADDR}\"#" ./gnoland-data/config/
sed -i "s#seeds = \".*\"#seeds = \"${SEEDS}\"#" ./gnoland-data/config/config.toml
sed -i "s#persistent_peers = \".*\"#persistent_peers = \"${PERSISTENT_PEERS}\"#" ./gnoland-data/config/config.toml

exec gnoland start --skip-failing-genesis-txs
exec /gnoland start --skip-failing-genesis-txs

0 comments on commit 6bbd31d

Please sign in to comment.