Skip to content

Commit

Permalink
Merge pull request #179 from DecentralCardGame/development
Browse files Browse the repository at this point in the history
Merge dev in master
  • Loading branch information
lxgr-linux authored Dec 16, 2023
2 parents 57e99d3 + cd9a959 commit 1359712
Show file tree
Hide file tree
Showing 60 changed files with 2,529 additions and 2,175 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ release/
.idea/
.vscode/
.DS_Store
/build
/cs
18 changes: 14 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,20 @@ RUN pip install tendermint-chunked-genesis-download


# install correct go version
RUN wget https://go.dev/dl/go1.20.2.linux-amd64.tar.gz
RUN tar -xvf go1.20.2.linux-amd64.tar.gz
RUN rm /usr/local/go -rf
RUN mv go /usr/local
RUN if [ $(uname -m) = "x86_64" ]; then \
wget https://go.dev/dl/go1.21.3.linux-amd64.tar.gz; \
tar -xvf go1.21.3.linux-amd64.tar.gz; \
rm /usr/local/go -rf; \
mv go /usr/local; \
elif [ $(uname -m) = "aarch64" ]; then \
wget https://go.dev/dl/go1.21.3.linux-arm64.tar.gz; \
tar -xvf go1.21.3.linux-arm64.tar.gz; \
rm /usr/local/go -rf; \
mv go /usr/local; \
else \
echo "what the hell is your OS? Go will not work that way."; \
fi


USER tendermint
WORKDIR /home/tendermint
Expand Down
35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
###############################################################################
### Build ###
###############################################################################

# Default target
all: install

# Build directory
BUILDDIR := ./build

# Build the project
build: go.sum $(BUILDDIR)/
@echo "Warning: Building without version information"
@echo "Warning: To build with version info and defaults please use './ignite chain build'"
go build -tags=ledger -mod=readonly -o $(BUILDDIR)/ ./...

# Create the build directory
$(BUILDDIR)/:
mkdir -p $(BUILDDIR)/

# Install binary to ~/go/bin/
install: build
cp $(BUILDDIR)/Cardchaind ~/go/bin/

# Verify dependencies
go.sum: go.mod
@echo "Ensure dependencies have not been modified ..." >&2
@go mod verify

# Clean build directory
clean:
rm -rf $(BUILDDIR)/

# Phony targets
.PHONY: all build install clean
5 changes: 4 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,10 @@ func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.Respo
// automated nerf/buff happens here
if app.LastBlockHeight()%epochBlockTime == 0 {
cardchainmodule.UpdateNerfLevels(ctx, app.CardchainKeeper)
app.CardchainKeeper.AddVoteRightsToAllUsers(ctx, ctx.BlockHeight()+app.CardchainKeeper.GetParams(ctx).VotingRightsExpirationTime)
matchesEnabled, _ := app.CardchainKeeper.FeatureFlagModuleInstance.Get(ctx, string(cardchainmoduletypes.FeatureFlagName_Matches))
if matchesEnabled { // Only give voterigths to all users, when matches are not anabled
app.CardchainKeeper.AddVoteRightsToAllUsers(ctx)
}
}

if app.LastBlockHeight()%500 == 0 { //HourlyFaucet
Expand Down
2 changes: 1 addition & 1 deletion config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ genesis:
staking:
params:
bond_denom: ubpf
chain_id: cardtestnet-5
chain_id: cardtestnet-6
validators:
- name: alice
bonded: 5000000ubpf
Expand Down
34 changes: 2 additions & 32 deletions config/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -61,41 +61,11 @@ server {
}

location ~ ^/grpc(/.*)?$ {
# Not sending ACAO header because it is already being added by the upstream
#add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Headers' '*' always;
add_header 'Access-Control-Allow-Methods' '*' always;
add_header 'Access-Control-Max-Age' 1728000 always;

if ($request_method = 'OPTIONS') {
return 200;
}

proxy_redirect off;
proxy_set_header host $host;
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-forward-for $proxy_add_x_forwarded_for;
proxy_pass http://blockchain:9090$1$is_args$args;
grpc_pass grpcs://blockchain:9090$1$is_args$args;
}

location ~ ^/grpc2(/.*)?$ {
# Not sending ACAO header because it is already being added by the upstream
#add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Headers' '*' always;
add_header 'Access-Control-Allow-Methods' '*' always;
add_header 'Access-Control-Max-Age' 1728000 always;

if ($request_method = 'OPTIONS') {
return 200;
}

proxy_redirect off;
proxy_set_header host $host;
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-forward-for $proxy_add_x_forwarded_for;
proxy_pass http://blockchain:9091$1$is_args$args;
grpc_pass grpcs://blockchain:9091$1$is_args$args;
}

location ~ ^/tendermint(/.*)?$ {
Expand Down
1 change: 1 addition & 0 deletions docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
echo -e "\033[0;32mfasten your seatbelts\033[0m"
FAUCET_SECRET_KEY="0x6F1f5bd93f3D59d6eed1d5ec40E29C1821029759"
CHAIN_ID=Cardchain
USE_SNAP=true

if [ -z "$FAUCET_SECRET_KEY" ]
then
Expand Down
Loading

0 comments on commit 1359712

Please sign in to comment.