Documentation ¶
Index ¶
- Constants
- Variables
- func AppExists(name string) (yes bool)
- func RunNode(logger *zap.Logger, config *viper.Viper)
- type AppAttributes
- type AppMaker
- type Application
- type Broadcaster
- type Core
- type Engine
- type Hashable
- type IMetropolisApp
- type Node
- type Payload
- type RPCNode
- type Serializable
- type Superior
- type Unserializable
Constants ¶
View Source
const ChainIDArg = "chainid"
View Source
const (
ReceiptsPrefix = "receipts-"
)
Variables ¶
View Source
var ( ErrInvalidChainID = errors.New("no such chain id") ErrMissingParams = errors.New("missing params") )
View Source
var Apps = make(map[string]AppMaker)
Functions ¶
Types ¶
type AppMaker ¶
AppMaker is the signature for functions which take charge of create new instance of applications
type Application ¶
type Application interface { agtypes.Application SetCore(Core) GetAttributes() AppAttributes }
Application embeds types.Application, defines application interface in ann
type Broadcaster ¶
Broadcaster means we can deliver tx in application
type Core ¶
type Core interface { IsValidator() bool GetPublicKey() (crypto.PubKeyEd25519, bool) GetPrivateKey() (crypto.PrivKeyEd25519, bool) GetChainID() string GetEngine() Engine BroadcastTxSuperior([]byte) error }
Core defines the interface at which an application sees its containing organization
type Engine ¶
type Engine interface { GetBlock(def.INT) (*agtypes.BlockCache, *pbtypes.BlockMeta, error) GetBlockMeta(def.INT) (*pbtypes.BlockMeta, error) GetValidators() (def.INT, *agtypes.ValidatorSet) PrivValidator() *agtypes.PrivValidator BroadcastTx([]byte) error Query(byte, []byte) (interface{}, error) }
Engine defines the consensus engine
type IMetropolisApp ¶
type IMetropolisApp interface { GetAttribute(string) (string, bool) GetAttributes() AppAttributes SetAttributes(AppAttributes) PushAttribute(string, string) AttributeExists(string) bool }
type Node ¶
type Node struct { Superior Superior Angine *angine.Angine Application agtypes.Application GenesisDoc *agtypes.GenesisDoc // contains filtered or unexported fields }
func (*Node) PrivValidator ¶
func (n *Node) PrivValidator() *agtypes.PrivValidator
type Payload ¶
type Payload struct { Function string `json:"function"` Params []interface{} `json:"params"` }
type RPCNode ¶
type RPCNode interface { Height() def.INT GetBlock(height def.INT) (*agtypes.BlockCache, *pbtypes.BlockMeta) BroadcastTx(tx []byte) error BroadcastTxCommit(tx []byte) error FlushMempool() GetValidators() (def.INT, []*agtypes.Validator) GetP2PNetInfo() (bool, []string, []*agtypes.Peer) GetNumPeers() int GetConsensusStateInfo() (string, []string) GetNumUnconfirmedTxs() int GetUnconfirmedTxs() []agtypes.Tx IsNodeValidator(pub crypto.PubKey) bool GetBlacklist() []string }
RPCNode define the node's abilities provided for rpc calls
type Serializable ¶
Serializable transforms to bytes
type Superior ¶
type Superior interface { Broadcaster }
Superior defines the application on the upper level, e.g. Metropolis
type Unserializable ¶
type Unserializable interface {
FromBytes(bs []byte)
}
Unserializable transforms from bytes
Click to show internal directories.
Click to hide internal directories.