Skip to content

Latest commit

 

History

History
72 lines (62 loc) · 1.79 KB

Integration_modules.md

File metadata and controls

72 lines (62 loc) · 1.79 KB

App Integration

If you use our Scaffold to create App, you are able to find TODOs in app.go. Follow those TODOs to config the Modules in app.go file.

app.go

  • Importing Modules

    // TODO : Import of nft & xnft
    "github.com/FreeFlixMedia/modules/nfts"
    "github.com/FreeFlixMedia/modules/xnfts"
  • Adding Modules in NewBasicMager

    // TODO: Add nft & xnft module(s) AppModuleBasic
    nfts.AppModuleBasic{},
    xnfts.AppModuleBasic{},
  • Adding Keeper and ScopedKeeper

    // TODO: Add nft & xnft Keeper
    nftKeeper nfts.Keeper
    xnftKeeper xnfts.Keeper
    
     // TODO: Add scoped xnft Keeper
    scopedXNFTKeeper capability.ScopedKeeper
  • Adding StoreKeys

    // TODO: Add the keys that module requires
    nfts.StoreKey, xnfts.StoreKey
  • Adding ScopedXNFTKeeper

    // TODO: Add scopedXNFTKeeper
    scopedXNFTKeeper := app.capabilityKeeper.ScopeToModule(xnfts.ModuleName)
  • Adding Module Keeper

	// TODO: initialize nft & xnft Keepers
    app.nftKeeper = nfts.NewKeeper(app.cdc, keys[nfts.StoreKey])
    app.xnftKeeper = xnfts.NewKeeper(app.cdc, keys[xnfts.StoreKey], app.nftKeeper, app.bankKeeper,app.ibcKeeper.ChannelKeeper, &app.ibcKeeper.PortKeeper, scopedXNFTKeeper)
    xnftModule := xnfts.NewAppModule(app.xnftKeeper)
  • Adding Router

    // TODO: Add xnft Route
    ibcRouter.AddRoute(xnfts.ModuleName, xnftModule)
  • Intialiting modules

    // TODO: Add nft & xnft module(s)
    nfts.NewAppModule(app.nftKeeper),
    xnftModule,
  • Init gensis modules

    // TODO: Init  nft & xnft module(s)
    nfts.StoreKey,
    xnfts.StoreKey,
  • Adding Scoped Keeper

    //TODO: Add ScopedXNFTKeeper
    app.scopedXNFTKeeper= scopedXNFTKeeper