Documentation ¶
Index ¶
Constants ¶
const ( TxTypeFirstBlock = 1 TxTypeStopNetwork = 2 TxTypeParserFirstBlock = "FirstBlock" TxTypeParserStopNetwork = "StopNetwork" )
const ( // DefaultConfigFile name of config file (toml format) DefaultConfigFile = "config.toml" // DefaultWorkdirName name of working directory DefaultWorkdirName = "apla-data" // DefaultPidFilename is default filename of pid file DefaultPidFilename = "go-apla.pid" // DefaultLockFilename is default filename of lock file DefaultLockFilename = "go-apla.lock" // FirstBlockFilename name of first block binary file FirstBlockFilename = "1block" // PrivateKeyFilename name of wallet private key file PrivateKeyFilename = "PrivateKey" // PublicKeyFilename name of wallet public key file PublicKeyFilename = "PublicKey" // NodePrivateKeyFilename name of node private key file NodePrivateKeyFilename = "NodePrivateKey" // NodePublicKeyFilename name of node public key file NodePublicKeyFilename = "NodePublicKey" // KeyIDFilename generated KeyID KeyIDFilename = "KeyID" // RollbackResultFilename rollback result file RollbackResultFilename = "rollback_result" // FromToPerDayLimit day limit token transfer between accounts FromToPerDayLimit = 10000 // TokenMovementQtyPerBlockLimit block limit token transfer TokenMovementQtyPerBlockLimit = 100 // TCPConnTimeout timeout of tcp connection TCPConnTimeout = 5 * time.Second // TxRequestExpire is expiration time for request of transaction TxRequestExpire = 1 * time.Minute // DefaultTempDirName is default name of temporary directory DefaultTempDirName = "apla-temp" // DefaultOBS allways is 1 DefaultOBS = 1 // MoneyLength is the maximum number of digits in money value MoneyLength = 30 TokenEcosystem = 1 HTTPServerMaxBodySize = 1 << 20 // ShiftContractID is the offset of tx identifiers ShiftContractID = 5000 // ContractList is the number of contracts per page on loading ContractList = 200 // Guest key GuestPublic = "" /* 128-byte string literal not displayed */ GuestKey = "4544233900443112470" GuestAddress = "0454-4233-9004-4311-2470" // StatusMainPage is a status for Main Page StatusMainPage = `2` NoneVDE = "none" DBFindLimit = 10000 )
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" OBSManagerError = "OBSManagerError" TCPClientError = "TCPClientError" BadTxError = "BadTxError" TimeCalcError = "BlockTimeCounterError" )
Types of log errors
const AddressLength = 20
AddressLength is length of address
const AvailableBCGap = 4
const BLOCK_VERSION = BV_INCLUDE_ROLLBACK_HASH
BLOCK_VERSION is block version
const BV_INCLUDE_ROLLBACK_HASH = 3
const BV_ROLLBACK_HASH = 2
const BlockSize = 16
BlockSize is size of block
const DATA_TYPE_BLOCK_BODY = 7
DATA_TYPE_BLOCK_BODY is body block datatype
const DATA_TYPE_MAX_BLOCK_ID = 10
DATA_TYPE_MAX_BLOCK_ID is block id max datatype
const DEFAULT_TCP_PORT = 7078
DEFAULT_TCP_PORT used when port number missed in host addr
const DOWNLOAD_CHAIN_TRY_COUNT = 10
DOWNLOAD_CHAIN_TRY_COUNT is number of attempt
const DefaultNodesConnectDelay = 6
const ERROR_TIME = 1
ERROR_TIME is error time
const FounderAmount = 100000000
FounderAmount is the starting amount of founder
const HashSize = 32
HashSize is size of hash
const MAX_TX_BACK = 86400
MAX_TX_BACK transaction may wander in the net for a day and then get into a block
const MAX_TX_FORW = 600
MAX_TX_FORW How fast could the time of transaction pass
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()
const MaxTXAttempt = 10
const MoneyDigits = 18
MoneyDigits is numbers of digits for tokens 1000000000000000000
const PrivkeyLength = 32
PrivkeyLength is privkey length
const PubkeySizeLength = 64
PubkeySizeLength is pubkey length
const READ_TIMEOUT = 20
READ_TIMEOUT is timeout for TCP
const ROUND_FIX = 0.00000000001
ROUND_FIX is rounding constant
const UPD_AND_VER_URL = "http://apla.io"
UPD_AND_VER_URL is root url
const VERSION = "3.0.0"
VERSION is current version
const WAIT_CONFIRMED_NODES = 10
WAIT_CONFIRMED_NODES is used in confirmations
const WRITE_TIMEOUT = 20
WRITE_TIMEOUT is timeout for TCP
Variables ¶
var ApiPath = `/api/v2/`
ApiPath is the beginning of the api url
var BuildInfo string
BuildInfo should be defined through -ldflags
var TxTypes = map[int64]string{ TxTypeFirstBlock: TxTypeParserFirstBlock, TxTypeStopNetwork: TxTypeParserStopNetwork, }
TxTypes is the list of the embedded transactions
var UsedStopNetworkCerts = [][]byte{}
UsedStopNetworkCerts contains a list of certificates that were used to stop the network
Functions ¶
func MakeStruct ¶
func MakeStruct(name string) interface{}
MakeStruct is only used for FirstBlock now
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 Test int64 PrivateBlockchain uint64 }
FirstBlock is the header of FirstBlock transaction