Documentation ¶
Overview ¶
Copyright 2020 The Energi Core Authors This file is part of the Energi Core library.
The Energi Core 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 Energi Core 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 Energi Core library. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- Variables
- func CreateEnergiSimnetGenesisBlock(filepath string) error
- func GeneralProxyHashExtractor(ctx context.Context, qAddr common.Address, blockNo *uint64) *common.Hash
- func MastenodeEnode(ipv4address uint32, pubkey [2][32]byte, cfg *params.ChainConfig) *enode.Node
- func SWVersionIntToString(semver *big.Int) string
- func SWVersionToInt() *big.Int
- type CacheChain
- type CacheQuery
- type CacheStorage
- type GeneralProxyHashFunc
Constants ¶
const ( // SimnetMigrationTx defines the special simnet migration tx identified set // as the migration file name. SimnetMigrationTx = "simnet-migration" )
Variables ¶
var ErrInvalidData = errors.New("Invalid data returned by the CacheQuery func")
ErrInvalidData is returned if the CacheQuery function returns a null result
Functions ¶
func CreateEnergiSimnetGenesisBlock ¶
CreateEnergiSimnetGenesisBlock creates a simnet genesis block. It only creates the file if it doesn't exist in the provided file path.
func GeneralProxyHashExtractor ¶
func GeneralProxyHashExtractor(ctx context.Context, qAddr common.Address, blockNo *uint64) *common.Hash
GeneralProxyHashExtractor retrieves if it exists the proxy hash func passed through the context.
func MastenodeEnode ¶
func SWVersionIntToString ¶
SWVersionIntToString returns a string from the provided software version int.
func SWVersionToInt ¶
SWVersionToInt converts the current semantic software version to an integer.
Types ¶
type CacheChain ¶
CacheChain defines the method(s) needed by the cache implementation to access the chain data.
type CacheQuery ¶
CacheQuery is the function that allow a fresh data query if the previous data held is considered to have expired or the cache was empty in the first place.
type CacheStorage ¶
type CacheStorage struct {
// contains filtered or unexported fields
}
CacheStorage is a storage that is held by the client that wants to cache specific data.
func NewCacheStorage ¶
func NewCacheStorage() *CacheStorage
NewCacheStorage creates a new CacheStorage instance.
func (*CacheStorage) Get ¶
func (c *CacheStorage) Get(chain CacheChain, source CacheQuery) (interface{}, error)
Get returns the cached data The existing data is updated on private calls when the new blockhash is generated othetwise (for publicservice calls) it returns existing data and asynchronously schedules the update An error is returned if a nil cache instance is used or the cache query function returns nil data.
type GeneralProxyHashFunc ¶
GeneralProxyHashFunc provides the function that helps check for governed proxy contracts filtered logs.
func GeneralProxyHashGen ¶
func GeneralProxyHashGen(blockchain *core.BlockChain) GeneralProxyHashFunc
GeneralProxyHashGen returns a function that helps retrieve the governed proxy contract hash.