Documentation ¶
Index ¶
- Constants
- Variables
- func AddressToHex(address *common.Address) string
- func BytesToBase64(bytes []byte) string
- func ConvertBase64Encoding(str string) ([32]byte, error)
- func EstimateGas(wallet *bind.TransactOpts) (opts *bind.TransactOpts)
- func FormatHash(ipfsHash string) string
- func HexToAddress(str string) common.Address
- func HexToBytes(str string) []byte
- func ParseSignature(jobSignatureBytes []byte) (uint8, [32]byte, [32]byte, error)
- func RemoveSpecialCharactersfromHash(pString string) string
- func SetGas(wallet *bind.TransactOpts, gasLimit uint64) (opts *bind.TransactOpts)
- func StringToBytes32(str string) [32]byte
- type EthereumClient
- type MultiPartyEscrowChannel
- type Processor
- func (processor *Processor) Close()
- func (processor *Processor) CurrentBlock() (currentBlock *big.Int, err error)
- func (processor *Processor) Enabled() (enabled bool)
- func (processor *Processor) EscrowContractAddress() common.Address
- func (processor *Processor) HasIdentity() bool
- func (processor *Processor) MultiPartyEscrow() *MultiPartyEscrow
- func (processor *Processor) MultiPartyEscrowChannel(channelID *big.Int) (channel *MultiPartyEscrowChannel, ok bool, err error)
- type ServiceMetadata
- func (metaData *ServiceMetadata) GetDaemonEndPoint() string
- func (metaData *ServiceMetadata) GetDaemonGroupID() [32]byte
- func (metaData *ServiceMetadata) GetDaemonGroupIDString() string
- func (metaData *ServiceMetadata) GetDaemonGroupName() string
- func (metaData *ServiceMetadata) GetDisplayName() string
- func (metaData *ServiceMetadata) GetMpeAddress() common.Address
- func (metaData *ServiceMetadata) GetPaymentAddress() common.Address
- func (metaData *ServiceMetadata) GetPaymentExpirationThreshold() *big.Int
- func (metaData *ServiceMetadata) GetPriceInCogs() *big.Int
- func (metaData *ServiceMetadata) GetServiceType() string
- func (metaData *ServiceMetadata) GetVersion() int
- func (metaData *ServiceMetadata) GetWireEncoding() string
- type SimulatedEthereumEnvironment
- func (env *SimulatedEthereumEnvironment) Commit() *SimulatedEthereumEnvironment
- func (env *SimulatedEthereumEnvironment) MpeDeposit(from *bind.TransactOpts, amount int64) *SimulatedEthereumEnvironment
- func (env *SimulatedEthereumEnvironment) MpeOpenChannel(from *bind.TransactOpts, to *bind.TransactOpts, amount int64, expiration int64, ...) *SimulatedEthereumEnvironment
- func (env *SimulatedEthereumEnvironment) SnetApproveMpe(from *bind.TransactOpts, amount int64) *SimulatedEthereumEnvironment
- func (env *SimulatedEthereumEnvironment) SnetTransferTokens(to *bind.TransactOpts, amount int64) *SimulatedEthereumEnvironment
Constants ¶
View Source
const IpfsPrefix = "ipfs://"
Variables ¶
View Source
var ( // HashPrefix32Bytes is an Ethereum signature prefix: see https://github.com/ethereum/go-ethereum/blob/bf468a81ec261745b25206b2a596eb0ee0a24a74/internal/ethapi/api.go#L361 HashPrefix32Bytes = []byte("\x19Ethereum Signed Message:\n32") )
Functions ¶
func AddressToHex ¶
AddressToHex converts Ethereum address to hex string representation.
func BytesToBase64 ¶
BytesToBase64 converts array of bytes to base64 string.
func ConvertBase64Encoding ¶
func EstimateGas ¶
func EstimateGas(wallet *bind.TransactOpts) (opts *bind.TransactOpts)
func FormatHash ¶
func HexToAddress ¶
HexToAddress converts hex string to Ethreum address.
func ParseSignature ¶
ParseSignature parses Ethereum signature.
func SetGas ¶
func SetGas(wallet *bind.TransactOpts, gasLimit uint64) (opts *bind.TransactOpts)
func StringToBytes32 ¶
Types ¶
type EthereumClient ¶
func GetEthereumClient ¶
func GetEthereumClient() (*EthereumClient, error)
func (*EthereumClient) Close ¶
func (ethereumClient *EthereumClient) Close()
type MultiPartyEscrowChannel ¶
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
func NewProcessor ¶
func NewProcessor(metadata *ServiceMetadata) (Processor, error)
NewProcessor creates a new blockchain processor
func (*Processor) CurrentBlock ¶
func (*Processor) EscrowContractAddress ¶
func (*Processor) HasIdentity ¶
func (*Processor) MultiPartyEscrow ¶
func (processor *Processor) MultiPartyEscrow() *MultiPartyEscrow
func (*Processor) MultiPartyEscrowChannel ¶
type ServiceMetadata ¶
type ServiceMetadata struct { Version int `json:"version"` DisplayName string `json:"display_name"` Encoding string `json:"encoding"` ServiceType string `json:"service_type"` PaymentExpirationThreshold *big.Int `json:"payment_expiration_threshold"` ModelIpfsHash string `json:"model_ipfs_hash"` MpeAddress string `json:"mpe_address"` Pricing struct { PriceModel string `json:"price_model"` PriceInCogs *big.Int `json:"price_in_cogs"` } `json:"pricing"` Groups []struct { GroupName string `json:"group_name"` GroupID string `json:"group_id"` PaymentAddress string `json:"payment_address"` } `json:"groups"` Endpoints []struct { GroupName string `json:"group_name"` Endpoint string `json:"endpoint"` } `json:"endpoints"` // contains filtered or unexported fields }
func GetServiceMetaDataFromIPFS ¶
func GetServiceMetaDataFromIPFS(hash string) (*ServiceMetadata, error)
func InitServiceMetaDataFromJson ¶
func InitServiceMetaDataFromJson(jsonData string) (*ServiceMetadata, error)
func ServiceMetaData ¶
func ServiceMetaData() *ServiceMetadata
func (*ServiceMetadata) GetDaemonEndPoint ¶
func (metaData *ServiceMetadata) GetDaemonEndPoint() string
func (*ServiceMetadata) GetDaemonGroupID ¶
func (metaData *ServiceMetadata) GetDaemonGroupID() [32]byte
func (*ServiceMetadata) GetDaemonGroupIDString ¶
func (metaData *ServiceMetadata) GetDaemonGroupIDString() string
func (*ServiceMetadata) GetDaemonGroupName ¶
func (metaData *ServiceMetadata) GetDaemonGroupName() string
func (*ServiceMetadata) GetDisplayName ¶
func (metaData *ServiceMetadata) GetDisplayName() string
func (*ServiceMetadata) GetMpeAddress ¶
func (metaData *ServiceMetadata) GetMpeAddress() common.Address
func (*ServiceMetadata) GetPaymentAddress ¶
func (metaData *ServiceMetadata) GetPaymentAddress() common.Address
func (*ServiceMetadata) GetPaymentExpirationThreshold ¶
func (metaData *ServiceMetadata) GetPaymentExpirationThreshold() *big.Int
func (*ServiceMetadata) GetPriceInCogs ¶
func (metaData *ServiceMetadata) GetPriceInCogs() *big.Int
func (*ServiceMetadata) GetServiceType ¶
func (metaData *ServiceMetadata) GetServiceType() string
func (*ServiceMetadata) GetVersion ¶
func (metaData *ServiceMetadata) GetVersion() int
func (*ServiceMetadata) GetWireEncoding ¶
func (metaData *ServiceMetadata) GetWireEncoding() string
type SimulatedEthereumEnvironment ¶
type SimulatedEthereumEnvironment struct { SingnetPrivateKey *ecdsa.PrivateKey SingnetWallet *bind.TransactOpts ClientWallet *bind.TransactOpts ClientPrivateKey *ecdsa.PrivateKey ServerWallet *bind.TransactOpts ServerPrivateKey *ecdsa.PrivateKey Backend *backends.SimulatedBackend SingularityNetToken *SingularityNetToken MultiPartyEscrowAddress common.Address MultiPartyEscrow *MultiPartyEscrow }
func GetSimulatedEthereumEnvironment ¶
func GetSimulatedEthereumEnvironment() (env SimulatedEthereumEnvironment)
func (*SimulatedEthereumEnvironment) Commit ¶
func (env *SimulatedEthereumEnvironment) Commit() *SimulatedEthereumEnvironment
func (*SimulatedEthereumEnvironment) MpeDeposit ¶
func (env *SimulatedEthereumEnvironment) MpeDeposit(from *bind.TransactOpts, amount int64) *SimulatedEthereumEnvironment
func (*SimulatedEthereumEnvironment) MpeOpenChannel ¶
func (env *SimulatedEthereumEnvironment) MpeOpenChannel(from *bind.TransactOpts, to *bind.TransactOpts, amount int64, expiration int64, groupId [32]byte) *SimulatedEthereumEnvironment
func (*SimulatedEthereumEnvironment) SnetApproveMpe ¶
func (env *SimulatedEthereumEnvironment) SnetApproveMpe(from *bind.TransactOpts, amount int64) *SimulatedEthereumEnvironment
func (*SimulatedEthereumEnvironment) SnetTransferTokens ¶
func (env *SimulatedEthereumEnvironment) SnetTransferTokens(to *bind.TransactOpts, amount int64) *SimulatedEthereumEnvironment
Click to show internal directories.
Click to hide internal directories.