{"modulePath":"github.com/MatrixAINetwork/MATRIX-TESTNET","version":"v1.1.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package man\n\nPackage man implements the Matrix protocol.\n\n## Constants\n\n```go\nconst (\n\t// Protocol messages belonging to man/62\n\tStatusMsg          = 0x00\n\tNewBlockHashesMsg  = 0x01\n\tTxMsg              = 0x02\n\tGetBlockHeadersMsg = 0x03\n\tBlockHeadersMsg    = 0x04\n\tGetBlockBodiesMsg  = 0x05\n\tBlockBodiesMsg     = 0x06\n\tNewBlockMsg        = 0x07\n\n\t// Protocol messages belonging to man/63\n\tGetNodeDataMsg = 0x0d\n\tNodeDataMsg    = 0x0e\n\tGetReceiptsMsg = 0x0f\n\tReceiptsMsg    = 0x10\n)\n```\nman protocol message codes\n\n```go\nconst (\n\tErrMsgTooLarge = iota\n\tErrDecode\n\tErrInvalidMsgCode\n\tErrProtocolVersionMismatch\n\tErrNetworkIdMismatch\n\tErrGenesisBlockMismatch\n\tErrNoStatusMsg\n\tErrExtraStatusMsg\n\tErrSuspendedPeer\n)\n```\n\n```go\nconst ProtocolMaxMsgSize = 20 * 1024 * 1024 // Maximum cap on the size of a protocol message\n\n```\n\n## Variables\n\n```go\nvar (\n\tSnapshootNumber   uint64\n\tSnapshootHash     string\n\tSaveSnapStart     uint64\n\tSaveSnapPeriod    uint64 = 300\n\tSnaploadFromLocal int    = 0\n)\n```\n\n```go\nvar DefaultConfig = Config{\n\tSyncMode: downloader.FullSync,\n\tManash: manash.Config{\n\t\tCacheDir:       \"manash\",\n\t\tCachesInMem:    2,\n\t\tCachesOnDisk:   3,\n\t\tDatasetsInMem:  1,\n\t\tDatasetsOnDisk: 2,\n\t},\n\tNetworkId:         1,\n\tLightPeers:        100,\n\tDatabaseCache:     768,\n\tDatabaseTableSize: 2,\n\tTrieCache:         256,\n\tTrieTimeout:       5 * time.Minute,\n\tGasPrice:          big.NewInt(18 * params.Shannon),\n\n\tTxPool: core.DefaultTxPoolConfig,\n\tGPO: gasprice.Config{\n\t\tBlocks:     20,\n\t\tPercentile: 60,\n\t},\n}\n```\nDefaultConfig contains default settings for use on the Matrix main net.\n\n```go\nvar MsgCenter *mc.Center\n```\n\n```go\nvar ProtocolLengths = []uint64{21, 8}\n```\nProtocolLengths are the number of implemented message corresponding to different protocol versions.\n\n```go\nvar ProtocolName = \"man\"\n```\nProtocolName is the official short name of the protocol used during capability negotiation.\n\n```go\nvar ProtocolVersions = []uint{man63, man62}\n```\nProtocolVersions are the upported versions of the man protocol (first is primary).\n\n## Functions\n\n```go\nfunc CreateConsensusEngine(ctx *pod.ServiceContext, config *manash.Config, chainConfig *params.ChainConfig, db mandb.Database) consensus.Engine\n```\nCreateConsensusEngine creates the required type of consensus engine instance for an Matrix service\n\n```go\nfunc CreateDB(ctx *pod.ServiceContext, config *Config, name string) (mandb.Database, error)\n```\nCreateDB creates the chain database.\n\n```go\nfunc NewBloomIndexer(db mandb.Database, size uint64) *core.ChainIndexer\n```\nNewBloomIndexer returns a chain indexer that generates bloom bits data for the canonical chain for fast logs filtering.\n\n```go\nfunc SendUdpTransactions(txser []types.SelfTransaction) error\n```\nSendUdpTransactions\n\n## Types\n\n```go\ntype AllReward struct {\n\tTime      TimeZone\n\tMiner     []RewardMount\n\tValidator []RewardMount\n\tInterest  []InterestReward\n}\n```\n\n```go\ntype BloomIndexer struct {\n\t// contains filtered or unexported fields\n}\n```\nBloomIndexer implements a core.ChainIndexer, building up a rotated bloom bits index for the Matrix header bloom filters, permitting blazing fast filtering.\n\n```go\nfunc (b *BloomIndexer) Commit() error\n```\nCommit implements core.ChainIndexerBackend, finalizing the bloom section and writing it out into the database.\n\n```go\nfunc (b *BloomIndexer) Process(header *types.Header)\n```\nProcess implements core.ChainIndexerBackend, adding a new header's bloom into the index.\n\n```go\nfunc (b *BloomIndexer) Reset(section uint64, lastSectionHead common.Hash) error\n```\nReset implements core.ChainIndexerBackend, starting a new bloombits index section.\n\n```go\ntype Config struct {\n\t// The genesis block, which is inserted if the database is empty.\n\t// If nil, the Matrix main net block is used.\n\tGenesis *core.Genesis `toml:\",omitempty\"`\n\n\t// Protocol options\n\tNetworkId uint64 // Network ID to use for selecting peers to connect to\n\tSyncMode  downloader.SyncMode\n\tNoPruning bool\n\n\t// Light client options\n\tLightServ  int `toml:\",omitempty\"` // Maximum percentage of time allowed for serving LES requests\n\tLightPeers int `toml:\",omitempty\"` // Maximum number of LES client peers\n\n\t// Database options\n\tSkipBcVersionCheck bool `toml:\"-\"`\n\tDatabaseHandles    int  `toml:\"-\"`\n\tDatabaseCache      int\n\tTrieCache          int\n\tDatabaseTableSize  int\n\tTrieTimeout        time.Duration\n\n\t// Mining-related options\n\tManerbase    common.Address `toml:\",omitempty\"`\n\tMinerThreads int            `toml:\",omitempty\"`\n\tExtraData    []byte         `toml:\",omitempty\"`\n\tGasPrice     *big.Int\n\n\t// Manash options\n\tManash manash.Config\n\n\t// Transaction pool options\n\tTxPool core.TxPoolConfig\n\n\t// Gas Price Oracle options\n\tGPO gasprice.Config\n\n\t// Enables tracking of SHA3 preimages in the VM\n\tEnablePreimageRecording bool\n\n\t// Miscellaneous options\n\tDocRoot string `toml:\"-\"`\n}\n```\n\n```go\nfunc (c Config) MarshalTOML() (interface{}, error)\n```\n\n```go\nfunc (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error\n```\n\n```go\ntype InterestReward struct {\n\tAccount  string\n\tReward   *big.Int\n\tVipLevel common.VIPRoleType\n\tStock    uint16\n\tDeposit  *big.Int\n}\n```\n\n```go\ntype LesServer interface {\n\tStart(srvr *p2p.Server)\n\tStop()\n\tProtocols() []p2p.Protocol\n\tSetBloomBitsIndexer(bbIndexer *core.ChainIndexer)\n}\n```\n\n```go\ntype ManAPIBackend struct {\n\t// contains filtered or unexported fields\n}\n```\nManAPIBackend implements manapi.Backend for full nodes\n\n```go\nfunc (b *ManAPIBackend) AccountManager() *accounts.Manager\n```\n\n```go\nfunc (b *ManAPIBackend) BlockByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Block, error)\n```\n\n```go\nfunc (b *ManAPIBackend) BloomStatus() (uint64, uint64)\n```\n\n```go\nfunc (b *ManAPIBackend) ChainConfig() *params.ChainConfig\n```\n\n```go\nfunc (b *ManAPIBackend) ChainDb() mandb.Database\n```\n\n```go\nfunc (b *ManAPIBackend) Config() *Config\n```\n\n```go\nfunc (b *ManAPIBackend) CurrentBlock() *types.Block\n```\n\n```go\nfunc (b *ManAPIBackend) Downloader() *downloader.Downloader\n```\n\n```go\nfunc (b *ManAPIBackend) EventMux() *event.TypeMux\n```\n\n```go\nfunc (b *ManAPIBackend) FetcherNotify(hash common.Hash, number uint64)\n```\n\n```go\nfunc (b *ManAPIBackend) Genesis() *types.Block\n```\n\n```go\nfunc (b *ManAPIBackend) GetBlock(ctx context.Context, hash common.Hash) (*types.Block, error)\n```\n\n```go\nfunc (b *ManAPIBackend) GetDepositAccount(signAccount common.Address, blockHash common.Hash) (common.Address, error)\n```\n\n```go\nfunc (b *ManAPIBackend) GetEVM(ctx context.Context, msg txinterface.Message, state *state.StateDBManage, header *types.Header, vmCfg vm.Config) (*vm.EVM, func() error, error)\n```\n\n```go\nfunc (b *ManAPIBackend) GetFutureRewards(state *state.StateDBManage, number rpc.BlockNumber) (interface{}, error)\n```\n\n```go\nfunc (b *ManAPIBackend) GetLogs(ctx context.Context, hash common.Hash) ([]types.CoinLogs, error)\n```\n\n```go\nfunc (b *ManAPIBackend) GetPoolNonce(cointyp string, ctx context.Context, addr common.Address) (uint64, error)\n```\n\n```go\nfunc (b *ManAPIBackend) GetPoolTransaction(hash common.Hash) types.SelfTransaction\n```\n\n```go\nfunc (b *ManAPIBackend) GetPoolTransactions() (types.SelfTransactions, error)\n```\n\n```go\nfunc (b *ManAPIBackend) GetReceipts(ctx context.Context, hash common.Hash) ([]types.CoinReceipts, error)\n```\n\n```go\nfunc (b *ManAPIBackend) GetState() (*state.StateDBManage, error)\n```\n\n```go\nfunc (b *ManAPIBackend) GetTd(blockHash common.Hash) *big.Int\n```\n\n```go\nfunc (b *ManAPIBackend) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)\n```\n\n```go\nfunc (b *ManAPIBackend) HeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Header, error)\n```\n\n```go\nfunc (b *ManAPIBackend) ImportSuperBlock(ctx context.Context, filePath string) (common.Hash, error)\n```\n\n```go\nfunc (b *ManAPIBackend) NetRPCService() *manapi.PublicNetAPI\n```\n\n```go\nfunc (b *ManAPIBackend) NetWorkID() uint64\n```\n\n```go\nfunc (b *ManAPIBackend) ProtocolVersion() int\n```\n\n```go\nfunc (b *ManAPIBackend) SendBroadTx(ctx context.Context, signedTx types.SelfTransaction, bType bool) error\n```\n\n```go\nfunc (b *ManAPIBackend) SendTx(ctx context.Context, signedTx types.SelfTransaction) error\n```\nTODO 调用该方法的时候应该返回错误的切片\n\n```go\nfunc (b *ManAPIBackend) ServiceFilter(ctx context.Context, session *bloombits.MatcherSession)\n```\n\n```go\nfunc (b *ManAPIBackend) SetHead(number uint64)\n```\n\n```go\nfunc (b *ManAPIBackend) SignTx(signedTx types.SelfTransaction, chainID *big.Int, blkHash common.Hash, signHeight uint64, usingEntrust bool) (types.SelfTransaction, error)\n```\n\n```go\nfunc (b *ManAPIBackend) StateAndHeaderByHash(ctx context.Context, hash common.Hash) (*state.StateDBManage, *types.Header, error)\n```\n\n```go\nfunc (b *ManAPIBackend) StateAndHeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*state.StateDBManage, *types.Header, error)\n```\n\n```go\nfunc (b *ManAPIBackend) Stats() (pending int, queued int)\n```\n\n```go\nfunc (b *ManAPIBackend) SubscribeChainEvent(ch chan\u003c- core.ChainEvent) event.Subscription\n```\n\n```go\nfunc (b *ManAPIBackend) SubscribeChainHeadEvent(ch chan\u003c- core.ChainHeadEvent) event.Subscription\n```\n\n```go\nfunc (b *ManAPIBackend) SubscribeChainSideEvent(ch chan\u003c- core.ChainSideEvent) event.Subscription\n```\n\n```go\nfunc (b *ManAPIBackend) SubscribeLogsEvent(ch chan\u003c- []types.CoinLogs) event.Subscription\n```\n\n```go\nfunc (b *ManAPIBackend) SubscribeNewTxsEvent(ch chan core.NewTxsEvent) event.Subscription\n```\n\n```go\nfunc (b *ManAPIBackend) SubscribeRemovedLogsEvent(ch chan\u003c- core.RemovedLogsEvent) event.Subscription\n```\n\n```go\nfunc (b *ManAPIBackend) SuggestPrice(ctx context.Context) (*big.Int, error)\n```\n\n```go\nfunc (b *ManAPIBackend) SyncMode() downloader.SyncMode\n```\n\n```go\nfunc (b *ManAPIBackend) TxPoolContent() (ntxs map[common.Address]types.SelfTransactions, btxs map[common.Address]types.SelfTransactions)\n```\nTODO 应该将返回值加入切片中否则以后多一种交易就要添加一个返回值\n\n```go\ntype Matrix struct {\n\tAPIBackend *ManAPIBackend\n\t// contains filtered or unexported fields\n}\n```\nMatrix implements the Matrix full node service.\n\n```go\nfunc New(ctx *pod.ServiceContext, config *Config) (*Matrix, error)\n```\nNew creates a new Matrix object (including the initialisation of the common Matrix object)\n\n```go\nfunc (s *Matrix) APIs() []rpc.API\n```\nAPIs return the collection of RPC services the matrix package offers. NOTE, some of these services probably need to be moved to somewhere else.\n\n```go\nfunc (s *Matrix) AccountManager() *accounts.Manager\n```\n\n```go\nfunc (s *Matrix) AddLesServer(ls LesServer)\n```\n\n```go\nfunc (s *Matrix) BlockChain() *core.BlockChain\n```\n\n```go\nfunc (s *Matrix) CA() *ca.Identity\n```\n\n```go\nfunc (s *Matrix) ChainDb() mandb.Database\n```\n\n```go\nfunc (s *Matrix) DPOSEngine() consensus.DPOSEngine\n```\n\n```go\nfunc (s *Matrix) Downloader() *downloader.Downloader\n```\n\n```go\nfunc (s *Matrix) Engine() consensus.Engine\n```\n\n```go\nfunc (s *Matrix) EventMux() *event.TypeMux\n```\n\n```go\nfunc (s *Matrix) FetcherNotify(hash common.Hash, number uint64, addr common.Address)\n```\n\tfunc (s *Matrix) FetcherNotify(hash common.Hash, number uint64) {\n\t\tids := ca.GetRolesByGroup(common.RoleValidator | common.RoleBroadcast)\n\t\tselfId := p2p.ServerP2p.Self().ID.String()\n\t\tfor _, id := range ids {\n\t\t\tif id.String() == selfId {\n\t\t\t\tlog.Info(\"func FetcherNotify  NodeID is same \", \"selfID\", selfId, \"ca`s nodeID\", id.String())\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tpeer := s.protocolManager.Peers.Peer(id.String()[:16])\n\t\t\tif peer == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\ts.protocolManager.fetcher.Notify(id.String()[:16], hash, number, time.Now(), peer.RequestOneHeader, peer.RequestBodies)\n\t\t}\n\t}\n\n```go\nfunc (s *Matrix) HD() *msgsend.HD\n```\n\n```go\nfunc (s *Matrix) IsListening() bool\n```\n\n```go\nfunc (s *Matrix) IsMining() bool\n```\n\n```go\nfunc (s *Matrix) ManBlkDeal() *blkmanage.ManBlkManage\n```\n\n```go\nfunc (s *Matrix) ManVersion() int\n```\n\n```go\nfunc (s *Matrix) Manerbase() (eb common.Address, err error)\n```\n\n```go\nfunc (s *Matrix) Miner() *miner.Miner\n```\n\n```go\nfunc (s *Matrix) MsgCenter() *mc.Center\n```\n\n```go\nfunc (s *Matrix) NetVersion() uint64\n```\n\n```go\nfunc (s *Matrix) OLConsensus() *olconsensus.TopNodeService\n```\n\n```go\nfunc (s *Matrix) Protocols() []p2p.Protocol\n```\nProtocols implements node.Service, returning all the currently configured network protocols to start.\n\n```go\nfunc (s *Matrix) Random() *baseinterface.Random\n```\n\n```go\nfunc (s *Matrix) ReElection() *reelection.ReElection\n```\n\n```go\nfunc (s *Matrix) ResetWithGenesisBlock(gb *types.Block)\n```\n\n```go\nfunc (s *Matrix) SignHelper() *signhelper.SignHelper\n```\n\n```go\nfunc (s *Matrix) Start(srvr *p2p.Server) error\n```\nStart implements node.Service, starting all internal goroutines needed by the Matrix protocol implementation.\n\n```go\nfunc (s *Matrix) StartMining(local bool) error\n```\n\n```go\nfunc (s *Matrix) Stop() error\n```\nStop implements node.Service, terminating all internal goroutines used by the Matrix protocol.\n\n```go\nfunc (s *Matrix) StopMining()\n```\n\n```go\nfunc (s *Matrix) TxPool() *core.TxPoolManager\n```\n\n```go\ntype NodeInfo struct {\n\tNetwork    uint64              `json:\"network\"`    // Matrix network ID (1=Frontier, 2=Morden, Ropsten=3, Rinkeby=4)\n\tDifficulty *big.Int            `json:\"difficulty\"` // Total difficulty of the host's blockchain\n\tGenesis    common.Hash         `json:\"genesis\"`    // SHA3 hash of the host's genesis block\n\tConfig     *params.ChainConfig `json:\"config\"`     // Chain configuration for the fork rules\n\tHead       common.Hash         `json:\"head\"`       // SHA3 hash of the host's best owned block\n}\n```\nNodeInfo represents a short summary of the Matrix sub-protocol metadata known about the host peer.\n\n```go\ntype PeerInfo struct {\n\tVersion       int      `json:\"version\"`       // Matrix protocol version negotiated\n\tDifficulty    *big.Int `json:\"difficulty\"`    // Total difficulty of the peer's blockchain\n\tHead          string   `json:\"head\"`          // SHA3 hash of the peer's best owned block\n\tSuperBlockNum uint64   `json:\"superBlockNum\"` // SuperBlockHash\n\tSuperBlockSeq uint64   `json:\"superBlockSeq\"` // SuperBlockHash\n\tBlockTime     uint64   `json:\"blockTime\"`     // blockTime\n\tBlockHeight   uint64   `json:\"blockHeight\"`   // blockHeight\n}\n```\nPeerInfo represents a short summary of the Matrix sub-protocol metadata known about a connected peer.\n\n```go\ntype PrivateAdminAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPrivateAdminAPI is the collection of Matrix full node-related APIs exposed over the private admin endpoint.\n\n```go\nfunc NewPrivateAdminAPI(man *Matrix) *PrivateAdminAPI\n```\nNewPrivateAdminAPI creates a new API definition for the full node private admin methods of the Matrix service.\n\n```go\nfunc (api *PrivateAdminAPI) ExportChain(file string) (bool, error)\n```\nExportChain exports the current blockchain into a local file.\n\n```go\nfunc (api *PrivateAdminAPI) ImportChain(file string) (bool, error)\n```\nImportChain imports a blockchain from a local file.\n\n```go\ntype PrivateDebugAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPrivateDebugAPI is the collection of Matrix full node APIs exposed over the private debugging endpoint.\n\n```go\nfunc NewPrivateDebugAPI(config *params.ChainConfig, man *Matrix) *PrivateDebugAPI\n```\nNewPrivateDebugAPI creates a new API definition for the full node-related private debug methods of the Matrix service.\n\n```go\nfunc (api *PrivateDebugAPI) GetBadBlocks(ctx context.Context) ([]core.BadBlockArgs, error)\n```\nGetBadBLocks returns a list of the last 'bad blocks' that the client has seen on the network and returns them as a JSON list of block-hashes\n\n```go\nfunc (api *PrivateDebugAPI) GetCommit(ctx context.Context) ([]common.CommitContext, error)\n```\n\n```go\nfunc (api *PrivateDebugAPI) GetModifiedAccountsByHash(startHash common.Hash, endHash *common.Hash) ([]common.Address, error)\n```\nGetModifiedAccountsByHash returns all accounts that have changed between the two blocks specified. A change is defined as a difference in nonce, balance, code hash, or storage hash.\n\nWith one parameter, returns the list of accounts modified in the specified block.\n\n```go\nfunc (api *PrivateDebugAPI) GetModifiedAccountsByNumber(startNum uint64, endNum *uint64) ([]common.Address, error)\n```\nGetModifiedAccountsByumber returns all accounts that have changed between the two blocks specified. A change is defined as a difference in nonce, balance, code hash, or storage hash.\n\nWith one parameter, returns the list of accounts modified in the specified block.\n\n```go\nfunc (api *PrivateDebugAPI) Preimage(ctx context.Context, hash common.Hash) (hexutil.Bytes, error)\n```\nPreimage is a debug API function that returns the preimage for a sha3 hash, if known.\n\n```go\nfunc (api *PrivateDebugAPI) StorageRangeAt(ctx context.Context, blockHash common.Hash, txIndex int, contractAddress common.Address, keyStart hexutil.Bytes, maxResult int) (StorageRangeResult, error)\n```\nStorageRangeAt returns the storage at the given block height and transaction index.\n\n```go\nfunc (api *PrivateDebugAPI) TraceBlock(ctx context.Context, blob []byte, config *TraceConfig) ([]*txTraceResult, error)\n```\nTraceBlock returns the structured logs created during the execution of EVM and returns them as a JSON object.\n\n```go\nfunc (api *PrivateDebugAPI) TraceBlockByHash(ctx context.Context, hash common.Hash, config *TraceConfig) ([]*txTraceResult, error)\n```\nTraceBlockByHash returns the structured logs created during the execution of EVM and returns them as a JSON object.\n\n```go\nfunc (api *PrivateDebugAPI) TraceBlockByNumber(ctx context.Context, number rpc.BlockNumber, config *TraceConfig) ([]*txTraceResult, error)\n```\nTraceBlockByNumber returns the structured logs created during the execution of EVM and returns them as a JSON object.\n\n```go\nfunc (api *PrivateDebugAPI) TraceBlockFromFile(ctx context.Context, file string, config *TraceConfig) ([]*txTraceResult, error)\n```\nTraceBlockFromFile returns the structured logs created during the execution of EVM and returns them as a JSON object.\n\n```go\nfunc (api *PrivateDebugAPI) TraceChain(ctx context.Context, start, end rpc.BlockNumber, config *TraceConfig) (*rpc.Subscription, error)\n```\nTraceChain returns the structured logs created during the execution of EVM between two blocks (excluding start) and returns them as a JSON object.\n\n```go\nfunc (api *PrivateDebugAPI) TraceTransaction(ctx context.Context, hash common.Hash, config *TraceConfig) (interface{}, error)\n```\nTraceTransaction returns the structured logs created during the execution of EVM and returns them as a JSON object.\n\n```go\ntype PrivateMinerAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPrivateMinerAPI provides private RPC methods to control the miner. These methods can be abused by external users and must be considered insecure for use by untrusted users.\n\n```go\nfunc NewPrivateMinerAPI(e *Matrix) *PrivateMinerAPI\n```\nNewPrivateMinerAPI create a new RPC service which controls the miner of this node.\n\n```go\nfunc (api *PrivateMinerAPI) GetHashrate() uint64\n```\nGetHashrate returns the current hashrate of the miner.\n\n```go\nfunc (api *PrivateMinerAPI) SetExtra(extra string) (bool, error)\n```\nSetExtra sets the extra data string that is included when this miner mines a block.\n\n```go\nfunc (api *PrivateMinerAPI) SetGasPrice(gasPrice hexutil.Big) bool\n```\nSetGasPrice sets the minimum accepted gas price for the miner.\n\n```go\nfunc (api *PrivateMinerAPI) TestChangeRole(kind string, blocknum string, leader string)\n```\n\n```go\nfunc (api *PrivateMinerAPI) TestHeaderGen(kind string, s string)\n```\n\n```go\nfunc (api *PrivateMinerAPI) TestLocalMining(kind string, s string)\n```\n\n```go\ntype ProtocolManager struct {\n\n\t//\tpeers      *peerSet\n\tPeers        *peerSet\n\tSubProtocols []p2p.Protocol\n\n\tMsgcenter *mc.Center\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewProtocolManager(config *params.ChainConfig, mode downloader.SyncMode, networkId uint64, mux *event.TypeMux, txpool txPool, engine consensus.Engine, blockchain *core.BlockChain, chaindb mandb.Database, MsgCenter *mc.Center) (*ProtocolManager, error)\n```\nNewProtocolManager returns a new Matrix sub protocol manager. The Matrix sub protocol manages peers capable with the Matrix network.\n\n```go\nfunc (pm *ProtocolManager) AllBroadcastBlock(block *types.Block, propagate bool)\n```\n\n```go\nfunc (pm *ProtocolManager) BroadcastBlock(block *types.Block, propagate bool)\n```\nBroadcastBlock will either propagate a block to a subset of it's peers, or will only announce it's availability (depending what's requested).\n\n```go\nfunc (pm *ProtocolManager) BroadcastBlockHeader(block *types.Block, propagate bool)\n```\nBroadcastBlock will either propagate a block to a subset of it's peers, or will only announce it's availability (depending what's requested). todo: debug\n\n```go\nfunc (pm *ProtocolManager) BroadcastTxs(txs types.SelfTransactions)\n```\nBroadcastTxs will propagate a batch of transactions to all peers which are not known to already have the given transaction.\n\n```go\nfunc (pm *ProtocolManager) NodeInfo() *NodeInfo\n```\nNodeInfo retrieves some protocol metadata about the running host node.\n\n```go\nfunc (pm *ProtocolManager) Start(maxPeers int)\n```\n\n```go\nfunc (pm *ProtocolManager) Stop()\n```\n\n```go\nfunc (pm *ProtocolManager) WaitForDownLoadMode()\n```\nlb WaitForDownLoadMode ...\n\n```go\ntype PublicDebugAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPublicDebugAPI is the collection of Matrix full node APIs exposed over the public debugging endpoint.\n\n```go\nfunc NewPublicDebugAPI(man *Matrix) *PublicDebugAPI\n```\nNewPublicDebugAPI creates a new API definition for the full node- related public debug methods of the Matrix service.\n\n```go\nfunc (api *PublicDebugAPI) DumpBlock(blockNr rpc.BlockNumber, cointyp string, addr string) ([]state.CoinDump, error)\n```\nDumpBlock retrieves the entire state of the database at a given block.\n\n```go\nfunc (api *PublicDebugAPI) DumpBlockAccount(blockNr rpc.BlockNumber, address common.Address) (state.Dump, error)\n```\nDumpBlock retrieves the entire state of the database at a given block.\n\n```go\ntype PublicMatrixAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPublicMatrixAPI provides an API to access Matrix full node-related information.\n\n```go\nfunc NewPublicMatrixAPI(e *Matrix) *PublicMatrixAPI\n```\nNewPublicMatrixAPI creates a new Matrix protocol API for full nodes.\n\n```go\nfunc (api *PublicMatrixAPI) Coinbase() (common.Address, error)\n```\nCoinbase is the address that mining rewards will be send to (alias for Manerbase)\n\n```go\nfunc (api *PublicMatrixAPI) Hashrate() hexutil.Uint64\n```\nHashrate returns the POW hashrate\n\n```go\nfunc (api *PublicMatrixAPI) Manerbase() (common.Address, error)\n```\nManerbase is the address that mining rewards will be send to\n\n```go\ntype PublicMinerAPI struct {\n\t// contains filtered or unexported fields\n}\n```\nPublicMinerAPI provides an API to control the miner. It offers only methods that operate on data that pose no security risk when it is publicly accessible.\n\n```go\nfunc NewPublicMinerAPI(e *Matrix) *PublicMinerAPI\n```\nNewPublicMinerAPI create a new PublicMinerAPI instance.\n\n```go\nfunc (api *PublicMinerAPI) GetWork() ([3]string, error)\n```\nGetWork returns a work package for external miner. The work package consists of 3 strings result\\[0], 32 bytes hex encoded current block header pow-hash result\\[1], 32 bytes hex encoded seed hash used for DAG result\\[2], 32 bytes hex encoded boundary condition (\"target\"), 2^256/difficulty\n\n```go\nfunc (api *PublicMinerAPI) Mining() bool\n```\nMining returns an indication if this node is currently mining.\n\n```go\nfunc (api *PublicMinerAPI) SubmitHashrate(hashrate hexutil.Uint64, id common.Hash) bool\n```\nSubmitHashrate can be used for remote miners to submit their hash rate. This enables the node to report the combined hash rate of all miners which submit work through this node. It accepts the miner hash rate and an identifier which must be unique between nodes.\n\n```go\nfunc (api *PublicMinerAPI) SubmitWork(nonce types.BlockNonce, solution, digest common.Hash) bool\n```\nSubmitWork can be used by external miner to submit their POW solution. It returns an indication if the work was accepted. Note, this is not an indication if the provided work was valid!\n\n```go\ntype RewardMount struct {\n\tAccount  string\n\tReward   *big.Int\n\tVipLevel common.VIPRoleType\n\tStock    uint16\n}\n```\n\n```go\ntype StorageRangeResult struct {\n\tStorage storageMap   `json:\"storage\"`\n\tNextKey *common.Hash `json:\"nextKey\"` // nil if Storage includes the last key in the trie.\n}\n```\nStorageRangeResult is the result of a debug\\_storageRangeAt API call.\n\n```go\ntype TimeZone struct {\n\tStart uint64\n\tStop  uint64\n}\n```\n\n```go\ntype TraceConfig struct {\n\t*vm.LogConfig\n\tTracer  *string\n\tTimeout *string\n\tReexec  *uint64\n}\n```\nTraceConfig holds extra parameters to trace functions.\n\n","path":"github.com/MatrixAINetwork/MATRIX-TESTNET/man","name":"man","synopsis":"Package man implements the Matrix protocol.","isRedistributable":true}
