Documentation ¶
Index ¶
- Constants
- Variables
- func Decode(data []byte, value interface{}) error
- func Encode(value interface{}) ([]byte, error)
- func FromKeyBytes(address []byte) (string, error)
- func HexEncodeToString(b []byte) string
- type AccountID
- type AccountInfo
- type ActivationServiceError
- type Approved
- type AveragePriceIsAboveMaxPrice
- type AveragePriceIsAboveMinPrice
- type Balance
- type BalancesMinted
- type BatchCreateContractData
- type BillingFrequencyChanged
- type BlockNumber
- type Bonded
- type BridgeBurnTransactionCreated
- type BridgeBurnTransactionExpired
- type BurnTransaction
- type BurnTransactionCreated
- type BurnTransactionProcessed
- type BurnTransactionProposed
- type BurnTransactionReady
- type BurnTransactionSignatureAdded
- type CallResponse
- type CertificationCodeStored
- type CertificationCodes
- type Closed
- type ClosedByCouncil
- type Conn
- type ConnectionPriceSet
- type Consumption
- type ConsumptionReportReceived
- type Contract
- type ContractBill
- type ContractBilled
- type ContractCreated
- type ContractDeployed
- type ContractGracePeriodElapsed
- type ContractGracePeriodEnded
- type ContractGracePeriodStarted
- type ContractPaymentOverdrawn
- type ContractResources
- type ContractState
- type ContractType
- type ContractUpdated
- type CouncilMemberVeto
- type DeletedState
- type Disapproved
- type DiscountLevel
- type Entity
- type EntityDeleted
- type EntityProof
- type EntityStored
- type EntryEvent
- type EventBatchCompletedWithErrors
- type EventDispatchedAs
- type EventItemFailed
- type EventRecords
- type EventSchedulerCallUnavailable
- type EventSchedulerPeriodicFailed
- type EventSchedulerPermanentlyOverweight
- type EventWithBalance
- type EventWithWho
- type Executed
- type Farm
- type FarmCertification
- type FarmCertificationSet
- type FarmDeleted
- type FarmMarkedAsDedicated
- type FarmPayoutV2AddressRegistered
- type FarmStored
- type FarmingPolicy
- type FarmingPolicyLimit
- type FarmingPolicySet
- type FarmingPolicyStored
- type FarmingPolicyUpdated
- type HexHash
- type IP
- type IPsFreed
- type IPsReserved
- type Identity
- type Interface
- type Location
- type Manager
- type MemberEvent
- type Meta
- type MintCompleted
- type MintTransaction
- type MintTransactionExpired
- type MintTransactionProposed
- type MintTransactionVoted
- type NameContract
- type NameContractCanceled
- type Node
- type NodeCertification
- type NodeCertificationSet
- type NodeCertifierAdded
- type NodeCertifierRemoved
- type NodeContract
- type NodeContractCanceled
- type NodeDeleted
- type NodeExtra
- type NodeExtraFeeSet
- type NodeMarkAsDedicated
- type NodePower
- type NodePublicConfig
- type NodeStored
- type NodeUptimeReported
- type NruConsumption
- type NruConsumptionReportReceived
- type OffchainWorkerExecuted
- type OptionBoardSerial
- type OptionDomain
- type OptionFarmingPolicyLimit
- type OptionIP
- type OptionPublicConfig
- type OptionRelay
- type Policy
- type Power
- type PowerState
- type PowerStateChanged
- type PowerTargetChanged
- type PriceStored
- type PricingPolicy
- type PricingPolicyStored
- type Proposed
- type Provider
- type PublicConfig
- type PublicIP
- type PublicIPInput
- type RefundTransaction
- type RefundTransactionCreated
- type RefundTransactionProcessed
- type RefundTransactionReady
- type RefundTransactionSignatureAdded
- type RentContract
- type RentContractCanceled
- type RentWaived
- type Resources
- type RewardDistributed
- type Role
- type ScannedNode
- type ServiceContract
- type ServiceContractBill
- type ServiceContractBilled
- type ServiceContractCanceled
- type ServiceContractCreated
- type ServiceContractState
- type SolutionProvider
- type SolutionProviderApproved
- type SolutionProviderCreated
- type StellarSignature
- type Substrate
- func (s *Substrate) AcceptTermsAndConditions(identity Identity, documentLink string, documentHash string) error
- func (s *Substrate) BatchAllCreateContract(identity Identity, contractData []BatchCreateContractData) ([]uint64, error)
- func (s *Substrate) BatchCancelContract(identity Identity, contracts []uint64) error
- func (s *Substrate) BatchCreateContract(identity Identity, contractData []BatchCreateContractData) ([]uint64, *int, error)
- func (s *Substrate) Call(cl Conn, meta Meta, identity Identity, call types.Call) (response *CallResponse, err error)
- func (s *Substrate) CallOnce(cl Conn, meta Meta, identity Identity, call types.Call) (hash types.Hash, err error)
- func (s *Substrate) CancelContract(identity Identity, contract uint64) error
- func (s *Substrate) Close()
- func (s *Substrate) CreateFarm(identity Identity, name string, publicIps []PublicIPInput) error
- func (s *Substrate) CreateNameContract(identity Identity, name string) (uint64, error)
- func (s *Substrate) CreateNode(identity Identity, node Node) (uint32, error)
- func (s *Substrate) CreateNodeContract(identity Identity, node uint32, body string, hash string, publicIPs uint32, ...) (uint64, error)
- func (s *Substrate) CreateRefundTransactionOrAddSig(identity Identity, tx_hash string, target string, amount int64, ...) error
- func (s *Substrate) CreateRentContract(identity Identity, node uint32, solutionProviderID *uint64) (uint64, error)
- func (s *Substrate) CreateTwin(identity Identity, relay string, pk []byte) (uint32, error)
- func (s *Substrate) EnsureAccount(identity Identity, ...) (info AccountInfo, err error)
- func (s *Substrate) FetchEventsForBlockRange(start uint32, end uint32) (types.StorageKey, []types.StorageChangeSet, error)
- func (s *Substrate) GetAccount(identity Identity) (info AccountInfo, err error)
- func (s *Substrate) GetAccountPublicInfo(account AccountID) (info AccountInfo, err error)
- func (s *Substrate) GetAverageTFTPrice() (price types.U32, err error)
- func (s *Substrate) GetBalance(account AccountID) (balance Balance, err error)
- func (s *Substrate) GetBlock(block types.Hash) (*types.SignedBlock, error)
- func (s *Substrate) GetBlockByNumber(blockNumber types.U32) (*types.SignedBlock, error)
- func (s *Substrate) GetBurnTransaction(burnTransactionID types.U64) (*BurnTransaction, error)
- func (s *Substrate) GetClient() (Conn, Meta, error)
- func (s *Substrate) GetContract(id uint64) (*Contract, error)
- func (s *Substrate) GetContractIDByNameRegistration(name string) (uint64, error)
- func (s *Substrate) GetContractWithHash(node uint32, hash HexHash) (uint64, error)
- func (s *Substrate) GetCurrentHeight() (uint32, error)
- func (s *Substrate) GetDedicatedNodePrice(nodeID uint32) (uint64, error)
- func (s *Substrate) GetDepositFee() (int64, error)
- func (s *Substrate) GetEntity(id uint32) (*Entity, error)
- func (s *Substrate) GetEventsForBlock(start uint32) (*EventRecords, error)
- func (s *Substrate) GetFarm(id uint32) (*Farm, error)
- func (s *Substrate) GetFarmByName(name string) (uint32, error)
- func (s *Substrate) GetLastNodeID() (uint32, error)
- func (s *Substrate) GetNode(id uint32) (*Node, error)
- func (s *Substrate) GetNodeByTwinID(twin uint32) (uint32, error)
- func (s *Substrate) GetNodeContracts(node uint32) ([]types.U64, error)
- func (s *Substrate) GetNodeRentContract(node uint32) (uint64, error)
- func (s *Substrate) GetNodes(farmID uint32) ([]uint32, error)
- func (s *Substrate) GetPowerTarget(nodeID uint32) (power NodePower, err error)
- func (s *Substrate) GetPricingPolicy(id uint32) (pricingPolicy PricingPolicy, err error)
- func (s *Substrate) GetRefundTransaction(txHash string) (*RefundTransaction, error)
- func (s *Substrate) GetServiceContract(id uint64) (*ServiceContract, error)
- func (s *Substrate) GetServiceContractID() (uint64, error)
- func (s *Substrate) GetTFTPrice() (price types.U32, err error)
- func (s *Substrate) GetTwin(id uint32) (*Twin, error)
- func (s *Substrate) GetTwinByPubKey(pk []byte) (uint32, error)
- func (s *Substrate) GetUser(id uint32) (*User, error)
- func (s *Substrate) GetZosVersion() (string, error)
- func (s *Substrate) IsBurnedAlready(burnTransactionID types.U64) (exists bool, err error)
- func (s *Substrate) IsMintedAlready(mintTxID string) (exists bool, err error)
- func (s *Substrate) IsRefundedAlready(txHash string) (exists bool, err error)
- func (s *Substrate) IsValidator(identity Identity) (exists bool, err error)
- func (s *Substrate) KVStoreDelete(identity Identity, key string) error
- func (s *Substrate) KVStoreGet(identity Identity, key string) ([]byte, error)
- func (s *Substrate) KVStoreList(identity Identity) (map[string]string, error)
- func (s *Substrate) KVStoreSet(identity Identity, key string, value string) error
- func (s *Substrate) ProposeBurnTransactionOrAddSig(identity Identity, txID uint64, target string, amount *big.Int, ...) error
- func (s *Substrate) ProposeOrVoteMintTransaction(identity Identity, txID string, target AccountID, amount *big.Int) error
- func (s *Substrate) Report(identity Identity, consumptions []NruConsumption) (types.Hash, error)
- func (s *Substrate) ScanNodes(ctx context.Context, from, to uint32) (<-chan ScannedNode, error)
- func (s *Substrate) ServiceContractApprove(identity Identity, contract uint64) error
- func (s *Substrate) ServiceContractBill(identity Identity, contract uint64, variable_amount uint64, metadata string) error
- func (s *Substrate) ServiceContractCancel(identity Identity, contract uint64) error
- func (s *Substrate) ServiceContractCreate(identity Identity, service AccountID, consumer AccountID) (uint64, error)
- func (s *Substrate) ServiceContractReject(identity Identity, contract uint64) error
- func (s *Substrate) ServiceContractSetFees(identity Identity, contract uint64, base_fee uint64, variable_fee uint64) error
- func (s *Substrate) ServiceContractSetMetadata(identity Identity, contract uint64, metadata string) error
- func (s *Substrate) SetBurnTransactionExecuted(identity Identity, txID uint64) error
- func (s *Substrate) SetContractConsumption(identity Identity, resources ...ContractResources) error
- func (s *Substrate) SetDedicatedNodePrice(identity Identity, nodeId uint32, price uint64) (hash types.Hash, err error)
- func (s *Substrate) SetNodeCertificate(identity Identity, id uint32, cert NodeCertification) error
- func (s *Substrate) SetNodePowerState(identity Identity, up bool) (hash types.Hash, err error)
- func (s *Substrate) SetNodePowerTarget(identity Identity, nodeID uint32, up bool) (hash types.Hash, err error)
- func (s *Substrate) SetRefundTransactionExecuted(identity Identity, txHash string) error
- func (s *Substrate) SignedTermsAndConditions(account AccountID) ([]TermsAndConditions, error)
- func (s *Substrate) SwapToStellar(identity Identity, targetStellarAddress string, amount big.Int) error
- func (s *Substrate) Time() (t time.Time, err error)
- func (s *Substrate) Transfer(identity Identity, amount uint64, destination AccountID) error
- func (s *Substrate) UpdateNode(identity Identity, node Node) (uint32, error)
- func (s *Substrate) UpdateNodeContract(identity Identity, contract uint64, body string, hash string) (uint64, error)
- func (s *Substrate) UpdateNodeUptime(identity Identity, uptime uint64) (hash types.Hash, err error)
- func (s *Substrate) UpdateNodeUptimeV2(identity Identity, uptime, timestampHint uint64) (hash types.Hash, err error)
- func (s *Substrate) UpdateTwin(identity Identity, relay string, pk []byte) (uint32, error)
- type TermsAndConditions
- type TokensBurned
- type Twin
- type TwinAccountBounded
- type TwinDeleted
- type TwinEntityRemoved
- type TwinEntityStored
- type TwinStored
- type Unit
- type UpdatedUsedResources
- type User
- type Val
- type Validator
- type ValidatorAdded
- type ValidatorApproved
- type ValidatorCreated
- type ValidatorRemoved
- type ValidatorRequestState
- type Versioned
- type Voted
- type ZosVersionUpdated
Constants ¶
const ( // TFT in uTFT TFT = 10_000_000 // uTFT // ReactivateThreshold is threshold to reactivate the account if funds went below that ReactivateThreshold = TFT * 0.001 // uTFT )
Variables ¶
var ( ErrBurnTransactionNotFound = fmt.Errorf("burn tx not found") ErrRefundTransactionNotFound = fmt.Errorf("refund tx not found") ErrFailedToDecode = fmt.Errorf("failed to decode events, skipping") )
var ( //ErrInvalidVersion is returned if version 4bytes is invalid ErrInvalidVersion = fmt.Errorf("invalid version") //ErrUnknownVersion is returned if version number is not supported ErrUnknownVersion = fmt.Errorf("unknown version") //ErrNotFound is returned if an object is not found ErrNotFound = fmt.Errorf("object not found") //ErrClosed is returned if the client is closed ErrClosed = fmt.Errorf("client closed") )
var ( ErrIsUsurped = fmt.Errorf("is usurped") Gigabyte = 1024 * 1024 * 1024 )
var (
ErrAccountNotFound = fmt.Errorf("account not found")
)
var ErrDepositFeeNotFound = fmt.Errorf("deposit fee not found")
var (
ErrMintTransactionNotFound = fmt.Errorf("mint tx not found")
)
Functions ¶
func FromKeyBytes ¶
func HexEncodeToString ¶
Types ¶
type AccountID ¶
AccountID type
func FromAddress ¶
FromAddress creates an AccountID from a SS58 address
func (AccountID) MarshalJSON ¶
MarshalJSON implementation
type AccountInfo ¶
type ActivationServiceError ¶
type ActivationServiceError struct { StatusCode int // 0 or a valid HTTP status code. 0 indicates that a response was not received due to an error such host unreachable. Err error }
TODO: Add service response status code if avialble
func (ActivationServiceError) Error ¶
func (e ActivationServiceError) Error() string
type Balance ¶
type Balance struct { Free types.U128 `json:"free"` Reserved types.U128 `json:"reserved"` MiscFrozen types.U128 `json:"misc_frozen"` FreeFrozen types.U128 `json:"free_frozen"` }
Balance
type BalancesMinted ¶
type BatchCreateContractData ¶
type BatchCreateContractData struct { Node uint32 `json:"node"` Body string `json:"body"` Hash string `json:"hash"` PublicIPs uint32 `json:"public_ips"` SolutionProviderID *uint64 `json:"solution_provider_id"` // for name contracts. if set the contract is assumed to be a name contract // and other fields are ignored Name string `json:"name"` }
BatchCreateContractData struct for batch create contract
type BillingFrequencyChanged ¶
type BlockNumber ¶
type BridgeBurnTransactionCreated ¶
type BridgeBurnTransactionCreated struct { Phase types.Phase BurnTransactionID types.U64 `json:"burn_transaction_id"` Source types.AccountID `json:"source"` Target []byte `json:"target"` Amount types.U64 `json:"amount"` Topics []types.Hash }
BridgeBurnTransactionCreated
type BridgeBurnTransactionExpired ¶
type BridgeBurnTransactionExpired struct { Phase types.Phase BurnTransactionID types.U64 `json:"burn_transaction_id"` Source types.OptionAccountID `json:"source"` Target []byte `json:"target"` Amount types.U64 `json:"amount"` Topics []types.Hash }
BridgeBurnTransactionExpired
type BurnTransaction ¶
type BurnTransaction struct { Block BlockNumber `json:"block"` Amount types.U64 `json:"amount"` Source types.OptionAccountID `json:"source"` Target string `json:"target"` Signatures []StellarSignature `json:"signatures"` SequenceNumber types.U64 `json:"sequence_number"` }
type BurnTransactionCreated ¶
type BurnTransactionProcessed ¶
type BurnTransactionProcessed struct { Phase types.Phase Burn BurnTransaction `json:"burn"` Topics []types.Hash }
BurnTransactionProcessed
type BurnTransactionProposed ¶
type BurnTransactionProposed struct { Phase types.Phase BurnTransactionID types.U64 `json:"burn_transaction_id"` Target []byte `json:"target"` Amount types.U64 `json:"amount"` Topics []types.Hash }
BurnTransactionProposed
type BurnTransactionReady ¶
type BurnTransactionReady struct { Phase types.Phase BurnTransactionID types.U64 `json:"burn_transaction_id"` Topics []types.Hash }
BurnTransactionReady
type BurnTransactionSignatureAdded ¶
type BurnTransactionSignatureAdded struct { Phase types.Phase BurnTransactionID types.U64 `json:"burn_transaction_id"` Signature StellarSignature `json:"signature"` Topics []types.Hash }
BurnTransactionSignatureAdded
type CallResponse ¶
type CallResponse struct { Hash types.Hash Events *EventRecords Block *types.SignedBlock Identity Identity }
type CertificationCodeStored ¶
type CertificationCodeStored struct { Phase types.Phase Codes CertificationCodes `json:"contract_id"` Topics []types.Hash }
type CertificationCodes ¶
type ClosedByCouncil ¶
type Conn ¶
type Conn = *gsrpc.SubstrateAPI
type ConnectionPriceSet ¶
type Consumption ¶
type Consumption struct { ContractID types.U64 `json:"contract_id"` Timestamp types.U64 `json:"timestamp"` CRU types.U64 `json:"cru"` SRU types.U64 `json:"sru"` HRU types.U64 `json:"hru"` MRU types.U64 `json:"mru"` NRU types.U64 `json:"nru"` }
Consumption structure
type ConsumptionReportReceived ¶
type ConsumptionReportReceived struct { Phase types.Phase Consumption Consumption `json:"consumption"` Topics []types.Hash }
DEPRECATED ConsumptionReportReceived
type Contract ¶
type Contract struct { Versioned State ContractState `json:"state"` ContractID types.U64 `json:"contract_id"` TwinID types.U32 `json:"twin_id"` ContractType ContractType `json:"contract_type"` SolutionProviderID types.OptionU64 `json:"solution_provider_id"` }
Contract structure
type ContractBill ¶
type ContractBill struct { ContractID types.U64 `json:"contract_id"` Timestamp types.U64 `json:"timestamp"` DiscountLevel DiscountLevel `json:"discount_level"` AmountBilled types.U128 `json:"amount_billed"` }
ContractBill structure
type ContractBilled ¶
type ContractBilled struct { Phase types.Phase ContractBill ContractBill `json:"contract_bill"` Topics []types.Hash }
ContractBilled
type ContractCreated ¶
type ContractCreated struct { Phase types.Phase Contract Contract `json:"contract"` Topics []types.Hash }
ContractCreated is the contract created event
type ContractDeployed ¶
type ContractDeployed struct { Phase types.Phase ContractID types.U64 `json:"contract_id"` AccountID AccountID `json:"account_id"` Topics []types.Hash }
ContractDeployed
type ContractResources ¶
type ContractState ¶
type ContractState struct { IsCreated bool `json:"is_created"` IsDeleted bool `json:"is_deleted"` AsDeleted DeletedState `json:"as_deleted"` IsGracePeriod bool `json:"is_grace_period"` AsGracePeriodBlockNumber types.U64 `json:"as_grace_period_block_number"` }
ContractState enum
type ContractType ¶
type ContractType struct { IsNodeContract bool `json:"is_node_contract"` NodeContract NodeContract `json:"node_contract"` IsNameContract bool `json:"is_name_contract"` NameContract NameContract `json:"name_contract"` IsRentContract bool `json:"is_rent_contract"` RentContract RentContract `json:"rent_contract"` }
type ContractUpdated ¶
type ContractUpdated struct { Phase types.Phase Contract Contract `json:"contract"` Topics []types.Hash }
ContractUpdated is the contract updated event
type CouncilMemberVeto ¶
type DeletedState ¶
type DeletedState struct { IsCanceledByUser bool `json:"is_canceled_by_user"` IsOutOfFunds bool `json:"is_out_of_funds"` IsCanceledByCollective bool `json:"is_canceled_by_collective"` }
type Disapproved ¶
type DiscountLevel ¶
type DiscountLevel struct { IsNone bool `json:"is_none"` IsDefault bool `json:"is_default"` IsBronze bool `json:"is_bronze"` IsSilver bool `json:"is_silver"` IsGold bool `json:"is_gold"` }
DiscountLevel enum
type Entity ¶
type Entity struct { Versioned ID types.U32 `json:"id"` Name string `json:"name"` Account AccountID `json:"account_id"` Country string `json:"country"` City string `json:"city"` }
Entity type
type EntityDeleted ¶
type EntityProof ¶
type EntityProof struct { EntityID types.U32 `json:"entity_id"` Signature string `json:"signature"` }
EntityProof struct
type EntityStored ¶
type EntryEvent ¶
type EventDispatchedAs ¶
type EventItemFailed ¶
type EventRecords ¶
type EventRecords struct { types.EventRecords SmartContractModule_ContractCreated []ContractCreated //nolint:stylecheck,golint SmartContractModule_ContractUpdated []ContractUpdated //nolint:stylecheck,golint SmartContractModule_NodeContractCanceled []NodeContractCanceled //nolint:stylecheck,golint SmartContractModule_NameContractCanceled []NameContractCanceled //nolint:stylecheck,golint SmartContractModule_IPsReserved []IPsReserved //nolint:stylecheck,golint SmartContractModule_IPsFreed []IPsFreed //nolint:stylecheck,golint SmartContractModule_ContractDeployed []ContractDeployed //nolint:stylecheck,golint SmartContractModule_ConsumptionReportReceived []ConsumptionReportReceived //nolint:stylecheck,golint SmartContractModule_ContractBilled []ContractBilled //nolint:stylecheck,golint SmartContractModule_TokensBurned []TokensBurned //nolint:stylecheck,golint SmartContractModule_UpdatedUsedResources []UpdatedUsedResources //nolint:stylecheck,golint SmartContractModule_NruConsumptionReportReceived []NruConsumptionReportReceived //nolint:stylecheck,golint SmartContractModule_RentContractCanceled []RentContractCanceled //nolint:stylecheck,golint SmartContractModule_ContractGracePeriodStarted []ContractGracePeriodStarted //nolint:stylecheck,golint SmartContractModule_ContractGracePeriodEnded []ContractGracePeriodEnded //nolint:stylecheck,golint SmartContractModule_NodeMarkedAsDedicated []NodeMarkAsDedicated //nolint:stylecheck,golint SmartContractModule_SolutionProviderCreated []SolutionProviderCreated //nolint:stylecheck,golint SmartContractModule_SolutionProviderApproved []SolutionProviderApproved //nolint:stylecheck,golint SmartContractModule_ServiceContractCreated []ServiceContractCreated //nolint:stylecheck,golint SmartContractModule_ServiceContractMetadataSet []ServiceContractCreated //nolint:stylecheck,golint SmartContractModule_ServiceContractFeesSet []ServiceContractCreated //nolint:stylecheck,golint SmartContractModule_ServiceContractApproved []ServiceContractCreated //nolint:stylecheck,golint SmartContractModule_ServiceContractCanceled []ServiceContractCanceled //nolint:stylecheck,golint SmartContractModule_ServiceContractBilled []ServiceContractBilled //nolint:stylecheck,golint SmartContractModule_BillingFrequencyChanged []BillingFrequencyChanged //nolint:stylecheck,golint SmartContractModule_NodeExtraFeeSet []NodeExtraFeeSet //nolint:stylecheck,golint SmartContractModule_RentWaived []RentWaived //nolint:stylecheck,golint SmartContractModule_ContractGracePeriodElapsed []ContractGracePeriodElapsed //nolint:stylecheck,golint SmartContractModule_ContractPaymentOverdrawn []ContractPaymentOverdrawn //nolint:stylecheck,golint SmartContractModule_RewardDistributed []RewardDistributed //nolint:stylecheck,golint // farm events TfgridModule_FarmStored []FarmStored //nolint:stylecheck,golint TfgridModule_FarmUpdated []FarmStored //nolint:stylecheck,golint TfgridModule_FarmDeleted []FarmDeleted //nolint:stylecheck,golint // node events TfgridModule_NodeStored []NodeStored //nolint:stylecheck,golint TfgridModule_NodeUpdated []NodeStored //nolint:stylecheck,golint TfgridModule_NodeDeleted []NodeDeleted //nolint:stylecheck,golint TfgridModule_NodeUptimeReported []NodeUptimeReported //nolint:stylecheck,golint TfgridModule_NodePublicConfigStored []NodePublicConfig //nolint:stylecheck,golint TfgridModule_PowerTargetChanged []PowerTargetChanged //nolint:stylecheck,golint TfgridModule_PowerStateChanged []PowerStateChanged //nolint:stylecheck,golint // entity events TfgridModule_EntityStored []EntityStored //nolint:stylecheck,golint TfgridModule_EntityUpdated []EntityStored //nolint:stylecheck,golint TfgridModule_EntityDeleted []EntityDeleted //nolint:stylecheck,golint // twin events TfgridModule_TwinStored []TwinStored //nolint:stylecheck,golint TfgridModule_TwinUpdated []TwinStored //nolint:stylecheck,golint TfgridModule_TwinDeleted []TwinDeleted //nolint:stylecheck,golint TfgridModule_TwinEntityStored []TwinEntityStored //nolint:stylecheck,golint TfgridModule_TwinEntityRemoved []TwinEntityRemoved //nolint:stylecheck,golint TfgridModule_TwinAccountBounded []TwinAccountBounded //nolint:stylecheck,golint // policy events TfgridModule_PricingPolicyStored []PricingPolicyStored //nolint:stylecheck,golint TfgridModule_FarmingPolicyStored []FarmingPolicyStored //nolint:stylecheck,golint // other events TfgridModule_FarmPayoutV2AddressRegistered []FarmPayoutV2AddressRegistered //nolint:stylecheck,golint TfgridModule_FarmMarkedAsDedicated []FarmMarkedAsDedicated //nolint:stylecheck,golint TfgridModule_ConnectionPriceSet []ConnectionPriceSet //nolint:stylecheck,golint TfgridModule_NodeCertificationSet []NodeCertificationSet //nolint:stylecheck,golint TfgridModule_NodeCertifierAdded []NodeCertifierAdded //nolint:stylecheck,golint TfgridModule_NodeCertifierRemoved []NodeCertifierRemoved //nolint:stylecheck,golint TfgridModule_FarmingPolicyUpdated []FarmingPolicyUpdated //nolint:stylecheck,golint TfgridModule_FarmingPolicySet []FarmingPolicySet //nolint:stylecheck,golint TfgridModule_FarmCertificationSet []FarmCertificationSet //nolint:stylecheck,golint TfgridModule_ZosVersionUpdated []ZosVersionUpdated //nolint:stylecheck,golint // burn module events BurningModule_BurnTransactionCreated []BurnTransactionCreated //nolint:stylecheck,golint // mints TFTBridgeModule_MintTransactionProposed []MintTransactionProposed //nolint:stylecheck,golint TFTBridgeModule_MintTransactionVoted []MintTransactionVoted //nolint:stylecheck,golint TFTBridgeModule_MintCompleted []MintCompleted //nolint:stylecheck,golint TFTBridgeModule_MintTransactionExpired []MintTransactionExpired //nolint:stylecheck,golint // burns TFTBridgeModule_BurnTransactionCreated []BridgeBurnTransactionCreated //nolint:stylecheck,golint TFTBridgeModule_BurnTransactionProposed []BurnTransactionProposed //nolint:stylecheck,golint TFTBridgeModule_BurnTransactionSignatureAdded []BurnTransactionSignatureAdded //nolint:stylecheck,golint TFTBridgeModule_BurnTransactionReady []BurnTransactionReady //nolint:stylecheck,golint TFTBridgeModule_BurnTransactionProcessed []BurnTransactionProcessed //nolint:stylecheck,golint TFTBridgeModule_BurnTransactionExpired []BridgeBurnTransactionExpired //nolint:stylecheck,golint // refunds TFTBridgeModule_RefundTransactionCreated []RefundTransactionCreated //nolint:stylecheck,golint TFTBridgeModule_RefundTransactionsignatureAdded []RefundTransactionSignatureAdded //nolint:stylecheck,golint TFTBridgeModule_RefundTransactionReady []RefundTransactionReady //nolint:stylecheck,golint TFTBridgeModule_RefundTransactionProcessed []RefundTransactionProcessed //nolint:stylecheck,golint TFTBridgeModule_RefundTransactionExpired []RefundTransactionCreated //nolint:stylecheck,golint // TFTPrice module TFTPriceModule_PriceStored []PriceStored //nolint:stylecheck,golint TFTPriceModule_AveragePriceStored []PriceStored //nolint:stylecheck,golint TFTPriceModule_OffchainWorkerExecuted []OffchainWorkerExecuted //nolint:stylecheck,golint TFTPriceModule_AveragePriceIsAboveMaxPrice []AveragePriceIsAboveMaxPrice TFTPriceModule_AveragePriceIsBelowMinPrice []AveragePriceIsAboveMinPrice // KVStore TFKVStore_EntrySet []EntryEvent //nolint:stylecheck,golint TFKVStore_EntryGot []EntryEvent //nolint:stylecheck,golint TFKVStore_EntryTaken []EntryEvent //nolint:stylecheck,golint // Validatorset pallet ValidatorSet_ValidatorAdditionInitiated []ValidatorAdded //nolint:stylecheck,golint ValidatorSet_ValidatorRemovalInitiated []ValidatorRemoved //nolint:stylecheck,golint Validator_Bonded []Bonded //nolint:stylecheck,golint Validator_ValidatorRequestCreated []ValidatorCreated //nolint:stylecheck,golint Validator_ValidatorRequestApproved []ValidatorApproved //nolint:stylecheck,golint Validator_ValidatorActivated []ValidatorApproved //nolint:stylecheck,golint Validator_ValidatorRemoved []ValidatorApproved //nolint:stylecheck,golint Validator_NodeValidatorChanged []Bonded //nolint:stylecheck,golint Validator_NodeValidatorRemoved []Bonded //nolint:stylecheck,golint CouncilMembership_MemberAdded []MemberEvent //nolint:stylecheck,golint CouncilMembership_MemberRemoved []MemberEvent //nolint:stylecheck,golint CouncilMembership_MembersSwapped []MemberEvent //nolint:stylecheck,golint CouncilMembership_MembersReset []MemberEvent //nolint:stylecheck,golint CouncilMembership_KeyChanged []MemberEvent //nolint:stylecheck,golint CouncilMembership_Dummy []MemberEvent //nolint:stylecheck,golint // Dao Pallet Dao_Voted []Voted //nolint:stylecheck,golint Dao_Proposed []Proposed //nolint:stylecheck,golint Dao_Approved []Approved //nolint:stylecheck,golint Dao_Disapproved []Disapproved //nolint:stylecheck,golint Dao_Executed []Executed //nolint:stylecheck,golint Dao_Closed []Closed //nolint:stylecheck,golint Dao_ClosedByCouncil []ClosedByCouncil //nolint:stylecheck,golint Dao_CouncilMemberVeto []CouncilMemberVeto //nolint:stylecheck,golint // Scheduler Pallet (temporary until go-substrate-rpc-client is fixed: https://github.com/centrifuge/go-substrate-rpc-client/issues/344) Scheduler_PeriodicFailed []EventSchedulerPeriodicFailed `test-gen-blockchain:"polkadot"` Scheduler_PermanentlyOverweight []EventSchedulerPermanentlyOverweight `test-gen-blockchain:"polkadot"` Utility_BatchCompletedWithErrors []EventBatchCompletedWithErrors `test-gen-blockchain:"centrifuge-parachain"` Utility_ItemFailed []EventItemFailed `test-gen-blockchain:"centrifuge-parachain"` Utility_DispatchedAs []EventDispatchedAs `test-gen-blockchain:"centrifuge-parachain"` // overrides Balances_Minted []BalancesMinted //nolint:stylecheck,golint Balances_BalanceSet []BalancesMinted //nolint:stylecheck,golint Balances_Burned []BalancesMinted //nolint:stylecheck,golint Balances_Suspended []BalancesMinted //nolint:stylecheck,golint Balances_Restored []BalancesMinted //nolint:stylecheck,golint Balances_Upgraded []EventWithWho //nolint:stylecheck,golint Balances_Issued []EventWithBalance //nolint:stylecheck,golint Balances_Rescinded []EventWithBalance //nolint:stylecheck,golint Balances_Locked []BalancesMinted //nolint:stylecheck,golint Balances_Unlocked []BalancesMinted //nolint:stylecheck,golint Balances_Frozen []BalancesMinted //nolint:stylecheck,golint Balances_Thawed []BalancesMinted //nolint:stylecheck,golint }
EventRecords is a struct that extends the default events with our events
type EventSchedulerCallUnavailable ¶
type EventSchedulerCallUnavailable struct {}
type EventSchedulerPeriodicFailed ¶
type EventSchedulerPeriodicFailed struct { Phase types.Phase Task types.TaskAddress ID types.OptionBytes Topics []types.Hash }
type EventSchedulerPermanentlyOverweight ¶
type EventSchedulerPermanentlyOverweight struct { Phase types.Phase Task types.TaskAddress ID types.OptionBytes Topics []types.Hash }
type EventWithBalance ¶
type EventWithWho ¶
type Farm ¶
type Farm struct { Versioned ID types.U32 `json:"id"` Name string `json:"name"` TwinID types.U32 `json:"twin_id"` PricingPolicyID types.U32 `json:"pricing_policy_id"` CertificationType FarmCertification `json:"certification_type"` PublicIPs []PublicIP `json:"public_ips"` DedicatedFarm bool `json:"dedicated_farm"` FarmingPoliciesLimit OptionFarmingPolicyLimit `json:"farming_policies_limit"` }
Farm type
type FarmCertification ¶
type FarmCertification struct { IsNotCertified bool `json:"is_not_certified"` IsGold bool `json:"is_gold"` }
NodeCertification is a substrate enum
type FarmCertificationSet ¶
type FarmDeleted ¶
type FarmMarkedAsDedicated ¶
type FarmStored ¶
type FarmingPolicy ¶
type FarmingPolicy struct { Versioned ID types.U32 `json:"id"` Name string `json:"name"` CU types.U32 `json:"cu"` SU types.U32 `json:"su"` NU types.U32 `json:"nu"` IPv4 types.U32 `json:"ipv4"` MinimalUptime types.U16 `json:"minimal_uptime"` PolicyCreated types.U32 `json:"policy_created"` PolicyEnd types.U32 `json:"policy_end"` Immutable bool `json:"immutable"` Default bool `json:"default"` NodeCertification NodeCertification `json:"node_certification"` FarmCertification FarmCertification `json:"farm_certification"` }
type FarmingPolicyLimit ¶
type FarmingPolicySet ¶
type FarmingPolicyStored ¶
type FarmingPolicyStored struct { Phase types.Phase Policy FarmingPolicy `json:"farming_policy"` Topics []types.Hash }
type FarmingPolicyUpdated ¶
type FarmingPolicyUpdated struct { Phase types.Phase FarmingPolicy FarmingPolicy `json:"farming_policy"` Topics []types.Hash }
type HexHash ¶
type HexHash [32]byte
func NewHexHash ¶
NewHexHash will create a new hash from a hex input (32 bytes)
type IPsFreed ¶
type IPsFreed struct { Phase types.Phase ContractID types.U64 `json:"contract_id"` IPs []PublicIP `json:"ips"` Topics []types.Hash }
IPsFreed
type IPsReserved ¶
type IPsReserved struct { Phase types.Phase ContractID types.U64 `json:"contract_id"` IPs []PublicIP `json:"ips"` Topics []types.Hash }
IPsReserved
type Identity ¶
type Identity interface { KeyPair() (subkey.KeyPair, error) Sign(data []byte) ([]byte, error) Type() string MultiSignature(sig []byte) types.MultiSignature Address() string PublicKey() []byte URI() string }
Identity is a user identity
func NewIdentityFromEd25519Key ¶
func NewIdentityFromEd25519Key(sk ed25519.PrivateKey) (Identity, error)
type Location ¶
type Location struct { City string `json:"city"` Country string `json:"country"` Latitude string `json:"latitude"` Longitude string `json:"longitude"` }
Location type
type Manager ¶
func NewManager ¶
type MemberEvent ¶
to handle council member events that are not defined in base types
type MintCompleted ¶
type MintCompleted struct { Phase types.Phase MintTransaction MintTransaction `json:"mint_transaction"` TxHash string `json:"tx_hash"` Topics []types.Hash }
MintCompleted
type MintTransaction ¶
type MintTransactionExpired ¶
type MintTransactionExpired struct { Phase types.Phase TxHash string `json:"tx_hash"` Amount types.U64 `json:"amount"` Target AccountID `json:"target"` Topics []types.Hash }
MintTransactionExpired
type MintTransactionProposed ¶
type MintTransactionProposed struct { Phase types.Phase TxHash string `json:"tx_hash"` Target AccountID `json:"target"` Amount types.U64 `json:"amount"` Topics []types.Hash }
MintTransactionProposed
type MintTransactionVoted ¶
type MintTransactionVoted struct { Phase types.Phase TxHash string `json:"tx_hash"` Topics []types.Hash }
MintTransactionVoted
type NameContract ¶
type NameContract struct {
Name string `json:"name"`
}
type NameContractCanceled ¶
type NameContractCanceled struct { Phase types.Phase ContractID types.U64 `json:"contract_id"` Topics []types.Hash }
NameContractCanceled
type Node ¶
type Node struct { Versioned ID types.U32 `json:"id"` FarmID types.U32 `json:"farm_id"` TwinID types.U32 `json:"twin_id"` Resources Resources `json:"resources"` Location Location `json:"location"` PublicConfig OptionPublicConfig `json:"public_config"` Created types.U64 `json:"created"` FarmingPolicy types.U32 `json:"farming_policy"` Interfaces []Interface `json:"interfaces"` Certification NodeCertification `json:"certification"` SecureBoot bool `json:"secure_boot"` Virtualized bool `json:"virtualized"` BoardSerial OptionBoardSerial `json:"board_serial"` ConnectionPrice types.U32 `json:"connection_price"` }
Node type
type NodeCertification ¶
NodeCertification is a substrate enum
type NodeCertificationSet ¶
type NodeCertifierAdded ¶
type NodeCertifierRemoved ¶
type NodeContract ¶
type NodeContractCanceled ¶
type NodeContractCanceled struct { Phase types.Phase ContractID types.U64 `json:"contract_id"` Node types.U32 `json:"node_id"` Twin types.U32 `json:"twin_id"` Topics []types.Hash }
NodeContractCanceled
type NodeDeleted ¶
type NodeExtra ¶
type NodeExtra struct { Secure bool `json:"secure"` Virtualized bool `json:"virtualized"` SerialNumber OptionBoardSerial `json:"serial_number"` }
type NodeExtraFeeSet ¶
type NodeMarkAsDedicated ¶
type NodePower ¶
type NodePower struct { State PowerState `json:"state"` Target Power `json:"target"` }
type NodePublicConfig ¶
type NodeStored ¶
type NodeUptimeReported ¶
type NruConsumption ¶
type NruConsumption struct { ContractID types.U64 `json:"contract_id"` Timestamp types.U64 `json:"timestamp"` Window types.U64 `json:"window"` NRU types.U64 `json:"nru"` }
Consumption structure
func (*NruConsumption) IsEmpty ¶
func (s *NruConsumption) IsEmpty() bool
IsEmpty true if consumption is zero
type NruConsumptionReportReceived ¶
type NruConsumptionReportReceived struct { Phase types.Phase Consumption NruConsumption `json:"consumption"` Topics []types.Hash }
ConsumptionReportReceived
type OffchainWorkerExecuted ¶
type OptionBoardSerial ¶
OptionBoardSerial type
type OptionDomain ¶
type OptionFarmingPolicyLimit ¶
type OptionFarmingPolicyLimit struct { HasValue bool `json:"has_value"` AsValue FarmingPolicyLimit `json:"as_value"` }
OptionFarmingPolicyLimit type
type OptionPublicConfig ¶
type OptionPublicConfig struct { HasValue bool `json:"has_value"` AsValue PublicConfig `json:"as_value"` }
OptionPublicConfig type
type OptionRelay ¶
OptionRelay type
type PowerState ¶
type PowerState struct { IsUp bool `json:"is_up"` IsDown bool `json:"is_down"` AsDownBlockNumber BlockNumber `json:"as_down_block_number"` }
type PowerStateChanged ¶
type PowerTargetChanged ¶
type PriceStored ¶
type PricingPolicy ¶
type PricingPolicy struct { Versioned ID types.U32 `json:"id"` Name string `json:"name"` SU Policy `json:"su"` CU Policy `json:"cu"` NU Policy `json:"nu"` IPU Policy `json:"ipu"` UniqueName Policy `json:"unique_name"` DomainName Policy `json:"domain_name"` FoundationAccount AccountID `json:"foundation_name"` CertifiedSalesAccount AccountID `json:"certified_sales_account"` DedicatedNodesDiscount types.U8 `json:"dedication_nodes_discount"` }
PricingPolicy struct represents a PricingPolicy
type PricingPolicyStored ¶
type PricingPolicyStored struct { Phase types.Phase Policy PricingPolicy `json:"pricing_policy"` Topics []types.Hash }
type PublicConfig ¶
type PublicConfig struct { IP4 IP `json:"ip4"` IP6 OptionIP `json:"ip6"` Domain OptionDomain `json:"domain"` }
PublicConfig type
type PublicIP ¶
type PublicIP struct { IP string `json:"ip"` Gateway string `json:"gateway"` ContractID types.U64 `json:"contract_id"` }
PublicIP structure
type PublicIPInput ¶
PublicIPInput structure
type RefundTransaction ¶
type RefundTransactionCreated ¶
type RefundTransactionCreated struct { Phase types.Phase RefundTransactionHash []byte `json:"refund_transaction_hash"` Target []byte `json:"target"` Amount types.U64 `json:"amount"` Topics []types.Hash }
RefundTransactionCreated
type RefundTransactionProcessed ¶
type RefundTransactionProcessed struct { Phase types.Phase RefundTransactionHash RefundTransaction `json:"refund_transaction_hash"` Topics []types.Hash }
RefundTransactionProcessed
type RefundTransactionReady ¶
type RefundTransactionReady struct { Phase types.Phase RefundTransactionHash []byte `json:"refund_transaction_hash"` Topics []types.Hash }
RefundTransactionReady
type RefundTransactionSignatureAdded ¶
type RefundTransactionSignatureAdded struct { Phase types.Phase RefundTransactionHash []byte `json:"refund_transaction_hash"` Signature StellarSignature `json:"signature"` Topics []types.Hash }
RefundTransactionSignatureAdded
type RentContract ¶
type RentContractCanceled ¶
type RentContractCanceled struct { Phase types.Phase ContractID types.U64 `json:"contract_id"` Topics []types.Hash }
RentContractCanceled
type RentWaived ¶
type Resources ¶
type Resources struct { HRU types.U64 `json:"hru"` SRU types.U64 `json:"sru"` CRU types.U64 `json:"cru"` MRU types.U64 `json:"mru"` }
Resources type
type RewardDistributed ¶
type ScannedNode ¶
type ServiceContract ¶
type ServiceContract struct { ServiceContractID types.U64 `json:"service_contract_id"` ServiceTwinID types.U32 `json:"service_twin_id"` ConsumerTwinID types.U32 `json:"consumer_twin_id"` BaseFee types.U64 `json:"base_fee"` VariableFee types.U64 `json:"variable_fee"` Metadata string `json:"metadata"` AcceptedByService bool `json:"accepted_by_service"` AcceptedByConsumer bool `json:"accepted_by_consumer"` LastBill types.U64 `json:"last_bill"` State ServiceContractState `json:"state"` }
ServiceContract struct
type ServiceContractBill ¶
type ServiceContractBill struct { VariableAmount types.U64 `json:"variable_amount"` Window types.U64 `json:"window"` Metadata string `json:"metadata"` }
ServiceContractBill struct
type ServiceContractBilled ¶
type ServiceContractBilled struct { Phase types.Phase ServiceContract ServiceContract `json:"service_contract"` ServiceContractBill ServiceContractBill `json:"service_contract_bill"` Amount types.U128 `json:"amount"` Topics []types.Hash }
ServiceContractBilled
type ServiceContractCanceled ¶
type ServiceContractCanceled struct { Phase types.Phase ServiceContractID types.U64 `json:"service_contract_id"` Cause DeletedState `json:"cause"` Topics []types.Hash }
ServiceContractCanceled
type ServiceContractCreated ¶
type ServiceContractCreated struct { Phase types.Phase ServiceContract ServiceContract `json:"service_contract"` Topics []types.Hash }
ServiceContractCreated
type ServiceContractState ¶
type ServiceContractState struct { IsCreated bool `json:"is_created"` IsAgreementReady bool `json:"is_agreement_ready"` IsApprovedByBoth bool `json:"is_approved_by_both"` }
ServiceContractState enum
type SolutionProvider ¶
type SolutionProviderCreated ¶
type SolutionProviderCreated struct { Phase types.Phase SolutionProvider SolutionProvider `json:"solution_provider"` Topics []types.Hash }
type StellarSignature ¶
type Substrate ¶
type Substrate struct {
// contains filtered or unexported fields
}
Substrate client
func (*Substrate) AcceptTermsAndConditions ¶
func (s *Substrate) AcceptTermsAndConditions(identity Identity, documentLink string, documentHash string) error
AcceptTermsAndConditions accepts terms and conditions
func (*Substrate) BatchAllCreateContract ¶
func (s *Substrate) BatchAllCreateContract(identity Identity, contractData []BatchCreateContractData) ([]uint64, error)
BatchAllCreateContract creates a batch of contracts for deployments atomically. transaction will rollback on error
func (*Substrate) BatchCancelContract ¶
BatchCancelContract cancels a batch of contracts
func (*Substrate) BatchCreateContract ¶
func (s *Substrate) BatchCreateContract(identity Identity, contractData []BatchCreateContractData) ([]uint64, *int, error)
BatchCreateContract creates a batch of contracts for deployments non-atomically. on error returns the created contracts, the first failing contract index and the error message.
func (*Substrate) Call ¶
func (s *Substrate) Call(cl Conn, meta Meta, identity Identity, call types.Call) (response *CallResponse, err error)
Call call this extrinsic and retry if Usurped
func (*Substrate) CancelContract ¶
CancelContract creates a contract for deployment
func (*Substrate) CreateFarm ¶
func (s *Substrate) CreateFarm(identity Identity, name string, publicIps []PublicIPInput) error
CreateFarm creates a farm takes in a name and public ip list
func (*Substrate) CreateNameContract ¶
CreateNameContract creates a contract for deployment
func (*Substrate) CreateNode ¶
CreateNode creates a node, this ignores public_config since this is only setable by the farmer
func (*Substrate) CreateNodeContract ¶
func (s *Substrate) CreateNodeContract(identity Identity, node uint32, body string, hash string, publicIPs uint32, solutionProviderID *uint64) (uint64, error)
CreateNodeContract creates a contract for deployment
func (*Substrate) CreateRefundTransactionOrAddSig ¶
func (*Substrate) CreateRentContract ¶
func (s *Substrate) CreateRentContract(identity Identity, node uint32, solutionProviderID *uint64) (uint64, error)
CreateRentContract creates a rent contract on a node
func (*Substrate) CreateTwin ¶
CreateTwin creates a twin
func (*Substrate) EnsureAccount ¶
func (s *Substrate) EnsureAccount(identity Identity, activationURL, termsAndConditionsLink, termsAndConditionsHash string) (info AccountInfo, err error)
EnsureAccount makes sure account is available on blockchain if not, it uses activation service to create one. EnsureAccount is safe to call on already activated accounts and it's mostly a NO-OP operation unless the account funds are very low, it will then make sure to reactivate the account (fund it) if the free tokens are <= ReactivateThreefold uTFT
func (*Substrate) FetchEventsForBlockRange ¶
func (s *Substrate) FetchEventsForBlockRange(start uint32, end uint32) (types.StorageKey, []types.StorageChangeSet, error)
func (*Substrate) GetAccount ¶
func (s *Substrate) GetAccount(identity Identity) (info AccountInfo, err error)
GetAccount gets account info with secure key
func (*Substrate) GetAccountPublicInfo ¶
func (s *Substrate) GetAccountPublicInfo(account AccountID) (info AccountInfo, err error)
GetAccountPublicInfo gets the info for a given account ID
func (*Substrate) GetAverageTFTPrice ¶
GetAverageTFTPrice gets the average TFT price
func (*Substrate) GetBalance ¶
GetBalance gets the balance for a given account ID
func (*Substrate) GetBlockByNumber ¶
func (*Substrate) GetBurnTransaction ¶
func (s *Substrate) GetBurnTransaction(burnTransactionID types.U64) (*BurnTransaction, error)
func (*Substrate) GetContract ¶
GetContract we should not have calls to create contract, instead only get
func (*Substrate) GetContractIDByNameRegistration ¶
GetContractIDByNameRegistration gets a contract given the its name
func (*Substrate) GetContractWithHash ¶
GetContractWithHash gets a contract given the node id and hash
func (*Substrate) GetCurrentHeight ¶
func (*Substrate) GetDedicatedNodePrice ¶
GetDedicatedeNodePrice returns the price of a dedicated node
func (*Substrate) GetDepositFee ¶
func (*Substrate) GetEventsForBlock ¶
func (s *Substrate) GetEventsForBlock(start uint32) (*EventRecords, error)
func (*Substrate) GetFarmByName ¶
GetFarm gets a farm with ID
func (*Substrate) GetLastNodeID ¶
GetNode with id
func (*Substrate) GetNodeByTwinID ¶
GetNodeByTwinID gets a node by twin id
func (*Substrate) GetNodeContracts ¶
GetNodeContracts gets all contracts on a node (pk) in given state
func (*Substrate) GetNodeRentContract ¶
GetNodeContracts gets all contracts on a node (pk) in given state
func (*Substrate) GetPowerTarget ¶
GetPowerTarget returns the power target for a node
func (*Substrate) GetPricingPolicy ¶
func (s *Substrate) GetPricingPolicy(id uint32) (pricingPolicy PricingPolicy, err error)
GetPricingPolicies gets pricing policy from tfgrid module
func (*Substrate) GetRefundTransaction ¶
func (s *Substrate) GetRefundTransaction(txHash string) (*RefundTransaction, error)
func (*Substrate) GetServiceContract ¶
func (s *Substrate) GetServiceContract(id uint64) (*ServiceContract, error)
GetServiceContract gets a service contract given the service contract id
func (*Substrate) GetServiceContractID ¶
GetServiceContractID gets the current value of storage ServiceContractID
func (*Substrate) GetTFTPrice ¶
GetTFTPrice gets the TFT price
func (*Substrate) GetTwinByPubKey ¶
GetTwinByPubKey gets a twin with public key
func (*Substrate) GetZosVersion ¶
GetZosVersion gets the latest version for each network
func (*Substrate) IsBurnedAlready ¶
func (*Substrate) IsMintedAlready ¶
func (*Substrate) IsRefundedAlready ¶
func (*Substrate) IsValidator ¶
func (*Substrate) KVStoreDelete ¶
func (*Substrate) KVStoreGet ¶
func (*Substrate) KVStoreList ¶
func (*Substrate) KVStoreSet ¶
func (*Substrate) ProposeBurnTransactionOrAddSig ¶
func (*Substrate) ProposeOrVoteMintTransaction ¶
func (*Substrate) ServiceContractApprove ¶
ServiceContractApprove approves a service contract
func (*Substrate) ServiceContractBill ¶
func (s *Substrate) ServiceContractBill(identity Identity, contract uint64, variable_amount uint64, metadata string) error
ServiceContractBill bills a service contract
func (*Substrate) ServiceContractCancel ¶
ServiceContractCancel cancels a service contract
func (*Substrate) ServiceContractCreate ¶
func (s *Substrate) ServiceContractCreate(identity Identity, service AccountID, consumer AccountID) (uint64, error)
ServiceContractCreate creates a service contract
func (*Substrate) ServiceContractReject ¶
ServiceContractReject rejects a service contract
func (*Substrate) ServiceContractSetFees ¶
func (s *Substrate) ServiceContractSetFees(identity Identity, contract uint64, base_fee uint64, variable_fee uint64) error
ServiceContractSetFees sets fees for a service contract
func (*Substrate) ServiceContractSetMetadata ¶
func (s *Substrate) ServiceContractSetMetadata(identity Identity, contract uint64, metadata string) error
ServiceContractSetMetadata sets metadata for a service contract
func (*Substrate) SetBurnTransactionExecuted ¶
func (*Substrate) SetContractConsumption ¶
func (s *Substrate) SetContractConsumption(identity Identity, resources ...ContractResources) error
SetContractConsumption can only be called by the node that owns the contract to set the used resources associated with the node.
func (*Substrate) SetDedicatedNodePrice ¶
func (s *Substrate) SetDedicatedNodePrice(identity Identity, nodeId uint32, price uint64) (hash types.Hash, err error)
SetDedicatedNodePrice sets an extra price on a node expressed in mUSD This price will be distributed back to the farmer if the node is rented Setting this price also makes the node only available to rent as dedicated
func (*Substrate) SetNodeCertificate ¶
func (s *Substrate) SetNodeCertificate(identity Identity, id uint32, cert NodeCertification) error
SetNodeCertificate sets the node certificate type
func (*Substrate) SetNodePowerState ¶
SetNodePowerState updates the node uptime to given value
func (*Substrate) SetNodePowerTarget ¶
func (s *Substrate) SetNodePowerTarget(identity Identity, nodeID uint32, up bool) (hash types.Hash, err error)
SetNodePowerTarget updates the power target of a node
func (*Substrate) SetRefundTransactionExecuted ¶
func (*Substrate) SignedTermsAndConditions ¶
func (s *Substrate) SignedTermsAndConditions(account AccountID) ([]TermsAndConditions, error)
SignedTermsAndConditions return list of signed terms and conditions for this account
func (*Substrate) SwapToStellar ¶
func (*Substrate) UpdateNode ¶
UpdateNode updates a node, this ignores public_config and only keep the value set by the farmer
func (*Substrate) UpdateNodeContract ¶
func (s *Substrate) UpdateNodeContract(identity Identity, contract uint64, body string, hash string) (uint64, error)
UpdateNodeContract updates existing contract
func (*Substrate) UpdateNodeUptime ¶
UpdateNodeUptime updates the node uptime to given value
type TermsAndConditions ¶
type TokensBurned ¶
type TokensBurned struct { Phase types.Phase ContractID types.U64 `json:"contract_id"` Amount types.U128 `json:"amount"` Topics []types.Hash }
TokensBurned
type Twin ¶
type Twin struct { ID types.U32 `json:"id"` Account AccountID `json:"acocunt_id"` Relay OptionRelay `json:"relay"` Entities []EntityProof `json:"entities"` Pk types.OptionBytes `json:"pk"` }
Twin struct
type TwinAccountBounded ¶
type TwinDeleted ¶
type TwinEntityRemoved ¶
type TwinEntityStored ¶
type TwinStored ¶
type UpdatedUsedResources ¶
type UpdatedUsedResources struct { Phase types.Phase ContractResources ContractResources `json:"contract_resources"` Topics []types.Hash }
type User ¶
type User struct { Versioned ID types.U32 `json:"id"` Name string `json:"name"` CountryID types.U32 `json:"country_id"` CityID types.U32 `json:"city_id"` Address AccountID `json:"address"` }
User from substrate
type ValidatorAdded ¶
type ValidatorApproved ¶
type ValidatorCreated ¶
type ValidatorRemoved ¶
type ValidatorRequestState ¶
type Versioned ¶
type Versioned struct {
Version uint32 `json:"version"`
}
Versioned base for all types
Source Files ¶
- account.go
- blocks.go
- bridge.go
- burn_events.go
- burning.go
- codec.go
- contract.go
- contract_events.go
- dao.go
- depositfee.go
- entity.go
- events.go
- farm.go
- impl.go
- kvstore.go
- minting.go
- node.go
- price.go
- refunds.go
- retrying_client.go
- service_contract.go
- termsandconditions.go
- tft_bridge_events.go
- transfer.go
- twin.go
- types.go
- user.go
- utils.go
- validator.go
- zos_version.go