5 Commits
Author SHA1 Message Date
nabarun 2ef71427ca Remove unecessary step to delete .laconic directory
Build / build (pull_request) Successful in 2m8s
Integration Tests / test-integration (pull_request) Successful in 1m52s
E2E Tests / test-e2e (pull_request) Successful in 3m28s
Lint / Run golangci-lint (pull_request) Successful in 5m2s
Unit Tests / test-unit (pull_request) Successful in 2m14s
SDK Tests / sdk_tests_nameservice_expiry (pull_request) Successful in 7m20s
SDK Tests / sdk_tests (pull_request) Successful in 8m24s
SDK Tests / sdk_tests_auctions (pull_request) Successful in 13m3s
2024-07-10 18:13:24 +05:30
prathamesh 77ce9c6725 Use bash to run the fixturenet script for SDK tests 2024-07-10 18:13:24 +05:30
prathamesh b8c7c62322 Use golang bullseye for building laconicd binary 2024-07-10 18:13:24 +05:30
prathamesh e7ac7ae23a Replace alpine with ubuntu as base image in the Dockerfile 2024-07-10 18:13:24 +05:30
prathamesh 576569fe66 Update root command setup to respect home flag (#34)
Integration Tests / test-integration (push) Successful in 2m33s
E2E Tests / test-e2e (push) Successful in 3m48s
Lint / Run golangci-lint (push) Successful in 5m41s
Unit Tests / test-unit (push) Successful in 1m51s
SDK Tests / sdk_tests_nameservice_expiry (push) Successful in 7m31s
SDK Tests / sdk_tests (push) Successful in 7m53s
SDK Tests / sdk_tests_auctions (push) Successful in 13m48s
Part of cerc-io/laconic2d#32 and cerc-io/laconic2d#33

- Update context used in root command with Viper so that it recognizes the client config from home directory passed in CLI flags
- Avoid providing default home dir to depinject so that the home directory passed in CLI flags is used in txs
- Known issue: The client config from non-default home directory still doesn't seem to be getting used for some commands; in such cases, user has to pass the required flags explicitly

Reviewed-on: cerc-io/laconic2d#34
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-07-10 12:32:49 +00:00
4 changed files with 14 additions and 17 deletions
+9 -9
View File
@@ -1,7 +1,4 @@
FROM golang:alpine AS build-env
# Install dependencies
RUN apk add --update git build-base linux-headers
FROM golang:1.21-bullseye AS builder
# Set working directory for the build
WORKDIR /go/src/git.vdb.to/cerc-io/laconicd
@@ -17,13 +14,16 @@ COPY . .
RUN make build
# Final image
FROM alpine:3.17.0
FROM ubuntu:22.04
# Install ca-certificates
RUN apk add --update ca-certificates jq curl bash
# Install ca-certificates, jq, curl, bash, and other necessary packages
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
jq curl netcat bash \
&& rm -rf /var/lib/apt/lists/*
# Copy over binaries from the build-env
COPY --from=build-env /go/src/git.vdb.to/cerc-io/laconicd/build/laconicd /usr/bin/laconicd
# Copy over binary from the builder
COPY --from=builder /go/src/git.vdb.to/cerc-io/laconicd/build/laconicd /usr/bin/laconicd
WORKDIR /
+4 -6
View File
@@ -68,7 +68,7 @@ func NewRootCmd() *cobra.Command {
cmd.SetOut(cmd.OutOrStdout())
cmd.SetErr(cmd.ErrOrStderr())
clientCtx = clientCtx.WithCmdContext(cmd.Context())
clientCtx = clientCtx.WithCmdContext(cmd.Context()).WithViper(EnvPrefix)
clientCtx, err := client.ReadPersistentCommandFlags(clientCtx, cmd.Flags())
if err != nil {
return err
@@ -96,10 +96,6 @@ func NewRootCmd() *cobra.Command {
return err
}
if err := client.SetCmdClientContextHandler(clientCtx, cmd); err != nil {
return err
}
// overwrite the minimum gas price from the app configuration
srvCfg := serverconfig.DefaultConfig()
srvCfg.MinGasPrices = "0photon"
@@ -138,7 +134,9 @@ func ProvideClientContext(
WithLegacyAmino(legacyAmino).
WithInput(os.Stdin).
WithAccountRetriever(types.AccountRetriever{}).
WithHomeDir(app.DefaultNodeHome).
// Workaround: Avoid providing DefaultNodeHome to depinject as it is given precedence over the one passed using --home flag in some CLI commands
// TODO: Implement proper fix
// WithHomeDir(app.DefaultNodeHome).
WithViper(EnvPrefix) // env variable prefix
// Read the config again to overwrite the default values with the values from the config file
-1
View File
@@ -15,7 +15,6 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then
# remove existing daemon and client
rm -rf $HOME/.laconicd/*
rm -rf $HOME/.laconic/*
if [ -n "`which make`" ]; then
make install
+1 -1
View File
@@ -2,7 +2,7 @@ services:
laconicd:
restart: unless-stopped
image: cerc/laconicd:local
entrypoint: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"]
entrypoint: ["bash", "/docker-entrypoint-scripts.d/create-fixturenet.sh"]
environment:
- TEST_AUCTION_ENABLED
- TEST_REGISTRY_EXPIRY