Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump ignite cli #25

Closed
wants to merge 10 commits into from
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
9 changes: 9 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# CODEOWNERS: https://help.github.com/articles/about-codeowners/

# Primary repo maintainers
* @ilgooz @jeronimoalbi @Pantani @julienrbrt

# Docs
*.md @salmad3 @toschdev @ilgooz
docs/* @salmad3 @toschdev @ilgooz
changelog.md @ilgooz @salmad3 @toschdev @jeronimoalbi @Pantani @julienrbrt
4 changes: 2 additions & 2 deletions .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
uses: docker/setup-buildx-action@v1

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand All @@ -25,7 +25,7 @@ jobs:

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
push: true
platforms: linux/amd64,linux/arm64
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: 1.16
go-version: "stable"

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
version: 'latest'
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 7 additions & 1 deletion .github/workflows/semantic-pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
name: "Semantic PR"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v1.2.0
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 14 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
name: Test

on: [push]
on:
pull_request:
push:
branches:
- main
- master
- release/*

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.16
go-version: "stable"
- run: make test
116 changes: 103 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,111 @@
BUILDDIR ?= $(CURDIR)/build
PROJECT_NAME = Faucet
FIND_ARGS := -name '*.go' -type f
PACKAGES=$(shell go list ./...)
VERSION := $(shell echo $(shell git describe --tags 2> /dev/null || echo "dev-$(shell git describe --always)") | sed 's/^v//')
COVER_FILE := coverage.txt
COVER_HTML_FILE := cover.html

all: install
export GO111MODULE = on

$(BUILDDIR)/:
mkdir -p $@
###############################################################################
### Test ###
###############################################################################

BUILD_TARGETS := build install
build: $(BUILDDIR)/
build: BUILD_ARGS=-o=$(BUILDDIR)
## test-unit: Run the unit tests.
test-unit:
@echo Running unit tests...
@VERSION=$(VERSION) go test -mod=readonly -v -timeout 30m $(PACKAGES)

$(BUILD_TARGETS):
go $@ -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./...
## test-race: Run the unit tests checking for race conditions
test-race:
@echo Running unit tests with race condition reporting...
@VERSION=$(VERSION) go test -mod=readonly -v -race -timeout 30m $(PACKAGES)

test:
go test ./...
## test-cover: Run the unit tests and create a coverage html report
test-cover:
@echo Running unit tests and creating coverage report...
@VERSION=$(VERSION) go test -mod=readonly -v -timeout 30m -coverprofile=$(COVER_FILE) -covermode=atomic $(PACKAGES)
@go tool cover -html=$(COVER_FILE) -o $(COVER_HTML_FILE)
@rm $(COVER_FILE)

## bench: Run the unit tests with benchmarking enabled
bench:
@echo Running unit tests with benchmarking...
@VERSION=$(VERSION) go test -mod=readonly -v -timeout 30m -bench=. $(PACKAGES)

## test: Run unit and integration tests.
test: govet govulncheck test-unit

.PHONY: test test-unit test-race test-cover bench

###############################################################################
### Build ###
###############################################################################

build: go.sum
ifeq ($(OS),Windows_NT)
go build -o build/faucet.exe ./cmd/faucet
else
go build -o build/faucet ./cmd/faucet
endif

build-linux: go.sum
LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build

install: go.sum
go install ./cmd/faucet

###############################################################################
### Tools & Dependencies ###
###############################################################################

go-mod-cache: go.sum
@echo "--> Download go modules to local cache"
@go mod download

go.sum: go.mod
@echo "--> Ensure dependencies have not been modified"
@go mod verify
@go mod tidy

clean:
rm -rf $(BUILDDIR)/
rm -rf build/

.PHONY: go-mod-cache clean

###############################################################################
### Development ###
###############################################################################

## govet: Run go vet.
govet:
@echo Running go vet...
@go vet $(shell go list ./...)

## govulncheck: Run govulncheck
govulncheck:
@echo Running govulncheck...
@go run golang.org/x/vuln/cmd/govulncheck ./...

## format: Run gofumpt and goimports.
format:
@echo Formatting...
@go install mvdan.cc/gofumpt
@go install golang.org/x/tools/cmd/goimports
@find . $(FIND_ARGS) | xargs gofumpt -w .
@find . $(FIND_ARGS) | xargs goimports -w -local github.com/ignite/network

## lint: Run Golang CI Lint.
lint:
@echo Running gocilint...
@go install github.com/golangci/golangci-lint/cmd/golangci-lint
@golangci-lint run --out-format=tab --issues-exit-code=0

help: Makefile
@echo
@echo " Choose a command run in "$(PROJECT_NAME)", or just run 'make' for install"
@echo
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo

.PHONY: all $(BUILD_TARGETS) clean
.PHONY: lint format govet govulncheck help
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,22 @@ $ make install
You can configure the faucet either using command line flags or environment variables. The following table
shows the available configuration options and respective defaults:

| flag | env | description | default |
|---------------------|-------------------|-------------------------------------------------------------- |-----------|
| port | PORT | tcp port where faucet will be listening for requests | 8000 |
| account-name | ACCOUNT_NAME | name of the account to be used by the faucet | faucet |
| mnemonic | MNEMONIC | mnemonic for restoring an account | |
| keyring-password | KEYRING_PASSWORD | password for accessing keyring | |
| cli-name | DENOMS | denomination of the coins sent by default (comma separated) | uatom |
| credit-amount | CREDIT_AMOUNT | amount to credit in each request | 10000000 |
| max-credit | MAX_CREDIT | maximum credit per account | 100000000 |
| sdk-version | SDK_VERSION | version of sdk (launchpad or stargate) | stargate |
| node | NODE | address of tendermint RPC endpoint for this chain | |
| keyring-backend | KEYRING_BACKEND | keyring backend to be used | |
| legacy-send | LEGACY_SEND | whether to use legacy send command | false |
| coin-type | COIN_TYPE | registered coin type number for HD derivation (BIP-0044) | 118 |
| home | HOME | replaces the default home used by the chain | |
| | | | |
| flag | env | description | default |
|------------------|------------------|-------------------------------------------------------------- |-----------|
| port | PORT | tcp port where faucet will be listening for requests | 8000 |
| account-name | ACCOUNT_NAME | name of the account to be used by the faucet | faucet |
| mnemonic | MNEMONIC | mnemonic for restoring an account | |
| keyring-password | KEYRING_PASSWORD | password for accessing keyring | |
| denoms | DENOMS | denomination of the coins sent by default (comma separated) | uatom |
| credit-amount | CREDIT_AMOUNT | amount to credit in each request | 10000000 |
| max-credit | MAX_CREDIT | maximum credit per account | 100000000 |
| fee-amount | FEE_AMOUNT | fee to pay along with the transaction | 0 |
| sdk-version | SDK_VERSION | version of sdk (launchpad or stargate) | stargate |
| node | NODE | address of tendermint RPC endpoint for this chain | |
| keyring-backend | KEYRING_BACKEND | keyring backend to be used | |
| coin-type | COIN_TYPE | registered coin type number for HD derivation (BIP-0044) | 118 |
| home | HOME | replaces the default home used by the chain | |
| | | | |

### [gaia](https://github.com/cosmos/gaia) example

Expand Down
19 changes: 10 additions & 9 deletions cmd/faucet/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ package main
import (
"flag"

"github.com/tendermint/starport/starport/pkg/cosmosfaucet"
"github.com/ignite/cli/v28/ignite/pkg/cosmosfaucet"
"github.com/ignite/cli/v28/ignite/pkg/cosmosver"

"github.com/tendermint/faucet/internal/environ"
)
Expand All @@ -23,8 +24,8 @@ var (
defaultDenoms string
creditAmount uint64
maxCredit uint64
feeAmount uint64
nodeAddress string
legacySendCmd bool
coinType string
home string
)
Expand All @@ -39,8 +40,8 @@ func init() {
"keyring backend to be used",
)
flag.StringVar(&sdkVersion, "sdk-version",
environ.GetString("SDK_VERSION", "latest"),
"version of sdk (launchpad, stargate-40, stargate-44 or latest)",
environ.GetString("SDK_VERSION", cosmosver.Latest.String()),
"version of sdk",
)
flag.StringVar(&keyName, "account-name",
environ.GetString("ACCOUNT_NAME", cosmosfaucet.DefaultAccountName),
Expand All @@ -60,7 +61,7 @@ func init() {
)
flag.StringVar(&defaultDenoms, "denoms",
environ.GetString("DENOMS", cosmosfaucet.DefaultDenom),
"denomination of the coins sent by default (comma separated)",
"denomination comma separated of the coins sent by default (the first one will be used for the fee denom)",
)
flag.Uint64Var(&creditAmount,
"credit-amount",
Expand All @@ -71,14 +72,14 @@ func init() {
"max-credit", environ.GetUint64("MAX_CREDIT", cosmosfaucet.DefaultMaxAmount),
"maximum credit per account",
)
flag.Uint64Var(&feeAmount,
"fee-amount", environ.GetUint64("FEE_AMOUNT", 0),
"fee to pay along with the transaction",
)
flag.StringVar(&nodeAddress, "node",
environ.GetString("NODE", ""),
"address of tendermint RPC endpoint for this chain",
)
flag.BoolVar(&legacySendCmd, "legacy-send",
environ.GetBool("LEGACY_SEND", false),
"whether to use legacy send command",
)
flag.StringVar(&coinType, "coin-type",
environ.GetString("COIN_TYPE", "118"),
"registered coin type number for HD derivation (BIP-0044), defaults from (satoshilabs/SLIP-0044)",
Expand Down
Loading
Loading