consts

package
v0.0.0-...-5ecede5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2018 License: LGPL-3.0-or-later Imports: 2 Imported by: 90

Documentation

Overview

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

View Source
const (
	TxTypeFirstBlock  = 1
	TxTypeStopNetwork = 2

	TxTypeParserFirstBlock  = "FirstBlock"
	TxTypeParserStopNetwork = "StopNetwork"
)
View Source
const (
	NetworkError             = "Network"
	JSONMarshallError        = "JSONMarshall"
	JSONUnmarshallError      = "JSONUnmarshall"
	CommandExecutionError    = "CommandExecution"
	ConversionError          = "Conversion"
	TypeError                = "Type"
	ProtocolError            = "Protocol"
	MarshallingError         = "Marshall"
	UnmarshallingError       = "Unmarshall"
	ParseError               = "Parse"
	IOError                  = "IO"
	CryptoError              = "Crypto"
	ContractError            = "Contract"
	DBError                  = "DB"
	PanicRecoveredError      = "Panic"
	ConnectionError          = "Connection"
	ConfigError              = "Config"
	VMError                  = "VM"
	JustWaiting              = "JustWaiting"
	BlockError               = "Block"
	ParserError              = "Parser"
	ContextError             = "Context"
	SessionError             = "Session"
	RouteError               = "Route"
	NotFound                 = "NotFound"
	Found                    = "Found"
	EmptyObject              = "EmptyObject"
	InvalidObject            = "InvalidObject"
	DuplicateObject          = "DuplicateObject"
	UnknownObject            = "UnknownObject"
	ParameterExceeded        = "ParameterExceeded"
	DivisionByZero           = "DivisionByZero"
	EvalError                = "Eval"
	JWTError                 = "JWT"
	AccessDenied             = "AccessDenied"
	SizeDoesNotMatch         = "SizeDoesNotMatch"
	NoIndex                  = "NoIndex"
	NoFunds                  = "NoFunds"
	BlockIsFirst             = "BlockIsFirst"
	IncorrectCallingContract = "IncorrectCallingContract"
	WritingFile              = "WritingFile"
	CentrifugoError          = "CentrifugoError"
	StatsdError              = "StatsdError"
	MigrationError           = "MigrationError"
	AutoupdateError          = "AutoupdateError"
	BCRelevanceError         = "BCRelevanceError"
	BCActualizationError     = "BCActualizationError"
	SchedulerError           = "SchedulerError"
	SyncProcess              = "SyncProcess"
	WrongModeError           = "WrongModeError"
	VDEManagerError          = "VDEManagerError"
	BadTxError               = "BadTxError"
)

Types of log errors

View Source
const AddressLength = 20

AddressLength is length of address

View Source
const AvailableBCGap = 4
View Source
const BLOCK_VERSION = 1

BLOCK_VERSION is block version

View Source
const BlockSize = 16

BlockSize is size of block

View Source
const DATA_TYPE_BLOCK_BODY = 7

DATA_TYPE_BLOCK_BODY is body block datatype

View Source
const DATA_TYPE_MAX_BLOCK_ID = 10

DATA_TYPE_MAX_BLOCK_ID is block id max datatype

View Source
const DEFAULT_TCP_PORT = 7078

DEFAULT_TCP_PORT used when port number missed in host addr

View Source
const DOWNLOAD_CHAIN_TRY_COUNT = 10

DOWNLOAD_CHAIN_TRY_COUNT is number of attempt

View Source
const DefaultConfigFile = "config.toml"

DefaultConfigFile name of config file (toml format)

View Source
const DefaultLockFilename = "go-genesis.lock"

DefaultLockFilename is default filename of lock file

View Source
const DefaultNodesConnectDelay = 6
View Source
const DefaultPidFilename = "go-genesis.pid"

DefaultPidFilename is default filename of pid file

View Source
const DefaultTempDirName = "genesis-temp"

DefaultTempDirName is default name of temporary directory

View Source
const DefaultVDE = 1

DefaultVDE allways is 1

View Source
const DefaultWorkdirName = "genesis-data"

DefaultWorkdirName name of working directory

View Source
const EGS_DIGIT = 18

EGS_DIGIT money_digit for EGS 1000000000000000000

