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

feat: rename cli name to fnsad #153

Merged
merged 14 commits into from
Mar 15, 2023
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
5 changes: 2 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build & Push
# Build & Push builds the lbm docker image on every tag push,
# and pushes the image to https://docker-registry.linecorp.com/link-network/v2/lbm
# Build & Push builds the finschia docker image on every tag push

on:
pull_request:
branches:
Expand Down Expand Up @@ -29,7 +29,6 @@ jobs:
endpoint: buildx
config-inline: |
[registry."docker.io"]
mirrors = ["docker-hub-mirror.linecorp.com"]
- name: login to the registry
uses: docker/login-action@v2
if: github.event_name != 'pull_request'
Expand Down
12 changes: 6 additions & 6 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ before:
- go generate ./...
builds:
-
id: "lbm"
main: ./cmd/lbm
binary: build/lbm
id: "finschia"
main: ./cmd/fnsad
binary: build/fnsad
env:
- CGO_ENABLED=0
flags:
- -mod=readonly
- -tags=netgo ledger
ldflags:
- -X github.com/line/lbm-sdk/version.Name=lbm
- -X github.com/line/lbm-sdk/version.ServerName=lbm
- -X github.com/line/lbm-sdk/version.Name=fisnchia
- -X github.com/line/lbm-sdk/version.ServerName=finschia
- -X github.com/line/lbm-sdk/version.Version={{ .Version }}
- -X github.com/line/lbm-sdk/version.Commit={{ .FullCommit }}
- -X "github.com/line/lbm-sdk/version.BuildTags=netgo,ledger"
archives:
-
builds: ['lbm']
builds: ['fnsad']
replacements:
darwin: Darwin
linux: Linux
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/wasmplus) [\#141](https://github.com/line/lbm/pull/141) change wasm module to wrapped `x/wasmplus`
* (lbm-sdk) [\#144](https://github.com/line/lbm/pull/144) bump line/lbm-sdk v0.47.0-alpha1 (11966d1234155ebef20b64f2ae7a905beffdb33f)
* (build) [\#150](https://github.com/line/lbm/pull/150) Modify the Makefile to build release bundles
* (build) [\#153](https://github.com/line/finschia/pull/153) rename cli name to `fnsad`

### Improvements
* (x/wasmd) [\#146](https://github.com/line/lbm/pull/146) update wasmd version
Expand Down
20 changes: 10 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# Simple usage with a mounted data directory:
# > docker build --platform="linux/amd64" -t line/lbm . --build-arg ARCH=x86_64
# > docker run -it -p 26656:26656 -p 26657:26657 -v ~/.lbm:/root/.lbm -v line/lbm lbm init
# > docker run -it -p 26656:26656 -p 26657:26657 -v ~/.lbm:/root/.lbm -v line/lbm lbm start --rpc.laddr=tcp://0.0.0.0:26657 --p2p.laddr=tcp://0.0.0.0:26656
# > docker run -it -p 26656:26656 -p 26657:26657 -v ~/.finschia:/root/.finschia -v line/lbm fnsad init
# > docker run -it -p 26656:26656 -p 26657:26657 -v ~/.finschia:/root/.finschia -v line/lbm fnsad start --rpc.laddr=tcp://0.0.0.0:26657 --p2p.laddr=tcp://0.0.0.0:26656
FROM golang:1.18-alpine AS build-env
ARG ARCH=$ARCH
ARG LBM_BUILD_OPTIONS=""
ARG FINSCHIA_BUILD_OPTIONS=""

# Set up OS dependencies
ENV PACKAGES curl wget make cmake git libc-dev bash gcc g++ linux-headers eudev-dev python3 perl
RUN apk add --update --no-cache $PACKAGES

# Set WORKDIR to lbm
WORKDIR /lbm-build/lbm
# Set WORKDIR to finschia
WORKDIR /finschia-build/finschia

# prepare dbbackend before building; this can be cached
COPY ./Makefile ./
COPY ./contrib ./contrib
COPY ./sims.mk ./
RUN make dbbackend LBM_BUILD_OPTIONS="$LBM_BUILD_OPTIONS"
RUN make dbbackend FINSCHIA_BUILD_OPTIONS="$(FINSCHIA_BUILD_OPTIONS)"

# Install GO dependencies
COPY ./go.mod /lbm-build/lbm/go.mod
COPY ./go.sum /lbm-build/lbm/go.sum
COPY ./go.mod /finschia-build/finschia/go.mod
COPY ./go.sum /finschia-build/finschia/go.sum
RUN go mod download

# Install libwasmvm.*.a
Expand All @@ -34,7 +34,7 @@ RUN ln -s /lib/libwasmvm_muslc.${ARCH}.a /usr/lib/libwasmvm_muslc.a
COPY . .

# Make install
RUN BUILD_TAGS=muslc make install CGO_ENABLED=1 LBM_BUILD_OPTIONS="$LBM_BUILD_OPTIONS"
RUN BUILD_TAGS=muslc make install CGO_ENABLED=1 FINSCHIA_BUILD_OPTIONS="$FINSCHIA_BUILD_OPTIONS"

# Final image
FROM alpine:edge
Expand All @@ -45,5 +45,5 @@ WORKDIR /root
RUN apk add --update --no-cache libstdc++ ca-certificates

# Copy over binaries from the build-env
COPY --from=build-env /go/bin/lbm /usr/bin/lbm
COPY --from=build-env /go/bin/fnsad /usr/bin/fnsad

44 changes: 22 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,38 +50,38 @@ ifeq ($(LEDGER_ENABLED),true)
endif

# DB backend selection; use default for testing; use rocksdb or cleveldb for performance; build automation is not ready for boltdb and badgerdb yet.
ifeq (,$(filter $(LBM_BUILD_OPTIONS), cleveldb rocksdb boltdb badgerdb))
ifeq (,$(filter $(FINSCHIA_BUILD_OPTIONS), cleveldb rocksdb boltdb badgerdb))
BUILD_TAGS += goleveldb
DB_BACKEND = goleveldb
else
ifeq (cleveldb,$(findstring cleveldb,$(LBM_BUILD_OPTIONS)))
ifeq (cleveldb,$(findstring cleveldb,$(FINSCHIA_BUILD_OPTIONS)))
CGO_ENABLED=1
BUILD_TAGS += gcc cleveldb
DB_BACKEND = cleveldb
CLEVELDB_DIR = leveldb
CGO_CFLAGS=-I$(shell pwd)/$(CLEVELDB_DIR)/include
CGO_LDFLAGS="-L$(shell pwd)/$(CLEVELDB_DIR)/build -L$(shell pwd)/snappy/build -lleveldb -lm -lstdc++ -lsnappy"
endif
ifeq (badgerdb,$(findstring badgerdb,$(LBM_BUILD_OPTIONS)))
ifeq (badgerdb,$(findstring badgerdb,$(FINSCHIA_BUILD_OPTIONS)))
BUILD_TAGS += badgerdb
DB_BACKEND = badgerdb
endif
ifeq (rocksdb,$(findstring rocksdb,$(LBM_BUILD_OPTIONS)))
ifeq (rocksdb,$(findstring rocksdb,$(FINSCHIA_BUILD_OPTIONS)))
CGO_ENABLED=1
BUILD_TAGS += gcc rocksdb
DB_BACKEND = rocksdb
ROCKSDB_DIR=$(shell pwd)/rocksdb
CGO_CFLAGS=-I$(ROCKSDB_DIR)/include
CGO_LDFLAGS="-L$(ROCKSDB_DIR) -lrocksdb -lm -lstdc++ $(shell awk '/PLATFORM_LDFLAGS/ {sub("PLATFORM_LDFLAGS=", ""); print}' < $(ROCKSDB_DIR)/make_config.mk)"
endif
ifeq (boltdb,$(findstring boltdb,$(LBM_BUILD_OPTIONS)))
ifeq (boltdb,$(findstring boltdb,$(FINSCHIA_BUILD_OPTIONS)))
BUILD_TAGS += boltdb
DB_BACKEND = boltdb
endif
endif

# VRF library selection
ifeq (libsodium,$(findstring libsodium,$(LBM_BUILD_OPTIONS)))
ifeq (libsodium,$(findstring libsodium,$(FINSCHIA_BUILD_OPTIONS)))
CGO_ENABLED=1
BUILD_TAGS += gcc libsodium
LIBSODIUM_TARGET = libsodium
Expand All @@ -90,7 +90,7 @@ ifeq (libsodium,$(findstring libsodium,$(LBM_BUILD_OPTIONS)))
endif

# secp256k1 implementation selection
ifeq (libsecp256k1,$(findstring libsecp256k1,$(LBM_BUILD_OPTIONS)))
ifeq (libsecp256k1,$(findstring libsecp256k1,$(FINSCHIA_BUILD_OPTIONS)))
CGO_ENABLED=1
BUILD_TAGS += libsecp256k1
endif
Expand All @@ -105,8 +105,8 @@ build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags))

# process linker flags

ldflags = -X github.com/line/lbm-sdk/version.Name=lbm \
-X github.com/line/lbm-sdk/version.AppName=lbm \
ldflags = -X github.com/line/lbm-sdk/version.Name=finschia \
-X github.com/line/lbm-sdk/version.AppName=finschia \
-X github.com/line/lbm-sdk/version.Version=$(VERSION) \
-X github.com/line/lbm-sdk/version.Commit=$(COMMIT) \
-X github.com/line/lbm-sdk/types.DBBackend=$(DB_BACKEND) \
Expand All @@ -117,7 +117,7 @@ ifeq ($(LINK_STATICALLY),true)
ldflags += -linkmode=external -extldflags "-Wl,-z,muldefs -static"
endif

ifeq (,$(findstring nostrip,$(LBM_BUILD_OPTIONS)))
ifeq (,$(findstring nostrip,$(FINSCHIA_BUILD_OPTIONS)))
ldflags += -w -s
endif
ldflags += $(LDFLAGS)
Expand All @@ -127,7 +127,7 @@ BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)'
CLI_TEST_BUILD_FLAGS := -tags "cli_test $(build_tags)"
CLI_MULTI_BUILD_FLAGS := -tags "cli_multi_node_test $(build_tags)"
# check for nostrip option
ifeq (,$(findstring nostrip,$(LBM_BUILD_OPTIONS)))
ifeq (,$(findstring nostrip,$(FINSCHIA_BUILD_OPTIONS)))
BUILD_FLAGS += -trimpath
endif

Expand Down Expand Up @@ -160,22 +160,22 @@ build: go.sum $(BUILDDIR)/ dbbackend $(LIBSODIUM_TARGET)
CGO_CFLAGS=$(CGO_CFLAGS) CGO_LDFLAGS=$(CGO_LDFLAGS) CGO_ENABLED=$(CGO_ENABLED) go build -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./...

build-static: go.sum $(BUILDDIR)/
docker build -t line/lbmnode:latest -f builders/Dockerfile.static . --build-arg ARCH=$(ARCH) --platform="linux/amd64"
docker build -t line/finschianode:latest -f builders/Dockerfile.static . --build-arg ARCH=$(ARCH) --platform="linux/amd64"

build-static-centos7: go.sum $(BUILDDIR)/
docker build -t line/lbm-builder:static_centos7 -f builders/Dockerfile.static_centos7 .
docker run -it --rm -v $(shell pwd):/code -e LBM_BUILD_OPTIONS="$(LBM_BUILD_OPTIONS)" line/lbm-builder:static_centos7
docker build -t line/finschia-builder:static_centos7 -f builders/Dockerfile.static_centos7 .
docker run -it --rm -v $(shell pwd):/code -e FINSCHIA_BUILD_OPTIONS="$(FINSCHIA_BUILD_OPTIONS)" line/finschia-builder:static_centos7

# USAGE: go env -w GOARCH={amd64|arm64} && make clean build-release-bundle VERSION=v0.0.0
RELEASE_BUNDLE=lbm-$(VERSION)-$(shell go env GOOS)-$(shell go env GOARCH)
RELEASE_BUNDLE=finschia-$(VERSION)-$(shell go env GOOS)-$(shell go env GOARCH)
LIBWASMVM_VERSION=$(shell go list -m github.com/line/wasmvm | awk '{print $$2}')
LIBWASMVM_PATH=$(shell find $(shell go env GOMODCACHE) -name $(LIBWASMVM) -type f | grep "$(LIBWASMVM_VERSION)")
build-release-bundle: build
@if [ "$(shell go env GOOS)" != "$(shell go env GOHOSTOS)" ]; then echo "ERROR: OS not match"; exit 1; fi
@if [ -z "${LIBWASMVM_PATH}" ]; then echo "ERROR: $(LIBWASMVM) $(LIBWASMVM_VERSION) not found: $(shell go env GOMODCACHE)"; exit 1; fi
@if [ ! -f "${LIBWASMVM_PATH}" ]; then echo "ERROR: Multiple version of $(LIBWASMVM) found: ${LIBWASMVM_PATH}"; exit 1; fi
@mkdir -p $(BUILDDIR)/$(RELEASE_BUNDLE)
@cp $(BUILDDIR)/lbm $(BUILDDIR)/$(RELEASE_BUNDLE)/$(RELEASE_BUNDLE)
@cp $(BUILDDIR)/fnsad $(BUILDDIR)/$(RELEASE_BUNDLE)/$(RELEASE_BUNDLE)
@cp "$(LIBWASMVM_PATH)" $(BUILDDIR)/$(RELEASE_BUNDLE)/
@case "$(shell go env GOHOSTOS),$(shell go env GOHOSTARCH),$(shell go env GOARCH)" in \
*,amd64,amd64 | *,arm64,arm64 | darwin,arm64,*) \
Expand All @@ -190,7 +190,7 @@ build-release-bundle: build
@echo "Built: $(BUILDDIR)/$(RELEASE_BUNDLE).tgz"

install: go.sum $(BUILDDIR)/ dbbackend $(LIBSODIUM_TARGET)
CGO_CFLAGS=$(CGO_CFLAGS) CGO_LDFLAGS=$(CGO_LDFLAGS) CGO_ENABLED=$(CGO_ENABLED) go install $(BUILD_FLAGS) $(BUILD_ARGS) ./cmd/lbm
CGO_CFLAGS=$(CGO_CFLAGS) CGO_LDFLAGS=$(CGO_LDFLAGS) CGO_ENABLED=$(CGO_ENABLED) go install $(BUILD_FLAGS) $(BUILD_ARGS) ./cmd/fnsad

$(BUILDDIR)/:
mkdir -p $(BUILDDIR)/
Expand Down Expand Up @@ -232,7 +232,7 @@ dbbackend:
endif

build-docker:
docker build --build-arg LBM_BUILD_OPTIONS="$(LBM_BUILD_OPTIONS)" -t line/lbm .
docker build --build-arg FINSCHIA_BUILD_OPTIONS="$(FINSCHIA_BUILD_OPTIONS)" -t line/lbm .

build-contract-tests-hooks:
mkdir -p $(BUILDDIR)
Expand All @@ -249,7 +249,7 @@ go.sum: go.mod
draw-deps:
@# requires brew install graphviz or apt-get install graphviz
go get github.com/RobotsAndPencils/goviz
@goviz -i ./cmd/lbm -d 2 | dot -Tpng -o dependency-graph.png
@goviz -i ./cmd/fnsad -d 2 | dot -Tpng -o dependency-graph.png

clean:
rm -rf $(BUILDDIR)/ artifacts/
Expand Down Expand Up @@ -331,14 +331,14 @@ format:
### Localnet ###
###############################################################################

build-docker-lbmnode:
build-docker-finschianode:
$(MAKE) -C networks/local

# Run a 4-node testnet locally
localnet-start: localnet-stop build-static localnet-build-nodes

localnet-build-nodes:
docker run --rm -v $(CURDIR)/mytestnet:/data line/lbmnode \
docker run --rm -v $(CURDIR)/mytestnet:/data line/finschianode \
testnet init-files --v 4 -o /data --starting-ip-address 192.168.10.2 --keyring-backend=test
docker-compose up -d

Expand All @@ -361,7 +361,7 @@ test-docker-push: test-docker
setup-transactions setup-contract-tests-data start-link run-lcd-contract-tests contract-tests \
test test-all test-build test-cover test-unit test-race \
benchmark \
build-docker-lbmnode localnet-start localnet-stop \
build-docker-finschianode localnet-start localnet-stop \
docker-single-node

###############################################################################
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# LBM(LINE Blockchain Mainnet)
# Finschia

[![codecov](https://codecov.io/gh/line/lbm/branch/main/graph/badge.svg?token=JFFuUevpzJ)](https://codecov.io/gh/line/lbm)

This repository hosts `LBM(LINE Blockchain Mainnet)`. This repository is forked from [gaia](https://github.com/cosmos/gaia) at 2021-03-15. LBM is a mainnet app implementation using [lbm-sdk](https://github.com/line/lbm-sdk) and [ostracon](https://github.com/line/ostracon).
This repository hosts `Finschia`. This repository is forked from [gaia](https://github.com/cosmos/gaia) at 2021-03-15. Finschia is a mainnet app implementation using [lbm-sdk](https://github.com/line/lbm-sdk), [ostracon](https://github.com/line/ostracon), [wasmd](https://github.com/line/wasmd) and [ibc-go](https://github.com/line/ibc-go).

**Node**: Requires [Go 1.18+](https://golang.org/dl/)

Expand Down Expand Up @@ -31,7 +31,7 @@ sh init_single.sh docker testnet # prepare keys, validators, initial state, etc

**Run**
```
docker run -i -p 26656:26656 -p 26657:26657 -v ${HOME}/.lbm:/root/.lbm line/lbm lbm start
docker run -i -p 26656:26656 -p 26657:26657 -v ${HOME}/.finschia:/root/.finschia line/lbm lbm start
```

## Local
Expand Down
4 changes: 2 additions & 2 deletions ante/ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"github.com/stretchr/testify/suite"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

linkapp "github.com/line/lbm/app"
linkhelpers "github.com/line/lbm/app/helpers"
linkapp "github.com/line/finschia/app"
linkhelpers "github.com/line/finschia/app/helpers"
)

type IntegrationTestSuite struct {
Expand Down
8 changes: 4 additions & 4 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ import (
wasmpluskeeper "github.com/line/wasmd/x/wasmplus/keeper"
wasmplustypes "github.com/line/wasmd/x/wasmplus/types"

appante "github.com/line/lbm/ante"
appparams "github.com/line/lbm/app/params"
appante "github.com/line/finschia/ante"
appparams "github.com/line/finschia/app/params"

// unnamed import of statik for swagger UI support
_ "github.com/line/lbm-sdk/client/docs/statik"
)

const appName = "LBM"
const appName = "Finschia"

var (
// DefaultNodeHome default home directories for the application daemon
Expand Down Expand Up @@ -261,7 +261,7 @@ func init() {
stdlog.Println("Failed to get home dir %2", err)
}

DefaultNodeHome = filepath.Join(userHomeDir, ".lbm")
DefaultNodeHome = filepath.Join(userHomeDir, ".finschia")
}

// NewLinkApp returns a reference to an initialized Link.
Expand Down
3 changes: 2 additions & 1 deletion app/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package app

import (
"github.com/line/lbm-sdk/std"
"github.com/line/lbm/app/params"

"github.com/line/finschia/app/params"
)

// MakeEncodingConfig creates an EncodingConfig for testing
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"

linkapp "github.com/line/lbm/app"
linkapp "github.com/line/finschia/app"
)

// SimAppChainID hardcoded chainID for simulation
Expand Down
Loading