Versions in this module Expand all Collapse all v1 v1.0.3 Dec 21, 2023 v1.0.1 Dec 21, 2023 v1.0.0 Dec 21, 2023 Changes in this version + const BLOCKCHAIN_NEIGHBOR_SYNC_TIME_SEC + const BLOCKCHAIN_PORT_RANGE_END + const BLOCKCHAIN_PORT_RANGE_START + const MINING_DIFFICULTY + const MINING_REWARD + const MINING_REWARD_MEGA + const MINING_REWARD_MET + const MINING_SENDER + const MINING_TIMER_SEC + const NEIGHBOR_IP_RANGE_END + const NEIGHBOR_IP_RANGE_START + const STAKING_SENDER + var MBlockkey = database.MakeBucket([]byte("block")) + var Utxokey = database.MakeBucket([]byte("utxo_tx")) + func AddBig(x float32, y float64) *big.Float + func CheckNFT(nv []int, nft string) bool + func CreateMiniBlock(b *pb.RpcBlock, db database.Database, bc *Blockchain) ([32]byte, error, float64) + func GetBlockDB(height int) ([]byte, []byte) + func Hash(previousHash []byte, timestamp int64, nonce uint64) [32]byte + func LastWallet(db database.Database) ([]byte, []byte) + func MatchBlockHeight(i uint64, j uint64) error + func MatchDomainToP2PBytes(ov []byte, nv []byte) error + func StakedInfo(txhash [32]byte, b *MiniBlock, z *NFTStaking) *pb.StakeNFT + func StringTo32Byte(e string) [32]byte + func SubBig(x float32, y float64) *big.Float + func UpdateWalletList(b *MiniBlock, db database.Database, ...) map[string]*pb.UTXOWalletBalanceRespose + func VerifyAddressPrefix(str string) string + type AmountRespose struct + Amount float32 + func (ar *AmountRespose) MarshalJSON() ([]byte, error) + type Blockchain struct + LastRPCBlock *LastRPCBlock + MegaBlock []string + MegaBlockCount int + MetBlock []string + MetBlockCount int + MiniBlock []string + MiniBlockCount int + Mux sync.Mutex + MuxNeighbors sync.Mutex + NFTPool []*NFTStaking + NFTStake []*pb.StakeNFT + Port uint16 + Txpool []*Transaction + Unstake []*int64 + Wallets []*WalletCreated + func Start(db database.Database) *Blockchain + func (bc *Blockchain) AddWallet(wallet string) bool + func (bc *Blockchain) CheckNFTRewards() []*Transaction + func (bc *Blockchain) ClearStake(ls []*int64) + func (bc *Blockchain) ClearTransactionPool() + func (bc *Blockchain) ConverOldNFTToNew(m []byte, nft *pb.StakeNFT) (*pb.StakeNFT, error) + func (bc *Blockchain) ConvertBlockToDomainGroupBlock(b *pb.BlockInfo) []*pb.BlockInfo + func (bc *Blockchain) ConvertGroupToSecureDomainInfo(bks []*pb.BlockInfo) *pb.P2PBlockWithTrustedDataResponseMessage + func (bc *Blockchain) GetNFT() *Nft + func (bc *Blockchain) GetStakedNFT() []*pb.StakeNFT + func (bc *Blockchain) LastMiniBlockRPC() error + func (bc *Blockchain) MatchDomainBlockToP2PBlock(bk *pb.P2PBlockWithTrustedDataRequestMessage, domainIP net.Addr) error + func (bc *Blockchain) P2PBlockUngroup(bk *pb.P2PBlockWithTrustedDataRequestMessage) *pb.BlockInfo + func (bc *Blockchain) ProofOfWork() uint64 + func (bc *Blockchain) StakeNFTMet(sender string, seed string, value string, nft string, stakeunlock string) bool + func (bc *Blockchain) StakedNFT(b *MiniBlock, pool []*NFTStaking) []*Transaction + func (bc *Blockchain) TransactionPool() []*Transaction + func (bc *Blockchain) ValidChain(chain []*MiniBlock) bool + func (bc *Blockchain) ValidProof(nonce uint64, previousHash [32]byte, transactions []*Transaction, ...) bool + func (bc *Blockchain) VerifyNFT(wx string) []byte + func (bc *Blockchain) VerifyTransactionSignature(senderPublickey *ecdsa.PublicKey, s *utils.Signature, tx *Transaction) error + func (bc *Blockchain) WalletToDB(db database.Database, nb *MiniBlock) error + func (mbc *Blockchain) ConvertBlockToDomainBlock() *pb.BlockInfo + type DomainBlock struct + Bits uint64 + CurrentHash [32]byte + Height uint64 + Megablock [32]byte + Metblock [32]byte + Nonce uint64 + PreviousHash [32]byte + Timestamp int64 + Transactions []*Transaction + UtxoCommitment string + type GenesisConsensus struct + Height int64 + Merkleroot []byte + Nonce int + PreviousHash [32]byte + Timestamp int64 + Transaction *mconfig.Txtransaction + func GenesisGenrate() *GenesisConsensus + func (gc *GenesisConsensus) GensisCompile() []byte + func (gc *GenesisConsensus) MarshalJSON() ([]byte, error) + func (gc *GenesisConsensus) VerifyGenesis() (string, bool) + func (gc *GenesisConsensus) VerifyMerkleRoot() + func (gc *GenesisConsensus) VerifyMessage() + func (gc *GenesisConsensus) VerifyNonce() + func (gc *GenesisConsensus) VerifyPreviousHash() + func (gc *GenesisConsensus) VerifyTimestamp() + func (gc *GenesisConsensus) VerifyTransaction() + type JsonMiniBlock struct + type LastRPCBlock struct + Bits uint64 + CurrentHash [32]byte + Height uint64 + Megablock [32]byte + Metblock [32]byte + Nonce uint64 + PreviousHash [32]byte + Timestamp int64 + Transactions []*Transaction + func (lb *LastRPCBlock) BlockToRPCLastBlock(nb *MiniBlock) *LastRPCBlock + type MBlock struct + Bits uint64 + CurrentHash [32]byte + Height uint64 + Megablock [32]byte + Metblock [32]byte + Nonce uint64 + PreviousHash [32]byte + Timestamp int64 + Transactions []*Transaction + func (B *MBlock) DomainblockToRPCBlock(val []byte) error + func (b *MBlock) UnmarshalJSON(data []byte) error + type MiniBlock struct + func (b *MiniBlock) BlockToDB(db database.Database) error + func (b *MiniBlock) Hash() [32]byte + func (b *MiniBlock) MarshalJSON() ([]byte, error) + func (b *MiniBlock) Nonce() uint64 + func (b *MiniBlock) PreviousHash() [32]byte + func (b *MiniBlock) Transactions() []*Transaction + func (b *MiniBlock) UnmarshalJSON(data []byte) error + type NFTStaking struct + LockTime int64 + LockingTXHash []byte + MetCoin float64 + NFT int + Status bool + UnLockTime int64 + WalletAddress string + type Nft struct + Common []int + LessCommon []int + Rare []int + Superrare []int + type TransactionRequest struct + RecipientBlockchainAddress *string + SenderBlockchainAddress *string + SenderPublicKey *string + Signature *string + Value *float32 + type TxVerify struct + func (Tx *TxVerify) VerifySignature() error + type Txtransaction struct + Txcoinbase []byte + Txhex []byte + func (tx *Txtransaction) MarshalJSON() ([]byte, error) + type WalletCreated struct + BlockHash string + LockHash string + WalletAddress string + func (wc *WalletCreated) MarshalJSON() ([]byte, error)