Skip to content
Closed
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
21 changes: 21 additions & 0 deletions starport/templates/app/stargate/Makefile.plush
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try to avoid scaffolding a makefile only for this, please?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is needed to Akash docker image to build the project. I think it is also useful to provide a option to allow users to build the project without install Starport

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use the starport chain build command. And if you are scaffolding a module with starport, you already have it installed. The build should be for developers. The users should manage the signed binary.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Akash need to build a docker image, and docker image does not have starport installed. Moreover, it will use make install to install the node binary. https://github.com/ovrclk/cosmos-omnibus/blob/master/Dockerfile#L25

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can run the commands into the Dockerfile. The Makefile is not necessary.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Makefile is used across for all projects in cosmos-omnibus

VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
LEDGER_ENABLED ?= true
BINDIR ?= $(GOPATH)/bin

ifeq ($(LEDGER_ENABLED),true)
build_tags += ledger
endif

ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=<%= AppName %> \
-X github.com/cosmos/cosmos-sdk/version.AppName=<%= AppName %>d \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags)"

BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)'


install: go.sum
go install $(BUILD_FLAGS) ./cmd/<%= BinaryNamePrefix %>d
45 changes: 45 additions & 0 deletions starport/templates/app/stargate/deploy/deploy.yaml.plush
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use akash folder instead of deploy?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

version: "2.0"

services:
node:
image: ghcr.io/ovrclk/cosmos-omnibus:v0.0.14-<%= AppName %>-v0.0.0
env:
- MONIKER=node_1
- CHAIN_JSON=https://raw.githubusercontent.com/cosmos/chain-registry/master/<%= AppName %>/chain.json
expose:
- port: 26657
as: 80
to:
- global: true
- port: 26656
to:
- global: true

profiles:
compute:
node:
resources:
cpu:
units: 2
memory:
size: 2Gi
storage:
size: 60Gi
placement:
dcloud:
attributes:
host: akash
signedBy:
anyOf:
- akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63
pricing:
node:
denom: uakt
amount: 100

deployment:
node:
dcloud:
profile: node
count: 1
23 changes: 23 additions & 0 deletions starport/templates/app/stargate/deploy/docker-compose.yml.plush
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: '3.4'

services:
node_1:
build:
context: ../
args:
PROJECT: <%= AppName %>
PROJECT_BIN: <%= BinaryNamePrefix %>d
VERSION: v0.0.0
REPOSITORY: https://github.com/<%= OwnerAndRepoName %>
NAMESPACE: <%= AppName %>
PROJECT_DIR: .<%= BinaryNamePrefix %>
ports:
- '26656:26656'
- '26657:26657'
environment:
- MONIKER=node_1
- CHAIN_JSON=https://raw.githubusercontent.com/cosmos/chain-registry/master/<%= AppName %>/chain.json
env_file:
- ../.env
volumes:
- ./node-data/.<%= BinaryNamePrefix %>:/root/.<%= BinaryNamePrefix %>