Documentation
¶
Index ¶
- Constants
- Variables
- func AggregateFundsTransactions(SortedAndSelectedFundsTx []*protocol.FundsTx, block *protocol.Block, ...) error
- func CheckAndChangeParameters(parameters *Parameters, configTxSlice *[]*protocol.ConfigTx) (change bool)
- func GetLatestProofs(n int, block *protocol.Block) (prevProofs [][crypto.COMM_KEY_LENGTH]byte)
- func Init(validatorWallet, multisigWallet ed25519.PublicKey, ...)
- func InvertBlockArray(array []*protocol.Block) []*protocol.Block
- func IsInSameChain(b1, b2 *protocol.Block) bool
- func OrderedBy(less ...lessFunc) *multiSorter
- type Parameters
- type SlashingProof
Constants ¶
View Source
const ( //How many blocks can we verify dynamically (e.g. proper time check) until we are too far behind //that this dynamic check is not possible anymore?! DELAYED_BLOCKS = 10 TXFETCH_TIMEOUT = 5 //Sec BLOCKFETCH_TIMEOUT = 40 //Sec //Some prominent programming languages (e.g., Java) have not unsigned integer types //Neglecting MSB simplifies compatibility MAX_MONEY = 9223372036854775807 //(2^63)-1 //Default Block params BLOCKHASH_SIZE = 32 //Byte FEE_MINIMUM = 1 //Coins BLOCK_SIZE = 20000 //Byte DIFF_INTERVAL = 15 //Blocks BLOCK_INTERVAL = 15 //Sec BLOCK_REWARD = 0 //Coins STAKING_MINIMUM = 1000 //Coins WAITING_MINIMUM = 0 //Blocks ACCEPTED_TIME_DIFF = 60 //Sec SLASHING_WINDOW_SIZE = 100 //Blocks SLASH_REWARD = 2 //Coins NUM_INCL_PREV_PROOFS = 5 //Number of previous proofs included in the PoS condition NO_AGGREGATION_LENGTH = 3 //Number of blocks after the newest block which are not aggregated. )
Variables ¶
View Source
var ( FileConnectionsLog *os.File FileConnections *os.File )
View Source
var StartTime = time.Now()
Functions ¶
func CheckAndChangeParameters ¶
func CheckAndChangeParameters(parameters *Parameters, configTxSlice *[]*protocol.ConfigTx) (change bool)
Separate function to reuse mechanism in client implementation
func GetLatestProofs ¶
func Init ¶
func Init(validatorWallet, multisigWallet ed25519.PublicKey, rootWallet ed25519.PrivateKey, validatorCommitment, rootCommitment *rsa.PrivateKey)
Miner entry point
func IsInSameChain ¶
Check if two blocks are part of the same chain or if they appear in two competing chains
Types ¶
type Parameters ¶
type Parameters struct { BlockHash [BLOCKHASH_SIZE]byte Fee_minimum uint64 //Paid minimum fee for sending a tx. Block_size uint64 //Block size in bytes. Diff_interval uint64 Block_interval uint64 Block_reward uint64 //Reward for delivering the correct PoS. Staking_minimum uint64 //Minimum amount a validator must own for staking. Waiting_minimum uint64 //Number of blocks that must a new validator must wait before it can start validating. Accepted_time_diff uint64 //Number of seconds that a block can be received in the future. Slashing_window_size uint64 //Number of blocks that a validator cannot vote on two competing chains. Slash_reward uint64 //Reward for providing the correct slashing proof. // contains filtered or unexported fields }
An instance of this datastructure is created whenever system parameters change. The blockhash is additionally recorded to know which blocks the parameter change belongs to. This is necessary, because the system records ALL config txs (even those who have no corresponding code to execute [e.g., when they're running an older version of the code]).
func NewDefaultParameters ¶
func NewDefaultParameters() Parameters
func (Parameters) String ¶
func (param Parameters) String() string
Click to show internal directories.
Click to hide internal directories.