Skip to content

Commit

Permalink
Merge pull request #26 from UptickNetwork/dev
Browse files Browse the repository at this point in the history
add the geneisi init logic for ibc nft transfer module
rename the docker files to uptick
  • Loading branch information
YangChuantongStarry authored Feb 3, 2024
2 parents 7106d6d + b503919 commit d8618ad
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 43 deletions.
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
COMMIT := $(shell git log -1 --format='%H')
VERSION := v0.2.17
VERSION := v0.2.18


# don't override user values
Expand Down Expand Up @@ -540,15 +540,15 @@ ifeq ($(OS),Windows_NT)
mkdir localnet-setup &
@$(MAKE) localnet-build

IF not exist "build/node0/$(UPTICK_BINARY)/config/genesis.json" docker run --rm -v $(CURDIR)/build\uptick\Z xuxinai2002/node:v0.2 "./uptickd testnet --v 4 -o /uptick --keyring-backend=test --starting-ip-address 192.167.10.2"
IF not exist "build/node0/$(UPTICK_BINARY)/config/genesis.json" docker run --rm -v $(CURDIR)/build\uptick\Z uptick/node:v0.2 "./uptickd testnet --v 4 -o /uptick --keyring-backend=test --starting-ip-address 192.167.10.2"
# docker-compose up -d
else
# mkdir -p localnet-setup
@$(MAKE) localnet-build

# if ! [ -f localnet-setup/node0/$(UPTICK_BINARY)/config/genesis.json ]; \
# then \
# docker run --rm -v $(CURDIR)/localnet-setup:/uptick:Z xuxinai2002/node:v0.1 "export LD_LIBRARY_PATH=/wasm && ./uptickd testnet init-files --v 4 -o /uptick --keyring-backend=test --starting-ip-address 192.167.10.2"; \
# docker run --rm -v $(CURDIR)/localnet-setup:/uptick:Z uptick/node:v0.1 "export LD_LIBRARY_PATH=/wasm && ./uptickd testnet init-files --v 4 -o /uptick --keyring-backend=test --starting-ip-address 192.167.10.2"; \
# fi
#
# docker-compose up -d
Expand All @@ -567,15 +567,15 @@ localnet-clean:
localnet-unsafe-reset:
docker-compose down
ifeq ($(OS),Windows_NT)
@docker run --rm -v $(CURDIR)\localnet-setup\node0\uptickd:uptick\Z xuxinai2002/node:v0.1 "./uptickd unsafe-reset-all --home=/uptick"
@docker run --rm -v $(CURDIR)\localnet-setup\node1\uptickd:uptick\Z xuxinai2002/node:v0.1 "./uptickd unsafe-reset-all --home=/uptick"
@docker run --rm -v $(CURDIR)\localnet-setup\node2\uptickd:uptick\Z xuxinai2002/node:v0.1 "./uptickd unsafe-reset-all --home=/uptick"
@docker run --rm -v $(CURDIR)\localnet-setup\node3\uptickd:uptick\Z xuxinai2002/node:v0.1 "./uptickd unsafe-reset-all --home=/uptick"
@docker run --rm -v $(CURDIR)\localnet-setup\node0\uptickd:uptick\Z uptick/node:v0.1 "./uptickd unsafe-reset-all --home=/uptick"
@docker run --rm -v $(CURDIR)\localnet-setup\node1\uptickd:uptick\Z uptick/node:v0.1 "./uptickd unsafe-reset-all --home=/uptick"
@docker run --rm -v $(CURDIR)\localnet-setup\node2\uptickd:uptick\Z uptick/node:v0.1 "./uptickd unsafe-reset-all --home=/uptick"
@docker run --rm -v $(CURDIR)\localnet-setup\node3\uptickd:uptick\Z uptick/node:v0.1 "./uptickd unsafe-reset-all --home=/uptick"
else
@docker run --rm -v $(CURDIR)/localnet-setup/node0/uptickd:/uptick:Z xuxinai2002/node:v0.1 "./uptickd unsafe-reset-all --home=/uptick"
@docker run --rm -v $(CURDIR)/localnet-setup/node1/uptickd:/uptick:Z xuxinai2002/node:v0.1 "./uptickd unsafe-reset-all --home=/uptick"
@docker run --rm -v $(CURDIR)/localnet-setup/node2/uptickd:/uptick:Z xuxinai2002/node:v0.1 "./uptickd unsafe-reset-all --home=/uptick"
@docker run --rm -v $(CURDIR)/localnet-setup/node3/uptickd:/uptick:Z xuxinai2002/node:v0.1 "./uptickd unsafe-reset-all --home=/uptick"
@docker run --rm -v $(CURDIR)/localnet-setup/node0/uptickd:/uptick:Z uptick/node:v0.1 "./uptickd unsafe-reset-all --home=/uptick"
@docker run --rm -v $(CURDIR)/localnet-setup/node1/uptickd:/uptick:Z uptick/node:v0.1 "./uptickd unsafe-reset-all --home=/uptick"
@docker run --rm -v $(CURDIR)/localnet-setup/node2/uptickd:/uptick:Z uptick/node:v0.1 "./uptickd unsafe-reset-all --home=/uptick"
@docker run --rm -v $(CURDIR)/localnet-setup/node3/uptickd:/uptick:Z uptick/node:v0.1 "./uptickd unsafe-reset-all --home=/uptick"
endif

# Clean testnet
Expand Down
29 changes: 10 additions & 19 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,7 @@ func (app *Uptick) registerUpgradeHandlers() {

// Set param key table for params module migration
baseAppLegacySS := app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable())
upgradeVersion := "v0.2.17"
upgradeVersion := "v0.2.18"

app.UpgradeKeeper.SetUpgradeHandler(
upgradeVersion,
Expand All @@ -1319,8 +1319,15 @@ func (app *Uptick) registerUpgradeHandlers() {
panic(fmt.Errorf("failed to wasmKeeper SetParams "))
}

//add wasm load
app.Cw721Keeper.LoadCw721Base(ctx)
gs := ibcnfttransfertypes.DefaultGenesisState()
bz, err := ibcnfttransfertypes.ModuleCdc.MarshalJSON(gs)
if err != nil {
panic(fmt.Errorf("failed to ModuleCdc %s: %w", ibcnfttransfertypes.ModuleName, err))
}
if module, ok := app.mm.Modules[ibcnfttransfertypes.ModuleName].(module.HasGenesis); ok {
module.InitGenesis(ctx, ibcnfttransfertypes.ModuleCdc, bz)
}

return app.mm.RunMigrations(ctx, app.configurator, vm)
})

Expand All @@ -1336,22 +1343,6 @@ func (app *Uptick) registerUpgradeHandlers() {
return
}

var storeUpgrades *storetypes.StoreUpgrades
switch upgradeInfo.Name {
case upgradeVersion:
// add revenue module for testnet (v7 -> v8)
storeUpgrades = &storetypes.StoreUpgrades{

// Added: []string{crisistypes.ModuleName, consensusparamtypes.ModuleName},
Added: []string{cw721types.ModuleName, wasmtypes.ModuleName},
}
}

if storeUpgrades != nil {

// configure store loader that checks if version == upgradeHeight and applies store upgrades
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, storeUpgrades))
}
}

func generateFeemarketParams(enableHeight int64) feemarkettypes.Params {
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3'
services:
node0:
container_name: upticknode0
image: "xuxinai2002/node:v0.1"
image: "uptick/node:v0.1"
ports:
- "26656-26657:26656-26657"
volumes:
Expand All @@ -16,7 +16,7 @@ services:

node1:
container_name: upticknode1
image: "xuxinai2002/node:v0.1"
image: "uptick/node:v0.1"
ports:
- "26659-26660:26656-26657"
volumes:
Expand All @@ -29,7 +29,7 @@ services:

node2:
container_name: upticknode2
image: "xuxinai2002/node:v0.1"
image: "uptick/node:v0.1"
ports:
- "26661-26662:26656-26657"
volumes:
Expand All @@ -42,7 +42,7 @@ services:

node3:
container_name: upticknode3
image: "xuxinai2002/node:v0.1"
image: "uptick/node:v0.1"
ports:
- "26663-26664:26656-26657"
volumes:
Expand Down
7 changes: 0 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,8 @@ require (
replace (
// use cosmos fork of keyring
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0

github.com/cosmos/ibc-go/v7 => github.com/uptSmart/ibc-go/v7 v7.3.0-erc20
// use Cosmos-SDK fork to enable Ledger functionality
// github.com/cosmos/cosmos-sdk => github.com/evmos/cosmos-sdk v0.47.5-evmos.2
// use Evmos geth fork
// github.com/ethereum/go-ethereum => github.com/evmos/go-ethereum v1.10.26-evmos-rc2
github.com/evmos/ethermint => github.com/bianjieai/ethermint v0.22.0-irishub-20231207
// Security Advisory https://github.com/advisories/GHSA-h395-qcrw-5vmq
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.1
// replace broken goleveldb
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
)
2 changes: 1 addition & 1 deletion networks/local/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
all:
docker build --no-cache --tag xuxinai2002/node:v0.2 ../.. -f uptick/Dockerfile
docker build --no-cache --tag uptick/node:v0.2 ../.. -f uptick/Dockerfile

.PHONY: all
2 changes: 1 addition & 1 deletion x/cw721/keeper/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (k Keeper) LoadCw721Base(ctx sdk.Context) (error, uint64) {
codeId, _ = strconv.ParseUint(string(resultBytes), 10, 64)

if codeId <= 0 {
codeId, err = k.StoreWasmContract(ctx, BASE_WASM_URL+"/cw721_base.wasm", types.AccModuleAddress.String())
codeId, err = k.StoreWasmContract(ctx, BASE_WASM_URL+"cw721_base.wasm", types.AccModuleAddress.String())
if err != nil {
k.Logger(ctx).Error("LoadCw721Base ", "err:", err.Error())
return err, 0
Expand Down

0 comments on commit d8618ad

Please sign in to comment.