Skip to content

Commit

Permalink
fix: re-brand lfb to lbm (#10)
Browse files Browse the repository at this point in the history
* fix: re-brand lfb to lbm

* chore: to do github action

* fix: update changelog
  • Loading branch information
Woosang Son authored Sep 13, 2021
1 parent f6c9deb commit e857567
Show file tree
Hide file tree
Showing 58 changed files with 854 additions and 853 deletions.
4 changes: 2 additions & 2 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 simapp docker image on every push to master and
# and pushes the image to https://docker-registry.linecorp.com/link-network/v2/lfb
# and pushes the image to https://docker-registry.linecorp.com/link-network/v2/lbm
on:
pull_request:
push:
Expand All @@ -21,7 +21,7 @@ jobs:
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=line/lfb
DOCKER_IMAGE=line/lbm
VERSION=noop
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ jobs:
excludelist+=" $(find ./ -type f -name '*.pb.gw.go')"
excludelist+=" $(find ./ -type f -path './tests/mocks/*.go')"
for filename in ${excludelist}; do
filename=$(echo $filename | sed 's/^./github.com\/line\/lfb/g')
filename=$(echo $filename | sed 's/^./github.com\/line\/lbm/g')
echo "Excluding ${filename} from coverage report..."
sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
done
Expand Down
18 changes: 9 additions & 9 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ before:
- go generate ./...
builds:
-
id: "lfb"
main: ./cmd/lfb
binary: build/lfb
id: "lbm"
main: ./cmd/lbm
binary: build/lbm
env:
- CGO_ENABLED=0
flags:
- -mod=readonly
- -tags=netgo ledger
ldflags:
- -X github.com/line/lfb-sdk/version.Name=lfb
- -X github.com/line/lfb-sdk/version.ServerName=lfb
- -X github.com/line/lfb-sdk/version.Version={{ .Version }}
- -X github.com/line/lfb-sdk/version.Commit={{ .FullCommit }}
- -X "github.com/line/lfb-sdk/version.BuildTags=netgo,ledger"
- -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.Version={{ .Version }}
- -X github.com/line/lbm-sdk/version.Commit={{ .FullCommit }}
- -X "github.com/line/lbm-sdk/version.BuildTags=netgo,ledger"
archives:
-
builds: ['lfb']
builds: ['lbm']
replacements:
darwin: Darwin
linux: Linux
Expand Down
58 changes: 29 additions & 29 deletions .initialize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,70 +9,70 @@ then
then
mode="testnet"
fi
LFB="docker run -i -p 26656:26656 -p 26657:26657 -v ${HOME}/.lfb:/root/.lfb line/lfb lfb"
LBM="docker run -i -p 26656:26656 -p 26657:26657 -v ${HOME}/.lbm:/root/.lbm line/lbm lbm"
elif [[ $1 == "testnet" ]]
then
mode="testnet"
fi

LFB=${LFB:-lfb}
LBM=${LBM:-lbm}

# initialize
rm -rf ~/.lfb
rm -rf ~/.lbm

# TODO
# Configure your CLI to eliminate need for chain-id flag
#${LFB} config chain-id lfb
#${LFB} config output json
#${LFB} config indent true
#${LFB} config trust-node true
#${LFB} config keyring-backend test
#${LBM} config chain-id lbm
#${LBM} config output json
#${LBM} config indent true
#${LBM} config trust-node true
#${LBM} config keyring-backend test

# Initialize configuration files and genesis file
# moniker is the name of your node
${LFB} init solo --chain-id=lfb
${LBM} init solo --chain-id=lbm

# configure for testnet
if [[ ${mode} == "testnet" ]]
then
if [[ $1 == "docker" ]]
then
docker run -i -p 26656:26656 -p 26657:26657 -v ${HOME}/.lfb:/root/.lfb line/lfb sh -c "export LFB_TESTNET=true"
docker run -i -p 26656:26656 -p 26657:26657 -v ${HOME}/.lbm:/root/.lbm line/lbm sh -c "export LBM_TESTNET=true"
else
export LFB_TESTNET=true
export LBM_TESTNET=true
fi
fi

# Please do not use the TEST_MNEMONIC for production purpose
TEST_MNEMONIC="mind flame tobacco sense move hammer drift crime ring globe art gaze cinnamon helmet cruise special produce notable negative wait path scrap recall have"

${LFB} keys add jack --keyring-backend=test --recover --account=0 <<< ${TEST_MNEMONIC}
${LFB} keys add alice --keyring-backend=test --recover --account=1 <<< ${TEST_MNEMONIC}
${LFB} keys add bob --keyring-backend=test --recover --account=2 <<< ${TEST_MNEMONIC}
${LFB} keys add rinah --keyring-backend=test --recover --account=3 <<< ${TEST_MNEMONIC}
${LFB} keys add sam --keyring-backend=test --recover --account=4 <<< ${TEST_MNEMONIC}
${LFB} keys add evelyn --keyring-backend=test --recover --account=5 <<< ${TEST_MNEMONIC}
${LBM} keys add jack --keyring-backend=test --recover --account=0 <<< ${TEST_MNEMONIC}
${LBM} keys add alice --keyring-backend=test --recover --account=1 <<< ${TEST_MNEMONIC}
${LBM} keys add bob --keyring-backend=test --recover --account=2 <<< ${TEST_MNEMONIC}
${LBM} keys add rinah --keyring-backend=test --recover --account=3 <<< ${TEST_MNEMONIC}
${LBM} keys add sam --keyring-backend=test --recover --account=4 <<< ${TEST_MNEMONIC}
${LBM} keys add evelyn --keyring-backend=test --recover --account=5 <<< ${TEST_MNEMONIC}

# TODO
#if [[ ${mode} == "testnet" ]]
#then
# ${LFB} add-genesis-account tlink15la35q37j2dcg427kfy4el2l0r227xwhc2v3lg 9223372036854775807link,1stake
# ${LBM} add-genesis-account tlink15la35q37j2dcg427kfy4el2l0r227xwhc2v3lg 9223372036854775807link,1stake
#else
# ${LFB} add-genesis-account link15la35q37j2dcg427kfy4el2l0r227xwhuaapxd 9223372036854775807link,1stake
# ${LBM} add-genesis-account link15la35q37j2dcg427kfy4el2l0r227xwhuaapxd 9223372036854775807link,1stake
#fi
# Add both accounts, with coins to the genesis file
${LFB} add-genesis-account $(${LFB} keys show jack -a --keyring-backend=test) 1000link,1000000000000stake
${LFB} add-genesis-account $(${LFB} keys show alice -a --keyring-backend=test) 1000link,1000000000000stake
${LFB} add-genesis-account $(${LFB} keys show bob -a --keyring-backend=test) 1000link,1000000000000stake
${LFB} add-genesis-account $(${LFB} keys show rinah -a --keyring-backend=test) 1000link,1000000000000stake
${LFB} add-genesis-account $(${LFB} keys show sam -a --keyring-backend=test) 1000link,1000000000000stake
${LFB} add-genesis-account $(${LFB} keys show evelyn -a --keyring-backend=test) 1000link,1000000000000stake
${LBM} add-genesis-account $(${LBM} keys show jack -a --keyring-backend=test) 1000link,1000000000000stake
${LBM} add-genesis-account $(${LBM} keys show alice -a --keyring-backend=test) 1000link,1000000000000stake
${LBM} add-genesis-account $(${LBM} keys show bob -a --keyring-backend=test) 1000link,1000000000000stake
${LBM} add-genesis-account $(${LBM} keys show rinah -a --keyring-backend=test) 1000link,1000000000000stake
${LBM} add-genesis-account $(${LBM} keys show sam -a --keyring-backend=test) 1000link,1000000000000stake
${LBM} add-genesis-account $(${LBM} keys show evelyn -a --keyring-backend=test) 1000link,1000000000000stake

${LFB} gentx jack 100000000stake --keyring-backend=test --chain-id=lfb
${LBM} gentx jack 100000000stake --keyring-backend=test --chain-id=lbm

${LFB} collect-gentxs
${LBM} collect-gentxs

${LFB} validate-genesis
${LBM} validate-genesis

# ${LFB} start --log_level *:debug --rpc.laddr=tcp://0.0.0.0:26657 --p2p.laddr=tcp://0.0.0.0:26656
# ${LBM} start --log_level *:debug --rpc.laddr=tcp://0.0.0.0:26657 --p2p.laddr=tcp://0.0.0.0:26656

2 changes: 1 addition & 1 deletion .releaserc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
repositoryUrl: [email protected]:line/lfb.git
repositoryUrl: [email protected]:line/lbm.git
verifyConditions: ['@semantic-release/github']
prepare: []
publish: ['@semantic-release/github']
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Breaking Changes
* (sdk) (auth) [\#16](https://github.com/line/lfb/pull/16) Introduce sig block height for the new replay protection
* (ostracon/sdk) [\#26](https://github.com/line/lfb/pull/26) Use vrf-based consensus, address string treatment
* (global) [\#10](https://github.com/line/lbm/pull/10) Re-brand lfb to lbm

## [gaia v4.0.4] - 2021-03-15
Initial lfb is based on the tendermint v0.34.9+, cosmos-sdk v0.42.0+, gaia v4.0.4
Initial lbm is based on the tendermint v0.34.9+, cosmos-sdk v0.42.0+, gaia v4.0.4

* (tendermint) [v0.34.9](https://github.com/tendermint/tendermint/releases/tag/v0.34.9).
* (cosmos-sdk) [v0.42.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.0).
Expand Down
32 changes: 16 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# How to contribute to LFB
# How to contribute to LBM

First of all, thank you so much for taking your time to contribute!
It will be amazing if you could help us by doing any of the following:

- File an issue in [the issue tracker](https://github.com/line/lfb/issues) to report bugs and propose new features and
- File an issue in [the issue tracker](https://github.com/line/lbm/issues) to report bugs and propose new features and
improvements.
- Ask a question by creating a new issue in [the issue tracker](https://github.com/line/lfb/issues).
- Browse [the list of previously answered questions](https://github.com/line/lfb/issues?q=label%3Aquestion).
- Contribute your work by sending [a pull request](https://github.com/line/lfb/pulls).
- Ask a question by creating a new issue in [the issue tracker](https://github.com/line/lbm/issues).
- Browse [the list of previously answered questions](https://github.com/line/lbm/issues?q=label%3Aquestion).
- Contribute your work by sending [a pull request](https://github.com/line/lbm/pulls).

## Contributor license agreement

Expand All @@ -17,7 +17,7 @@ the ICLA (individual contributor license agreement). Please

## Code of conduct

We expect contributors to follow [our code of conduct](https://github.com/line/lfb/blob/main/CODE_OF_CONDUCT.md).
We expect contributors to follow [our code of conduct](https://github.com/line/lbm/blob/main/CODE_OF_CONDUCT.md).

## Commit message and Pull Request message

Expand Down Expand Up @@ -49,20 +49,20 @@ All PRs require two Reviews before merge (except docs changes, or variable name-
## Forking

Please note that Go requires code to live under absolute paths, which complicates forking.
While my fork lives at `https://github.com/someone/lfb`,
the code should never exist at `$GOPATH/src/github.com/someone/lfb`.
While my fork lives at `https://github.com/someone/lbm`,
the code should never exist at `$GOPATH/src/github.com/someone/lbm`.
Instead, we use `git remote` to add the fork as a new remote for the original repo,
`$GOPATH/src/github.com/line/lfb`, and do all the work there.
`$GOPATH/src/github.com/line/lbm`, and do all the work there.

For instance, to create a fork and work on a branch of it, I would:

- Create the fork on github, using the fork button.
- Go to the original repo checked out locally (i.e. `$GOPATH/src/github.com/line/lfb`)
- Go to the original repo checked out locally (i.e. `$GOPATH/src/github.com/line/lbm`)
- `git remote rename origin upstream`
- `git remote add origin [email protected]:someone/lfb.git`
- `git remote add origin [email protected]:someone/lbm.git`

Now `origin` refers to my fork and `upstream` refers to the lfb version.
So I can `git push -u origin main` to update my fork, and make pull requests to lfb from there.
Now `origin` refers to my fork and `upstream` refers to the lbm version.
So I can `git push -u origin main` to update my fork, and make pull requests to lbm from there.
Of course, replace `someone` with your git handle.

To pull in updates from the origin repo, run
Expand All @@ -77,7 +77,7 @@ Please don't make Pull Requests from `main`.
We use [Go 1.15 Modules](https://github.com/golang/go/wiki/Modules) to manage
dependency versions.

The `main` branch of every LFB repository should just build with `go get`,
The `main` branch of every LBM repository should just build with `go get`,
which means they should be kept up-to-date with their dependencies, so we can
get away with telling people they can just `go get` our software.

Expand All @@ -86,7 +86,7 @@ build, in which case we can fall back on `go mod tidy -v`.

## Testing

Tests can be ran by running `make test` at the top level of the lfb repository.
Tests can be ran by running `make test` at the top level of the lbm repository.

We expect tests to use `require` or `assert` rather than `t.Skip` or `t.Fail`,
unless there is a reason to do otherwise.
Expand Down Expand Up @@ -132,7 +132,7 @@ should be targeted against the release candidate branch.
- `main` must never fail `make lint test test-race`
- `main` should not fail `make lint`
- no `--force` onto `main` (except when reverting a broken commit, which should seldom happen)
- create a development branch either on github.com/line/lfb, or your fork (using `git remote add origin`)
- create a development branch either on github.com/line/lbm, or your fork (using `git remote add origin`)
- before submitting a pull request, begin `git rebase` on top of `main`
### Pull Merge Procedure
Expand Down
22 changes: 11 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# Simple usage with a mounted data directory:
# > docker build -t line/lfb .
# > docker run -it -p 26656:26656 -p 26657:26657 -v ~/.lfb:/root/.lfb -v line/lfb lfb init
# > docker run -it -p 26656:26656 -p 26657:26657 -v ~/.lfb:/root/.lfb -v line/lfb lfb start --rpc.laddr=tcp://0.0.0.0:26657 --p2p.laddr=tcp://0.0.0.0:26656
# > docker build -t line/lbm .
# > 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
FROM golang:1.15-alpine3.13 AS build-env
ARG LFB_BUILD_OPTIONS=""
ARG LBM_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 lfb
WORKDIR /lfb-build/lfb
# Set WORKDIR to lbm
WORKDIR /lbm-build/lbm

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

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

# Build cosmwasm
Expand All @@ -33,7 +33,7 @@ RUN cd $(go list -f "{{ .Dir }}" -m github.com/line/wasmvm) && \
COPY . .

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

# Final image
FROM alpine:edge
Expand All @@ -44,5 +44,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/lfb /usr/bin/lfb
COPY --from=build-env /go/bin/lbm /usr/bin/lbm

Loading

0 comments on commit e857567

Please sign in to comment.