Documentation ¶
Index ¶
- Variables
- func PubKeyString(pk PubKey) string
- type ByAll
- type Context
- func (c Context) BlockHeight() int64
- func (c Context) BlockTime() int64
- func (c Context) ChainID() string
- func (c Context) EthappState() *state.StateDB
- func (c Context) GetNonce() uint64
- func (c Context) GetSigners() []common.Address
- func (c Context) HasSigner(signer common.Address) bool
- func (c Context) Reset() Context
- func (c *Context) SetNonce(nonce uint64)
- func (c *Context) WithSigners(signers ...common.Address)
- type GenesisDoc
- type GenesisValidator
- type PubKey
- type Signable
Constants ¶
This section is empty.
Variables ¶
var Cdc = amino.NewCodec()
Functions ¶
func PubKeyString ¶
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func NewContext ¶
func (Context) BlockHeight ¶
func (Context) EthappState ¶
func (Context) GetSigners ¶
func (Context) Reset ¶
Reset should clear out all permissions, but carry on knowledge that this is a child
func (*Context) WithSigners ¶
type GenesisDoc ¶
type GenesisDoc struct { GenesisTime time.Time `json:"genesis_time"` ChainID string `json:"chain_id"` ConsensusParams *types.ConsensusParams `json:"consensus_params,omitempty"` Validators []GenesisValidator `json:"validators"` AppHash []byte `json:"app_hash"` }
GenesisDoc defines the initial conditions for a tendermint blockchain, in particular its validator set.
func GenesisDocFromFile ¶
func GenesisDocFromFile(genDocFile string) (*GenesisDoc, error)
GenesisDocFromFile reads JSON data from a file and unmarshalls it into a GenesisDoc.
func GenesisDocFromJSON ¶
func GenesisDocFromJSON(jsonBlob []byte) (*GenesisDoc, error)
GenesisDocFromJSON unmarshalls JSON data into a GenesisDoc.
func (*GenesisDoc) SaveAs ¶
func (genDoc *GenesisDoc) SaveAs(file string) error
SaveAs is a utility method for saving GenensisDoc as a JSON file.
func (*GenesisDoc) ValidateAndComplete ¶
func (genDoc *GenesisDoc) ValidateAndComplete() error
ValidateAndComplete checks that all necessary fields are present and fills in defaults for optional fields left empty
func (*GenesisDoc) ValidatorHash ¶
func (genDoc *GenesisDoc) ValidatorHash() []byte
ValidatorHash returns the hash of the validator set contained in the GenesisDoc
type GenesisValidator ¶
type GenesisValidator struct { PubKey PubKey `json:"pub_key"` Power string `json:"power"` Name string `json:"name"` Address string `json:"address"` CompRate sdk.Rat `json:"comp_rate"` MaxAmount int64 `json:"max_amount"` Website string `json:"website"` Location string `json:"location"` Email string `json:"email"` Profile string `json:profile` }
GenesisValidator is an initial validator.
type Signable ¶
type Signable interface { // SignBytes is the immutable data, which needs to be signed SignBytes() []byte // Sign will add a transaction with signature Sign(tx *types.Transaction) error // Signers will return the public key(s) that signed if the signature // is valid, or an error if there is any issue with the signature, // including if there are no signatures Signers() (common.Address, error) // TxBytes returns the transaction data as well as all signatures // It should return an error if Sign was never called TxBytes() ([]byte, error) }
Signable represents any transaction we wish to send to tendermint core These methods allow us to sign arbitrary Tx with the KeyStore