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 ¶ added in v0.1.2
AddressToHex converts Ethereum address to hex string representation.
func BytesToBase64 ¶ added in v0.1.2
BytesToBase64 converts array of bytes to base64 string.
func ConvertBase64Encoding ¶ added in v0.1.3
func EstimateGas ¶ added in v0.1.2
func EstimateGas(wallet *bind.TransactOpts) (opts *bind.TransactOpts)
func FormatHash ¶ added in v0.1.3
func HexToAddress ¶ added in v0.1.2
HexToAddress converts hex string to Ethreum address.
func HexToBytes ¶ added in v0.1.2
HexToBytes converts hex string to bytes array.
func ParseSignature ¶ added in v0.1.2
ParseSignature parses Ethereum signature.
func RemoveSpecialCharactersfromHash ¶ added in v0.1.3
func SetGas ¶ added in v0.1.2
func SetGas(wallet *bind.TransactOpts, gasLimit uint64) (opts *bind.TransactOpts)
func StringToBytes32 ¶ added in v0.1.2
Types ¶
type EthereumClient ¶ added in v0.1.3
func GetEthereumClient ¶ added in v0.1.3
func GetEthereumClient() (*EthereumClient, error)
func (*EthereumClient) Close ¶ added in v0.1.3
func (ethereumClient *EthereumClient) Close()
type MultiPartyEscrowChannel ¶ added in v0.1.2
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 ¶ added in v0.1.2
func (*Processor) EscrowContractAddress ¶ added in v0.1.2
func (*Processor) HasIdentity ¶ added in v0.1.3
func (*Processor) MultiPartyEscrow ¶ added in v0.1.2
func (processor *Processor) MultiPartyEscrow() *MultiPartyEscrow
func (*Processor) MultiPartyEscrowChannel ¶ added in v0.1.2
type ServiceMetadata ¶ added in v0.1.2
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 ¶ added in v0.1.3
func GetServiceMetaDataFromIPFS(hash string) (*ServiceMetadata, error)
func InitServiceMetaDataFromJson ¶ added in v0.1.3
func InitServiceMetaDataFromJson(jsonData string) (*ServiceMetadata, error)
func ServiceMetaData ¶ added in v0.1.3
func ServiceMetaData() *ServiceMetadata
func (*ServiceMetadata) GetDaemonEndPoint ¶ added in v0.1.3
func (metaData *ServiceMetadata) GetDaemonEndPoint() string
func (*ServiceMetadata) GetDaemonGroupID ¶ added in v0.1.3
func (metaData *ServiceMetadata) GetDaemonGroupID() [32]byte
func (*ServiceMetadata) GetDaemonGroupIDString ¶ added in v0.1.5
func (metaData *ServiceMetadata) GetDaemonGroupIDString() string
func (*ServiceMetadata) GetDaemonGroupName ¶ added in v0.1.3
func (metaData *ServiceMetadata) GetDaemonGroupName() string
func (*ServiceMetadata) GetDisplayName ¶ added in v0.1.3
func (metaData *ServiceMetadata) GetDisplayName() string
func (*ServiceMetadata) GetMpeAddress ¶ added in v0.1.3
func (metaData *ServiceMetadata) GetMpeAddress() common.Address
func (*ServiceMetadata) GetPaymentAddress ¶ added in v0.1.3
func (metaData *ServiceMetadata) GetPaymentAddress() common.Address
func (*ServiceMetadata) GetPaymentExpirationThreshold ¶ added in v0.1.3
func (metaData *ServiceMetadata) GetPaymentExpirationThreshold() *big.Int
func (*ServiceMetadata) GetPriceInCogs ¶ added in v0.1.3
func (metaData *ServiceMetadata) GetPriceInCogs() *big.Int
func (*ServiceMetadata) GetServiceType ¶ added in v0.1.3
func (metaData *ServiceMetadata) GetServiceType() string
func (*ServiceMetadata) GetVersion ¶ added in v0.1.3
func (metaData *ServiceMetadata) GetVersion() int
func (*ServiceMetadata) GetWireEncoding ¶ added in v0.1.3
func (metaData *ServiceMetadata) GetWireEncoding() string
type SimulatedEthereumEnvironment ¶ added in v0.1.2
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 ¶ added in v0.1.2
func GetSimulatedEthereumEnvironment() (env SimulatedEthereumEnvironment)
func (*SimulatedEthereumEnvironment) Commit ¶ added in v0.1.2
func (env *SimulatedEthereumEnvironment) Commit() *SimulatedEthereumEnvironment
func (*SimulatedEthereumEnvironment) MpeDeposit ¶ added in v0.1.2
func (env *SimulatedEthereumEnvironment) MpeDeposit(from *bind.TransactOpts, amount int64) *SimulatedEthereumEnvironment
func (*SimulatedEthereumEnvironment) MpeOpenChannel ¶ added in v0.1.2
func (env *SimulatedEthereumEnvironment) MpeOpenChannel(from *bind.TransactOpts, to *bind.TransactOpts, amount int64, expiration int64, groupId [32]byte) *SimulatedEthereumEnvironment
func (*SimulatedEthereumEnvironment) SnetApproveMpe ¶ added in v0.1.2
func (env *SimulatedEthereumEnvironment) SnetApproveMpe(from *bind.TransactOpts, amount int64) *SimulatedEthereumEnvironment
func (*SimulatedEthereumEnvironment) SnetTransferTokens ¶ added in v0.1.2
func (env *SimulatedEthereumEnvironment) SnetTransferTokens(to *bind.TransactOpts, amount int64) *SimulatedEthereumEnvironment
Click to show internal directories.
Click to hide internal directories.