Skip to content

Commit

Permalink
Merge pull request #165 from DecentralCardGame/development
Browse files Browse the repository at this point in the history
Merge development into master; 0.10.0 release; cardtestnet-5
  • Loading branch information
lxgr-linux authored Oct 17, 2023
2 parents ef6a47b + 66a2110 commit 57e99d3
Show file tree
Hide file tree
Showing 150 changed files with 5,945 additions and 5,219 deletions.
2 changes: 1 addition & 1 deletion .fleet/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"backend.maxHeapSizeMb": 896
"backend.maxHeapSizeMb": 1568
}
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:

- name: Prepare Release Variables
id: vars
uses: ignite/cli/actions/release/vars@main
uses: ignite/cli/actions/release/vars@v0.26.1

- name: Issue Release Assets
uses: ignite/cli/actions/cli@main
uses: ignite/cli/actions/cli@v0.26.1
if: ${{ steps.vars.outputs.should_release == 'true' }}
with:
args: chain build --release --release.prefix ${{ steps.vars.outputs.tarball_prefix }} -t linux:amd64 -t darwin:amd64 --yes
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ RUN apt-get -y -qq update && \
apt-get install -y -qq apt-transport-https curl wget unzip screen bash jq python3 pip && \
apt-get clean


# install python script to download genesis
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
Expand Down
31 changes: 29 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,16 @@ import (

"github.com/DecentralCardGame/Cardchain/docs"
cardchainmodule "github.com/DecentralCardGame/Cardchain/x/cardchain"
cardchainclient "github.com/DecentralCardGame/Cardchain/x/cardchain/client"
cardchainmodulekeeper "github.com/DecentralCardGame/Cardchain/x/cardchain/keeper"
cardchainmoduletypes "github.com/DecentralCardGame/Cardchain/x/cardchain/types"

appparams "github.com/DecentralCardGame/Cardchain/app/params"
globtypes "github.com/DecentralCardGame/Cardchain/types"
featureflagmodule "github.com/DecentralCardGame/Cardchain/x/featureflag"
featureflagclient "github.com/DecentralCardGame/Cardchain/x/featureflag/client"
featureflagmodulekeeper "github.com/DecentralCardGame/Cardchain/x/featureflag/keeper"
featureflagmoduletypes "github.com/DecentralCardGame/Cardchain/x/featureflag/types"
// this line is used by starport scaffolding # stargate/app/moduleImport
)

Expand All @@ -139,7 +144,10 @@ func getGovProposalHandlers() []govclient.ProposalHandler {
upgradeclient.LegacyCancelProposalHandler,
ibcclientclient.UpdateClientProposalHandler,
ibcclientclient.UpgradeProposalHandler,
//cardchainclient.ProposalHandler,
cardchainclient.CopyrightProposalHandler,
cardchainclient.MatchReporterProposalHandler,
cardchainclient.SetProposalHandler,
featureflagclient.ProposalHandler,
// this line is used by starport scaffolding # stargate/app/govProposalHandler
)

Expand Down Expand Up @@ -175,6 +183,7 @@ var (
ica.AppModuleBasic{},
vesting.AppModuleBasic{},
cardchainmodule.AppModuleBasic{},
featureflagmodule.AppModuleBasic{},
// this line is used by starport scaffolding # stargate/app/moduleBasic
)

Expand Down Expand Up @@ -250,6 +259,8 @@ type App struct {
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper

CardchainKeeper cardchainmodulekeeper.Keeper

FeatureflagKeeper featureflagmodulekeeper.Keeper
// this line is used by starport scaffolding # stargate/app/keeperDeclaration

// mm is the module manager
Expand Down Expand Up @@ -299,6 +310,7 @@ func New(
cardchainmoduletypes.RunningAveragesStoreKey, cardchainmoduletypes.CouncilsStoreKey,
cardchainmoduletypes.ImagesStoreKey, cardchainmoduletypes.InternalStoreKey,
cardchainmoduletypes.ServersStoreKey,
featureflagmoduletypes.StoreKey,
// this line is used by starport scaffolding # stargate/app/storeKey
)
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
Expand Down Expand Up @@ -495,6 +507,14 @@ func New(
// If evidence needs to be handled for the app, set routes in router here and seal
app.EvidenceKeeper = *evidenceKeeper

app.FeatureflagKeeper = *featureflagmodulekeeper.NewKeeper(
appCodec,
keys[featureflagmoduletypes.StoreKey],
keys[featureflagmoduletypes.MemStoreKey],
app.GetSubspace(featureflagmoduletypes.ModuleName),
)
featureflagModule := featureflagmodule.NewAppModule(appCodec, app.FeatureflagKeeper, app.AccountKeeper, app.BankKeeper)

app.CardchainKeeper = *cardchainmodulekeeper.NewKeeper(
appCodec,
keys[cardchainmoduletypes.UsersStoreKey],
Expand All @@ -509,7 +529,7 @@ func New(
keys[cardchainmoduletypes.ServersStoreKey],
keys[cardchainmoduletypes.InternalStoreKey],
app.GetSubspace(cardchainmoduletypes.ModuleName),

app.FeatureflagKeeper,
app.BankKeeper,
)

Expand All @@ -522,6 +542,7 @@ func New(
govRouter.
AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler).
AddRoute(cardchainmoduletypes.RouterKey, cardchainmodule.NewProposalHandler(app.CardchainKeeper)).
AddRoute(featureflagmoduletypes.RouterKey, featureflagmodule.NewProposalHandler(app.FeatureflagKeeper)).
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)).
AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)).
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)).
Expand Down Expand Up @@ -585,6 +606,7 @@ func New(
transferModule,
icaModule,
cardchainModule,
featureflagModule,
// this line is used by starport scaffolding # stargate/app/appModule
)

