From 2afd0da546b4fba2c8cbd0381c2f7263957a87ab Mon Sep 17 00:00:00 2001 From: Unique Divine <51418232+Unique-Divine@users.noreply.github.com> Date: Sun, 17 Dec 2023 11:14:47 -0600 Subject: [PATCH] fix(build): revert to working build + cherry-picks (#1715) * fix(build): revert to working build + cherry-picks * chore: changelog * changelog + set -e --- .github/workflows/goreleaser.yml | 2 +- .goreleaser.yml | 30 +++++------ CHANGELOG.md | 3 +- contrib/bashlib.sh | 78 +++++++++++++++++++++++++++ contrib/make/build.mk | 10 ++-- contrib/make/release.mk | 1 - contrib/scripts/release_pre_darwin.sh | 10 ++-- contrib/scripts/release_pre_linux.sh | 25 +++------ go.mod | 16 +++--- go.sum | 28 +++++----- justfile | 53 ++++++++++++++++++ 11 files changed, 189 insertions(+), 67 deletions(-) create mode 100644 contrib/bashlib.sh create mode 100644 justfile diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index e77ba3ac8..aa6277004 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -11,7 +11,7 @@ permissions: jobs: goreleaser: - runs-on: ubuntu-latest-m + runs-on: ubuntu-latest steps: - name: Set up QEMU uses: docker/setup-qemu-action@v3 diff --git a/.goreleaser.yml b/.goreleaser.yml index bdd5d11ca..8b158ed4f 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -9,19 +9,14 @@ builds: binary: nibid hooks: pre: - - cmd: bash contrib/scripts/release_pre_darwin.sh - output: false # enable for debug - env: - - TARGET={{ .Target }} + - bash contrib/scripts/release_pre_darwin.sh goos: - darwin goarch: - amd64 - arm64 env: - - CC_darwin_amd64=o64-clang - - CC_darwin_arm64=oa64-clang - - 'CC={{ index .Env (print "CC_" .Os "_" .Arch) }}' + - CC=o64-clang flags: - -mod=readonly - -trimpath @@ -42,25 +37,25 @@ builds: - static_wasm - rocksdb - grocksdb_no_link + overrides: + - goos: darwin + goarch: arm64 + env: + - CC=oa64-clang - id: linux main: ./cmd/nibid binary: nibid hooks: pre: - - cmd: bash contrib/scripts/release_pre_linux.sh - output: false # enable for debug - env: - - TARGET={{ .Target }} + - bash contrib/scripts/release_pre_linux.sh goos: - linux goarch: - amd64 - arm64 env: - - CC_linux_amd64=x86_64-linux-gnu-gcc - - CC_linux_arm64=aarch64-linux-gnu-gcc - - 'CC={{ index .Env (print "CC_" .Os "_" .Arch) }}' + - CC=x86_64-linux-gnu-gcc flags: - -mod=readonly - -trimpath @@ -79,8 +74,13 @@ builds: - ledger - muslc - rocksdb - - static - grocksdb_no_link + - static + overrides: + - goos: linux + goarch: arm64 + env: + - CC=aarch64-linux-gnu-gcc universal_binaries: - id: darwin diff --git a/CHANGELOG.md b/CHANGELOG.md index 4edff08dd..230a8deeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#1682](https://github.com/NibiruChain/nibiru/pull/1682) - feat!: add upgrade handler for v1.1.0 * [#1706](https://github.com/NibiruChain/nibiru/pull/1706) - fix: `v1.1.0` upgrade handler * [#1712](https://github.com/NibiruChain/nibiru/pull/1712) - refactor(inflation): turn inflation off by default +* [#1715](https://github.com/NibiruChain/nibiru/pull/1715) - fix(build): revert! to working build + cherry-picks #### Dapp modules: perp, spot, etc @@ -73,7 +74,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#1710](https://github.com/NibiruChain/nibiru/pull/1710) - refactor(perp): Clean and organize module errors for x/perp ### Dependencies -- Bump `github.com/cometbft/cometbft-db` from 0.8.0 to 0.9.1 ([#1693](https://github.com/NibiruChain/nibiru/pull/1693)) * Bump `github.com/spf13/cast` from 1.5.1 to 1.6.0 ([#1689](https://github.com/NibiruChain/nibiru/pull/1689)) * Bump `cosmossdk.io/math` from 1.1.2 to 1.2.0 ([#1676](https://github.com/NibiruChain/nibiru/pull/1676)) @@ -81,7 +81,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Bump `actions/setup-go` from 4 to 5 ([#1696](https://github.com/NibiruChain/nibiru/pull/1696)) * Bump `golang` from 1.19 to 1.21 ([#1698](https://github.com/NibiruChain/nibiru/pull/1698)) * [#1678](https://github.com/NibiruChain/nibiru/pull/1678) - chore(deps): collections to v0.4.0 for math.Int value encoder -* Bump `rocksdb` from 8.1.1 to 8.8.1 ## [v1.1.0] - 2023-11-20 diff --git a/contrib/bashlib.sh b/contrib/bashlib.sh new file mode 100644 index 000000000..7680e4e79 --- /dev/null +++ b/contrib/bashlib.sh @@ -0,0 +1,78 @@ +#!/usr/bin/env bash + +set -e + +# ————————————————————————————————————————————————— +# COLORS: Terminal colors are set with ANSI escape codes. + +export COLOR_GREEN="\033[32m" +export COLOR_CYAN="\033[36m" +export COLOR_RESET="\033[0m" + +export COLOR_BLACK="\033[30m" +export COLOR_RED="\033[31m" +export COLOR_YELLOW="\033[33m" +export COLOR_BLUE="\033[34m" +export COLOR_MAGENTA="\033[35m" +export COLOR_WHITE="\033[37m" + +# Bright color definitions +export COLOR_BRIGHT_BLACK="\033[90m" +export COLOR_BRIGHT_RED="\033[91m" +export COLOR_BRIGHT_GREEN="\033[92m" +export COLOR_BRIGHT_YELLOW="\033[93m" +export COLOR_BRIGHT_BLUE="\033[94m" +export COLOR_BRIGHT_MAGENTA="\033[95m" +export COLOR_BRIGHT_CYAN="\033[96m" +export COLOR_BRIGHT_WHITE="\033[97m" + +# ————————————————————————————————————————————————— +# LOGGING + +# log_debug: Simple wrapper for `echo` with a DEBUG prefix. +log_debug() { + echo "${COLOR_CYAN}DEBUG${COLOR_RESET}" "$@" +} + +# log_error: ERROR messages in red, output to stderr. +log_error() { + echo "❌ ${COLOR_RED}ERROR:${COLOR_RESET}" "$@" >&2 +} + +log_success() { + echo "${COLOR_GREEN}✅ Success:${COLOR_RESET}" "$@" +} + +# ————————————————————————————————————————————————— +# OK Suffix: Functions used for error handling or validating inputs. + +# which_ok: Check if the given binary is in the $PATH. +# Returns code 0 on success and code 1 if the command fails. +which_ok() { + if which "$1" >/dev/null 2>&1; then + return 0 + else + log_error "$1 is not present in \$PATH" + return 1 + fi +} + +# source_ok (Function): Sources a bash script if it exists. +# Usage: source_ok [bash_script] +source_ok() { + local bash_script="$1" + if test -r "$bash_script"; then + # shellcheck disable=SC1090 + source "$bash_script" + fi +} + +env_var_ok() { + local env_var="$1" + if [[ -z "$env_var" ]]; then + log_error "expected env var to be set" + return 1 # Return 1 to indicate error (variable is not set) + else + return 0 # Return 0 to indicate success (variable is set) + fi +} diff --git a/contrib/make/build.mk b/contrib/make/build.mk index 4708bc104..c704c218c 100644 --- a/contrib/make/build.mk +++ b/contrib/make/build.mk @@ -3,6 +3,8 @@ ### Build Flags ### ############################################################################### +# BRANCH: Current git branch +# COMMIT: Current commit hash BRANCH := $(shell git rev-parse --abbrev-ref HEAD) COMMIT := $(shell git log -1 --format='%H') @@ -15,7 +17,6 @@ ifeq (,$(VERSION)) endif endif - OS_NAME := $(shell uname -s | tr A-Z a-z) ifeq ($(shell uname -m),x86_64) ARCH_NAME := amd64 @@ -23,9 +24,12 @@ else ARCH_NAME := arm64 endif +# SDK_PACK: Cosmos-SDK version SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g') -TM_VERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::') # grab everything after the space in "github.com/tendermint/tendermint v0.34.7" -ROCKSDB_VERSION := 8.8.1 +# TM_VERSION: Tendermint Core version (CometBFT) +# grab everything after the space in "github.com/tendermint/tendermint v0.34.7" +TM_VERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::') +ROCKSDB_VERSION := 8.1.1 WASMVM_VERSION := $(shell go list -m github.com/CosmWasm/wasmvm | awk '{sub(/^v/, "", $$2); print $$2}') DOCKER := $(shell which docker) BUILDDIR ?= $(CURDIR)/build diff --git a/contrib/make/release.mk b/contrib/make/release.mk index 8b7289af0..a32f83d31 100644 --- a/contrib/make/release.mk +++ b/contrib/make/release.mk @@ -20,7 +20,6 @@ release-snapshot: docker run \ --rm \ --platform linux/amd64 \ - -v /tmp:/tmp \ -v "$(CURDIR)":/go/src/$(PACKAGE_NAME) \ -w /go/src/$(PACKAGE_NAME) \ -e CGO_ENABLED=1 \ diff --git a/contrib/scripts/release_pre_darwin.sh b/contrib/scripts/release_pre_darwin.sh index 92b320697..87f2617c7 100755 --- a/contrib/scripts/release_pre_darwin.sh +++ b/contrib/scripts/release_pre_darwin.sh @@ -11,8 +11,8 @@ set -e WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | awk '{sub(/^v/, "", $2); print $2}') -ROCKSDB_VERSION=8.8.1 - -flock -x /tmp/wasmvm-lock -c "wget -c https://github.com/CosmWasm/wasmvm/releases/download/v${WASMVM_VERSION}/libwasmvmstatic_darwin.a -O /tmp/libwasmvmstatic_darwin.a && [ ! -f /usr/local/osxcross/SDK/MacOSX12.0.sdk/usr/lib/libwasmvmstatic_darwin.a ] && cp /tmp/libwasmvmstatic_darwin.a /usr/local/osxcross/SDK/MacOSX12.0.sdk/usr/lib/libwasmvmstatic_darwin.a; echo 'libwasmvm installed'" -flock -x /tmp/rocksdb-darwin-headers-lock -c "wget -c https://github.com/NibiruChain/gorocksdb/releases/download/v${ROCKSDB_VERSION}/include.${ROCKSDB_VERSION}.tar.gz -O /tmp/include.${ROCKSDB_VERSION}.tar.gz && [ ! -d /usr/local/osxcross/SDK/MacOSX12.0.sdk/usr/include/rocksdb ] && tar -xvf /tmp/include.${ROCKSDB_VERSION}.tar.gz -C /usr/local/osxcross/SDK/MacOSX12.0.sdk/usr/include/; echo 'rocksdb headers installed'" -flock -x /tmp/rocksdb-lib-lock -c "wget -c https://github.com/NibiruChain/gorocksdb/releases/download/v${ROCKSDB_VERSION}/librocksdb_${ROCKSDB_VERSION}_darwin_all.tar.gz -O /tmp/librocksdb_${ROCKSDB_VERSION}_darwin_all.tar.gz && [ ! -f /usr/local/osxcross/SDK/MacOSX12.0.sdk/usr/lib/librocksdb.a ] && tar -xvf /tmp/librocksdb_${ROCKSDB_VERSION}_darwin_all.tar.gz -C /usr/local/osxcross/SDK/MacOSX12.0.sdk/usr/lib/; echo 'librocksdb installed'" +wget https://github.com/CosmWasm/wasmvm/releases/download/v${WASMVM_VERSION}/libwasmvmstatic_darwin.a -O /usr/local/osxcross/SDK/MacOSX12.0.sdk/usr/lib/libwasmvmstatic_darwin.a +wget https://github.com/NibiruChain/gorocksdb/releases/download/v8.1.1/include.8.1.1.tar.gz -O /root/include.8.1.1.tar.gz +tar -xf /root/include.8.1.1.tar.gz -C /usr/local/osxcross/SDK/MacOSX12.0.sdk/usr/include/ +wget https://github.com/NibiruChain/gorocksdb/releases/download/v8.1.1/librocksdb_8.1.1_darwin_all.tar.gz -O /root/librocksdb_8.1.1_darwin_all.tar.gz +tar -xf /root/librocksdb_8.1.1_darwin_all.tar.gz -C /usr/local/osxcross/SDK/MacOSX12.0.sdk/usr/lib/ diff --git a/contrib/scripts/release_pre_linux.sh b/contrib/scripts/release_pre_linux.sh index 355c28f43..d3c145881 100755 --- a/contrib/scripts/release_pre_linux.sh +++ b/contrib/scripts/release_pre_linux.sh @@ -11,20 +11,11 @@ set -e WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | awk '{sub(/^v/, "", $2); print $2}') -ROCKSDB_VERSION=8.8.1 - -flock -x /tmp/rocksdb-linux-headers-lock -c "wget -c https://github.com/NibiruChain/gorocksdb/releases/download/v${ROCKSDB_VERSION}/include.${ROCKSDB_VERSION}.tar.gz -O /tmp/include.${ROCKSDB_VERSION}.tar.gz && [ ! -d /usr/include/rocksdb ] && tar -xvf /tmp/include.${ROCKSDB_VERSION}.tar.gz -C /usr/include/; echo 'rocksdb headers installed'" - -if [ "$TARGET" == "linux_amd64_v1" ]; then - wget -c https://github.com/CosmWasm/wasmvm/releases/download/v${WASMVM_VERSION}/libwasmvm_muslc.x86_64.a -O /tmp/libwasmvm_muslc.x86_64.a - cp /tmp/libwasmvm_muslc.x86_64.a /usr/lib/x86_64-linux-gnu/libwasmvm_muslc.a - - wget -c https://github.com/NibiruChain/gorocksdb/releases/download/v${ROCKSDB_VERSION}/librocksdb_${ROCKSDB_VERSION}_linux_amd64.tar.gz -O /tmp/librocksdb_${ROCKSDB_VERSION}_linux_amd64.tar.gz - tar -xvf /tmp/librocksdb_${ROCKSDB_VERSION}_linux_amd64.tar.gz -C /usr/lib/x86_64-linux-gnu/ -else - wget -c https://github.com/CosmWasm/wasmvm/releases/download/v${WASMVM_VERSION}/libwasmvm_muslc.aarch64.a -O /tmp/libwasmvm_muslc.aarch64.a - cp /tmp/libwasmvm_muslc.aarch64.a /usr/lib/aarch64-linux-gnu/libwasmvm_muslc.a - - wget -c https://github.com/NibiruChain/gorocksdb/releases/download/v${ROCKSDB_VERSION}/librocksdb_${ROCKSDB_VERSION}_linux_arm64.tar.gz -O /tmp/librocksdb_${ROCKSDB_VERSION}_linux_arm64.tar.gz - tar -xvf /tmp/librocksdb_${ROCKSDB_VERSION}_linux_arm64.tar.gz -C /usr/lib/aarch64-linux-gnu/ -fi +wget https://github.com/CosmWasm/wasmvm/releases/download/v${WASMVM_VERSION}/libwasmvm_muslc.x86_64.a -O /usr/lib/x86_64-linux-gnu/libwasmvm_muslc.a +wget https://github.com/CosmWasm/wasmvm/releases/download/v${WASMVM_VERSION}/libwasmvm_muslc.aarch64.a -O /usr/lib/aarch64-linux-gnu/libwasmvm_muslc.a +wget https://github.com/NibiruChain/gorocksdb/releases/download/v8.1.1/include.8.1.1.tar.gz -O /root/include.8.1.1.tar.gz +tar -xvf /root/include.8.1.1.tar.gz -C /usr/include/ +wget https://github.com/NibiruChain/gorocksdb/releases/download/v8.1.1/librocksdb_8.1.1_linux_amd64.tar.gz -O /root/librocksdb_8.1.1_linux_amd64.tar.gz +tar -xvf /root/librocksdb_8.1.1_linux_amd64.tar.gz -C /usr/lib/x86_64-linux-gnu/ +wget https://github.com/NibiruChain/gorocksdb/releases/download/v8.1.1/librocksdb_8.1.1_linux_arm64.tar.gz -O /root/librocksdb_8.1.1_linux_arm64.tar.gz +tar -xvf /root/librocksdb_8.1.1_linux_arm64.tar.gz -C /usr/lib/aarch64-linux-gnu/ diff --git a/go.mod b/go.mod index cfda570d6..322533e1f 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/NibiruChain/collections v0.4.0 github.com/armon/go-metrics v0.4.1 github.com/cometbft/cometbft v0.37.2 - github.com/cometbft/cometbft-db v0.9.1 + github.com/cometbft/cometbft-db v0.8.0 github.com/cosmos/cosmos-proto v1.0.0-beta.3 github.com/cosmos/cosmos-sdk v0.47.5 github.com/cosmos/go-bip39 v1.0.0 @@ -130,7 +130,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.6 // indirect + github.com/linxGnu/grocksdb v1.8.0 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -164,15 +164,15 @@ require ( github.com/ulikunitz/xz v0.5.11 // indirect github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v0.14.3 // indirect - go.etcd.io/bbolt v1.3.8 // indirect + go.etcd.io/bbolt v1.3.7 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/crypto v0.15.0 // indirect + golang.org/x/crypto v0.14.0 // indirect golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb // indirect - golang.org/x/net v0.18.0 // indirect + golang.org/x/net v0.17.0 // indirect golang.org/x/oauth2 v0.13.0 // indirect golang.org/x/sync v0.3.0 // indirect - golang.org/x/sys v0.14.0 // indirect - golang.org/x/term v0.14.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/term v0.13.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.128.0 // indirect @@ -194,5 +194,3 @@ replace github.com/cosmos/iavl => github.com/cosmos/iavl v0.20.0 // pin version! 126854af5e6d has issues with the store so that queries fail replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - -replace github.com/linxGnu/grocksdb => github.com/linxGnu/grocksdb v1.8.9 diff --git a/go.sum b/go.sum index 4e55468cd..ec9a85ba1 100644 --- a/go.sum +++ b/go.sum @@ -383,8 +383,8 @@ github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZ github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= github.com/cometbft/cometbft v0.37.2 h1:XB0yyHGT0lwmJlFmM4+rsRnczPlHoAKFX6K8Zgc2/Jc= github.com/cometbft/cometbft v0.37.2/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs= -github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= -github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= +github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= +github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= @@ -883,8 +883,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.9 h1:/s352A7OI/+tOxeecK21qJyLJ0YHI7J8gN/cXOKzEis= -github.com/linxGnu/grocksdb v1.8.9/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.0 h1:H4L/LhP7GOMf1j17oQAElHgVlbEje2h14A8Tz9cM2BE= +github.com/linxGnu/grocksdb v1.8.0/go.mod h1:09CeBborffXhXdNpEcOeZrLKEnRtrZFEpFdPNI9Zjjg= github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -1218,8 +1218,8 @@ github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWp github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= -go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= +go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -1268,8 +1268,8 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1381,8 +1381,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= -golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1534,14 +1534,14 @@ golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.14.0 h1:LGK9IlZ8T9jvdy6cTdfKUCltatMFOehAQo9SRC46UQ8= -golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww= +golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/justfile b/justfile new file mode 100644 index 000000000..31bc57854 --- /dev/null +++ b/justfile @@ -0,0 +1,53 @@ +# Displays available recipes by running `just -l`. +setup: + #!/usr/bin/env bash + just -l + +# Locally install the `nibid` binary and build if needed. +install: + make install + +# Build the `nibid` binary. +build: + make build + +alias b := build + +# Generate protobuf code (Golang) for Nibiru +proto-gen: + #!/usr/bin/env bash + make proto-gen + +alias proto := proto-gen + +# Build protobuf types (Rust) +proto-rs: + bash proto/buf.gen.rs.sh + +lint: + #!/usr/bin/env bash + source contrib/bashlib.sh + if ! which_ok golangci-lint; then + log_info "Installing golangci-lint" + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2 + fi + + golangci-lint run --allow-parallel-runners --fix + +# Runs golang formatter (gofumpt) +fmt: + gofumpt -w x app + +# Format and lint +tidy: + #!/usr/bin/env bash + go mod tidy + just proto-gen + just lint + just fmt + +release-test: + make release-snapshot + +release-publish: + make release