Documentation
¶
Index ¶
- Variables
- func ActivateSC(host string, addr *address.Address) error
- func ActivateSCMulti(par ActivateSCParams) error
- func CheckProgramMetadata(hosts []string, progHash *hashing.HashValue) (*progmeta.ProgramMetadata, error)
- func CheckSC(apiHosts []string, scAddr *address.Address, textout ...io.Writer) bool
- func CreateRequestTransaction(par CreateRequestTransactionParams) (*sctransaction.Transaction, error)
- func CreateRequestTransactionOld(client nodeclient.NodeClient, senderSigScheme signaturescheme.SignatureScheme, ...) (*sctransaction.Transaction, error)
- func CreateSC(par CreateSCParams) (*address.Address, *balance.Color, error)
- func CreateSimpleRequestMultiOld(client nodeclient.NodeClient, sigScheme signaturescheme.SignatureScheme, ...) (*sctransaction.Transaction, error)
- func CreateSimpleRequestOld(client nodeclient.NodeClient, sigScheme signaturescheme.SignatureScheme, ...) (*sctransaction.Transaction, error)
- func DeactivateSC(host string, addr *address.Address) error
- func DeactivateSCMulti(par DeactivateSCParams) error
- func DumpSCState(host string, scAddress string) (*admapi.DumpSCStateResponse, error)
- func ExportDKShare(node string, address *address.Address) (string, error)
- func GenerateNewDistributedKeySet(hosts []string, n, t uint16) (*address.Address, error)
- func GenerateNewDistributedKeySetOld(nodes []string, n, t uint16) (*address.Address, error)
- func GetProgramMetadata(host string, progHash *hashing.HashValue) (*progmeta.ProgramMetadata, error)
- func GetPublicKeyInfo(node string, addr *address.Address) *dkgapi.GetPubKeyInfoResponse
- func GetPublicKeyInfoMulti(nodes []string, addr *address.Address) []*dkgapi.GetPubKeyInfoResponse
- func GetSCData(host string, addr *address.Address) (*registry.BootupData, bool, error)
- func GetSCList(url string) ([]address.Address, error)
- func ImportDKShare(node string, base58blob string) error
- func IsRequestProcessed(host string, addr *address.Address, reqid sctransaction.RequestId) (bool, error)
- func MustNotNullInputs(tx *valuetransaction.Transaction)
- func NewColoredTokensTransaction(client nodeclient.NodeClient, sigScheme signaturescheme.SignatureScheme, ...) (*valuetransaction.Transaction, error)
- func PutProgramMetadata(host string, md registry.ProgramMetadata) error
- func PutSCData(host string, bd registry.BootupData) error
- func PutSCDataMulti(hosts []string, bd registry.BootupData) (bool, []error)
- func QueryRequestProcessingStatusMulti(host string, addr *address.Address, reqs []sctransaction.RequestId) (map[sctransaction.RequestId]bool, error)
- func RunAndWaitForRequestProcessedMulti(hosts []string, scAddr *address.Address, reqIndex uint16, ...) (*sctransaction.Transaction, error)
- func Shutdown(host string) error
- func TotalBalanceOfInputs(outs map[valuetransaction.OutputID][]*balance.Balance) int64
- func WaitForRequestProcessedMulti(hosts []string, scAddr *address.Address, txid *valuetransaction.ID, ...) error
- type ActivateSCParams
- type CreateRequestTransactionParams
- type CreateSCParams
- type CreateSimpleRequestParamsOld
- type DeactivateSCParams
- type QuerySCStateResult
- type RequestBlockJson
- type RequestBlockParams
- type SCStatus
Constants ¶
This section is empty.
Variables ¶
var ErrStateNotFound = errors.New("State not found")
Functions ¶
func ActivateSCMulti ¶
func ActivateSCMulti(par ActivateSCParams) error
func CheckProgramMetadata ¶
func CheckProgramMetadata(hosts []string, progHash *hashing.HashValue) (*progmeta.ProgramMetadata, error)
CheckProgramMetadata checks if metadata exists in hosts and is consistent return program meta data from the first host if all consistent, otherwise nil
func CheckSC ¶
CheckSC checks and reports deployment data of SC in the given list of node it loads bootuo data from the first node in the list and uses CommitteeNodes from that bootup data to check the whole committee
func CreateRequestTransaction ¶
func CreateRequestTransaction(par CreateRequestTransactionParams) (*sctransaction.Transaction, error)
func CreateRequestTransactionOld ¶
func CreateRequestTransactionOld(client nodeclient.NodeClient, senderSigScheme signaturescheme.SignatureScheme, reqsJson []*RequestBlockJson) (*sctransaction.Transaction, error)
Deprecated
func CreateSC ¶
CreateSC performs all actions needed to deploy smart contract, except activation noinspection ALL
func CreateSimpleRequestMultiOld ¶
func CreateSimpleRequestMultiOld(client nodeclient.NodeClient, sigScheme signaturescheme.SignatureScheme, pars []CreateSimpleRequestParamsOld) (*sctransaction.Transaction, error)
func CreateSimpleRequestOld ¶
func CreateSimpleRequestOld(client nodeclient.NodeClient, sigScheme signaturescheme.SignatureScheme, par CreateSimpleRequestParamsOld) (*sctransaction.Transaction, error)
func DeactivateSCMulti ¶
func DeactivateSCMulti(par DeactivateSCParams) error
func DumpSCState ¶
func DumpSCState(host string, scAddress string) (*admapi.DumpSCStateResponse, error)
func GenerateNewDistributedKeySet ¶
GenerateNewDistributedKeySet calls nodes in parallel to produce distributed key set
func GenerateNewDistributedKeySetOld ¶
GenerateNewDistributedKeySetOld calls nodes one after the other to produce distributed key set
func GetProgramMetadata ¶
func GetProgramMetadata(host string, progHash *hashing.HashValue) (*progmeta.ProgramMetadata, error)
GetProgramMetadata calls node to get ProgramMetadata by program hash
func GetPublicKeyInfo ¶
func GetPublicKeyInfo(node string, addr *address.Address) *dkgapi.GetPubKeyInfoResponse
GetPublicKeyInfo retrieves public info about key with specific address from host
func GetPublicKeyInfoMulti ¶
func GetPublicKeyInfoMulti(nodes []string, addr *address.Address) []*dkgapi.GetPubKeyInfoResponse
GetPublicKeyInfoMulti retrieves public info about key with specific address from multiple hosts
func ImportDKShare ¶
func IsRequestProcessed ¶
func MustNotNullInputs ¶
func MustNotNullInputs(tx *valuetransaction.Transaction)
func NewColoredTokensTransaction ¶
func NewColoredTokensTransaction(client nodeclient.NodeClient, sigScheme signaturescheme.SignatureScheme, amount int64) (*valuetransaction.Transaction, error)
NewColoredTokensTransaction mints specified amount of colored tokens from iotas in the address corresponding to sigScheme. It returns a value transaction with empty data payload (not sc transaction)
func PutProgramMetadata ¶
func PutProgramMetadata(host string, md registry.ProgramMetadata) error
PutProgramMetadata calls node to write ProgramMetadata record
func PutSCData ¶
func PutSCData(host string, bd registry.BootupData) error
PutSCData calls node to write BootupData record
func PutSCDataMulti ¶
func PutSCDataMulti(hosts []string, bd registry.BootupData) (bool, []error)
PutSCDataMulti calls PutSCData to hosts in parallel
func QueryRequestProcessingStatusMulti ¶
func QueryRequestProcessingStatusMulti(host string, addr *address.Address, reqs []sctransaction.RequestId) (map[sctransaction.RequestId]bool, error)
func RunAndWaitForRequestProcessedMulti ¶
func RunAndWaitForRequestProcessedMulti(hosts []string, scAddr *address.Address, reqIndex uint16, timeout time.Duration, f func() (*sctransaction.Transaction, error)) (*sctransaction.Transaction, error)
func TotalBalanceOfInputs ¶
func TotalBalanceOfInputs(outs map[valuetransaction.OutputID][]*balance.Balance) int64
Types ¶
type ActivateSCParams ¶
type CreateRequestTransactionParams ¶
type CreateRequestTransactionParams struct {
NodeClient nodeclient.NodeClient
SenderSigScheme signaturescheme.SignatureScheme
BlockParams []RequestBlockParams
Post bool
WaitForConfirmation bool
WaitForCompletion bool
PublisherHosts []string
PublisherQuorum int
Timeout time.Duration
}
type CreateSCParams ¶
type CreateSCParams struct {
Node nodeclient.NodeClient
CommitteeApiHosts []string
CommitteePeeringHosts []string
AccessNodes []string
N uint16
T uint16
OwnerSigScheme signaturescheme.SignatureScheme
ProgramHash hashing.HashValue
Description string
Textout io.Writer
Prefix string
}
type CreateSimpleRequestParamsOld ¶
type CreateSimpleRequestParamsOld struct {
SCAddress *address.Address
RequestCode sctransaction.RequestCode
Timelock uint32
Transfer map[balance.Color]int64 // should not not include request token. It is added automatically
Vars map[string]interface{} ` `
}
type DeactivateSCParams ¶
type QuerySCStateResult ¶
type QuerySCStateResult struct {
Queries map[kv.Key]*stateapi.QueryResult
// returned only when QueryGeneralData = true
StateIndex uint32
Timestamp time.Time
StateHash *hashing.HashValue
StateTxId *valuetransaction.ID
Requests []*sctransaction.RequestId
}
func QuerySCState ¶
func QuerySCState(host string, query *stateapi.QueryRequest) (*QuerySCStateResult, error)
type RequestBlockJson ¶
type RequestBlockJson struct {
Address string `json:"address"`
RequestCode sctransaction.RequestCode `json:"request_code"`
Timelock uint32 `json:"timelock"`
AmountIotas int64 `json:"amount_iotas"` // minimum 1 iota will be taken anyway
Vars map[string]interface{} `json:"vars"`
}
Deprecated
type RequestBlockParams ¶
type RequestBlockParams struct {
TargetSCAddress *address.Address
RequestCode sctransaction.RequestCode
Timelock uint32
Transfer map[balance.Color]int64 // should not not include request token. It is added automatically
Vars map[string]interface{} ` `
}
type SCStatus ¶
type SCStatus struct {
StateIndex uint32
Timestamp time.Time
StateHash *hashing.HashValue
StateTxId *valuetransaction.ID
Requests []*sctransaction.RequestId
ProgramHash *hashing.HashValue
Description string
OwnerAddress *address.Address
SCAddress *address.Address
Balance map[balance.Color]int64
MinimumReward int64
FetchedAt time.Time
}
func FetchSCStatus ¶
func FetchSCStatus(nodeClient nodeclient.NodeClient, waspHost string, scAddress *address.Address, addCustomQueries func(query *stateapi.QueryRequest)) (*SCStatus, map[kv.Key]*stateapi.QueryResult, error)