diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1bad8a49..b7b9eef7 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -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: @@ -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' diff --git a/.goreleaser.yml b/.goreleaser.yml index a1412943..b8ed090c 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index ed44803f..67aa985a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Dockerfile b/Dockerfile index 779358e9..395a593a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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 @@ -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 diff --git a/Makefile b/Makefile index ea0e7743..843ee99d 100644 --- a/Makefile +++ b/Makefile @@ -50,11 +50,11 @@ 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 @@ -62,11 +62,11 @@ else 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 @@ -74,14 +74,14 @@ else 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 @@ -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 @@ -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) \ @@ -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) @@ -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 @@ -160,14 +160,14 @@ 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 @@ -175,7 +175,7 @@ build-release-bundle: build @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,*) \ @@ -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)/ @@ -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) @@ -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/ @@ -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 @@ -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 ############################################################################### diff --git a/README.md b/README.md index d50608b1..a4aed780 100644 --- a/README.md +++ b/README.md @@ -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/) @@ -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 diff --git a/ante/ante_test.go b/ante/ante_test.go index b6f8fb0c..dc85b263 100644 --- a/ante/ante_test.go +++ b/ante/ante_test.go @@ -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 { diff --git a/app/app.go b/app/app.go index 5497dc7d..a374e46f 100644 --- a/app/app.go +++ b/app/app.go @@ -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 @@ -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. diff --git a/app/encoding.go b/app/encoding.go index 45fd0f35..83b78824 100644 --- a/app/encoding.go +++ b/app/encoding.go @@ -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 diff --git a/app/helpers/test_helpers.go b/app/helpers/test_helpers.go index 1e7346bf..bffe8d2e 100644 --- a/app/helpers/test_helpers.go +++ b/app/helpers/test_helpers.go @@ -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 diff --git a/builders/Dockerfile.static b/builders/Dockerfile.static index 85b8e3c3..ec0f64b2 100644 --- a/builders/Dockerfile.static +++ b/builders/Dockerfile.static @@ -1,27 +1,26 @@ # Simple usage with a mounted data directory: -# > docker build --platform="linux/amd64" -t line/lbm -f builders/Dockerfile.static . --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 build --platform="linux/amd64" -t line/finschia -f builders/Dockerfile.static . --build-arg ARCH=x86_64 +# > docker run -it -p 26656:26656 -p 26657:26657 -v ~/.finschia:/root/.finschia -v line/finschia fnsad init +# > docker run -it -p 26656:26656 -p 26657:26657 -v ~/.finschia:/root/.finschia -v line/finschia 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 LBM_BUILD_OPTIONS="" +ARG FINSCHIA_BUILD_OPTIONS="" ARG ARCH=$ARCH # 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 + +#COPY ./Makefile ./ +#COPY ./contrib ./contrib +#COPY ./sims.mk ./ +COPY ./go.mod /finschia-build/finschia/go.mod +COPY ./go.sum /finschia-build/finschia/go.sum -# 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" # Install GO dependencies -COPY ./go.mod /lbm-build/lbm/go.mod -COPY ./go.sum /lbm-build/lbm/go.sum RUN go mod download # Install libwasmvm.*.a @@ -33,6 +32,9 @@ RUN ln -s /lib/libwasmvm_muslc.${ARCH}.a /usr/lib/libwasmvm_muslc.a # Add source files COPY . . +# prepare dbbackend before building; this can be cached +RUN make dbbackend FINSCHIA_BUILD_OPTIONS="$FINSCHIA_BUILD_OPTIONS" + # Make install RUN BUILD_TAGS=muslc make build CGO_ENABLED=1 @@ -41,12 +43,12 @@ FROM alpine:edge # Set up OS dependencies RUN apk add --update --no-cache libstdc++ ca-certificates -COPY networks/local/lbmnode/wrapper.sh /usr/bin/wrapper.sh +COPY networks/local/finschianode/wrapper.sh /usr/bin/wrapper.sh -VOLUME /lbm +VOLUME /finschia # Copy over binaries from the build-env -COPY --from=build-env /lbm-build/lbm/build/lbm /lbm/ -WORKDIR /lbm +COPY --from=build-env /finschia-build/finschia/build/fnsad /finschia/ +WORKDIR /finschia EXPOSE 26656 26657 ENTRYPOINT ["/usr/bin/wrapper.sh"] diff --git a/builders/Dockerfile.static_centos7 b/builders/Dockerfile.static_centos7 index fd85a75e..e4e63c2c 100644 --- a/builders/Dockerfile.static_centos7 +++ b/builders/Dockerfile.static_centos7 @@ -1,15 +1,15 @@ # make image -# > docker build -t line/lbm-builder:static -f builders/Dockerfile.static_centos7 . +# > docker build -t line/finschia-builder:static -f builders/Dockerfile.static_centos7 . # # run build -# > docker run -it --rm -v $(pwd):/code line/lbm-builder:static_centos7 +# > docker run -it --rm -v $(pwd):/code line/finschia-builder:static_centos7 # # make image and run build -# > docker run -it --rm -v $(pwd):/code -e LBM_BUILD_OPTIONS=rocksdb $(docker build -f builders/Dockerfile.static_centos7 -q .) +# > docker run -it --rm -v $(pwd):/code -e FINSCHIA_BUILD_OPTIONS=rocksdb $(docker build -f builders/Dockerfile.static_centos7 -q .) -FROM centos:7.6.1810 +FROM centos:centos7 -ENV LBM_BUILD_OPTIONS="goleveldb" +ENV FINSCHIA_BUILD_OPTIONS="goleveldb" RUN yum -y update && \ @@ -60,5 +60,5 @@ WORKDIR /code # copy build script COPY builders/scripts/build-static.sh builders/scripts/build-static.sh -# # build lbm +# build Finschia ENTRYPOINT builders/scripts/build-static.sh diff --git a/builders/scripts/build-static.sh b/builders/scripts/build-static.sh index c61cfeae..eb654132 100755 --- a/builders/scripts/build-static.sh +++ b/builders/scripts/build-static.sh @@ -24,5 +24,5 @@ rm -rf target cd "${PROJECT_ROOT}" || exit 1 -# build lbm -BUILD_TAGS=static LINK_STATICALLY=true make build LBM_BUILD_OPTIONS="${LBM_BUILD_OPTIONS}" +# build Finschia +BUILD_TAGS=static LINK_STATICALLY=true make build FINSCHIA_BUILD_OPTIONS="${FINSCHIA_BUILD_OPTIONS}" diff --git a/builders/scripts/install-libwasmvm.sh b/builders/scripts/install-libwasmvm.sh index 9f0b07be..f8050b9a 100644 --- a/builders/scripts/install-libwasmvm.sh +++ b/builders/scripts/install-libwasmvm.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# This script is used in the Dockerfiles and installs the lbm dependency libwasmvm.*.a into the container image. +# This script is used in the Dockerfiles and installs the Finschia dependency libwasmvm.*.a into the container image. # See also https://github.com/line/wasmvm/releases set -e diff --git a/cli_test/README.md b/cli_test/README.md index 89dff395..1c0e9c48 100644 --- a/cli_test/README.md +++ b/cli_test/README.md @@ -10,9 +10,9 @@ go test -mod=readonly -v -p 4 `go list ./cli_test/...` -tags=cli_test ### Test Structure -This integration suite [uses a thin wrapper](https://github.com/line/lbm-sdk/tree/main/tests) over the [`os/exec`](https://golang.org/pkg/os/exec/) package. This allows the integration test to run against built binary (`lbm` is used) while being written in golang. This allows tests to take advantage of the various golang code we have for operations like marshal/unmarshal, crypto, etc... +This integration suite [uses a thin wrapper](https://github.com/line/lbm-sdk/tree/main/tests) over the [`os/exec`](https://golang.org/pkg/os/exec/) package. This allows the integration test to run against built binary (`fnsad` is used) while being written in golang. This allows tests to take advantage of the various golang code we have for operations like marshal/unmarshal, crypto, etc... -> NOTE: The tests will use whatever `lbm` binary is available in your `$PATH`. You can check which binary will be run by the suite by running `which lbm`. If you have your `$GOPATH` properly setup they should be in `$GOPATH/bin/lbm`. This will ensure that your test uses the latest binary you have built +> NOTE: The tests will use whatever `fnsad` binary is available in your `$PATH`. You can check which binary will be run by the suite by running `which finschia`. If you have your `$GOPATH` properly setup they should be in `$GOPATH/bin/finschia`. This will ensure that your test uses the latest binary you have built Tests generally follow this structure: @@ -22,7 +22,7 @@ func TestMyNewCommand(t *testing.T) { f := InitFixtures(t) defer f.Cleanup() - // start lbm server + // start finschia server proc := f.GDStart() defer func() { require.NoError(t, proc.Stop(false)) }() @@ -33,19 +33,19 @@ func TestMyNewCommand(t *testing.T) { This boilerplate above: - Ensures the tests run in parallel. Because the tests are calling out to `os/exec` for many operations these tests can take a long time to run. -- Creates `.lbm` folder in a new temp folder. -- Uses `lbm` to create 2 accounts for use in testing: `foo` and `bar` +- Creates `.fisnchia` folder in a new temp folder. +- Uses `fnsad` to create 2 accounts for use in testing: `foo` and `bar` - Creates a genesis file with coins (`1000footoken,1000feetoken,150stake`) controlled by the `foo` key - Generates an initial bonding transaction (`gentx`) to make the `foo` key a validator at genesis -- Starts `lbm` and stops it once the test exits +- Starts `fnsad` and stops it once the test exits - Cleans up test state on a successful run ### Notes when adding/running tests - Because the tests run against a built binary, you should make sure you build every time the code changes and you want to test again, otherwise you will be testing against an older version. If you are adding new tests this can easily lead to confusing test results. -- The [`test_helpers.go`](./test_helpers.go) file is organized according to the format of `lbm` commands. There are comments with section headers describing the different areas. Helper functions to call CLI functionality are generally named after the command (e.g. `lbm query staking validator` would be `QueryStakingValidator`). Try to keep functions grouped by their position in the command tree. +- The [`test_helpers.go`](./test_helpers.go) file is organized according to the format of `fnsad` commands. There are comments with section headers describing the different areas. Helper functions to call CLI functionality are generally named after the command (e.g. `fnsad query staking validator` would be `QueryStakingValidator`). Try to keep functions grouped by their position in the command tree. - Test state that is needed by `tx` and `query` commands (`home`, `chain_id`, etc...) is stored on the `Fixtures` object. This makes constructing your new tests almost trivial. -- Sometimes if you exit a test early there can be still running `lbm` processes that will interrupt subsequent runs. Still running `lbm` processes will block access to the keybase while still running `lbm` processes will block ports and prevent new tests from spinning up. You can ensure new tests spin up clean by running `pkill -9 lbm` before each test run. +- Sometimes if you exit a test early there can be still running `fnsad` processes that will interrupt subsequent runs. Still running `fnsad` processes will block access to the keybase while still running `fnsad` processes will block ports and prevent new tests from spinning up. You can ensure new tests spin up clean by running `pkill -9 fnsad` before each test run. - Most `query` and `tx` commands take a variadic `flags` argument. This pattern allows for the creation of a general function which is easily modified by adding flags. See the `TxSend` function and its use for a good example. - `Tx*` functions follow a general pattern and return `(success bool, stdout string, stderr string)`. This allows for easy testing of multiple different flag configurations. See `TestLinkCLICreateValidator` or `TestLinkCLISubmitProposal` for a good example of the pattern. diff --git a/cli_test/cli_test.go b/cli_test/cli_test.go index 1dc49ab5..c7c87e7f 100644 --- a/cli_test/cli_test.go +++ b/cli_test/cli_test.go @@ -21,9 +21,10 @@ import ( "github.com/line/lbm-sdk/types/tx" gov "github.com/line/lbm-sdk/x/gov/types" minttypes "github.com/line/lbm-sdk/x/mint/types" - "github.com/line/lbm/app" osttypes "github.com/line/ostracon/types" "github.com/stretchr/testify/require" + + "github.com/line/finschia/app" ) func TestLBMKeysAddMultisig(t *testing.T) { diff --git a/cli_test/multi_test.go b/cli_test/multi_test.go index 233c6eda..54b96b16 100644 --- a/cli_test/multi_test.go +++ b/cli_test/multi_test.go @@ -11,7 +11,8 @@ import ( "github.com/line/lbm-sdk/client/flags" "github.com/line/lbm-sdk/crypto/keys/ed25519" sdk "github.com/line/lbm-sdk/types" - "github.com/line/lbm/app" + + "github.com/line/finschia/app" ) func TestMultiValidatorAndSendTokens(t *testing.T) { @@ -19,7 +20,7 @@ func TestMultiValidatorAndSendTokens(t *testing.T) { fg := InitFixturesGroup(t) - fg.LBMStartCluster(minGasPrice.String()) + fg.FinschiaStartCluster(minGasPrice.String()) defer fg.Cleanup() f := fg.Fixture(0) @@ -98,7 +99,7 @@ func TestMultiValidatorAddNodeAndPromoteValidator(t *testing.T) { t.Parallel() fg := InitFixturesGroup(t) - fg.LBMStartCluster(minGasPrice.String()) + fg.FinschiaStartCluster(minGasPrice.String()) defer fg.Cleanup() f1 := fg.Fixture(0) diff --git a/cli_test/test_helpers.go b/cli_test/test_helpers.go index 4c9d08ea..e6f892c0 100644 --- a/cli_test/test_helpers.go +++ b/cli_test/test_helpers.go @@ -19,10 +19,6 @@ import ( "github.com/spf13/cobra" "github.com/stretchr/testify/require" - "github.com/line/lbm/app" - lbmcmd "github.com/line/lbm/cmd/lbm/cmd" - lbmtypes "github.com/line/lbm/types" - "github.com/line/lbm-sdk/baseapp" "github.com/line/lbm-sdk/client" clientkeys "github.com/line/lbm-sdk/client/keys" @@ -65,6 +61,10 @@ import ( ostctypes "github.com/line/ostracon/rpc/core/types" osttypes "github.com/line/ostracon/types" wasmtypes "github.com/line/wasmd/x/wasm/types" + + "github.com/line/finschia/app" + lbmcmd "github.com/line/finschia/cmd/fnsad/cmd" + lbmtypes "github.com/line/finschia/types" ) const ( @@ -1187,7 +1187,7 @@ func (fg *FixtureGroup) initNodes(numberOfNodes int) { require.NoError(t, err) } } -func (fg *FixtureGroup) LBMStartCluster(minGasPrices string, flags ...string) { +func (fg *FixtureGroup) FinschiaStartCluster(minGasPrices string, flags ...string) { genDoc, err := osttypes.GenesisDocFromJSON(fg.genesisFileContent) require.NoError(fg.T, err) diff --git a/cmd/lbm/cmd/genaccounts.go b/cmd/fnsad/cmd/genaccounts.go similarity index 100% rename from cmd/lbm/cmd/genaccounts.go rename to cmd/fnsad/cmd/genaccounts.go diff --git a/cmd/lbm/cmd/genaccounts_test.go b/cmd/fnsad/cmd/genaccounts_test.go similarity index 100% rename from cmd/lbm/cmd/genaccounts_test.go rename to cmd/fnsad/cmd/genaccounts_test.go diff --git a/cmd/lbm/cmd/root.go b/cmd/fnsad/cmd/root.go similarity index 94% rename from cmd/lbm/cmd/root.go rename to cmd/fnsad/cmd/root.go index b9e38f56..93336cc8 100644 --- a/cmd/lbm/cmd/root.go +++ b/cmd/fnsad/cmd/root.go @@ -27,7 +27,6 @@ import ( banktypes "github.com/line/lbm-sdk/x/bank/types" "github.com/line/lbm-sdk/x/crisis" genutilcli "github.com/line/lbm-sdk/x/genutil/client/cli" - lbmtypes "github.com/line/lbm/types" ostcli "github.com/line/ostracon/libs/cli" "github.com/line/ostracon/libs/log" "github.com/line/wasmd/x/wasm" @@ -38,8 +37,9 @@ import ( "github.com/spf13/viper" dbm "github.com/tendermint/tm-db" - "github.com/line/lbm/app" - "github.com/line/lbm/app/params" + "github.com/line/finschia/app" + "github.com/line/finschia/app/params" + fnsatypes "github.com/line/finschia/types" ) const ( @@ -61,8 +61,8 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) { WithViper("") rootCmd := &cobra.Command{ - Use: "lbm", - Short: "LINE Blockchain Mainnet (LBM) App", + Use: "fnsad", + Short: "Finschia Mainnet App", PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { // set the default command outputs cmd.SetOut(cmd.OutOrStdout()) @@ -81,7 +81,7 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) { if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil { return err } - return lbmPreRunE(cmd) + return fnsaPreRunE(cmd) }, } rootCmd.PersistentFlags().Bool(flagTestnet, false, "Run with testnet mode. The address prefix becomes tlink if this flag is set.") @@ -322,15 +322,15 @@ func createSimappAndExport( func initConfig(testnet bool) { config := sdk.GetConfig() - config.SetCoinType(lbmtypes.CoinType) - config.SetBech32PrefixForAccount(lbmtypes.Bech32PrefixAcc(testnet), lbmtypes.Bech32PrefixAccPub(testnet)) - config.SetBech32PrefixForConsensusNode(lbmtypes.Bech32PrefixConsAddr(testnet), lbmtypes.Bech32PrefixConsPub(testnet)) - config.SetBech32PrefixForValidator(lbmtypes.Bech32PrefixValAddr(testnet), lbmtypes.Bech32PrefixValPub(testnet)) + config.SetCoinType(fnsatypes.CoinType) + config.SetBech32PrefixForAccount(fnsatypes.Bech32PrefixAcc(testnet), fnsatypes.Bech32PrefixAccPub(testnet)) + config.SetBech32PrefixForConsensusNode(fnsatypes.Bech32PrefixConsAddr(testnet), fnsatypes.Bech32PrefixConsPub(testnet)) + config.SetBech32PrefixForValidator(fnsatypes.Bech32PrefixValAddr(testnet), fnsatypes.Bech32PrefixValPub(testnet)) config.GetCoinType() config.Seal() } -func lbmPreRunE(cmd *cobra.Command) (err error) { +func fnsaPreRunE(cmd *cobra.Command) (err error) { customAppTemplate, customAppConfig := initAppConfig() err = server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig) diff --git a/cmd/lbm/cmd/root_test.go b/cmd/fnsad/cmd/root_test.go similarity index 100% rename from cmd/lbm/cmd/root_test.go rename to cmd/fnsad/cmd/root_test.go diff --git a/cmd/lbm/cmd/testnet.go b/cmd/fnsad/cmd/testnet.go similarity index 98% rename from cmd/lbm/cmd/testnet.go rename to cmd/fnsad/cmd/testnet.go index b947732a..fa3b0225 100644 --- a/cmd/lbm/cmd/testnet.go +++ b/cmd/fnsad/cmd/testnet.go @@ -47,14 +47,14 @@ var ( func testnetCmd(mbm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator) *cobra.Command { cmd := &cobra.Command{ Use: "testnet", - Short: "Initialize files for a lbm testnet", + Short: "Initialize files for a fnsad testnet", Long: `testnet will create "v" number of directories and populate each with necessary files (private validator, genesis, config, etc.). Note, strict routability for addresses is turned off in the config file. Example: - lbm testnet --v 4 --output-dir ./output --starting-ip-address 192.168.10.2 + fnsad testnet --v 4 --output-dir ./output --starting-ip-address 192.168.10.2 `, RunE: func(cmd *cobra.Command, _ []string) error { clientCtx, err := client.GetClientQueryContext(cmd) @@ -84,7 +84,7 @@ Example: cmd.Flags().Int(flagNumValidators, 4, "Number of validators to initialize the testnet with") cmd.Flags().StringP(flagOutputDir, "o", "./mytestnet", "Directory to store initialization data for the testnet") cmd.Flags().String(flagNodeDirPrefix, "node", "Prefix the directory name for each node with (node results in node0, node1, ...)") - cmd.Flags().String(flagNodeDaemonHome, "lbm", "Home directory of the node's daemon configuration") + cmd.Flags().String(flagNodeDaemonHome, "finschia", "Home directory of the node's daemon configuration") cmd.Flags().String(flagStartingIPAddress, "192.168.0.1", "Starting IP address (192.168.0.1 results in persistent peers list ID0@192.168.0.1:46656, ID1@192.168.0.2:46656, ...)") cmd.Flags().String(flags.FlagChainID, "", "genesis file chain-id, if left blank will be randomly created") cmd.Flags().String(server.FlagMinGasPrices, fmt.Sprintf("0.000006%s", sdk.DefaultBondDenom), "Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.01photino,0.001stake)") diff --git a/cmd/lbm/cmd/testnet_test.go b/cmd/fnsad/cmd/testnet_test.go similarity index 98% rename from cmd/lbm/cmd/testnet_test.go rename to cmd/fnsad/cmd/testnet_test.go index ad3930fa..120a7f61 100644 --- a/cmd/lbm/cmd/testnet_test.go +++ b/cmd/fnsad/cmd/testnet_test.go @@ -11,10 +11,11 @@ import ( banktypes "github.com/line/lbm-sdk/x/bank/types" genutiltest "github.com/line/lbm-sdk/x/genutil/client/testutil" genutiltypes "github.com/line/lbm-sdk/x/genutil/types" - "github.com/line/lbm/app" "github.com/line/ostracon/libs/log" "github.com/spf13/viper" "github.com/stretchr/testify/require" + + "github.com/line/finschia/app" ) func Test_TestnetCmd(t *testing.T) { diff --git a/cmd/lbm/main.go b/cmd/fnsad/main.go similarity index 81% rename from cmd/lbm/main.go rename to cmd/fnsad/main.go index 984cbcc9..81efa279 100644 --- a/cmd/lbm/main.go +++ b/cmd/fnsad/main.go @@ -6,8 +6,8 @@ import ( "github.com/line/lbm-sdk/server" svrcmd "github.com/line/lbm-sdk/server/cmd" - "github.com/line/lbm/app" - "github.com/line/lbm/cmd/lbm/cmd" + "github.com/line/finschia/app" + "github.com/line/finschia/cmd/fnsad/cmd" ) func main() { diff --git a/contrib/Dockerfile.test b/contrib/Dockerfile.test index ed03aaec..4aecf89e 100644 --- a/contrib/Dockerfile.test +++ b/contrib/Dockerfile.test @@ -1,7 +1,7 @@ # Simple usage with a mounted data directory: # > docker build -t link . -# > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.lbm:/root/.lbm -v ~/.linkcli:/root/.linkcli link lbm init -# > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.lbm:/root/.lbm -v ~/.linkcli:/root/.linkcli link lbm start +# > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.finschia:/root/.finschia -v ~/.linkcli:/root/.linkcli link fnsad init +# > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.finschia:/root/.finschia -v ~/.linkcli:/root/.linkcli link fnsad start FROM golang:1.18-alpine AS build-env # Set up dependencies @@ -25,7 +25,7 @@ RUN apk add --update ca-certificates WORKDIR /root # 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 COPY ./contrib/single-node.sh . diff --git a/contrib/githooks/pre-commit b/contrib/githooks/pre-commit index fe4f8c83..fd9ec444 100755 --- a/contrib/githooks/pre-commit +++ b/contrib/githooks/pre-commit @@ -31,7 +31,7 @@ if [[ $STAGED_GO_FILES != "" ]]; then gofmt -w -s $file misspell -w $file - goimports -w -local github.com/line/lbm $file + goimports -w -local github.com/line/finschia $file git add $file done diff --git a/contrib/githooks/precommit b/contrib/githooks/precommit index fe4f8c83..fd9ec444 100644 --- a/contrib/githooks/precommit +++ b/contrib/githooks/precommit @@ -31,7 +31,7 @@ if [[ $STAGED_GO_FILES != "" ]]; then gofmt -w -s $file misspell -w $file - goimports -w -local github.com/line/lbm $file + goimports -w -local github.com/line/finschia $file git add $file done diff --git a/contrib/single-node.sh b/contrib/single-node.sh index de8523dd..95cea72c 100755 --- a/contrib/single-node.sh +++ b/contrib/single-node.sh @@ -11,17 +11,17 @@ fi # Build genesis file incl account for passed address coins="10000000000stake,100000000000samoleans" -lbm init --chain-id $CHAINID $CHAINID -lbm keys add validator --keyring-backend="test" -lbm add-genesis-account $(lbm keys show validator -a --keyring-backend="test") $coins -lbm gentx validator 5000000000stake --keyring-backend="test" --chain-id $CHAINID -lbm collect-gentxs +fnsad init --chain-id $CHAINID $CHAINID +fnsad keys add validator --keyring-backend="test" +fnsad add-genesis-account $(fnsad keys show validator -a --keyring-backend="test") $coins +fnsad gentx validator 5000000000stake --keyring-backend="test" --chain-id $CHAINID +fnsad collect-gentxs # Set proper defaults and change ports -sed -i 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:26657"#g' ~/.lbm/config/config.toml -sed -i 's/timeout_commit = "5s"/timeout_commit = "1s"/g' ~/.lbm/config/config.toml -sed -i 's/timeout_propose = "3s"/timeout_propose = "1s"/g' ~/.lbm/config/config.toml -sed -i 's/index_all_keys = false/index_all_keys = true/g' ~/.lbm/config/config.toml +sed -i 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:26657"#g' ~/.fisnchia/config/config.toml +sed -i 's/timeout_commit = "5s"/timeout_commit = "1s"/g' ~/.fisnchia/config/config.toml +sed -i 's/timeout_propose = "3s"/timeout_propose = "1s"/g' ~/.fisnchia/config/config.toml +sed -i 's/index_all_keys = false/index_all_keys = true/g' ~/.fisnchia/config/config.toml # Start the link -lbm start --pruning=nothing +fnsad start --pruning=nothing diff --git a/docker-compose.yml b/docker-compose.yml index 36535b75..8f50fe45 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,9 @@ version: '3' services: - lbmnode0: - container_name: lbmnode0 - image: "line/lbmnode" + fnsadnode0: + container_name: fnsadnode0 + image: "line/finschianode" ports: - "26656-26657:26656-26657" environment: @@ -15,9 +15,9 @@ services: localnet: ipv4_address: 192.168.10.2 - lbmnode1: - container_name: lbmnode1 - image: "line/lbmnode" + fnsadnode1: + container_name: fnsadnode1 + image: "line/finschianode" ports: - "26659-26660:26656-26657" environment: @@ -29,9 +29,9 @@ services: localnet: ipv4_address: 192.168.10.3 - lbmnode2: - container_name: lbmnode2 - image: "line/lbmnode" + fnsadnode2: + container_name: fnsadnode2 + image: "line/finschianode" environment: - ID=2 - LOG=${LOG:-lbm.log} @@ -43,9 +43,9 @@ services: localnet: ipv4_address: 192.168.10.4 - lbmnode3: - container_name: lbmnode3 - image: "line/lbmnode" + fnsadnode3: + container_name: fnsadnode3 + image: "line/finschianode" environment: - ID=3 - LOG=${LOG:-lbm.log} diff --git a/docs/DOCS_README.md b/docs/DOCS_README.md index 8a88a33a..917a6632 100644 --- a/docs/DOCS_README.md +++ b/docs/DOCS_README.md @@ -5,15 +5,15 @@ parent: # Updating the docs -If you want to open a PR on LBM to update the documentation, please follow the guidelines in the [`CONTRIBUTING.md`](https://github.com/line/lbm/tree/main/CONTRIBUTING.md) +If you want to open a PR on Finschia to update the documentation, please follow the guidelines in the [`CONTRIBUTING.md`](https://github.com/line/finschia/tree/main/CONTRIBUTING.md) ## Docs Build Workflow -The documentation for LBM is hosted at: +The documentation for Finschia is hosted at: - https://docs-blockchain.line.biz -built from the files in this (`/docs`) directory for [main](https://github.com/line/lbm/tree/main/docs) +built from the files in this (`/docs`) directory for [main](https://github.com/line/finschia/tree/main/docs) ## README diff --git a/docs/README.md b/docs/README.md index 4026b5c5..d2a0f849 100644 --- a/docs/README.md +++ b/docs/README.md @@ -4,30 +4,30 @@ parent: layout: home --> -# LBM(LINE Blockchain Mainnet) Documentation +# Finschia Mainnet Documentation -Welcome to the documentation of the **LINE Blockchain Mainnet: `lbm`**. +Welcome to the documentation of the **Finschia Mainnet**. -## What is LBM? +## What is Finschia? -- [Intro to the `lbm` software](lbm-tutorials/what-is-lbm.md) +- [Intro to the `fnsad` software](finschia-tutorials/what-is-finschia.md) -## Join the LINE Blockchain Mainnet +## Join the Finschia Mainnet -- [Install the `lbm` application](./lbm-tutorials/installation.md) -- [Set up a full node and join the mainnet](./lbm-tutorials/join-mainnet.md) +- [Install the `fnsad` application](finschia-tutorials/installation.md) +- [Set up a full node and join the mainnet](finschia-tutorials/join-mainnet.md) - [Upgrade to a validator node](./validators/validator-setup.md) -## Setup Your Own `lbm` Testnet +## Setup Your Own `Finschia` Testnet -- [Setup your own `lbm` testnet](./lbm-tutorials/deploy-testnet.md) +- [Setup your own `fnsad` testnet](finschia-tutorials/deploy-testnet.md) ## Additional Resources -- [Validator Resources](./validators/README.md): Contains documentation for `lbm` validators. +- [Validator Resources](./validators/README.md): Contains documentation for `finschia` validators. - [Delegator Resources](./delegators/README.md): Contains documentation for delegators. -- [Other Resources](./resources/README.md): Contains documentation on `lbm`, genesis file, service providers, ledger wallets, ... -- [LBM Archives](./resources/archives.md): State archives of past iteration of the LINE Blockchain Mainnet. +- [Other Resources](./resources/README.md): Contains documentation on `finschia`, genesis file, service providers, ledger wallets, ... +- [Finschia Archives](./resources/archives.md): State archives of past iteration of the Finschia Mainnet. # Contribute diff --git a/docs/delegators/delegator-guide-cli.md b/docs/delegators/delegator-guide-cli.md index 8da4e5a8..427e0a97 100644 --- a/docs/delegators/delegator-guide-cli.md +++ b/docs/delegators/delegator-guide-cli.md @@ -4,7 +4,7 @@ order: 1 # Delegator Guide (CLI) -This document contains all the necessary information for delegators to interact with the LBM through the Command-Line Interface (CLI). +This document contains all the necessary information for delegators to interact with the Finschia through the Command-Line Interface (CLI). It also contains instructions on how to manage accounts, restore accounts from the fundraiser and use a ledger nano device. @@ -14,7 +14,7 @@ carefully, as negligence in this significant process could lead to an indefinite loss of your base coin. Therefore, read through the following instructions in their entirety prior to proceeding and reach out to us in case you need support. -Please also note that you are about to interact with the LBM, a +Please also note that you are about to interact with the Finschia, a blockchain technology containing highly experimental software. While the blockchain has been developed in accordance to the state of the art and audited with utmost care, we can nevertheless expect to have issues, updates and bugs. @@ -32,14 +32,14 @@ Please exercise extreme caution! ## Table of Contents -- [Installing `lbm`](#installing-lbm) -- [LBM Accounts](#lbm-accounts) +- [Installing `fnsad`](#installing-finschia) +- [Finschia Accounts](#finschia-accounts) + [Restoring an Account from the Fundraiser](#restoring-an-account-from-the-fundraiser) + [Creating an Account](#creating-an-account) -- [Accessing a LINE Blockchain Mainnet](#accessing-a-line-blockchain-mainnet) +- [Accessing a Finschia Mainnet](#accessing-a-line-blockchain-mainnet) + [Running Your Own Full-Node](#running-your-own-full-node) + [Connecting to a Remote Full-Node](#connecting-to-a-remote-full-node) -- [Setting Up `lbm`](#setting-up-lbm) +- [Setting Up `fnsad`](#setting-up-finschia) - [Querying the State](#querying-the-state) - [Sending Transactions](#sending-transactions) + [A Note on Gas and Fees](#a-note-on-gas-and-fees) @@ -47,29 +47,29 @@ Please exercise extreme caution! + [Participating in Governance](#participating-in-governance) + [Signing Transactions from an Offline Computer](#signing-transactions-from-an-offline-computer) -## Installing `lbm` +## Installing `fnsad` -`lbm`: This is the command-line interface to interact with a `lbm` full-node. +`fnsad`: This is the command-line interface to interact with a `fnsad` full-node. ::: warning -**Please check that you download the latest stable release of `lbm` that is available** +**Please check that you download the latest stable release of `fnsad` that is available** ::: [**Download the binaries**] Not available yet. -[**Install from source**](../lbm-tutorials/installation.md) +[**Install from source**](../finschia-tutorials/installation.md) ::: tip -`lbm` is used from a terminal. To open the terminal, follow these steps: +`fnsad` is used from a terminal. To open the terminal, follow these steps: - **Windows**: `Start` > `All Programs` > `Accessories` > `Command Prompt` - **MacOS**: `Finder` > `Applications` > `Utilities` > `Terminal` - **Linux**: `Ctrl` + `Alt` + `T` ::: -## LBM Accounts +## Finschia Accounts -At the core of every LBM account, there is a seed, which takes the form of a 12 or 24-words mnemonic. From this mnemonic, it is possible to create any number of LBM accounts, i.e. pairs of private key/public key. This is called an HD wallet (see [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) for more information on the HD wallet specification). +At the core of every Finschia account, there is a seed, which takes the form of a 12 or 24-words mnemonic. From this mnemonic, it is possible to create any number of Fisnchia accounts, i.e. pairs of private key/public key. This is called an HD wallet (see [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) for more information on the HD wallet specification). ``` Account 0 Account 1 Account 2 @@ -118,11 +118,11 @@ The address is a public string with a human-readable prefix (e.g. `link1twsfmuj2 *NOTE: This section only concerns fundraiser participants* ::: -If you participated in the fundraiser, you should be in possession of a 12-words mnemonic. Newly generated mnemonics use 24 words, but 12-word mnemonics are also compatible with all the LBM tools. +If you participated in the fundraiser, you should be in possession of a 12-words mnemonic. Newly generated mnemonics use 24 words, but 12-word mnemonics are also compatible with all the Finschia tools. #### On a Ledger Device -At the core of a ledger device, there is a mnemonic used to generate accounts on multiple blockchains (including a LINE Blockchain Mainnet). Usually, you will create a new mnemonic when you initialize your ledger device. However, it is possible to tell the ledger device to use a mnemonic provided by the user instead. Let us go ahead and see how you can input the mnemonic you obtained during the fundraiser as the seed of your ledger device. +At the core of a ledger device, there is a mnemonic used to generate accounts on multiple blockchains (including a Finschia Mainnet). Usually, you will create a new mnemonic when you initialize your ledger device. However, it is possible to tell the ledger device to use a mnemonic provided by the user instead. Let us go ahead and see how you can input the mnemonic you obtained during the fundraiser as the seed of your ledger device. ::: warning *NOTE: To do this, **it is preferable to use a brand new ledger device.**. Indeed, there can be only one mnemonic per ledger device. If, however, you want to use a ledger that is already initialized with a seed, you can reset it by going in `Settings`>`Device`>`Reset All`. **Please note that this will wipe out the seed currently stored on the device. If you have not properly secured the associated mnemonic, you could lose your funds!!!*** @@ -150,7 +150,7 @@ Next, click [here](#using-a-ledger-device) to learn how to generate an account. To restore an account using a fundraiser mnemonic and store the associated encrypted private key on a computer, use the following command: ```bash -lbm keys add --recover +fnsad keys add --recover ``` - `` is the name of the account. It is a reference to the account number used to derive the key pair from the mnemonic. You will use this name to identify your account when you want to send a transaction. @@ -169,7 +169,7 @@ store security policies please refer to your operating system manual.** ### Creating an Account -To create an account, you just need to have `lbm` installed. Before creating it, you need to know where you intend to store and interact with your private keys. The best options are to store them in an offline dedicated computer or a ledger device. Storing them on your regular online computer involves more risk, since anyone who infiltrates your computer through the internet could exfiltrate your private keys and steal your funds. +To create an account, you just need to have `fnsad` installed. Before creating it, you need to know where you intend to store and interact with your private keys. The best options are to store them in an offline dedicated computer or a ledger device. Storing them on your regular online computer involves more risk, since anyone who infiltrates your computer through the internet could exfiltrate your private keys and steal your funds. #### Using a Ledger Device @@ -177,17 +177,17 @@ To create an account, you just need to have `lbm` installed. Before creating it, **Only use Ledger devices that you bought factory new or trust fully** ::: -When you initialize your ledger, a 24-word mnemonic is generated and stored in the device. This mnemonic is compatible with LBM and LBM accounts can be derived from it. Therefore, all you have to do is make your ledger compatible with `lbm`. To do so, you need to go through the following steps: +When you initialize your ledger, a 24-word mnemonic is generated and stored in the device. This mnemonic is compatible with Finschia and Finschia accounts can be derived from it. Therefore, all you have to do is make your ledger compatible with `fnsad`. To do so, you need to go through the following steps: 1. Download the Ledger Live app [here](https://www.ledger.com/pages/ledger-live). 2. Connect your ledger via USB and update to the latest firmware -3. Go to the ledger live app store, and download the "LBM" application (this can take a while). **Note: You may have to enable `Dev Mode` in the `Settings` of Ledger Live to be able to download the "LBM" application**. -4. Navigate to the LBM app on your ledger device +3. Go to the ledger live app store, and download the "Finschia" application (this can take a while). **Note: You may have to enable `Dev Mode` in the `Settings` of Ledger Live to be able to download the "Finschia" application**. +4. Navigate to the Finschia app on your ledger device Then, to create an account, use the following command: ```bash -lbm keys add --ledger +fnsad keys add --ledger ``` ::: warning @@ -206,7 +206,7 @@ lbm keys add --ledger To generate an account, just use the following command: ```bash -lbm keys add +fnsad keys add ``` The command will generate a 24-words mnemonic and save the private and public keys for account `0` @@ -241,13 +241,13 @@ rm ~/.bash_history You can generate more accounts from the same mnemonic using the following command: ```bash -lbm keys add --recover --account 1 +fnsad keys add --recover --account 1 ``` This command will prompt you to input a passphrase as well as your mnemonic. Change the account number to generate a different account. -## Accessing a LINE Blockchain Mainnet +## Accessing a Finschia Mainnet In order to query the state and send transactions, you need a way to access the network. To do so, you can either run your own full-node, or connect to someone else's. @@ -259,30 +259,30 @@ In order to query the state and send transactions, you need a way to access the This is the most secure option, but comes with relatively high resource requirements. In order to run your own full-node, you need good bandwidth and at least 1TB of disk space. -You will find the tutorial on how to install `lbm` [here](../lbm-tutorials/installation.md), and the guide to run a full-node [here](../lbm-tutorials/join-mainnet.md). +You will find the tutorial on how to install `fnsad` [here](../finschia-tutorials/installation.md), and the guide to run a full-node [here](../finschia-tutorials/join-mainnet.md). ### Connecting to a Remote Full-Node If you do not want or cannot run your own node, you can connect to someone else's full-node. You should pick an operator you trust, because a malicious operator could return incorrect query results or censor your transactions. However, they will never be able to steal your funds, as your private keys are stored locally on your computer or ledger device. Possible options of full-node operators include validators, wallet providers or exchanges. -In order to connect to the full-node, you will need an address of the following form: `https://77.87.106.33:26657` (*Note: This is a placeholder*). This address has to be communicated by the full-node operator you choose to trust. You will use this address in the [following section](#setting-up-lbm). +In order to connect to the full-node, you will need an address of the following form: `https://77.87.106.33:26657` (*Note: This is a placeholder*). This address has to be communicated by the full-node operator you choose to trust. You will use this address in the [following section](#setting-up-finschia). -## Setting Up `lbm` +## Setting Up `fnsad` ::: tip -**Before setting up `lbm`, make sure you have set up a way to [access a LINE Blockchain Mainnet](#accessing-a-line-blockchain-mainnet)** +**Before setting up `fnsad`, make sure you have set up a way to [access a Finschia Mainnet](#accessing-a-line-blockchain-mainnet)** ::: ::: warning -**Please check that you are always using the latest stable release of `lbm`** +**Please check that you are always using the latest stable release of `fnsad`** ::: -`lbm` is the tool that enables you to interact with the node that runs on a LINE Blockchain Mainnet, whether you run it yourself or not. Let us set it up properly. +`fnsad` is the tool that enables you to interact with the node that runs on a Finschia Mainnet, whether you run it yourself or not. Let us set it up properly. -In order to set up `lbm`, use the following command: +In order to set up `fnsad`, use the following command: ```bash -lbm config +fnsad config ``` It allows you to set a default value for each given flag. @@ -290,9 +290,9 @@ It allows you to set a default value for each given flag. First, set up the address of the full-node you want to connect to: ```bash -lbm config node :: +fnsad query account // query the list of validators -lbm query staking validators +fnsad query staking validators // query the information of a validator given their address (e.g. linkvaloper1ghekyjucln7y67ntx7cf27m9dpuxxemnjz9hqc) -lbm query staking validator +fnsad query staking validator // query all delegations made from a delegator given their address (e.g. link1qyqszqgpqyqszqgpqyqszqgpqyqszqgp8apuk5) -lbm query staking delegations +fnsad query staking delegations // query a specific delegation made from a delegator (e.g. link1qyqszqgpqyqszqgpqyqszqgpqyqszqgp8apuk5) to a validator (e.g. linkvaloper1ghekyjucln7y67ntx7cf27m9dpuxxemnjz9hqc) given their addresses -lbm query staking delegation +fnsad query staking delegation // query the rewards of a delegator given a delegator address (e.g. link1qyqszqgpqyqszqgpqyqszqgpqyqszqgp8apuk5) -lbm query distribution rewards +fnsad query distribution rewards // query all proposals currently open for depositing -lbm query gov proposals --status deposit_period +fnsad query gov proposals --status deposit_period // query all proposals currently open for voting -lbm query gov proposals --status voting_period +fnsad query gov proposals --status voting_period // query a proposal given its proposalID -lbm query gov proposal +fnsad query gov proposal ``` For more commands, just type: ```bash -lbm query +fnsad query ``` For each command, you can use the `-h` or `--help` flag to get more information. @@ -359,12 +359,12 @@ For each command, you can use the `-h` or `--help` flag to get more information. ## Sending Transactions ::: warning -On a LINE Blockchain Mainnet, the accepted denom is `ulink`, where `1link = 1,000,000ulink` +On a Finschia Mainnet, the accepted denom is `ulink`, where `1link = 1,000,000ulink` ::: ### A Note on Gas and Fees -Transactions on a LINE Blockchain Mainnet need to include a transaction fee in order to be processed. This fee pays for the gas required to run the transaction. The formula is the following: +Transactions on a Finschia Mainnet need to include a transaction fee in order to be processed. This fee pays for the gas required to run the transaction. The formula is the following: ``` fees = ceil(gas * gasPrices) @@ -383,7 +383,7 @@ For mainnet, the recommended `gas-prices` is `0.025ulink`. ### Sending Tokens ::: tip -**Before you can bond atbase coins and withdraw rewards, you need to [set up `lbm`](#setting-up-lbm) and [create an account](#creating-an-account)** +**Before you can bond atbase coins and withdraw rewards, you need to [set up `fnsad`](#setting-up-fnsad) and [create an account](#creating-an-account)** ::: ::: warning @@ -395,13 +395,13 @@ For mainnet, the recommended `gas-prices` is `0.025ulink`. // Ex value for parameters (do not actually use these values in your tx!!): =link1ghekyjucln7y67ntx7cf27m9dpuxxemnqk82wt =1000000ulink // Ex value for flags: =0.025ulink -lbm tx send --from --gas auto --gas-adjustment 1.5 --gas-prices +fnsad tx send --from --gas auto --gas-adjustment 1.5 --gas-prices ``` ### Bonding base coin and Withdrawing Rewards ::: tip -**Before you can bond base coins and withdraw rewards, you need to [set up `lbm`](#setting-up-lbm) and [create an account](#creating-an-account)** +**Before you can bond base coins and withdraw rewards, you need to [set up `fnsad`](#setting-up-fnsad) and [create an account](#creating-an-account)** ::: ::: warning @@ -416,7 +416,7 @@ lbm tx send --from --gas auto --gas-adjustme // Bond a certain amount of base coin to a given validator // ex value for flags: =linkvaloper1ghekyjucln7y67ntx7cf27m9dpuxxemnjz9hqc, =10000000ulink, =0.025ulink -lbm tx staking delegate --from --gas auto --gas-adjustment 1.5 --gas-prices +fnsad tx staking delegate --from --gas auto --gas-adjustment 1.5 --gas-prices // Redelegate a certain amount of base coin from a validator to another @@ -425,19 +425,19 @@ lbm tx staking delegate --from =linkvaloper1ghekyjucln7y67ntx7cf27m9dpuxxemnjz9hqc, =100000000ulink, =0.025ulink -lbm tx staking redelegate --from --gas auto --gas-adjustment 1.5 --gas-prices +fnsad tx staking redelegate --from --gas auto --gas-adjustment 1.5 --gas-prices // Withdraw all rewards // ex value for flag: =0.025ulink -lbm tx distribution withdraw-all-rewards --from --gas auto --gas-adjustment 1.5 --gas-prices +fnsad tx distribution withdraw-all-rewards --from --gas auto --gas-adjustment 1.5 --gas-prices // Unbond a certain amount of base coin from a given validator // You will have to wait 3 weeks before your base coin are fully unbonded and transferrable // ex value for flags: =linkvaloper1ghekyjucln7y67ntx7cf27m9dpuxxemnjz9hqc, =10000000ulink, =0.025ulink -lbm tx staking unbond --from --gas auto --gas-adjustment 1.5 --gas-prices +fnsad tx staking unbond --from --gas auto --gas-adjustment 1.5 --gas-prices ``` ::: warning @@ -448,14 +448,14 @@ To confirm that your transaction went through, you can use the following queries ```bash // your balance should change after you bond base coin or withdraw rewards -lbm query account +fnsad query account // you should have delegations after you bond base coin -lbm query staking delegations +fnsad query staking delegations // this returns your tx if it has been included // use the tx hash that was displayed when you created the tx -lbm query tx +fnsad query tx ``` @@ -465,7 +465,7 @@ Double check with a block explorer if you interact with the network through a tr #### Primer on Governance -A LINE Blockchain Mainnet has a built-in governance system that lets bonded base coin holders vote on proposals. There are three types of proposal: +A Finschia Mainnet has a built-in governance system that lets bonded base coin holders vote on proposals. There are three types of proposal: - `Text Proposals`: These are the most basic type of proposals. They can be used to get the opinion of the network on a given topic. - `Parameter Proposals`: These are used to update the value of an existing parameter. @@ -492,19 +492,19 @@ At the end of the voting period, the proposal is accepted if there are more than // =text/parameter_change/software_upgrade // ex value for flag: =0.025ulink -lbm tx gov submit-proposal --title "Test Proposal" --description "My awesome proposal" --type --deposit=10000000ulink --gas auto --gas-adjustment 1.5 --gas-prices --from +fnsad tx gov submit-proposal --title "Test Proposal" --description "My awesome proposal" --type --deposit=10000000ulink --gas auto --gas-adjustment 1.5 --gas-prices --from // Increase deposit of a proposal -// Retrieve proposalID from lbm query gov proposals --status deposit_period +// Retrieve proposalID from finschia query gov proposals --status deposit_period // ex value for parameter: =10000000ulink -lbm tx gov deposit --gas auto --gas-adjustment 1.5 --gas-prices --from +fnsad tx gov deposit --gas auto --gas-adjustment 1.5 --gas-prices --from // Vote on a proposal -// Retrieve proposalID from lbm query gov proposals --status voting_period +// Retrieve proposalID from finschia query gov proposals --status voting_period //