Documentation ¶
Overview ¶
Contains sub-packages and modules for managing users' wallets and issuing transactions.
Index ¶
- Constants
- Variables
- func AddHardfork(input interface{}, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
- func CallZauthDelete(serverAddr, token, clientID string) error
- func CallZauthRetreiveKey(serverAddr, token, clientID, peerPublicKey string) (string, error)
- func CallZauthRevoke(serverAddr, token, clientID, peerPublicKey string) error
- func CallZvaultDeletePrimaryKey(serverAddr, token, clientID string) error
- func CallZvaultNewSplit(serverAddr, token, clientID string) error
- func CallZvaultNewWallet(serverAddr, token string) error
- func CallZvaultRetrieveKeys(serverAddr, token, clientID string) (string, error)
- func CallZvaultRetrieveRestrictions(serverAddr, token, peerPublicKey string) (string, error)
- func CallZvaultRetrieveSharedWallets(serverAddr, token string) (string, error)
- func CallZvaultRetrieveWallets(serverAddr, token string) (string, error)
- func CallZvaultRevokeKey(serverAddr, token, clientID, publicKey string) error
- func CallZvaultStoreKeyString(serverAddr, token, privateKey string) error
- func CallZvaultUpdateRestrictions(serverAddr, token, clientID, peerPublicKey string, restrictions []string) error
- func CheckConfig() error
- func CheckEthHashStatus(hash string) int
- func CloseLog()
- func ConvertToToken(token int64) float64
- func ConvertToValue(token float64) uint64
- func ConvertTokenToUSD(token float64) (float64, error)
- func ConvertUSDToToken(usd float64) (float64, error)
- func ConvertZcnTokenToETH(f float64) (float64, error)
- func CreateWalletFromEthMnemonic(mnemonic, password string, statusCb WalletCallback) error
- func CreateWalletOffline() (string, error)
- func CryptoJsDecrypt(passphrase, encryptedMessage string) (string, error)
- func CryptoJsEncrypt(passphrase, message string) (string, error)
- func Decrypt(key, text string) (string, error)
- func Encrypt(key, text string) (string, error)
- func EthToTokens(tokens float64) int64
- func Faucet(tokens uint64, input string, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
- func GEthToTokens(gwei float64) int64
- func GTokensToEth(tokens int64) float64
- func GetEthBalance(ethAddr string, cb GetBalanceCallback) error
- func GetEthClient() (*ethclient.Client, error)
- func GetIdForUrl(url string) string
- func GetLatestFinalizedMagicBlock() (m *block.MagicBlock, err error)
- func GetLogger() *logger.Logger
- func GetMinerSCNodeInfo(id string) ([]byte, error)
- func GetMinerSCNodePool(id string) ([]byte, error)
- func GetMinerSCUserInfo(clientID string) ([]byte, error)
- func GetMiners(active, stakable bool, limit, offset int) ([]byte, error)
- func GetMintNonce() ([]byte, error)
- func GetNotProcessedZCNBurnTickets(ethereumAddress, startNonce string) ([]byte, error)
- func GetPublicEncryptionKey(mnemonic string) (string, error)
- func GetSharders(active, stakable bool, limit, offset int) ([]byte, error)
- func GetUserLockedTotal(clientID string) (int64, error)
- func GetWallet(walletStr string) (*zcncrypto.Wallet, error)
- func GetWalletAddrFromEthMnemonic(mnemonic string) (string, error)
- func IsEthTransactionVerified(txHash string) (bool, error)
- func IsMnemonicValid(mnemonic string) booldeprecated
- func IsValidEthAddress(ethAddr string) (bool, error)
- func MinerSCCollectReward(providerId string, providerType Provider, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
- func MinerSCKill(providerId string, providerType Provider, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
- func MinerSCLock(providerId string, providerType Provider, lock uint64, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
- func MinerSCMinerSettings(input *MinerSCMinerInfo, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
- func MinerSCSharderSettings(input *MinerSCMinerInfo, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
- func MinerSCUnlock(providerId string, providerType Provider, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
- func MinerScUpdateConfig(input interface{}, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
- func MinerScUpdateGlobals(input interface{}, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
- func RecoverOfflineWallet(mnemonic string) (string, error)
- func RecoverWallet(mnemonic string, statusCb WalletCallback) error
- func Send(toClientID string, tokens uint64, desc string, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
- func SetAuthUrl(url string) error
- func SetLogFile(logFile string, verbose bool)
- func SetLogLevel(lvl int)
- func SetWalletInfo(jsonWallet, sigScheme string, splitKeyWallet bool) error
- func SetupAuth(authHost, clientID, clientKey, publicKey, privateKey, localPublicKey string, ...) error
- func SignWith0Wallet(hash string, w *zcncrypto.Wallet) (string, error)deprecated
- func SignWithKey(privateKey, hash string) (string, error)
- func SplitKeys(privateKey string, numSplits int) (string, error)
- func StorageSCCollectReward(providerId string, providerType Provider, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
- func StorageScUpdateConfig(input interface{}, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
- func SuggestEthGasPrice() (int64, error)
- func TokensToEth(tokens int64) float64
- func TransferEthTokens(fromPrivKey string, amountTokens, gasPrice int64) (string, error)
- func ZCNSCAddAuthorizer(input *AddAuthorizerPayload, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
- func ZCNSCAuthorizerHealthCheck(input *AuthorizerHealthCheckPayload, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
- func ZCNSCCollectReward(providerId string, providerType Provider, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
- func ZCNSCDeleteAuthorizer(input *DeleteAuthorizerPayload, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
- func ZCNSCUpdateAuthorizerConfig(input *AuthorizerNode, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
- func ZCNSCUpdateGlobalConfig(input *InputMap, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
- func ZauthAuthCommon(serverAddr string) sys.AuthorizeFunc
- func ZauthSignTxn(serverAddr string) sys.AuthorizeFunc
- type AddAuthorizerPayload
- type AuthCallback
- type AuthMessage
- type AuthResponse
- type AuthorizerConfig
- type AuthorizerHealthCheckPayload
- type AuthorizerNode
- type AuthorizerStakePoolSettings
- type Blobber
- type BurnTicket
- type ConfirmationStatus
- type CreateAllocationRequest
- type DelegatePool
- type DeleteAuthorizerPayload
- type GetBalanceCallback
- type GetClientResponse
- type GetInfoCallback
- type GetNonceCallback
- type GetNonceCallbackStub
- type InputMap
- type Miner
- type MinerSCDelegatePool
- type MinerSCDelegatePoolInfo
- type MinerSCMinerInfo
- type MinerSCNodes
- type MinerSCUserPoolsInfo
- type Node
- type Params
- type PriceRange
- type Provider
- type SendTxnData
- type SimpleMiner
- type StakePool
- type StakePoolSettings
- type Terms
- type Validator
- type WalletCallback
Constants ¶
const ( GET_CLIENT = `/v1/client/get` PUT_TRANSACTION = `/v1/transaction/put` TXN_VERIFY_URL = `/v1/transaction/get/confirmation?hash=` GET_BLOCK_INFO = `/v1/block/get?` GET_MAGIC_BLOCK_INFO = `/v1/block/magic/get?` GET_LATEST_FINALIZED = `/v1/block/get/latest_finalized` GET_LATEST_FINALIZED_MAGIC_BLOCK = `/v1/block/get/latest_finalized_magic_block` GET_FEE_STATS = `/v1/block/get/fee_stats` GET_CHAIN_STATS = `/v1/chain/get/stats` GET_MINT_NONCE = `/v1/mint_nonce` GET_MINERSC_NODE = "/nodeStat" GET_MINERSC_POOL = "/nodePoolStat" GET_MINERSC_USER = "/getUserPools" GET_MINERSC_MINERS = "/getMinerList" GET_MINERSC_SHARDERS = "/getSharderList" )
const ( StorageSmartContractAddress = `6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712d7` FaucetSmartContractAddress = `6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712d3` MinerSmartContractAddress = `6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712d9` ZCNSCSmartContractAddress = `6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712e0` )
const ( StatusSuccess int = 0 StatusNetworkError int = 1 // TODO: Change to specific error StatusError int = 2 StatusRejectedByUser int = 3 StatusInvalidSignature int = 4 StatusAuthError int = 5 StatusAuthVerifyFailed int = 6 StatusAuthTimeout int = 7 StatusUnknown int = -1 )
const TOKEN_UNIT int64 = 1e10
Variables ¶
var AddSignature = func(privateKey, signature string, hash string) (string, error) { var ( ss = zcncrypto.NewSignatureScheme(client.SignatureScheme()) err error ) err = ss.SetPrivateKey(privateKey) if err != nil { return "", err } return ss.Add(signature, hash) }
var AvailableRestrictions = map[string][]string{
"token_transfers": {"transfer"},
"allocation_file_operations": {
"read_redeem",
"commit_connection",
},
"allocation_storage_operations": {
"new_allocation_request",
"update_allocation_request",
"finalize_allocation",
"cancel_allocation",
"add_free_storage_assigner",
"free_allocation_request",
},
"allocation_token_operations": {
"read_pool_lock",
"read_pool_unlock",
"write_pool_lock",
},
"storage_rewards": {
"collect_reward",
"stake_pool_lock",
"stake_pool_unlock",
},
"storage_operations": {
"challenge_response",
"add_validator",
"add_blobber",
"blobber_health_check",
"validator_health_check",
},
"storage_management": {
"kill_blobber",
"kill_validator",
"shutdown_blobber",
"shutdown_validator",
"update_blobber_settings",
"update_validator_settings",
},
"miner_operations": {
"add_miner",
"add_sharder",
"miner_health_check",
"sharder_health_check",
"contributeMpk",
"shareSignsOrShares",
"wait",
"sharder_keep",
},
"miner_management_operations": {
"delete_miner",
"delete_sharder",
"update_miner_settings",
"kill_miner",
"kill_sharder",
},
"miner_financial_operations": {
"addToDelegatePool",
"deleteFromDelegatePool",
"collect_reward",
},
"token_bridging": {
"mint",
"burn",
},
"authorizer_management_operations": {
"delete-authorizer",
},
"authorizer_operations": {
"add-authorizer",
"authorizer-health-check",
"add-to-delegate-pool",
"delete-from-delegate-pool",
},
}
AvailableRestrictions represents supported restrictions mapping.
var SignFn = func(hash string) (string, error) { sigScheme := zcncrypto.NewSignatureScheme(client.SignatureScheme()) err := sigScheme.SetPrivateKey(client.PrivateKey()) if err != nil { return "", err } return sigScheme.Sign(hash) }
Functions ¶
func AddHardfork ¶ added in v1.17.13
func AddHardfork(input interface{}, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
func CallZauthDelete ¶ added in v1.17.0
func CallZauthRetreiveKey ¶ added in v1.17.13
func CallZauthRevoke ¶ added in v1.17.0
func CallZvaultDeletePrimaryKey ¶ added in v1.17.0
func CallZvaultNewSplit ¶ added in v1.17.13
func CallZvaultNewWallet ¶ added in v1.17.13
func CallZvaultRetrieveKeys ¶ added in v1.17.0
func CallZvaultRetrieveRestrictions ¶ added in v1.17.13
func CallZvaultRetrieveSharedWallets ¶ added in v1.17.0
func CallZvaultRetrieveWallets ¶ added in v1.17.0
func CallZvaultRevokeKey ¶ added in v1.17.0
func CallZvaultStoreKeyString ¶ added in v1.17.0
func CallZvaultUpdateRestrictions ¶ added in v1.17.13
func CheckConfig ¶ added in v1.7.1
func CheckConfig() error
func CheckEthHashStatus ¶
CheckEthHashStatus - checking the status of ETH transaction possible values 0 or 1
func ConvertTokenToUSD ¶
ConvertTokenToUSD converts the ZCN tokens to USD amount
- token: ZCN tokens amount
func ConvertZcnTokenToETH ¶
ConvertZcnTokenToETH - converting Zcn tokens to Eth
- f: ZCN tokens amount
func CreateWalletFromEthMnemonic ¶
func CreateWalletFromEthMnemonic(mnemonic, password string, statusCb WalletCallback) error
CreateWalletFromEthMnemonic - creating new wallet from Eth mnemonics
func CreateWalletOffline ¶ added in v1.8.10
CreateWalletOffline creates the wallet for the config signature scheme.
func CryptoJsDecrypt ¶ added in v1.8.11
func CryptoJsEncrypt ¶ added in v1.8.11
func Decrypt ¶
Decrypt decrypts encrypted text using the key.
- key: key to use for decryption
- text: text to decrypt
func EthToTokens ¶
TokensToEth - converting eth tokens to wei
func Faucet ¶ added in v1.17.13
func Faucet(tokens uint64, input string, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
func GEthToTokens ¶
func GTokensToEth ¶
func GetEthBalance ¶
func GetEthBalance(ethAddr string, cb GetBalanceCallback) error
GetEthBalance - getting back balance for ETH wallet
func GetEthClient ¶
func GetIdForUrl ¶
GetIdForUrl retrieve the ID of the network node (miner/sharder) given its url.
- url: url of the node.
func GetLatestFinalizedMagicBlock ¶
func GetLatestFinalizedMagicBlock() (m *block.MagicBlock, err error)
GetLatestFinalizedMagicBlock gets latest finalized magic block
- numSharders: number of sharders
- timeout: request timeout
func GetMinerSCNodeInfo ¶
GetMinerSCNodeInfo get miner information from sharders
- id: the id of miner
- cb: info callback instance, carries the response of the GET request to the sharders
func GetMinerSCUserInfo ¶
GetMinerSCUserInfo retrieve user stake pools for the providers related to the Miner SC (miners/sharders).
- clientID: user's wallet id
func GetMintNonce ¶ added in v1.8.15
GetMintNonce retrieve the client's latest mint nonce from sharders
- cb: info callback instance, carries the response of the GET request to the sharders
func GetNotProcessedZCNBurnTickets ¶ added in v1.8.15
GetNotProcessedZCNBurnTickets retrieve burn tickets that are not compensated by minting
- ethereumAddress: ethereum address for the issuer of the burn tickets
- startNonce: start nonce for the burn tickets
- cb: info callback instance, carries the response of the GET request to the sharders
func GetPublicEncryptionKey ¶ added in v1.8.10
GetPublicEncryptionKey returns the public encryption key for the given mnemonic
func GetUserLockedTotal ¶ added in v1.8.13
GetUserLockedTotal get total token user locked # Inputs
- clientID wallet id
func GetWalletAddrFromEthMnemonic ¶
GetWalletAddrFromEthMnemonic - wallet ETH address from mnemoninnc
func IsEthTransactionVerified ¶ added in v1.8.11
IsEthTransactionVerified checks if the transaction - given its hash - is verified on the ethereum network
- txHash: transaction hash
func IsMnemonicValid
deprecated
func IsValidEthAddress ¶
IsValidEthAddress - multiple checks for valid ETH address
func MinerSCCollectReward ¶ added in v1.17.13
func MinerSCCollectReward(providerId string, providerType Provider, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
func MinerSCKill ¶ added in v1.17.13
func MinerSCKill(providerId string, providerType Provider, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
func MinerSCLock ¶
func MinerSCLock(providerId string, providerType Provider, lock uint64, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
func MinerSCMinerSettings ¶ added in v1.17.13
func MinerSCMinerSettings(input *MinerSCMinerInfo, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
func MinerSCSharderSettings ¶ added in v1.17.13
func MinerSCSharderSettings(input *MinerSCMinerInfo, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
func MinerSCUnlock ¶
func MinerSCUnlock(providerId string, providerType Provider, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
func MinerScUpdateConfig ¶ added in v1.17.13
func MinerScUpdateConfig(input interface{}, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
func MinerScUpdateGlobals ¶ added in v1.17.13
func MinerScUpdateGlobals(input interface{}, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
func RecoverOfflineWallet ¶ added in v1.8.5
RecoverOfflineWallet recovers the previously generated wallet using the mnemonic.
func RecoverWallet ¶
func RecoverWallet(mnemonic string, statusCb WalletCallback) error
RecoverWallet recovers the previously generated wallet using the mnemonic. It also registers the wallet again to block chain.
func Send ¶ added in v1.17.13
func Send(toClientID string, tokens uint64, desc string, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
func SetAuthUrl ¶
SetAuthUrl will be called by app to set zauth URL to SDK. # Inputs
- url: the url of zAuth server
func SetLogFile ¶
SetLogFile - sets file path to write log verbose - true - console output; false - no console output
func SetLogLevel ¶
func SetLogLevel(lvl int)
SetLogLevel set the log level. lvl - 0 disabled; higher number (upto 4) more verbosity
func SetWalletInfo ¶
SetWalletInfo should be set before any transaction or client specific APIs splitKeyWallet parameter is valid only if SignatureScheme is "BLS0Chain"
# Inputs - jsonWallet: json format of wallet { "client_id":"30764bcba73216b67c36b05a17b4dd076bfdc5bb0ed84856f27622188c377269", "client_key":"1f495df9605a4479a7dd6e5c7a78caf9f9d54e3a40f62a3dd68ed377115fe614d8acf0c238025f67a85163b9fbf31d10fbbb4a551d1cf00119897edf18b1841c", "keys":[ {"public_key":"1f495df9605a4479a7dd6e5c7a78caf9f9d54e3a40f62a3dd68ed377115fe614d8acf0c238025f67a85163b9fbf31d10fbbb4a551d1cf00119897edf18b1841c","private_key":"41729ed8d82f782646d2d30b9719acfd236842b9b6e47fee12b7bdbd05b35122"} ], "mnemonics":"glare mistake gun joke bid spare across diagram wrap cube swear cactus cave repeat you brave few best wild lion pitch pole original wasp", "version":"1.0", "date_created":"1662534022", "nonce":0 }
- splitKeyWallet: if wallet keys is split
func SetupAuth ¶
func SetupAuth(authHost, clientID, clientKey, publicKey, privateKey, localPublicKey string, cb AuthCallback) error
SetupAuth prepare auth app with clientid, key and a set of public, private key and local publickey which is running on PC/Mac.
func SignWithKey ¶ added in v1.12.1
func StorageSCCollectReward ¶ added in v1.17.13
func StorageSCCollectReward(providerId string, providerType Provider, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
func StorageScUpdateConfig ¶ added in v1.17.13
func StorageScUpdateConfig(input interface{}, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
func SuggestEthGasPrice ¶
SuggestEthGasPrice - return back suggested price for gas
func TokensToEth ¶
TokensToEth - converting wei to eth tokens
func TransferEthTokens ¶
TransferEthTokens - transfer ETH tokens to multisign wallet
func ZCNSCAddAuthorizer ¶ added in v1.17.13
func ZCNSCAddAuthorizer(input *AddAuthorizerPayload, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
func ZCNSCAuthorizerHealthCheck ¶ added in v1.17.13
func ZCNSCAuthorizerHealthCheck(input *AuthorizerHealthCheckPayload, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
func ZCNSCCollectReward ¶ added in v1.17.13
func ZCNSCCollectReward(providerId string, providerType Provider, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
func ZCNSCDeleteAuthorizer ¶ added in v1.17.13
func ZCNSCDeleteAuthorizer(input *DeleteAuthorizerPayload, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
func ZCNSCUpdateAuthorizerConfig ¶ added in v1.17.13
func ZCNSCUpdateAuthorizerConfig(input *AuthorizerNode, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
func ZCNSCUpdateGlobalConfig ¶ added in v1.17.13
func ZCNSCUpdateGlobalConfig(input *InputMap, client ...string) (hash, out string, nonce int64, txn *transaction.Transaction, err error)
func ZauthAuthCommon ¶ added in v1.17.0
func ZauthAuthCommon(serverAddr string) sys.AuthorizeFunc
func ZauthSignTxn ¶ added in v1.17.0
func ZauthSignTxn(serverAddr string) sys.AuthorizeFunc
ZauthSignTxn returns a function that sends a txn signing request to the zauth server
Types ¶
type AddAuthorizerPayload ¶ added in v1.7.9
type AddAuthorizerPayload struct { PublicKey string `json:"public_key"` URL string `json:"url"` StakePoolSettings AuthorizerStakePoolSettings `json:"stake_pool_settings"` // Used to initially create stake pool }
AddAuthorizerPayload represents the payload for adding an authorizer.
type AuthCallback ¶
type AuthCallback interface { // OnSetupComplete This call back gives the status of the Two factor authenticator(zauth) setup. OnSetupComplete(status int, err string) }
AuthCallback needs to be implemented by the caller SetupAuth()
type AuthMessage ¶ added in v1.17.0
type AuthResponse ¶ added in v1.17.0
type AuthResponse struct {
Sig string `json:"sig"`
}
type AuthorizerConfig ¶ added in v1.7.1
type AuthorizerHealthCheckPayload ¶ added in v1.8.13
type AuthorizerHealthCheckPayload struct {
ID string `json:"id"` // authorizer ID
}
AuthorizerHealthCheckPayload represents the payload for authorizer health check.
type AuthorizerNode ¶ added in v1.7.1
type AuthorizerNode struct { ID string `json:"id"` URL string `json:"url"` Config *AuthorizerConfig `json:"config"` }
AuthorizerNode represents an authorizer node in the network
type AuthorizerStakePoolSettings ¶ added in v1.7.9
type AuthorizerStakePoolSettings struct { DelegateWallet string `json:"delegate_wallet"` NumDelegates int `json:"num_delegates"` ServiceCharge float64 `json:"service_charge"` }
AuthorizerStakePoolSettings represents the settings for an authorizer's stake pool.
type Blobber ¶
type Blobber struct { // ID is the blobber ID. ID common.Key `json:"id"` // BaseURL is the blobber's base URL used to access the blobber BaseURL string `json:"url"` // Terms of storage service of the blobber (read/write price, max offer duration) Terms Terms `json:"terms"` // Capacity is the total capacity of the blobber Capacity common.Size `json:"capacity"` // Used is the capacity of the blobber used to create allocations Allocated common.Size `json:"allocated"` // LastHealthCheck is the last time the blobber was checked for health LastHealthCheck common.Timestamp `json:"last_health_check"` // StakePoolSettings is the settings of the blobber's stake pool StakePoolSettings StakePoolSettings `json:"stake_pool_settings"` // NotAvailable is true if the blobber is not available NotAvailable bool `json:"not_available"` // IsRestricted is true if the blobber is restricted. // Restricted blobbers needs to be authenticated using AuthTickets in order to be used for allocation creation. // Check Restricted Blobbers documentation for more details. IsRestricted bool `json:"is_restricted"` }
Blobber represents a blobber node.
type BurnTicket ¶ added in v1.8.15
type BurnTicket struct { Hash string `json:"hash"` Amount int64 `json:"amount"` Nonce int64 `json:"nonce"` }
BurnTicket represents the burn ticket of native ZCN tokens used by the bridge protocol to mint ERC20 tokens
type ConfirmationStatus ¶ added in v1.5.1
type ConfirmationStatus int
type CreateAllocationRequest ¶
type CreateAllocationRequest struct { DataShards int `json:"data_shards"` ParityShards int `json:"parity_shards"` Size common.Size `json:"size"` Expiration common.Timestamp `json:"expiration_date"` Owner string `json:"owner_id"` OwnerPublicKey string `json:"owner_public_key"` Blobbers []string `json:"blobbers"` ReadPriceRange PriceRange `json:"read_price_range"` WritePriceRange PriceRange `json:"write_price_range"` }
CreateAllocationRequest is information to create allocation.
type DelegatePool ¶ added in v1.8.4
type DeleteAuthorizerPayload ¶ added in v1.8.9
type DeleteAuthorizerPayload struct {
ID string `json:"id"` // authorizer ID
}
DeleteAuthorizerPayload represents the payload for deleting an authorizer.
type GetBalanceCallback ¶
GetBalanceCallback needs to be implemented by the caller of GetBalance() to get the status
type GetClientResponse ¶
type GetClientResponse struct { ID string `json:"id"` Version string `json:"version"` CreationDate int `json:"creation_date"` PublicKey string `json:"public_key"` }
func GetClientDetails ¶
func GetClientDetails(clientID string) (*GetClientResponse, error)
type GetInfoCallback ¶
type GetInfoCallback interface { // OnInfoAvailable will be called when GetLockTokenConfig is complete // if status == StatusSuccess then info is valid // is status != StatusSuccess then err will give the reason OnInfoAvailable(op int, status int, info string, err string) }
GetInfoCallback represents the functions that will be called when the response of a GET request to the sharders is available
type GetNonceCallback ¶ added in v1.8.3
GetNonceCallback needs to be implemented by the caller of GetNonce() to get the status
type GetNonceCallbackStub ¶ added in v1.8.3
type GetNonceCallbackStub struct {
// contains filtered or unexported fields
}
func (*GetNonceCallbackStub) OnNonceAvailable ¶ added in v1.8.3
func (g *GetNonceCallbackStub) OnNonceAvailable(status int, nonce int64, info string)
type Miner ¶
type Miner struct { ID string `json:"id"` N2NHost string `json:"n2n_host"` Host string `json:"host"` Port int `json:"port"` PublicKey string `json:"public_key"` ShortName string `json:"short_name"` BuildTag string `json:"build_tag"` TotalStake int64 `json:"total_stake"` Stat interface{} `json:"stat"` }
type MinerSCDelegatePool ¶
type MinerSCDelegatePool struct {
Settings StakePoolSettings `json:"settings"`
}
type MinerSCDelegatePoolInfo ¶
type MinerSCMinerInfo ¶
type MinerSCMinerInfo struct { SimpleMiner `json:"simple_miner"` MinerSCDelegatePool `json:"stake_pool"` }
MinerSCMinerInfo interface for miner/sharder info functions on miner smart contract.
type MinerSCNodes ¶
type MinerSCNodes struct {
Nodes []Node `json:"Nodes"`
}
MinerSCNodes list of nodes registered to the miner smart contract
type MinerSCUserPoolsInfo ¶
type MinerSCUserPoolsInfo struct {
Pools map[string][]*MinerSCDelegatePoolInfo `json:"pools"`
}
MinerSCUserPoolsInfo represents the user stake pools information
type PriceRange ¶
PriceRange represents a price range allowed by user to filter blobbers.
type SendTxnData ¶ added in v1.4.1
type SendTxnData struct {
Note string `json:"note"`
}
type SimpleMiner ¶ added in v1.8.4
type SimpleMiner struct {
ID string `json:"id"`
}
SimpleMiner represents a node in the network, miner or sharder.
type StakePool ¶ added in v1.8.4
type StakePool struct { Pools map[string]*DelegatePool `json:"pools"` Reward int64 `json:"rewards"` Settings StakePoolSettings `json:"settings"` Minter int `json:"minter"` }
type StakePoolSettings ¶
type Validator ¶ added in v1.8.5
type Validator struct { ID common.Key `json:"id"` BaseURL string `json:"url"` StakePoolSettings StakePoolSettings `json:"stake_pool_settings"` }
type WalletCallback ¶
WalletCallback needs to be implemented for wallet creation.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Utilities to interact with ethereum wallet.
|
Utilities to interact with ethereum wallet. |