Skip to content

Commit

Permalink
Merge pull request #379 from hypersign-protocol/testnetv2-housekeeping
Browse files Browse the repository at this point in the history
Chore: Minor housekeeping work before Testnet V2 launch
  • Loading branch information
arnabghose997 authored Nov 25, 2023
2 parents 74f15b7 + 2d970fe commit 5e44dc2
Show file tree
Hide file tree
Showing 38 changed files with 2,245 additions and 281 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: 1.19.7
go-version: 1.20.11
id: go

- name: Check out code into the Go module directory
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.20

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
Expand All @@ -49,7 +49,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.20

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19
FROM golang:1.20

# Set up dependencies
ENV PACKAGES curl make git libc-dev bash gcc python3 jq
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export GO111MODULE=on
all: proto-gen-go proto-gen-swagger build

go-version-check:
ifneq ($(GO_MINOR_VERSION),19)
@echo "ERROR: Go version 1.19 is required to build hid-noded binary"
ifneq ($(GO_MINOR_VERSION),20)
@echo "ERROR: Go version 1.20 is required to build hid-noded binary"
exit 1
endif

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ The Hypersign Identity Network is a permissionless blockchain network to manage

Following are the prerequisites that needs to be installed:

- Golang (Installation Guide: https://go.dev/doc/install) (version: 1.19+)
- Golang (Installation Guide: https://go.dev/doc/install) (version: 1.20)
- make
- jq

## Get started

Expand All @@ -39,7 +40,7 @@ Following are the prerequisites that needs to be installed:
2. Run the following script to setup a single-node blockchain. Please note that the following script requires `jq` to be installed.
```sh
bash localnet.sh
bash ./scripts/localnet-single-node/setup.sh
```

3. Start `hid-noded`:
Expand Down
4 changes: 2 additions & 2 deletions app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package app

import (
"github.com/cosmos/cosmos-sdk/x/auth/ante"
"github.com/cosmos/ibc-go/v3/modules/core/keeper"
"github.com/cosmos/ibc-go/v4/modules/core/keeper"

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
ibcante "github.com/cosmos/ibc-go/v3/modules/core/ante"
ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante"
ssiante "github.com/hypersign-protocol/hid-node/x/ssi/ante"
)

Expand Down
60 changes: 45 additions & 15 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,21 @@ import (
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

"github.com/cosmos/ibc-go/v3/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v3/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v3/modules/core"
ibcclient "github.com/cosmos/ibc-go/v3/modules/core/02-client"
ibcclientclient "github.com/cosmos/ibc-go/v3/modules/core/02-client/client"
ibcclienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"
ibcporttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper"
"github.com/cosmos/ibc-go/v4/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v4/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v4/modules/core"
ibcclient "github.com/cosmos/ibc-go/v4/modules/core/02-client"
ibcclientclient "github.com/cosmos/ibc-go/v4/modules/core/02-client/client"
ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"
ibcporttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types"
porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"

ibcfee "github.com/cosmos/ibc-go/v4/modules/apps/29-fee"
ibcfeekeeper "github.com/cosmos/ibc-go/v4/modules/apps/29-fee/keeper"
ibcfeetypes "github.com/cosmos/ibc-go/v4/modules/apps/29-fee/types"

"github.com/spf13/cast"
abci "github.com/tendermint/tendermint/abci/types"
Expand Down Expand Up @@ -155,6 +160,7 @@ var (
authzmodule.AppModuleBasic{},
wasm.AppModuleBasic{},
ssimodule.AppModuleBasic{},
ibcfee.AppModuleBasic{},
)

// module account permissions
Expand All @@ -167,6 +173,7 @@ var (
govtypes.ModuleName: {authtypes.Burner},
ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
wasm.ModuleName: {authtypes.Burner},
ibcfeetypes.ModuleName: nil,
}
)

Expand Down Expand Up @@ -243,6 +250,7 @@ type HidnodeApp struct {
UpgradeKeeper upgradekeeper.Keeper
ParamsKeeper paramskeeper.Keeper
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
IBCFeeKeeper ibcfeekeeper.Keeper
EvidenceKeeper evidencekeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
Expand All @@ -253,6 +261,7 @@ type HidnodeApp struct {
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
ScopedTransferKeeper capabilitykeeper.ScopedKeeper
ScopedWasmKeeper capabilitykeeper.ScopedKeeper
ScopedIBCFeeKeeper capabilitykeeper.ScopedKeeper

SsiKeeper ssimodulekeeper.Keeper

Expand Down Expand Up @@ -293,7 +302,7 @@ func NewHidnodeApp(
govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey,
upgradetypes.StoreKey, feegrant.StoreKey, evidencetypes.StoreKey,
ibctransfertypes.StoreKey, capabilitytypes.StoreKey, authzkeeper.StoreKey,
ssimoduletypes.StoreKey, wasm.StoreKey,
ssimoduletypes.StoreKey, wasm.StoreKey, ibcfeetypes.StoreKey,
)
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
Expand Down Expand Up @@ -444,20 +453,32 @@ func NewHidnodeApp(
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)).
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper))

// IBC Fee Module keeper
app.IBCFeeKeeper = ibcfeekeeper.NewKeeper(
appCodec, keys[ibcfeetypes.StoreKey], app.getSubspace(ibcfeetypes.ModuleName),
app.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware
app.IBCKeeper.ChannelKeeper,
&app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper,
)

// Create Transfer Keepers
app.TransferKeeper = ibctransferkeeper.NewKeeper(
appCodec,
keys[ibctransfertypes.StoreKey],
app.getSubspace(ibctransfertypes.ModuleName),
app.IBCKeeper.ChannelKeeper,
app.IBCFeeKeeper, // ISC4 Wrapper: fee IBC middleware
app.IBCKeeper.ChannelKeeper,
&app.IBCKeeper.PortKeeper,
app.AccountKeeper,
app.BankKeeper,
scopedTransferKeeper,
)
transferModule := transfer.NewAppModule(app.TransferKeeper)
transferIBCModule := transfer.NewIBCModule(app.TransferKeeper)

// Create Transfer Stack
var transferStack porttypes.IBCModule
transferStack = transfer.NewIBCModule(app.TransferKeeper)
transferStack = ibcfee.NewIBCMiddleware(transferStack, app.IBCFeeKeeper)

// Create evidence Keeper for to register the IBC light client misbehaviour evidence route
evidenceKeeper := evidencekeeper.NewKeeper(
Expand Down Expand Up @@ -511,6 +532,11 @@ func NewHidnodeApp(
wasmOpts...,
)

// Create fee enabled wasm ibc Stack
var wasmStack porttypes.IBCModule
wasmStack = wasm.NewIBCHandler(app.WasmKeeper, app.IBCKeeper.ChannelKeeper, app.IBCFeeKeeper)
wasmStack = ibcfee.NewIBCMiddleware(wasmStack, app.IBCFeeKeeper)

// The gov proposal types can be individually enabled (x/wasm)
if len(enabledProposals) != 0 {
govRouter.AddRoute(
Expand All @@ -534,8 +560,8 @@ func NewHidnodeApp(
// Create static IBC router, add transfer route, then set and seal it
ibcRouter := ibcporttypes.NewRouter()
ibcRouter.
AddRoute(ibctransfertypes.ModuleName, transferIBCModule).
AddRoute(wasm.ModuleName, wasm.NewIBCHandler(app.WasmKeeper, app.IBCKeeper.ChannelKeeper))
AddRoute(ibctransfertypes.ModuleName, transferStack).
AddRoute(wasm.ModuleName, wasmStack)
app.IBCKeeper.SetRouter(ibcRouter)

/**** Module Options ****/
Expand Down Expand Up @@ -567,6 +593,7 @@ func NewHidnodeApp(
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper),
evidence.NewAppModule(app.EvidenceKeeper),
ibc.NewAppModule(app.IBCKeeper),
ibcfee.NewAppModule(app.IBCFeeKeeper),
params.NewAppModule(app.ParamsKeeper),
transferModule,
ssiModule,
Expand All @@ -589,6 +616,7 @@ func NewHidnodeApp(
stakingtypes.ModuleName,
ibchost.ModuleName,
ibctransfertypes.ModuleName,
ibcfeetypes.ModuleName,
feegrant.ModuleName,
authz.ModuleName,
ssimoduletypes.ModuleName,
Expand Down Expand Up @@ -617,6 +645,7 @@ func NewHidnodeApp(
slashingtypes.ModuleName,
ibchost.ModuleName,
ibctransfertypes.ModuleName,
ibcfeetypes.ModuleName,
wasm.ModuleName,
)

Expand All @@ -639,6 +668,7 @@ func NewHidnodeApp(
genutiltypes.ModuleName,
evidencetypes.ModuleName,
ibctransfertypes.ModuleName,
ibcfeetypes.ModuleName,
ssimoduletypes.ModuleName,
feegrant.ModuleName,
authz.ModuleName,
Expand Down
2 changes: 1 addition & 1 deletion app/prefix.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package app

import (
sdk "github.com/cosmos/cosmos-sdk/types"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)

const (
Expand Down
1 change: 0 additions & 1 deletion app/wasm_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,3 @@ func TestGetEnabledProposals(t *testing.T) {
})
}
}

2 changes: 1 addition & 1 deletion cmd/hid-noded/cmd/debug_extensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ func signSchemaDocCmd() *cobra.Command {
if err != nil {
return err
}

// Unmarshal Proof Object
var credSchemaDocProof types.DocumentProof
err = clientCtx.Codec.UnmarshalJSON([]byte(argProofObjectWithoutSignature), &credSchemaDocProof)
Expand Down
2 changes: 1 addition & 1 deletion cmd/hid-noded/cmd/generate_ssi_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func generateDidDoc(didNamespace string, publicKeyMultibase string, userAddress
Type: types.EcdsaSecp256k1VerificationKey2019,
Controller: didId,
PublicKeyMultibase: publicKeyMultibase,
BlockchainAccountId: types.CosmosCAIP10Prefix + ":jagrat:" + userAddress,
BlockchainAccountId: types.CosmosCAIP10Prefix + ":prajna:" + userAddress,
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion contrib/hidnoded-cosmovisor.service
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Unit]
Description=Hypersign Identity Network - Jagrat Chain
Description=Hypersign Identity Network
Requires=network-online.target
After=network-online.target

Expand Down
2 changes: 1 addition & 1 deletion contrib/hidnoded-standalone.service
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Unit]
Description= Jagrat Network node
Description= Hypersign Identity Network
Requires=network-online.target
After=network-online.target

Expand Down
Loading

0 comments on commit 5e44dc2

Please sign in to comment.