Expand Down Expand Up @@ -615,6 +637,7 @@ func New(
paramstypes.ModuleName,
vestingtypes.ModuleName,
cardchainmoduletypes.ModuleName,
featureflagmoduletypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/beginBlockers
)

Expand All @@ -640,6 +663,7 @@ func New(
upgradetypes.ModuleName,
vestingtypes.ModuleName,
cardchainmoduletypes.ModuleName,
featureflagmoduletypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/endBlockers
)

Expand Down Expand Up @@ -670,6 +694,7 @@ func New(
upgradetypes.ModuleName,
vestingtypes.ModuleName,
cardchainmoduletypes.ModuleName,
featureflagmoduletypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/initGenesis
)

Expand Down Expand Up @@ -700,6 +725,7 @@ func New(
ibc.NewAppModule(app.IBCKeeper),
transferModule,
cardchainModule,
featureflagModule,
// this line is used by starport scaffolding # stargate/app/appModule
)
app.sm.RegisterStoreDecoders()
Expand Down Expand Up @@ -972,6 +998,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(icacontrollertypes.SubModuleName)
paramsKeeper.Subspace(icahosttypes.SubModuleName)
paramsKeeper.Subspace(cardchainmoduletypes.ModuleName)
paramsKeeper.Subspace(featureflagmoduletypes.ModuleName)
// this line is used by starport scaffolding # stargate/app/paramSubspace

return paramsKeeper
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-4
chain_id: cardtestnet-5
validators:
- name: alice
bonded: 5000000ubpf
Expand Down
75 changes: 51 additions & 24 deletions docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,61 @@ then
exit 1
fi

#we can derive the peer id from the address and should do so!
NODE_ADDR=$(cat syncnode.txt)
PEER_ID=$(curl -s "http://"$NODE_ADDR":26657/status" | jq -r .result.node_info.id)
#we can derive the peer id from the rpc
mapfile -t peers < <(
jq -r '.peers[]' peer_nodes.json
)

for item in "${peers[@]}"; do
echo "peers: ${item}"
done

mapfile -t rpcs < <(
jq -r '.rpcs[]' peer_nodes.json
)

echo "peers" $peers

for i in "${!rpcs[@]}"; do
if curl --output /dev/null --silent --head --fail --connect-timeout 5 ${rpcs[$i]}; then
echo "URL exists: ${rpcs[$i]}"
PEER_ID=$(curl -s ${rpcs[$i]}"/status" | jq -r .result.node_info.id)

PEERS=$PEER_ID"@"${peers[$i]}
break
else
echo "not reachable $i"
fi
done
if [ -z "$PEERS" ]
then
echo -e "\033[0;31mNo PEERS available\033[0m"
exit
fi

SEEDS=""
PEERS=$PEER_ID"@"$NODE_ADDR":26656"
echo "peers is:" $PEERS
sed -i.bak -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.Cardchain/config/config.toml

SNAP_RPCs=("http://crowd.rpc.t.stavr.tech:21207"
"https://cardchain-testnet.nodejumper.io:443"
"https://cardchain-rpc.acloud.pp.ua:443")

# for i in "${SNAP_RPCs[@]}"; do
# if curl --output /dev/null --silent --head --fail --connect-timeout 5 $i; then
# echo "URL exists: $i"
# SNAP_RPC=$i
# break
# else
# echo "not reachable $i"
# fi
# done

# if [ -z "$SNAP_RPC" ]
# then
# echo -e "\033[0;31mNo SNAP_RPC available\033[0m"
# fi

SNAP_RPC="http://$(cat syncnode.txt):26657"
mapfile -t snap_rpcs < <(
jq -r '.snap_rpcs[]' peer_nodes.json
)

for i in "${snap_rpcs[@]}"; do
if curl --output /dev/null --silent --head --fail --connect-timeout 5 $i; then
echo "URL exists: $i"
SNAP_RPC=$i
break
else
echo "not reachable $i"
fi
done
if [ -z "$SNAP_RPC" ]
then
echo -e "\033[0;31mNo SNAP_RPC available\033[0m"
exit
fi

LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height)
echo $LATEST_HEIGHT
BLOCK_HEIGHT=$((LATEST_HEIGHT)); \
Expand Down
Loading

0 comments on commit 57e99d3

Please sign in to comment.