☁️
Zus Docs
  • About Züs
  • System
    • Providers and Services
      • Miner
      • Sharder
      • Blobber
      • Validator
      • Authorizer
      • Node Locator (0DNS)
    • Storage
      • Architecture and Data Management
      • Protocol
        • Allocations
        • Reference Objects
        • Challenges
        • Write Markers
          • Chain Hashing
          • Two Commit
        • Blobber Repair Protocol
      • ZS3 Server
        • Backup, Recovery and Replication
        • Encryption and Compression
        • S3FS Setup and Usage
        • Backup & Recovery with Restic on Blimp + ZS3 Server
        • Backup & Recovery with Veeam on Blimp + ZS3 Server
      • File Operations
        • Upload
        • Download
        • File Sharing
        • Partial Error Recovery
        • Streaming
        • Rent a Blobber
    • Smart Contracts
      • Storage S.C.
      • Miner S.C.
      • ZCN S.C.
      • ERC-20 S.C.s
      • Bridge Protocol
    • Blockchain & Consensus
      • Entities
    • User Authentication and Wallet Management System
      • OKTA Integration
      • Key Management System (KMS)
  • APIs
    • 0DNS API
    • JS API
    • Mobile API
  • CLIs
    • Storage CLI
      • Quickstart
      • Configuring the tool
    • Wallet CLI
      • Wallet Configuration
      • Quickstart
      • Configuring the tool
  • SDKs
    • Go SDK
      • GO SDK Microservices
    • JS SDK
  • Tokenomics
    • Staking
    • Reward & Penalty
  • ✨Züs Apps
    • 🗝️Vult
      • Getting Started
        • Web
        • Mobile
      • Vult AI
        • Batch Processing
        • Memory Retention
        • Technical Implementation
        • Architecture Overview
      • Login / Register
      • File Management Pages
      • File Sharing
      • Storage Management Dashboard
      • Storage Maintenance and Troubleshooting
      • Züs Subscription
      • Wallet Management
      • Refer a friend
      • Settings
    • 🏗️Blimp
      • Getting Started
      • Login / Register
      • Configure Storage
        • Create Standard Storage Allocation
        • Create Enterprise Allocation
        • Create S3 Server Allocation
        • Create Cloud Migration Allocation
        • Allocation Maintenance and Troubleshooting
      • File Management Pages
      • File Sharing
      • Manage Allocations
      • Upgrade Storage
      • Blimp Vault
      • Refer a friend
      • Settings
      • Launching ZS3 Server
      • Using CLI to backup files into Blimp + ZS3 Server
    • 🏠Chimney
      • Getting Started
      • Login / Register
      • Create New Deployment
      • Manage Your Deployments
      • Homepage
      • Staking Dashboard
      • Rank Dashboard
      • Monitor Dashboard
      • Stats Dashboard
      • Logs Dashboard
      • Wallet Dashboard
      • Operations on your Deployments
      • Restricted Blobbers
      • Settings
        • Manage Profile
        • Wallet Settings
        • Update Blobber Settings
        • Update Blobber Version
        • Refer a friend
        • Help
    • 🌐Atlus
      • Getting Started
      • Home page
      • Service Providers Page
      • Charts Page
        • Market Charts
        • Network Charts
        • Storage Charts
      • Blockchain Page
      • Server Map Page
      • Storage Explainer Page
      • Details Pages
        • Block Details Page
        • Transaction Details Page
        • Wallet Details Page
        • Miner Details Page
        • Sharder Details Page
        • Blobber Details Page
        • Validator Details Page
        • Authorizer Details Page
        • Allocation Details Page
      • Appendix: Common Components
    • ⚡Bolt
      • Getting Started
        • Web
        • Mobile
      • Login / Register
      • Sign In with external wallet
      • Staking Dashboard
      • Staking/Unstaking a provider
      • Claiming Rewards
      • Send/Receive ZCN tokens
      • Buy ZCN
      • Deposit/Withdraw ZCN tokens
      • Activity Dashboard
      • Refer a friend
      • Settings
  • Releases
    • Hardfork
Powered by GitBook
On this page
  • Miner-related Functions
  • Global Node Management
  • Execution Statistics
  1. System
  2. Smart Contracts

Miner S.C.

Miner-related Functions

NewMinerSmartContract

Creates a new instance of the Miner Smart Contract.

goCopy codefunc NewMinerSmartContract() sci.SmartContractInterface {
	var mscCopy = &MinerSmartContract{
		SmartContract: sci.NewSC(ADDRESS),
		bcContext:     &smartcontract.BCContext{},
	}
	mscCopy.initSC()
	mscCopy.setSC(mscCopy.SmartContract, mscCopy.bcContext)
	return mscCopy
}

Execute

Executes a specified function within the Miner Smart Contract, based on the function name and input data provided.

Function Parameters:

goCopy codefunc (msc *MinerSmartContract) Execute(
	t *transaction.Transaction,
	funcName string, 
	input []byte, 
	balances cstate.StateContextI
) (string, error)

Parameters:

Field
Description

t

Transaction to be executed.

funcName

The function name to execute within the smart contract.

input

Byte array of input data for the function.

balances

State context interface for maintaining blockchain state.


Global Node Management

getGlobalNode

Retrieves the global configuration node from the blockchain state.

Function Signature:

goCopy codefunc getGlobalNode(balances cstate.CommonStateContextI) (gn *GlobalNode, err error)

Parameters:

Field
Description

balances

Blockchain state context interface.

Returns:

  • *GlobalNode - Pointer to the global node configuration.

  • error - Error if retrieval fails.

InitConfig

Initializes the global configuration settings for the Miner Smart Contract.

Function Signature:

goCopy codefunc InitConfig(balances cstate.CommonStateContextI) error

Parameters:

Field
Description

balances

Blockchain state context interface.

Description: This function initializes the settings in the blockchain, validating and storing the global node configuration if it does not already exist. If a global node does not exist, a default node is created and stored.


Execution Statistics

Miner Smart Contract records performance metrics for each key function:

Function Name
Description

add_miner

Tracks time taken to add a new miner.

add_sharder

Tracks time taken to add a new sharder.

collect_reward

Measures the time required for reward collection.

miner_health_check

Monitors time taken to conduct miner health checks.

sharder_health_check

Tracks time taken for sharder health checks.

update_globals

Counts the number of global configuration updates.

update_miner_settings

Tracks the time taken to update miner settings.

update_sharder_settings

Tracks time taken to update sharder settings.

payFees

Monitors the time taken for processing fee payments.

feesPaid

Keeps a count of total fees paid by miners and sharders.

mintedTokens

Counts the total tokens minted in the smart contract.

PreviousStorage S.C.NextZCN S.C.

Last updated 6 months ago