Documentation ¶
Overview ¶
Copyright 2020 The the-blockchain-bar Authors This file is part of the the-blockchain-bar library.
The the-blockchain-bar library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The the-blockchain-bar library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2020 The the-blockchain-bar Authors This file is part of the the-blockchain-bar library.
The the-blockchain-bar library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The the-blockchain-bar library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2020 The the-blockchain-bar Authors This file is part of the the-blockchain-bar library.
The the-blockchain-bar library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The the-blockchain-bar library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2020 The the-blockchain-bar Authors This file is part of the the-blockchain-bar library.
The the-blockchain-bar library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The the-blockchain-bar library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2020 The the-blockchain-bar Authors This file is part of the the-blockchain-bar library.
The the-blockchain-bar library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The the-blockchain-bar library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2020 The the-blockchain-bar Authors This file is part of the the-blockchain-bar library.
The the-blockchain-bar library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The the-blockchain-bar library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- func ApplyTx(tx SignedTx, s *State) error
- func InitDataDirIfNotExists(dataDir string, genesis []byte) error
- func IsBlockHashValid(hash Hash, miningDifficulty uint64) bool
- func NewAccount(value string) common.Address
- func ValidateTx(tx SignedTx, s *State) error
- type Block
- type BlockFS
- type BlockHeader
- type Genesis
- type Hash
- type SignedTx
- type State
- func (s *State) AddBlock(b Block) (Hash, error)
- func (s *State) AddBlocks(blocks []Block) error
- func (c *State) ChangeMiningDifficulty(newDifficulty uint64)
- func (s *State) Close() error
- func (s *State) Copy() State
- func (s *State) GetAccountBalance(account common.Address) uint
- func (s *State) GetNextAccountNonce(account common.Address) uint
- func (s *State) LatestBlock() Block
- func (s *State) LatestBlockHash() Hash
- func (s *State) NextBlockNumber() uint64
- func (s *State) ResetChain(dataDir string) error
- type Tx
Constants ¶
const BlockReward = 100
const TxFee = uint(50)
Variables ¶
This section is empty.
Functions ¶
func InitDataDirIfNotExists ¶
func IsBlockHashValid ¶
func NewAccount ¶
func ValidateTx ¶
Types ¶
type Block ¶
type Block struct { Header BlockHeader `json:"header"` TXs []SignedTx `json:"payload"` }
type BlockFS ¶
func GetBlocksAfter ¶
type BlockHeader ¶
type State ¶
type State struct { Balances map[common.Address]uint Account2Nonce map[common.Address]uint // contains filtered or unexported fields }