Documentation ¶
Index ¶
- Constants
- func Base58Decode(s string) []byte
- func Base58Encode(raw []byte) string
- func BytesToFloat64(b []byte) float64
- func BytesToInt32(b []byte) int32
- func BytesToInt64(b []byte) int64
- func CopyBytes(b []byte) (copiedBytes []byte)
- func Float64ToBytes(f float64) []byte
- func FromHex(s string) []byte
- func Hex2Bytes(str string) []byte
- func Int32ToBytes(n int32) []byte
- func Int64ToBytes(n int64) []byte
- func LoadYamlAsViper(configfile string) *viper.Viper
- func Parity(bit []byte) []byte
- func ParseHex(s string) []byte
- func Sha3(raw []byte) []byte
- func ToHex(data []byte) string
- func UnifyDecimal(a *Fixed, b *Fixed) (*Fixed, *Fixed, error)
- type ACCConfig
- type Config
- type ConsoleLogConfig
- type DBConfig
- type DebugConfig
- type FileLogConfig
- type Fixed
- func (f *Fixed) Add(other *Fixed) *Fixed
- func (f *Fixed) BiggerThan(other *Fixed) bool
- func (f *Fixed) ChangeDecimal(targetDecimal int) *Fixed
- func (f *Fixed) Div(i int64) *Fixed
- func (f *Fixed) Equals(other *Fixed) bool
- func (f *Fixed) IsNegative() bool
- func (f *Fixed) IsPositive() bool
- func (f *Fixed) IsZero() bool
- func (f *Fixed) LessThan(other *Fixed) bool
- func (f *Fixed) Marshal() string
- func (f *Fixed) Multiply(other *Fixed) *Fixed
- func (f *Fixed) Neg() *Fixed
- func (f *Fixed) Sub(other *Fixed) *Fixed
- func (f *Fixed) Times(i int64) *Fixed
- func (f *Fixed) TimesF(v float64) *Fixed
- func (f *Fixed) ToFloat() float64
- func (f *Fixed) ToString() string
- func (f *Fixed) ToStringWithDecimal() string
- type GenesisConfig
- type LogConfig
- type MetricsConfig
- type P2PConfig
- type RPCConfig
- type SimpleNotation
- func (sn *SimpleNotation) Bytes() []byte
- func (sn *SimpleNotation) Reset()
- func (sn *SimpleNotation) WriteByte(b byte, escape bool)
- func (sn *SimpleNotation) WriteBytes(bs []byte, escape bool)
- func (sn *SimpleNotation) WriteBytesSlice(p [][]byte, escape bool)
- func (sn *SimpleNotation) WriteFloat64(f float64, escape bool)
- func (sn *SimpleNotation) WriteInt32(i int32, escape bool)
- func (sn *SimpleNotation) WriteInt64(i int64, escape bool)
- func (sn *SimpleNotation) WriteMapStringToI64(m map[string]int64, escape bool)
- func (sn *SimpleNotation) WriteString(s string, escape bool)
- func (sn *SimpleNotation) WriteStringSlice(p []string, escape bool)
- type TokenInfo
- type VMConfig
- type VersionConfig
- type Witness
Constants ¶
const ( VoteInterval = 200 SlotLength = 3 )
consts
Variables ¶
This section is empty.
Functions ¶
func BytesToFloat64 ¶ added in v1.1.0
BytesToFloat64 converts byte slice to float64.
func BytesToInt32 ¶ added in v1.1.0
BytesToInt32 converts byte slice to int32.
func Float64ToBytes ¶ added in v1.1.0
Float64ToBytes converts float64 to byte slice.
func Int32ToBytes ¶ added in v1.1.0
Int32ToBytes converts int32 to byte slice.
func LoadYamlAsViper ¶ added in v1.1.0
LoadYamlAsViper load yaml file as viper object
Types ¶
type Config ¶
type Config struct { ACC *ACCConfig Genesis string VM *VMConfig DB *DBConfig P2P *P2PConfig RPC *RPCConfig Log *LogConfig Metrics *MetricsConfig Debug *DebugConfig Version *VersionConfig }
Config provide all configuration for the application
type ConsoleLogConfig ¶
ConsoleLogConfig is the config for consolewriter of ilog.
type DebugConfig ¶
type DebugConfig struct {
ListenAddr string
}
DebugConfig is the config of debug.
type FileLogConfig ¶
FileLogConfig is the config for filewriter of ilog.
type Fixed ¶ added in v1.1.0
Fixed implements fixed point number for user of token balance
func NewFixed ¶ added in v1.1.0
NewFixed generate Fixed from string and decimal, will truncate if decimal is smaller. Decimal < 0 means auto detecting decimal
func UnmarshalFixed ¶ added in v1.1.0
UnmarshalFixed unmarshal from string
func (*Fixed) BiggerThan ¶ added in v1.1.0
BiggerThan ...
func (*Fixed) ChangeDecimal ¶ added in v1.1.0
ChangeDecimal change decimal to give decimal, without changing its real value
func (*Fixed) ToStringWithDecimal ¶ added in v1.1.0
ToStringWithDecimal convert to string with tailing 0s
type GenesisConfig ¶
type GenesisConfig struct { CreateGenesis bool InitialTimestamp string TokenInfo *TokenInfo WitnessInfo []*Witness ContractPath string AdminInfo *Witness FoundationInfo *Witness }
GenesisConfig config of the genesis bloc
type LogConfig ¶
type LogConfig struct { FileLog *FileLogConfig ConsoleLog *ConsoleLogConfig AsyncWrite bool }
LogConfig is the config of ilog.
type MetricsConfig ¶
MetricsConfig is the config of metrics.
type P2PConfig ¶
type P2PConfig struct { ListenAddr string SeedNodes []string ChainID uint32 Version uint16 DataPath string InboundConn int OutboundConn int BlackPID []string BlackIP []string AdminPort string }
P2PConfig is the config for p2p network.
type SimpleNotation ¶ added in v1.1.0
type SimpleNotation struct {
// contains filtered or unexported fields
}
SimpleNotation is a simple serialize notation used to convert struct to bytes.
func NewSimpleNotation ¶ added in v1.1.0
func NewSimpleNotation() *SimpleNotation
NewSimpleNotation returns a new SimpleNotation instance.
func (*SimpleNotation) Bytes ¶ added in v1.1.0
func (sn *SimpleNotation) Bytes() []byte
Bytes returns the result bytes of buffer.
func (*SimpleNotation) Reset ¶ added in v1.1.0
func (sn *SimpleNotation) Reset()
Reset resets the buffer.
func (*SimpleNotation) WriteByte ¶ added in v1.1.0
func (sn *SimpleNotation) WriteByte(b byte, escape bool)
WriteByte writes a byte to buffer.
func (*SimpleNotation) WriteBytes ¶ added in v1.1.0
func (sn *SimpleNotation) WriteBytes(bs []byte, escape bool)
WriteBytes writes a byte slice to buffer.
func (*SimpleNotation) WriteBytesSlice ¶ added in v1.1.0
func (sn *SimpleNotation) WriteBytesSlice(p [][]byte, escape bool)
WriteBytesSlice writes a bytes slice to buffer.
func (*SimpleNotation) WriteFloat64 ¶ added in v1.1.0
func (sn *SimpleNotation) WriteFloat64(f float64, escape bool)
WriteFloat64 writes a float64 to buffer.
func (*SimpleNotation) WriteInt32 ¶ added in v1.1.0
func (sn *SimpleNotation) WriteInt32(i int32, escape bool)
WriteInt32 writes a int32 to buffer.
func (*SimpleNotation) WriteInt64 ¶ added in v1.1.0
func (sn *SimpleNotation) WriteInt64(i int64, escape bool)
WriteInt64 writes a int64 to buffer.
func (*SimpleNotation) WriteMapStringToI64 ¶ added in v1.1.0
func (sn *SimpleNotation) WriteMapStringToI64(m map[string]int64, escape bool)
WriteMapStringToI64 writes a map[string]int64 to buffer.
func (*SimpleNotation) WriteString ¶ added in v1.1.0
func (sn *SimpleNotation) WriteString(s string, escape bool)
WriteString writes a string to buffer.
func (*SimpleNotation) WriteStringSlice ¶ added in v1.1.0
func (sn *SimpleNotation) WriteStringSlice(p []string, escape bool)
WriteStringSlice writes a string slice to buffer.
type TokenInfo ¶ added in v1.1.0
type TokenInfo struct { FoundationAccount string IOSTTotalSupply int64 IOSTDecimal int64 RAMTotalSupply int64 RAMGenesisAmount int64 }
TokenInfo config of the genesis block
type VersionConfig ¶ added in v1.1.0
VersionConfig contrains netname(mainnet / testnet etc) and protocol info