Documentation ¶
Index ¶
- Constants
- Variables
- func Base58Decode(s string) []byte
- func Base58Encode(raw []byte) string
- func BytesToInt(b []byte) int
- func BytesToInt64(b []byte) int64
- func BytesToUint64(b []byte) uint64
- func CopyBytes(b []byte) (copiedBytes []byte)
- func FromHex(s string) []byte
- func GetPulicIP() string
- func Hash160(raw []byte) []byte
- func Hex2Bytes(str string) []byte
- func Int64ToBytes(i int64) []byte
- func IntToBytes(n int) []byte
- func IntervalSecond(t1 Timestamp, t2 Timestamp) int64
- func IntervalSecondBySlot(slot1 int64, slot2 int64) int64
- func IsPublicIP(IP net.IP) bool
- func Parity(bit []byte) []byte
- func ParseHex(s string) []byte
- func RandHash(n int) []byte
- func ReadFile(src string) ([]byte, error)
- func Sha256(raw []byte) []byte
- func Sha3(raw []byte) []byte
- func ToHex(data []byte) string
- func Uint64ToBytes(i uint64) []byte
- type ACCConfig
- type App
- type BlockIDType
- type Config
- type ConsoleLogConfig
- type DBConfig
- type DebugConfig
- type FileLogConfig
- type GenesisConfig
- type Hash
- type LogConfig
- type MetricsConfig
- type P2PConfig
- type RPCConfig
- type Serializable
- type Service
- type StorageSize
- type Timestamp
- type Uint160
- type VMConfig
Constants ¶
const ( // SlotLength interval of generate block SlotLength = 3 // SecondsInHour ... SecondsInHour = 3600 // SecondsInDay ... SecondsInDay = 24 * 3600 )
const ( // HashLength ... HashLength = 32 // AddressLength ... AddressLength = 20 // VoteInterval the interval between the votes VoteInterval = 200 )
const UINT160SIZE int = 20
UINT160SIZE ...
Variables ¶
var PublicIPDetechUrls = []string{
"http://ipecho.net/plain",
"http://myexternalip.com/raw",
}
PublicIPDetechUrls test public ip
Functions ¶
func IntervalSecondBySlot ¶
IntervalSecondBySlot the interval between the slots
Types ¶
type App ¶
type App []Service
App is a list of Service.
type Config ¶
type Config struct { ACC *ACCConfig Genesis *GenesisConfig VM *VMConfig DB *DBConfig P2P *P2PConfig RPC *RPCConfig Log *LogConfig Metrics *MetricsConfig Debug *DebugConfig }
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 GenesisConfig ¶
type GenesisConfig struct { CreateGenesis bool GenesisHash string WitnessInfo []string VoteContractPath string AdminID string }
GenesisConfig config of the genesis block
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 }
P2PConfig is the config for p2p network.
type Serializable ¶
Serializable data serializable
type Service ¶
type Service interface { Start() error Stop() }
Service defines APIs of resident goroutines.
type Timestamp ¶
type Timestamp struct {
Slot int64
}
Timestamp the interval between the blocks
func GetCurrentTimestamp ¶
func GetCurrentTimestamp() Timestamp
GetCurrentTimestamp return value of current timestamp
func GetTimestamp ¶
GetTimestamp return value of timestamp