Skip to content

Latest commit

 

History

History
326 lines (189 loc) · 6.32 KB

Miner.md

File metadata and controls

326 lines (189 loc) · 6.32 KB

Miner built-in actor

The miner built-in actor responsible to deal with storage mining operations and collect proof.

To interact with specific miner, you need to use this miner address to invoke the methods in miner built-in actor. You also need to specify method number of which method you want to invoke. Please refer the each method for its method number.

GetPeerID

func GetPeerID() GetPeerIDReturn {}

Return the Peer ID for the caller/miner address.

uint GetPeerIDMethodNum = 2812875329.

Params:

  • null

Results:

  • struct GetPeerIDReturn
    • bytes PeerID - the peer ID for the specified storage provider/miner.

ChangePeerID

func ChangePeerID(params ChangePeerIDParams) EmptyValue {}

Change the peer ID for the caller/miner address.

uint ChangePeerIDMethodNum = 1236548004.

Params:

  • struct ChangePeerIDParams
    • bytes NewID - the new peer ID.

Results:

  • struct EmptyValue

GetMultiaddrs

func GetMultiaddrs() GetMultiAddrsReturn {}

Returns the multi-signature address for this caller/miner address.

uint GetMultiaddrsMethodNum = 1332909407.

Params:

  • null

Results:

  • struct GetMultiAddrsReturn
    • byte[] MultiAddrs - the multi-signature address.

ChangeMultiaddrs

func ChangeMultiaddrs(params ChangeMultiaddrsParams) EmptyValue {}

Change the multi-signature address for this caller/miner address.

uint ChangeMultiaddrsMethodNum = 1063480576.

Params:

  • struct ChangeMultiaddrsParams
    • byte[] NewMultiaddrs - the new multi-signature address.

Results:

  • struct EmptyValue

ChangeWorkerAddress

func ChangeWorkerAddress(params ChangeWorkerAddressParams) EmptyValue {}

Change the worker address for the caller/miner address, and overwrite the existing addresses with the new control addresses passed in the params.

uint ChangeOwnerAddressMethodNum = 1010589339.

Params:

  • struct ChangeWorkerAddressParams
    • byte NewWorker - the new worker address.
    • byte[] NewControlAddrs - the new controller addresses.

Results:

  • struct EmptyValue

ConfirmChangeWorkerAddress

func ConfirmChangeWorkerAddress() EmptyValue {}

Confirm the worker address has been changed for the caller/miner address.

uint ConfirmChangeWorkerAddressMethodNum = 2354970453.

Params:

  • null

Results:

  • struct EmptyValue

RepayDebt

func RepayDebt() EmptyValue {}

Repay as much fee debt as possible for the caller/miner address.

uint RepayDebtMethodNum = 3665352697.

Params:

  • null

Results:

  • struct EmptyValue

GetOwner

func GetOwner() GetOwnerReturn {}

Return the the owner address of the caller/miner address.

uint GetOwnerMethodNum = 3275365574.

Params:

  • null

Results:

  • struct GetOwnerReturn
    • byte Owner - owner address.

ChangeOwnerAddress

func ChangeOwnerAddress(bytes address) {}

Proposes or confirms a change of owner address.

uint ChangeOwnerAddressMethodNum = 1010589339.

Params:

  • bytes Address - the new owner address.

Results:

  • struct EmptyValue

GetBeneficiary

func GetBeneficiary() GetBeneficiaryReturn {}

Return the currently active and proposed beneficiary information.

uint GetBeneficiaryMethodNum = 4158972569.

Params:

  • null

Results:

  • struct GetBeneficiaryReturn
    • struct ActiveBeneficiary - current active beneficiary.

      • byte Beneficiary - the address of the beneficiary.
      • struct BeneficiaryTerm
        • int256 Quota - the quota token amount.
        • int256 UsedQuota - the used quota token amount.
        • uint64 Expiration - the epoch that the quota will be expired.
    • struct PendingBeneficiaryChange - the proposed and pending beneficiary.

      • bytes newBeneficiary - the new beneficiary address.
      • int256 NewQuota - the new quota token amount.
      • uint64 NewExpiration - the epoch that the new quota will be expired.
      • bool ApprovedByBeneficiary - if this proposal is approved by beneficiary or not.
      • bool ApprovedByNominee - if this proposal is approved by nominee or not.

ChangeBeneficiary

func ChangeBeneficiary(params ChangeBeneficiaryParams) EmptyValue {}

Propose or confirm a change of beneficiary information.

uint ChangeBeneficiaryMethodNum = 1570634796.

Params:

  • struct ChangeBeneficiaryParams
    • bytes newBeneficiary - the new beneficiary address.
    • int256 NewQuota - the new quota token amount.
    • uint64 NewExpiration - the epoch that the new quota will be expired.

Results:

  • struct EmptyValue

IsControllingAddress

func IsControllingAddress(params IsControllingAddressParams) IsControllingAddressReturn {}

Returns whether the provided address is the Owner, the Worker, or any of the control addresses.

uint IsControllingAddressMethodNum = 348244887.

Params:

  • byte IsControllingAddressParams - the address to be verified.

Results:

  • bool IsControllingAddressReturn - if the specified address is the control address.

GetSectorSize

func GetSectorSize() GetSectorSizeReturn {}

Returns the miner's sector size.

uint GetSectorSizeMethodNum = 3858292296;

Params:

  • null

Results:

  • struct GetSectorSizeReturn
    • unit64 SectorSize - the sector size of this miner.

GetAvailableBalance

func GetAvailableBalance() GetAvailableBalanceReturn {}

Returns the available balance of this miner.

uint GetAvailableBalanceMethodNum = 4026106874.

Params:

  • null

Results:

  • int256 GetAvailableBalanceReturn - the available token balance amount.

WithdrawBalance

func WithdrawBalance(params WithdrawBalanceParams) WithdrawBalanceReturn {}

Withdraw the token balance for this miner.

Params:

  • struct WithdrawBalanceParams
    • int256 AmountRequested - withdraw token amount.

Results:

  • int256 WithdrawBalanceReturn - the token amount withdraw.

GetVestingFunds

func GetVestingFunds() GetVestingFundsReturn {}

Return the funds vesting in this miner as a list of (vesting_epoch, vesting_amount) tuples.

uint GetVestingFundsMethodNum = 1726876304.

Params:

  • null

Results:

  • struct GetVestingFundsReturn
    • struct VestingFunds[] Funds
      • int64 Epoch - the epoch of funds vested.
      • int256 Amount - the amount of funds vested.