iovns

package module
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

README

IOVNS

This repo contains bnsd built on top of the cosmos-sdk

Everything is still very very very experimental, and I expect the design to dramatically change over the course of the coming days.

Running docker image

# build docker script
docker build -t iovns .
# initialize chain
bash scripts/init.sh
# run docker iovnsd
docker run -it -p 127.0.0.1:26657:26657 -p 127.0.0.1:26656:26656 \
  -v ~/.iovnsd:/app/.iovnsd -v ~/.iovnscli:/app/.iovnscli \ 
  iovns iovnsd start

Documentation

Index

Constants

View Source
const EmptyAccountName = ""

EmptyAccountName defines the empty account identifier in an IOV domain

Variables

View Source
var Separator = []byte("*")

Separator divides domain name from account name in an IOV starname

View Source
var ZeroAddress = sdk.AccAddress{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}

Functions

func GetAccountKey

func GetAccountKey(domain, name string) string

GetAccountKey returns an account key in the form of string given the domain name and the account name

func SecondsToTime

func SecondsToTime(seconds int64) time.Time

SecondsToTime converts unix seconds to time

func SplitAccountKey

func SplitAccountKey(key []byte) (domainName, accountName string)

SplitAccountKey takes an account key and splits it into domain name and account name, panics on nil keys.

func TimeToSeconds

func TimeToSeconds(t time.Time) int64

TimeToSeconds converts a time.Time to unix seconds timestamp

Types

type QueryDecoder

type QueryDecoder func(data []byte, ptrTargetModel interface{}) error

QueryDecoder defines a function that decodes query bytes to query models

var DefaultQueryDecode QueryDecoder = json.Unmarshal

DefaultQueryDecode is the default function used to decode query bytes to query models

type QueryEncoder

type QueryEncoder func(queryModel interface{}) ([]byte, error)

QueryEncoder defines a function that encodes query models to bytes

var DefaultQueryEncode QueryEncoder = json.Marshal

DefaultQueryEncode is the default function used to marshal query models into bytes

type QueryHandler

type QueryHandler interface {
	// QueryPath defines the path of the query in the module to retrieve information
	QueryPath() string
	// Validate validates the correctness of the query formation in a stateless way
	Validate() error
}

QueryHandler abstracts the functionality of a query handler CONTRACT: must be a struct pointer

Directories

Path Synopsis
cmd
Package mock contains utilities and types that simulate behaviour of other components of the app, with the possibility to force outputs.
Package mock contains utilities and types that simulate behaviour of other components of the app, with the possibility to force outputs.
pkg
index
Package index contains utilities to create single key indexes in key-value stores An index is formed in the following way: a KVStore is provided, a prefix and an Indexer object.
Package index contains utilities to create single key indexes in key-value stores An index is formed in the following way: a KVStore is provided, a prefix and an Indexer object.
swagger-ui
x
configuration
Package configuration contains the iovns module for handling state configuration such as account
Package configuration contains the iovns module for handling state configuration such as account

Jump to

Keyboard shortcuts

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