Documentation ¶
Index ¶
- func CopyStringMap(src map[string]string) (dst map[string]string)
- func CopyStringSet(src map[string]struct{}) (dst map[string]struct{})
- func DeserializeStringMap(r io.Reader) (smap map[string]string, err error)
- func DeserializeStringSet(r io.Reader) (vmap map[string]struct{}, err error)
- func FileExisted(filename string) bool
- func GetConfirmedPassword() ([]byte, error)
- func GetPassword() ([]byte, error)
- func SerializeStringMap(w io.Writer, smap map[string]string) (err error)
- func SerializeStringSet(w io.Writer, vmap map[string]struct{}) (err error)
- func StartPProf(port uint32)
- func StringExisted(src []string, check string) bool
- type HeightChanges
- type History
- func (h *History) Append(height uint32, execute func(), rollback func())
- func (h *History) Changes() []HeightChanges
- func (h *History) Commit(height uint32)
- func (h *History) Height() uint32
- func (h *History) RollbackSeekTo(height uint32)
- func (h *History) RollbackTo(height uint32) error
- func (h *History) SeekTo(height uint32) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyStringMap ¶ added in v0.5.0
CopyStringMap copy the src map's key and value, and return the dst map.
func CopyStringSet ¶ added in v0.5.0
CopyStringSet copy the src map's key, and return the dst map.
func DeserializeStringMap ¶ added in v0.5.0
func DeserializeStringSet ¶ added in v0.5.0
func FileExisted ¶
func GetConfirmedPassword ¶
GetConfirmedPassword gets double confirmed password from user input
func SerializeStringMap ¶ added in v0.5.0
func SerializeStringSet ¶ added in v0.5.0
func StringExisted ¶ added in v0.7.0
Types ¶
type HeightChanges ¶ added in v0.5.0
type HeightChanges struct {
// contains filtered or unexported fields
}
HeightChanges holds all changes on a particular height.
type History ¶ added in v0.5.0
type History struct {
// contains filtered or unexported fields
}
History is a helper to log all producers and votes changes for state, so we can handle block rollback by tracing the change history, no need to loop though all transactions since the beginning of DPOS consensus.
func NewHistory ¶ added in v0.5.0
newHistory creates a new history instance.
func (*History) Changes ¶ added in v0.5.0
func (h *History) Changes() []HeightChanges
Changes holds the changes by the height where the changes happens.
func (*History) RollbackSeekTo ¶ added in v0.8.0
RollbackSeekToSeekTo changes state to a historical height in range of history capacity.
func (*History) RollbackTo ¶ added in v0.5.0
RollbackTo restores state to height, and remove all histories after height. If no enough histories to rollback return error.