Documentation
¶
Index ¶
- func ConvertStringToBigInt(st string) big.Int
- func ConvertStringToInt64(st string) uint64
- func EtherToWei(etherAmount float64) *big.Int
- func EtherToWeiUint64(etherAmount float64) uint64
- func GetAddress(privateKey *ecdsa.PrivateKey) common.Address
- func GetAddressFromSignedMessage(message []byte, sig []byte) (common.Address, error)
- func GetPublicKey(privateKey *ecdsa.PrivateKey) ecdsa.PublicKey
- func ParsePrivateKey(privateKey string) (*ecdsa.PrivateKey, error)
- func SignMessage(privateKey *ecdsa.PrivateKey, message []byte) ([]byte, error)
- type Contracts
- type EventChannelCollection
- type EventChannels
- type JobCreatorEventChannels
- type MediationEventChannels
- type PaymentEventChannels
- type StorageEventChannels
- type TokenEventChannels
- type Web3Options
- type Web3SDK
- func (sdk *Web3SDK) AcceptResult(dealId string) (string, error)
- func (sdk *Web3SDK) AddResult(dealId string, resultsId string, dataId string, instructionCount uint64) (string, error)
- func (sdk *Web3SDK) AddUserToList(serviceType uint8) error
- func (sdk *Web3SDK) Agree(deal dto.Deal) (string, error)
- func (sdk *Web3SDK) CheckResult(dealId string) (string, error)
- func (sdk *Web3SDK) GetAddress() common.Address
- func (sdk *Web3SDK) GetServiceAddresses(serviceType string) ([]common.Address, error)
- func (sdk *Web3SDK) GetSolverAddresses() ([]common.Address, error)
- func (sdk *Web3SDK) GetSolverUrl(address string) (string, error)
- func (sdk *Web3SDK) GetUser(address common.Address) (users.SharedStructsUser, error)
- func (sdk *Web3SDK) MediationAcceptResult(dealId string) (string, error)
- func (sdk *Web3SDK) MediationRejectResult(dealId string) (string, error)
- func (sdk *Web3SDK) UpdateUser(metadataCID string, url string, roles []uint8) error
- func (sdk *Web3SDK) WaitTx(ctx context.Context, tx *types.Transaction) (*types.Receipt, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertStringToBigInt ¶
func ConvertStringToInt64 ¶
func EtherToWei ¶
func EtherToWeiUint64 ¶
func GetAddress ¶
func GetAddress(privateKey *ecdsa.PrivateKey) common.Address
func GetPublicKey ¶
func GetPublicKey(privateKey *ecdsa.PrivateKey) ecdsa.PublicKey
func ParsePrivateKey ¶
func ParsePrivateKey(privateKey string) (*ecdsa.PrivateKey, error)
func SignMessage ¶
func SignMessage(privateKey *ecdsa.PrivateKey, message []byte) ([]byte, error)
Types ¶
type Contracts ¶
type Contracts struct {
Token *token.Token
Payments *payments.Payments
Storage *storage.Storage
Users *users.Users
JobCreator *jobcreator.Jobcreator
Mediation *mediation.Mediation
Controller *controller.Controller
}
these are the go-binding wrappers for the various deployed contracts
func NewContracts ¶
type EventChannelCollection ¶
type EventChannels ¶
type EventChannels struct {
Token *TokenEventChannels
Payment *PaymentEventChannels
Storage *StorageEventChannels
JobCreator *JobCreatorEventChannels
Mediation *MediationEventChannels
// contains filtered or unexported fields
}
func NewEventChannels ¶
func NewEventChannels() *EventChannels
func (*EventChannels) Start ¶
func (eventChannels *EventChannels) Start( sdk *Web3SDK, ctx context.Context, cm *system.CleanupManager, ) error
type JobCreatorEventChannels ¶
type JobCreatorEventChannels struct {
// contains filtered or unexported fields
}
func NewJobCreatorEventChannels ¶
func NewJobCreatorEventChannels() *JobCreatorEventChannels
func (*JobCreatorEventChannels) Start ¶
func (s *JobCreatorEventChannels) Start( sdk *Web3SDK, ctx context.Context, cm *system.CleanupManager, ) error
func (*JobCreatorEventChannels) SubscribeJobAdded ¶
func (t *JobCreatorEventChannels) SubscribeJobAdded(handler func(jobcreator.JobcreatorJobAdded))
type MediationEventChannels ¶
type MediationEventChannels struct {
// contains filtered or unexported fields
}
func NewMediationEventChannels ¶
func NewMediationEventChannels() *MediationEventChannels
func (*MediationEventChannels) Start ¶
func (m *MediationEventChannels) Start( sdk *Web3SDK, ctx context.Context, cm *system.CleanupManager, ) error
func (*MediationEventChannels) SubscribeMediationRequested ¶
func (m *MediationEventChannels) SubscribeMediationRequested(handler func(mediation.MediationMediationRequested))
type PaymentEventChannels ¶
type PaymentEventChannels struct {
// contains filtered or unexported fields
}
func NewPaymentEventChannels ¶
func NewPaymentEventChannels() *PaymentEventChannels
func (*PaymentEventChannels) Start ¶
func (p *PaymentEventChannels) Start( sdk *Web3SDK, ctx context.Context, cm *system.CleanupManager, ) error
func (*PaymentEventChannels) SubscribePayment ¶
func (p *PaymentEventChannels) SubscribePayment(handler func(payments.PaymentsPayment))
type StorageEventChannels ¶
type StorageEventChannels struct {
// contains filtered or unexported fields
}
func NewStorageEventChannels ¶
func NewStorageEventChannels() *StorageEventChannels
func (*StorageEventChannels) Start ¶
func (s *StorageEventChannels) Start( sdk *Web3SDK, ctx context.Context, cm *system.CleanupManager, ) error
func (*StorageEventChannels) SubscribeDealStateChange ¶
func (t *StorageEventChannels) SubscribeDealStateChange(handler func(storage.StorageDealStateChange))
type TokenEventChannels ¶
type TokenEventChannels struct {
// contains filtered or unexported fields
}
func NewTokenEventChannels ¶
func NewTokenEventChannels() *TokenEventChannels
func (*TokenEventChannels) Start ¶
func (t *TokenEventChannels) Start( sdk *Web3SDK, ctx context.Context, cm *system.CleanupManager, ) error
func (*TokenEventChannels) SubscribeTransfer ¶
func (t *TokenEventChannels) SubscribeTransfer(handler func(token.TokenTransfer))
type Web3Options ¶
type Web3Options struct {
// core settings
RpcURL string `json:"rpc_url"`
PrivateKey string `json:"private_key"`
ChainID int `json:"chain_id"`
// contract addresses
ControllerAddress string `json:"controller_address"`
PaymentsAddress string `json:"payments_address"`
StorageAddress string `json:"storage_address"`
UsersAddress string `json:"users_address"`
MediationAddress string `json:"mediation_address"`
JobCreatorAddress string `json:"jobcreator_address"`
TokenAddress string `json:"token_address"`
// this is injected by whatever service we are running
// it's used for logging tx's
Service system.Service `json:"-"`
}
type Web3SDK ¶
type Web3SDK struct {
Options Web3Options
PrivateKey *ecdsa.PrivateKey
Client *ethclient.Client
CallOpts *bind.CallOpts
TransactOpts *bind.TransactOpts
Contracts *Contracts
}
func NewContractSDK ¶
func NewContractSDK(options Web3Options) (*Web3SDK, error)
func (*Web3SDK) AddUserToList ¶
func (*Web3SDK) GetAddress ¶
func (*Web3SDK) GetServiceAddresses ¶
func (*Web3SDK) GetSolverAddresses ¶
func (*Web3SDK) MediationAcceptResult ¶
func (*Web3SDK) MediationRejectResult ¶
func (*Web3SDK) UpdateUser ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.