View Source
const ERROR_TIME = 1

ERROR_TIME is error time

View Source
const FirstBlockFilename = "1block"

FirstBlockFilename name of first block binary file

View Source
const FounderAmount = 50000

FounderAmount is the starting amount of founder

View Source
const FromToPerDayLimit = 10000

FromToPerDayLimit day limit token transfer between accounts

View Source
const HashSize = 32

HashSize is size of hash

View Source
const KeyIDFilename = "KeyID"

KeyIDFilename generated KeyID

View Source
const MAX_TX_BACK = 86400

MAX_TX_BACK transaction may wander in the net for a day and then get into a block

View Source
const MAX_TX_FORW = 0

MAX_TX_FORW How fast could the time of transaction pass

View Source
const MIN_CONFIRMED_NODES = 0

MIN_CONFIRMED_NODES The number of nodes which should have the same block as we have for regarding this block belongs to the major part of DC-net. For get_confirmed_block_id()

View Source
const MaxTXAttempt = 10
View Source
const MoneyLength = 30

MoneyLength is the maximum number of digits in money value

View Source
const NETWORK_ID = 1

NETWORK_ID is id of network

View Source
const NodePrivateKeyFilename = "NodePrivateKey"

NodePrivateKeyFilename name of node private key file

View Source
const NodePublicKeyFilename = "NodePublicKey"

NodePublicKeyFilename name of node public key file

View Source
const PrivateKeyFilename = "PrivateKey"

PrivateKeyFilename name of wallet private key file

View Source
const PrivkeyLength = 32

PrivkeyLength is privkey length

View Source
const PubkeySizeLength = 64

PubkeySizeLength is pubkey length

View Source
const PublicKeyFilename = "PublicKey"

PublicKeyFilename name of wallet public key file

View Source
const READ_TIMEOUT = 20

READ_TIMEOUT is timeout for TCP

View Source
const ROUND_FIX = 0.00000000001

ROUND_FIX is rounding constant

View Source
const RollbackResultFilename = "rollback_result"

RollbackResultFilename rollback result file

View Source
const TCPConnTimeout = 5 * time.Second

TCPConnTimeout timeout of tcp connection

View Source
const TokenMovementQtyPerBlockLimit = 100

TokenMovementQtyPerBlockLimit block limit token transfer

View Source
const TxRequestExpire = 1 * time.Minute

TxRequestExpire is expiration time for request of transaction

View Source
const UPD_AND_VER_URL = "http://apla.io"

UPD_AND_VER_URL is root url

View Source
const VERSION = "0.9.4"

VERSION is current version

View Source
const WAIT_CONFIRMED_NODES = 10

WAIT_CONFIRMED_NODES is used in confirmations

View Source
const WRITE_TIMEOUT = 20

WRITE_TIMEOUT is timeout for TCP

Variables

View Source
var ApiPath = `/api/v2/`

ApiPath is the beginning of the api url

TxTypes is the list of the embedded transactions

View Source
var UsedStopNetworkCerts = [][]byte{}

UsedStopNetworkCerts contains a list of certificates that were used to stop the network

Functions

func IsStruct

func IsStruct(tx int) bool

IsStruct is only used for FirstBlock now

func MakeStruct

func MakeStruct(name string) interface{}

MakeStruct is only used for FirstBlock now

func Sign

func Sign(v interface{}) (sign []byte)

Sign returns the signature attached to the header

Types

type BlockHeader

type BlockHeader struct {
	Type     byte
	BlockID  uint32
	Time     uint32
	WalletID int64
	StateID  byte
	Sign     []byte
}

BlockHeader is a structure of the block header

type FirstBlock

type FirstBlock struct {
	TxHeader
	PublicKey             []byte
	NodePublicKey         []byte
	StopNetworkCertBundle []byte
}

FirstBlock is the header of FirstBlock transaction

type LogEventType

type LogEventType int

LogEventType is storing numeric event type

type StopNetwork

type StopNetwork struct {
	TxHeader
	StopNetworkCert []byte
}

type TxHeader

type TxHeader struct {
	Type  byte
	Time  uint32
	KeyID int64
}

TxHeader is the old version of the transaction header

func Header(v interface{}) TxHeader

Header returns TxHeader

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL