Skip to content

Commit

Permalink
Merge branch 'main' into roman/e2e-skip
Browse files Browse the repository at this point in the history
  • Loading branch information
p0mvn committed May 26, 2022
2 parents 9488f2b + 74c9bd5 commit c5d5c9f
Show file tree
Hide file tree
Showing 54 changed files with 1,937 additions and 1,849 deletions.
62 changes: 0 additions & 62 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

1 change: 1 addition & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Default state for all rules
default: true
MD024: false
MD003:
# Heading style
style: "atx"
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ Example:
}

// convert balances to underlying coins and sum up balances to total balance
for addr, account := range snapshotAccs {
for _, account := range snapshotAccs {
// All pool shares are in liquid balances OR bonded balances (locked),
// therefore underlyingCoinsForSelectPools on liquidBalances + bondedBalances
// will include everything that is in one of those two pools.
Expand All @@ -282,7 +282,7 @@ Example:
Add(account.LiquidBalances...).
Add(sdk.NewCoin(appparams.BaseCoinUnit, account.Staked)).
Add(sdk.NewCoin(appparams.BaseCoinUnit, account.UnbondingStake)).
Add(account.Bonded...).
Add(account.Bonded...)
}

snapshot := DeriveSnapshot{
Expand Down
1 change: 1 addition & 0 deletions cmd/osmosisd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
InitCmd(osmosis.ModuleBasics, osmosis.DefaultNodeHome),
genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, osmosis.DefaultNodeHome),
genutilcli.MigrateGenesisCmd(),
ExportDeriveBalancesCmd(),
AddGenesisAccountCmd(osmosis.DefaultNodeHome),
AddGenesisWasmMsgCmd(osmosis.DefaultNodeHome),
genutilcli.GenTxCmd(osmosis.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, osmosis.DefaultNodeHome),
Expand Down
39 changes: 39 additions & 0 deletions contrib/images/osmobuilder/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# syntax=docker/dockerfile:1

# --------------------------------------------------------
# Builder
# --------------------------------------------------------

FROM golang:1.18.2-alpine3.15 as build

ARG NAME="osmosis"
ARG APP_NAME="osmosisd"
ARG VERSION
ARG COMMIT
ARG COSMWASM_VERSION="v1.0.0"
ARG BUILD_TAGS="netgo ledger muslc"

RUN set -eux; apk add --no-cache ca-certificates build-base;
RUN apk add git
# Needed by github.com/zondax/hid
RUN apk add linux-headers

WORKDIR /osmosis
COPY . /osmosis

# CosmWasm: see https://github.com/CosmWasm/wasmvm/releases
ADD https://github.com/CosmWasm/wasmvm/releases/download/$COSMWASM_VERSION/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
ADD https://github.com/CosmWasm/wasmvm/releases/download/$COSMWASM_VERSION/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a

# CosmWasm: copy the right library according to architecture. The final location will be found by the linker flag `-lwasmvm_muslc`
RUN cp /lib/libwasmvm_muslc.$(uname -m).a /lib/libwasmvm_muslc.a

RUN go build \
-mod=readonly \
-tags "$BUILD_TAGS" \
-ldflags "-X github.com/osmosis-labs/osmosis/version.Name=$NAME -X github.com/osmosis-labs/osmosis/version.AppName=$APP_NAME -X github.com/osmosis-labs/osmosis/version.Version=$VERSION -X github.com/osmosis-labs/osmosis/version.Commit=$COMMIT -X github.com/osmosis-labs/osmosis/version.BuildTags='netgo,ledger,muslc' -w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \
-trimpath \
-o /osmosis/build/ \
./...

ENTRYPOINT ["ash"]
97 changes: 97 additions & 0 deletions contrib/images/osmobuilder/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Script to automatically build binaries
# for linux/amd64, linux/arm64

# It builds a osmosisd binary while build the docker image
# in order to create a single binary statically linked to cosmwasm

# Usage:
#
# Create a new release by running from the root of the repository:
# make -f contrib/images/osmobuilder/Makefile release
#
# A release/ folder will be created with the appropriate files

VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
COSMWASM_VERSION := "v1.0.0"
BUILD_TAGS := "netgo ledger muslc"

IMAGE:=osmobuilder:$(VERSION)

.PHONY: create-dockerx-builder build-binary-amd64 get-binary-amd64

release: get-binary-amd64 get-binary-arm64 git sha

# Run `create-dockerx-builder` to create the builder first
create-dockerx-builder:
docker buildx create --name osmobuilder || true

# Build image for amd64 architecture
build-binary-amd64: create-dockerx-builder
docker buildx use osmobuilder
docker buildx build \
--platform linux/amd64 \
--build-arg VERSION=$(VERSION) \
--build-arg COMMIT=$(COMMIT) \
--build-arg COSMWASM_VERSION=$(COSMWASM_VERSION) \
--build-arg BUILD_TAGS=$(BUILD_TAGS) \
-t $(IMAGE)-amd64 \
--load \
--no-cache \
--progress plain \
-f contrib/images/osmobuilder/Dockerfile .

# Get binary from image for amd64 architecture
get-binary-amd64: build-binary-amd64
mkdir -p release/
docker rm -f osmobinary || true
docker create -ti --name osmobinary $(IMAGE)-amd64
docker cp osmobinary:/osmosis/build/osmosisd release/osmosis-$(VERSION)-linux-amd64
tar -zcvf release/osmosis-$(VERSION)-linux-amd64.tar.gz release/osmosis-$(VERSION)-linux-amd64
docker rm -f osmobinary

# Build image for arm64 architecture
build-binary-arm64: create-dockerx-builder
docker buildx use osmobuilder
docker buildx build \
--platform linux/arm64 \
--build-arg VERSION=$(VERSION) \
--build-arg COMMIT=$(COMMIT) \
--build-arg COSMWASM_VERSION=$(COSMWASM_VERSION) \
--build-arg BUILD_TAGS=$(BUILD_TAGS) \
-t $(IMAGE)-arm64 \
--load \
--no-cache \
--progress plain \
-f contrib/images/osmobuilder/Dockerfile .

# Get binary from image for arm64 architecture
get-binary-arm64: build-binary-arm64
mkdir -p release/
docker rm -f osmobinary || true
docker create -ti --name osmobinary $(IMAGE)-arm64
docker cp osmobinary:/osmosis/build/osmosisd release/osmosis-$(VERSION)-linux-arm64
tar -zcvf release/osmosis-$(VERSION)-linux-arm64.tar.gz release/osmosis-$(VERSION)-linux-arm64
docker rm -f osmobinary

# Calculate sha
sha:
mkdir -p release/
rm -f release/sha256sum.txt
sha256sum release/* | sed 's#release/##g' > release/sha256sum.txt

# Create git archive
git:
mkdir -p release/
git archive \
--format zip \
--prefix "osmosis-$(VERSION)/" \
-o "release/Source code.zip" \
HEAD

git archive \
--format tar.gz \
--prefix "osmosis-$(VERSION)/" \
-o "release/Source code.tar.gz" \
HEAD

5 changes: 0 additions & 5 deletions x/epochs/spec/01_concepts.md

This file was deleted.

48 changes: 0 additions & 48 deletions x/epochs/spec/02_state.md

This file was deleted.

16 changes: 0 additions & 16 deletions x/epochs/spec/03_events.md

This file was deleted.

21 changes: 0 additions & 21 deletions x/epochs/spec/04_keeper.md

This file was deleted.

29 changes: 0 additions & 29 deletions x/epochs/spec/05_hooks.md

This file was deleted.

13 changes: 0 additions & 13 deletions x/epochs/spec/06_queries.md

This file was deleted.

26 changes: 0 additions & 26 deletions x/epochs/spec/07_future_improvements.md

This file was deleted.

Loading

0 comments on commit c5d5c9f

Please sign in to comment.