app

package module
v0.0.0-...-e7c82ff Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

README

SDK Application Tutorial

This repository contains the source code of the nameservice tutorial.

Tutorial

Click here to access the tutorial. You can also view it on the website.

Building and running the example

Click here for instructions on how to build and run the code.

Translations:

Slides

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//设置客户端的安装路径
	// default home directories for the application CLI
	DefaultCLIHome = os.ExpandEnv("$HOME/.nscli")

	//设置全节点的安装路径
	// DefaultNodeHome sets the folder where the applcation data and configuration will be stored
	DefaultNodeHome = os.ExpandEnv("$HOME/.nsd")

	//为不同模块的初始化 以及 配置,使其能够成为一个完整的应用
	// ModuleBasicManager is in charge of setting up basic module elemnets
	ModuleBasics = module.NewBasicManager(
		genaccounts.AppModuleBasic{},
		genutil.AppModuleBasic{},
		auth.AppModuleBasic{},
		bank.AppModuleBasic{},
		params.AppModuleBasic{},
		nameservice.AppModule{},
		staking.AppModuleBasic{},
		distr.AppModuleBasic{},
		slashing.AppModuleBasic{},
	)
)

Functions

func MakeCodec

func MakeCodec() *codec.Codec

MakeCodec generates the necessary codecs for Amino

func NewNameServiceApp

func NewNameServiceApp(logger log.Logger, db dbm.DB) *nameServiceApp

NewNameServiceApp is a constructor function for nameServiceApp 为应用添加一个简单的构造函数 添加以下逻辑: - 从每个所需模块中实例化所需的`Keeper`。 - 生成每个`Keeper`所需的`storeKey`。 - 注册每个模块的`handler`。`baseapp`的`路由器`的 `AddRoute()` 方法用来做这个。 - 注册每个模块的`querier`。`baseapp`的`queryRouter`中的`AddRoute()`方法用来做这个。 - 将`KVStores`挂载到`baseApp`的multistore提供的key值。 - 设置`initChainer`来定义初始应用程序状态。

Types

type GenesisState

type GenesisState map[string]json.RawMessage

GenesisState represents chain state at the start of the chain. Any initial state (account balances) are stored here.

func NewDefaultGenesisState

func NewDefaultGenesisState() GenesisState

Directories

Path Synopsis
cmd
nsd
x

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL