Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions core/provider/digitalocean/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,22 @@ func (p *Provider) CreateTask(ctx context.Context, definition provider.TaskDefin
}

_, _, err = task.dockerClient.ImageInspectWithRaw(ctx, definition.Image.Image)
registryAuth := doConfig["docker_auth"]
if err != nil {
p.logger.Info("image not found, pulling", zap.String("image", definition.Image.Image))
if err = task.dockerClient.ImagePull(ctx, p.logger, definition.Image.Image, image.PullOptions{
RegistryAuth: doConfig["docker_auth"],
}); err != nil {
for retries := 5; retries > 0; retries-- {
err = task.dockerClient.ImagePull(ctx, p.logger, definition.Image.Image, image.PullOptions{
RegistryAuth: registryAuth,
})
if err != nil {
p.logger.Info("got rate limited on docker pull, sleeping 10 seconds and going again")
time.Sleep(10 * time.Second)
} else {
break
}
}
if err != nil {
p.logger.Error("failed to pull image", zap.String("image", definition.Image.Image), zap.Error(err))
return nil, err
}
}
Expand Down
3 changes: 2 additions & 1 deletion core/types/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ type ChainConfig struct {
NumValidators int // NumValidators is the number of validators to create
NumNodes int // NumNodes is the number of nodes to create

BinaryName string // BinaryName is the name of the chain binary in the Docker image
BinaryName string // BinaryName is the name of the chain binary in the Docker image
Entrypoint []string // Entrypoint is the list of arguments to invoke in the entrypoint of the Docker image

Image provider.ImageDefinition // Image is the Docker ImageDefinition of the chain

Expand Down
9 changes: 9 additions & 0 deletions cosmos/node/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,14 @@ func (n *Node) InitHome(ctx context.Context) error {
return fmt.Errorf("failed to init home (exit code %d): %s, stdout: %s", exitCode, stderr, stdout)
}

clientConfig := GenerateDefaultClientConfig(n.GetChainConfig().ChainId)
if err := n.ModifyTomlConfigFile(
ctx,
"config/client.toml",
clientConfig,
); err != nil {
return err
}

return nil
}
15 changes: 11 additions & 4 deletions cosmos/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,18 @@ func CreateNode(ctx context.Context, logger *zap.Logger, infraProvider provider.

node.logger.Info("creating node", zap.String("name", nodeConfig.Name))

entrypoint := []string{chainConfig.BinaryName}
if len(chainConfig.Entrypoint) > 0 {
entrypoint = chainConfig.Entrypoint
}

def := provider.TaskDefinition{
Name: nodeConfig.Name,
Image: chainConfig.Image,
Ports: append([]string{"9090", "26656", "26657", "26660", "1317"}, chainConfig.AdditionalPorts...),
Entrypoint: append([]string{chainConfig.BinaryName, "--home", chainConfig.HomeDir, "start"}, chainConfig.AdditionalStartFlags...),
Name: nodeConfig.Name,
Image: chainConfig.Image,
Ports: append([]string{"9090", "26656", "26657", "26660", "1317"}, chainConfig.AdditionalPorts...),
Entrypoint: append(
append(entrypoint, "--home", chainConfig.HomeDir, "start"),
chainConfig.AdditionalStartFlags...),
DataDir: chainConfig.HomeDir,
Environment: map[string]string{"GODEBUG": "blockprofilerate=1"},
}
Expand Down
Loading