Update test and script files

This commit is contained in:
neeraj 2024-04-01 11:55:00 +05:30
parent b304305e7c
commit 53d6cbf023
7 changed files with 43 additions and 35 deletions

View File

@ -4,7 +4,7 @@ FROM golang:alpine AS build-env
RUN apk add --update git build-base linux-headers RUN apk add --update git build-base linux-headers
# Set working directory for the build # Set working directory for the build
WORKDIR /go/src/git.vdb.to/cerc-io/laconic2d WORKDIR /go/src/git.vdb.to/cerc-io/laconicd
# Cache Go modules # Cache Go modules
COPY go.mod go.sum ./ COPY go.mod go.sum ./
@ -23,9 +23,9 @@ FROM alpine:3.17.0
RUN apk add --update ca-certificates jq curl RUN apk add --update ca-certificates jq curl
# Copy over binaries from the build-env # Copy over binaries from the build-env
COPY --from=build-env /go/src/git.vdb.to/cerc-io/laconic2d/build/laconic2d /usr/bin/laconic2d COPY --from=build-env /go/src/git.vdb.to/cerc-io/laconicd/build/laconicd /usr/bin/laconicd
WORKDIR / WORKDIR /
# Run laconic2d by default # Run laconicd by default
CMD ["laconic2d"] CMD ["laconicd"]

View File

@ -2,7 +2,7 @@
DOCKER := $(shell which docker) DOCKER := $(shell which docker)
LACONIC_BINARY = laconic2d LACONIC_BINARY = laconicd
BRANCH := $(shell git rev-parse --abbrev-ref HEAD) BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
COMMIT := $(shell git log -1 --format='%H') COMMIT := $(shell git log -1 --format='%H')
@ -42,7 +42,7 @@ build-linux:
GOOS=linux GOARCH=amd64 LEDGER_ENABLED=false $(MAKE) build GOOS=linux GOARCH=amd64 LEDGER_ENABLED=false $(MAKE) build
$(BUILD_TARGETS): go.sum $(BUILDDIR)/ $(BUILD_TARGETS): go.sum $(BUILDDIR)/
@echo "--> installing laconic2d" @echo "--> installing laconicd"
go $@ $(BUILD_FLAGS) $(BUILD_ARGS) ./... go $@ $(BUILD_FLAGS) $(BUILD_ARGS) ./...
$(BUILDDIR)/: $(BUILDDIR)/:

View File

@ -8,10 +8,10 @@ The Source of Proof. Laconic is a next generation data availability & verifiabil
## Installation ## Installation
Install `laconic2d`: Install `laconicd`:
```bash ```bash
# install the laconic2d binary # install the laconicd binary
make install make install
``` ```
@ -38,3 +38,11 @@ Run tests:
# e2e tests # e2e tests
make test-e2e make test-e2e
``` ```
## Community
The following chat channels and forums are a great spot to ask questions about Ethermint:
- [Laconic Twitter](https://twitter.com/laconicnetwork)
- [Discord](https://discord.com/invite/ukhbBemyxY)
- [Website](https://laconic.com)

View File

@ -6,7 +6,7 @@ MONIKER="localtestnet"
KEYRING="test" KEYRING="test"
LOGLEVEL="${LOGLEVEL:-info}" LOGLEVEL="${LOGLEVEL:-info}"
if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconic2d/data/blockstore.db" ]; then if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then
# validate dependencies are installed # validate dependencies are installed
command -v jq > /dev/null 2>&1 || { command -v jq > /dev/null 2>&1 || {
echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/" echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/"
@ -14,25 +14,25 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconic2d/data/blockstore.db" ]; then
} }
# remove existing daemon and client # remove existing daemon and client
rm -rf $HOME/.laconic2d/* rm -rf $HOME/.laconicd/*
rm -rf $HOME/.laconic/* rm -rf $HOME/.laconic/*
if [ -n "`which make`" ]; then if [ -n "`which make`" ]; then
make install make install
fi fi
laconic2d config set client keyring-backend $KEYRING laconicd config set client keyring-backend $KEYRING
laconic2d config set client chain-id $CHAINID laconicd config set client chain-id $CHAINID
# if $KEY exists it should be deleted # if $KEY exists it should be deleted
laconic2d keys add $KEY --keyring-backend $KEYRING laconicd keys add $KEY --keyring-backend $KEYRING
# Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer) # Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer)
laconic2d init $MONIKER --chain-id $CHAINID --default-denom photon laconicd init $MONIKER --chain-id $CHAINID --default-denom photon
update_genesis() { update_genesis() {
jq "$1" $HOME/.laconic2d/config/genesis.json > $HOME/.laconic2d/config/tmp_genesis.json && jq "$1" $HOME/.laconicd/config/genesis.json > $HOME/.laconicd/config/tmp_genesis.json &&
mv $HOME/.laconic2d/config/tmp_genesis.json $HOME/.laconic2d/config/genesis.json mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
} }
if [[ "$TEST_REGISTRY_EXPIRY" == "true" ]]; then if [[ "$TEST_REGISTRY_EXPIRY" == "true" ]]; then
@ -61,28 +61,28 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconic2d/data/blockstore.db" ]; then
# disable produce empty block # disable produce empty block
if [[ "$OSTYPE" == "darwin"* ]]; then if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.laconic2d/config/config.toml sed -i '' 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.laconicd/config/config.toml
else else
sed -i 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.laconic2d/config/config.toml sed -i 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.laconicd/config/config.toml
fi fi
# Allocate genesis accounts (cosmos formatted addresses) # Allocate genesis accounts (cosmos formatted addresses)
laconic2d genesis add-genesis-account $KEY 100000000000000000000000000photon --keyring-backend $KEYRING laconicd genesis add-genesis-account $KEY 100000000000000000000000000photon --keyring-backend $KEYRING
# Sign genesis transaction # Sign genesis transaction
laconic2d genesis gentx $KEY 1000000000000000000000photon --keyring-backend $KEYRING --chain-id $CHAINID laconicd genesis gentx $KEY 1000000000000000000000photon --keyring-backend $KEYRING --chain-id $CHAINID
# Collect genesis tx # Collect genesis tx
laconic2d genesis collect-gentxs laconicd genesis collect-gentxs
# Run this to ensure everything worked and that the genesis file is setup correctly # Run this to ensure everything worked and that the genesis file is setup correctly
laconic2d genesis validate laconicd genesis validate
else else
echo "Using existing database at $HOME/.laconic2d. To replace, run '`basename $0` clean'" echo "Using existing database at $HOME/.laconicd. To replace, run '`basename $0` clean'"
fi fi
# Start the node (remove the --pruning=nothing flag if historical queries are not needed) # Start the node (remove the --pruning=nothing flag if historical queries are not needed)
laconic2d start \ laconicd start \
--pruning=nothing \ --pruning=nothing \
--log_level $LOGLEVEL \ --log_level $LOGLEVEL \
--minimum-gas-prices=0.0001photon \ --minimum-gas-prices=0.0001photon \

View File

@ -1,3 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
docker build -t cerc/laconic2d:local ../.. --progress=plain --no-cache docker build -t cerc/laconicd:local ../.. --progress=plain --no-cache

View File

@ -1,7 +1,7 @@
services: services:
laconic2d: laconicd:
restart: unless-stopped restart: unless-stopped
image: cerc/laconic2d:local image: cerc/laconicd:local
entrypoint: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"] entrypoint: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"]
environment: environment:
- TEST_AUCTION_ENABLED - TEST_AUCTION_ENABLED
@ -28,6 +28,6 @@ services:
sdk-test-runner: sdk-test-runner:
image: cerc/registry-sdk-tester:local image: cerc/registry-sdk-tester:local
depends_on: depends_on:
laconic2d: laconicd:
condition: service_healthy condition: service_healthy
command: tail -F /dev/null command: tail -F /dev/null

View File

@ -8,21 +8,21 @@ fi
yarn_args=("--inspect-brk=8888") yarn_args=("--inspect-brk=8888")
yarn_args+=("${@:-test}") yarn_args+=("${@:-test}")
# Get the key from laconic2d # Get the key from laconicd
laconic2d_key=$( laconicd_key=$(
yes | docker compose exec laconic2d laconic2d keys export alice --keyring-backend test --unarmored-hex --unsafe yes | docker compose exec laconicd laconicd keys export alice --keyring-backend test --unarmored-hex --unsafe
) )
# Set parameters for the test suite # Set parameters for the test suite
cosmos_chain_id=laconic_9000-1 cosmos_chain_id=laconic_9000-1
laconicd_rpc_endpoint=http://laconic2d:26657 laconicd_rpc_endpoint=http://laconicd:26657
laconicd_gql_endpoint=http://laconic2d:9473/api laconicd_gql_endpoint=http://laconicd:9473/api
docker compose exec laconic2d sh -c "curl --retry 10 --retry-delay 3 --retry-connrefused http://127.0.0.1:9473/api" docker compose exec laconicd sh -c "curl --retry 10 --retry-delay 3 --retry-connrefused http://127.0.0.1:9473/api"
# Run tests # Run tests
docker compose exec \ docker compose exec \
-e COSMOS_CHAIN_ID="$cosmos_chain_id" \ -e COSMOS_CHAIN_ID="$cosmos_chain_id" \
-e LACONICD_REST_ENDPOINT="$laconicd_rpc_endpoint" \ -e LACONICD_REST_ENDPOINT="$laconicd_rpc_endpoint" \
-e LACONICD_GQL_ENDPOINT="$laconicd_gql_endpoint" \ -e LACONICD_GQL_ENDPOINT="$laconicd_gql_endpoint" \
-e PRIVATE_KEY="$laconic2d_key" \ -e PRIVATE_KEY="$laconicd_key" \
sdk-test-runner yarn run "${yarn_args[@]}" sdk-test-runner yarn run "${yarn_args[@]}"