guard

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2019 License: MIT Imports: 9 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContractMeta_Schedule_name = map[int32]string{
	0: "MONTHLY",
	1: "QUARTERLY",
	2: "ANNUALLY",
}
View Source
var ContractMeta_Schedule_value = map[string]int32{
	"MONTHLY":   0,
	"QUARTERLY": 1,
	"ANNUALLY":  2,
}
View Source
var Contract_ContractState_name = map[int32]string{
	0: "DRAFT",
	1: "SIGNED",
	2: "UPLOADED",
	3: "LOST",
	4: "CANCELED",
	5: "CLOSED",
}
View Source
var Contract_ContractState_value = map[string]int32{
	"DRAFT":    0,
	"SIGNED":   1,
	"UPLOADED": 2,
	"LOST":     3,
	"CANCELED": 4,
	"CLOSED":   5,
}
View Source
var FileStoreStatus_MetaState_name = map[int32]string{
	0: "DRAFT",
	1: "UPLOADING",
	2: "RUNNING",
	3: "PARTIAL_LOST",
	4: "LOST",
	5: "DONE",
}
View Source
var FileStoreStatus_MetaState_value = map[string]int32{
	"DRAFT":        0,
	"UPLOADING":    1,
	"RUNNING":      2,
	"PARTIAL_LOST": 3,
	"LOST":         4,
	"DONE":         5,
}
View Source
var ResponseCode_name = map[int32]string{
	0:  "SUCCESS",
	1:  "SIGNATURE_FORMAT_ERROR",
	2:  "COMPUTE_ADDRESS_ERROR",
	20: "OTHER_ERROR",
}
View Source
var ResponseCode_value = map[string]int32{
	"SUCCESS":                0,
	"SIGNATURE_FORMAT_ERROR": 1,
	"COMPUTE_ADDRESS_ERROR":  2,
	"OTHER_ERROR":            20,
}

Functions

func RegisterGuardServiceServer

func RegisterGuardServiceServer(s *grpc.Server, srv GuardServiceServer)

Types

type ChallengeQuestion

type ChallengeQuestion struct {
	ShardHash            []byte   `protobuf:"bytes,1,opt,name=shard_hash,json=shardHash,proto3" json:"shard_hash,omitempty"`
	HostAddress          []byte   `protobuf:"bytes,2,opt,name=host_address,json=hostAddress,proto3" json:"host_address,omitempty"`
	ChunkIndex           int32    `protobuf:"varint,3,opt,name=chunk_index,json=chunkIndex,proto3" json:"chunk_index,omitempty"`
	RandomNounce         int32    `protobuf:"varint,4,opt,name=random_nounce,json=randomNounce,proto3" json:"random_nounce,omitempty"`
	ExpectAnswer         []byte   `protobuf:"bytes,5,opt,name=expect_answer,json=expectAnswer,proto3" json:"expect_answer,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ChallengeQuestion) Descriptor

func (*ChallengeQuestion) Descriptor() ([]byte, []int)

func (*ChallengeQuestion) GetChunkIndex

func (m *ChallengeQuestion) GetChunkIndex() int32

func (*ChallengeQuestion) GetExpectAnswer

func (m *ChallengeQuestion) GetExpectAnswer() []byte

func (*ChallengeQuestion) GetHostAddress

func (m *ChallengeQuestion) GetHostAddress() []byte

func (*ChallengeQuestion) GetRandomNounce

func (m *ChallengeQuestion) GetRandomNounce() int32

func (*ChallengeQuestion) GetShardHash

func (m *ChallengeQuestion) GetShardHash() []byte

func (*ChallengeQuestion) ProtoMessage

func (*ChallengeQuestion) ProtoMessage()

func (*ChallengeQuestion) Reset

func (m *ChallengeQuestion) Reset()

func (*ChallengeQuestion) String

func (m *ChallengeQuestion) String() string

func (*ChallengeQuestion) XXX_DiscardUnknown

func (m *ChallengeQuestion) XXX_DiscardUnknown()

func (*ChallengeQuestion) XXX_Marshal

func (m *ChallengeQuestion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ChallengeQuestion) XXX_Merge

func (m *ChallengeQuestion) XXX_Merge(src proto.Message)

func (*ChallengeQuestion) XXX_Size

func (m *ChallengeQuestion) XXX_Size() int

func (*ChallengeQuestion) XXX_Unmarshal

func (m *ChallengeQuestion) XXX_Unmarshal(b []byte) error

type ChallengeQuestions

type ChallengeQuestions struct {
	FileHash             []byte               `protobuf:"bytes,1,opt,name=file_hash,json=fileHash,proto3" json:"file_hash,omitempty"`
	ShardHash            []byte               `protobuf:"bytes,2,opt,name=shard_hash,json=shardHash,proto3" json:"shard_hash,omitempty"`
	PreparerAddress      []byte               `protobuf:"bytes,3,opt,name=preparer_address,json=preparerAddress,proto3" json:"preparer_address,omitempty"`
	RequestCount         int32                `protobuf:"varint,4,opt,name=request_count,json=requestCount,proto3" json:"request_count,omitempty"`
	Questions            []*ChallengeQuestion `protobuf:"bytes,5,rep,name=questions,proto3" json:"questions,omitempty"`
	PrepareTime          *types.Timestamp     `protobuf:"bytes,6,opt,name=prepare_time,json=prepareTime,proto3" json:"prepare_time,omitempty"`
	RenterSignature      []byte               `protobuf:"bytes,7,opt,name=renter_signature,json=renterSignature,proto3" json:"renter_signature,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

func (*ChallengeQuestions) Descriptor

func (*ChallengeQuestions) Descriptor() ([]byte, []int)

func (*ChallengeQuestions) GetFileHash

func (m *ChallengeQuestions) GetFileHash() []byte

func (*ChallengeQuestions) GetPrepareTime

func (m *ChallengeQuestions) GetPrepareTime() *types.Timestamp

func (*ChallengeQuestions) GetPreparerAddress

func (m *ChallengeQuestions) GetPreparerAddress() []byte

func (*ChallengeQuestions) GetQuestions

func (m *ChallengeQuestions) GetQuestions() []*ChallengeQuestion

func (*ChallengeQuestions) GetRenterSignature

func (m *ChallengeQuestions) GetRenterSignature() []byte

func (*ChallengeQuestions) GetRequestCount

func (m *ChallengeQuestions) GetRequestCount() int32

func (*ChallengeQuestions) GetShardHash

func (m *ChallengeQuestions) GetShardHash() []byte

func (*ChallengeQuestions) ProtoMessage

func (*ChallengeQuestions) ProtoMessage()

func (*ChallengeQuestions) Reset

func (m *ChallengeQuestions) Reset()

func (*ChallengeQuestions) String

func (m *ChallengeQuestions) String() string

func (*ChallengeQuestions) XXX_DiscardUnknown

func (m *ChallengeQuestions) XXX_DiscardUnknown()

func (*ChallengeQuestions) XXX_Marshal

func (m *ChallengeQuestions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ChallengeQuestions) XXX_Merge

func (m *ChallengeQuestions) XXX_Merge(src proto.Message)

func (*ChallengeQuestions) XXX_Size

func (m *ChallengeQuestions) XXX_Size() int

func (*ChallengeQuestions) XXX_Unmarshal

func (m *ChallengeQuestions) XXX_Unmarshal(b []byte) error

type CheckFileStoreMetaRequest

type CheckFileStoreMetaRequest struct {
	FileHash             []byte   `protobuf:"bytes,1,opt,name=file_hash,json=fileHash,proto3" json:"file_hash,omitempty"`
	RenterAddress        []byte   `protobuf:"bytes,2,opt,name=renter_address,json=renterAddress,proto3" json:"renter_address,omitempty"`
	RequesterAddress     []byte   `protobuf:"bytes,3,opt,name=requester_address,json=requesterAddress,proto3" json:"requester_address,omitempty"`
	Signature            []byte   `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*CheckFileStoreMetaRequest) Descriptor

func (*CheckFileStoreMetaRequest) Descriptor() ([]byte, []int)

func (*CheckFileStoreMetaRequest) GetFileHash

func (m *CheckFileStoreMetaRequest) GetFileHash() []byte

func (*CheckFileStoreMetaRequest) GetRenterAddress

func (m *CheckFileStoreMetaRequest) GetRenterAddress() []byte

func (*CheckFileStoreMetaRequest) GetRequesterAddress

func (m *CheckFileStoreMetaRequest) GetRequesterAddress() []byte

func (*CheckFileStoreMetaRequest) GetSignature

func (m *CheckFileStoreMetaRequest) GetSignature() []byte

func (*CheckFileStoreMetaRequest) ProtoMessage

func (*CheckFileStoreMetaRequest) ProtoMessage()

func (*CheckFileStoreMetaRequest) Reset

func (m *CheckFileStoreMetaRequest) Reset()

func (*CheckFileStoreMetaRequest) String

func (m *CheckFileStoreMetaRequest) String() string

func (*CheckFileStoreMetaRequest) XXX_DiscardUnknown

func (m *CheckFileStoreMetaRequest) XXX_DiscardUnknown()

func (*CheckFileStoreMetaRequest) XXX_Marshal

func (m *CheckFileStoreMetaRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CheckFileStoreMetaRequest) XXX_Merge

func (m *CheckFileStoreMetaRequest) XXX_Merge(src proto.Message)

func (*CheckFileStoreMetaRequest) XXX_Size

func (m *CheckFileStoreMetaRequest) XXX_Size() int

func (*CheckFileStoreMetaRequest) XXX_Unmarshal

func (m *CheckFileStoreMetaRequest) XXX_Unmarshal(b []byte) error

type Contract

type Contract struct {
	//the contract executor record, changed frequently after proposal
	Contract             *ContractMeta          `protobuf:"bytes,1,opt,name=contract,proto3" json:"contract,omitempty"`
	State                Contract_ContractState `protobuf:"varint,2,opt,name=state,proto3,enum=guard.Contract_ContractState" json:"state,omitempty"`
	RenterSignature      []byte                 `protobuf:"bytes,3,opt,name=renter_signature,json=renterSignature,proto3" json:"renter_signature,omitempty"`
	HostSignature        []byte                 `protobuf:"bytes,4,opt,name=host_signature,json=hostSignature,proto3" json:"host_signature,omitempty"`
	EscrowSignedTime     *types.Timestamp       `protobuf:"bytes,5,opt,name=escrow_signed_time,json=escrowSignedTime,proto3" json:"escrow_signed_time,omitempty"`
	EscrowSignature      []byte                 `protobuf:"bytes,6,opt,name=escrow_signature,json=escrowSignature,proto3" json:"escrow_signature,omitempty"`
	ChangeLog            []*Log                 `protobuf:"bytes,7,rep,name=change_log,json=changeLog,proto3" json:"change_log,omitempty"`
	LastModifyTime       *types.Timestamp       `protobuf:"bytes,8,opt,name=last_modify_time,json=lastModifyTime,proto3" json:"last_modify_time,omitempty"`
	GuardSignature       []byte                 `protobuf:"bytes,9,opt,name=guard_signature,json=guardSignature,proto3" json:"guard_signature,omitempty"`
	XXX_NoUnkeyedLiteral struct{}               `json:"-"`
	XXX_unrecognized     []byte                 `json:"-"`
	XXX_sizecache        int32                  `json:"-"`
}

func (*Contract) Descriptor

func (*Contract) Descriptor() ([]byte, []int)

func (*Contract) GetChangeLog

func (m *Contract) GetChangeLog() []*Log

func (*Contract) GetContract

func (m *Contract) GetContract() *ContractMeta

func (*Contract) GetEscrowSignature

func (m *Contract) GetEscrowSignature() []byte

func (*Contract) GetEscrowSignedTime

func (m *Contract) GetEscrowSignedTime() *types.Timestamp

func (*Contract) GetGuardSignature

func (m *Contract) GetGuardSignature() []byte

func (*Contract) GetHostSignature

func (m *Contract) GetHostSignature() []byte

func (*Contract) GetLastModifyTime

func (m *Contract) GetLastModifyTime() *types.Timestamp

func (*Contract) GetRenterSignature

func (m *Contract) GetRenterSignature() []byte

func (*Contract) GetState

func (m *Contract) GetState() Contract_ContractState

func (*Contract) ProtoMessage

func (*Contract) ProtoMessage()

func (*Contract) Reset

func (m *Contract) Reset()

func (*Contract) String

func (m *Contract) String() string

func (*Contract) XXX_DiscardUnknown

func (m *Contract) XXX_DiscardUnknown()

func (*Contract) XXX_Marshal

func (m *Contract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Contract) XXX_Merge

func (m *Contract) XXX_Merge(src proto.Message)

func (*Contract) XXX_Size

func (m *Contract) XXX_Size() int

func (*Contract) XXX_Unmarshal

func (m *Contract) XXX_Unmarshal(b []byte) error

type ContractMeta

type ContractMeta struct {
	//Contract proposed by renter, will not be changed after renter proposed
	ContractId           []byte                `protobuf:"bytes,1,opt,name=contract_id,json=contractId,proto3" json:"contract_id,omitempty"`
	RenterAddress        []byte                `protobuf:"bytes,2,opt,name=renter_address,json=renterAddress,proto3" json:"renter_address,omitempty"`
	HostAddress          []byte                `protobuf:"bytes,3,opt,name=host_address,json=hostAddress,proto3" json:"host_address,omitempty"`
	ShardHash            []byte                `protobuf:"bytes,4,opt,name=shard_hash,json=shardHash,proto3" json:"shard_hash,omitempty"`
	ShardIndex           int32                 `protobuf:"varint,5,opt,name=shard_index,json=shardIndex,proto3" json:"shard_index,omitempty"`
	ShardFileSize        int64                 `protobuf:"varint,6,opt,name=shard_file_size,json=shardFileSize,proto3" json:"shard_file_size,omitempty"`
	FileHash             []byte                `protobuf:"bytes,7,opt,name=file_hash,json=fileHash,proto3" json:"file_hash,omitempty"`
	RentStart            *types.Timestamp      `protobuf:"bytes,8,opt,name=rent_start,json=rentStart,proto3" json:"rent_start,omitempty"`
	RentEnd              *types.Timestamp      `protobuf:"bytes,9,opt,name=rent_end,json=rentEnd,proto3" json:"rent_end,omitempty"`
	GuardAddress         []byte                `protobuf:"bytes,10,opt,name=guard_address,json=guardAddress,proto3" json:"guard_address,omitempty"`
	EscrowAddress        []byte                `protobuf:"bytes,11,opt,name=escrow_address,json=escrowAddress,proto3" json:"escrow_address,omitempty"`
	Price                int64                 `protobuf:"varint,12,opt,name=price,proto3" json:"price,omitempty"`
	Amount               int64                 `protobuf:"varint,13,opt,name=amount,proto3" json:"amount,omitempty"`
	CollaeteralAmount    int64                 `protobuf:"varint,14,opt,name=collaeteral_amount,json=collaeteralAmount,proto3" json:"collaeteral_amount,omitempty"`
	PayoutSchedule       ContractMeta_Schedule `` /* 138-byte string literal not displayed */
	NumPayouts           int32                 `protobuf:"varint,16,opt,name=num_payouts,json=numPayouts,proto3" json:"num_payouts,omitempty"`
	XXX_NoUnkeyedLiteral struct{}              `json:"-"`
	XXX_unrecognized     []byte                `json:"-"`
	XXX_sizecache        int32                 `json:"-"`
}

the relationship of the objects from Guard's view FileStoreMeta (1:n) Contract (1:n) payout contract is the signed document between the renter and host for one shard's storage the contract information contains buyer, seller, escrow, guard , storage shard's information, rent duration, amount, payment method(periodically and times) ContractMeta is the information which will not be changed after proposal Contract technically is the contract execution record, it contains the contractMeta and state information

func (*ContractMeta) Descriptor

func (*ContractMeta) Descriptor() ([]byte, []int)

func (*ContractMeta) GetAmount

func (m *ContractMeta) GetAmount() int64

func (*ContractMeta) GetCollaeteralAmount

func (m *ContractMeta) GetCollaeteralAmount() int64

func (*ContractMeta) GetContractId

func (m *ContractMeta) GetContractId() []byte

func (*ContractMeta) GetEscrowAddress

func (m *ContractMeta) GetEscrowAddress() []byte

func (*ContractMeta) GetFileHash

func (m *ContractMeta) GetFileHash() []byte

func (*ContractMeta) GetGuardAddress

func (m *ContractMeta) GetGuardAddress() []byte

func (*ContractMeta) GetHostAddress

func (m *ContractMeta) GetHostAddress() []byte

func (*ContractMeta) GetNumPayouts

func (m *ContractMeta) GetNumPayouts() int32

func (*ContractMeta) GetPayoutSchedule

func (m *ContractMeta) GetPayoutSchedule() ContractMeta_Schedule

func (*ContractMeta) GetPrice

func (m *ContractMeta) GetPrice() int64

func (*ContractMeta) GetRentEnd

func (m *ContractMeta) GetRentEnd() *types.Timestamp

func (*ContractMeta) GetRentStart

func (m *ContractMeta) GetRentStart() *types.Timestamp

func (*ContractMeta) GetRenterAddress

func (m *ContractMeta) GetRenterAddress() []byte

func (*ContractMeta) GetShardFileSize

func (m *ContractMeta) GetShardFileSize() int64

func (*ContractMeta) GetShardHash

func (m *ContractMeta) GetShardHash() []byte

func (*ContractMeta) GetShardIndex

func (m *ContractMeta) GetShardIndex() int32

func (*ContractMeta) ProtoMessage

func (*ContractMeta) ProtoMessage()

func (*ContractMeta) Reset

func (m *ContractMeta) Reset()

func (*ContractMeta) String

func (m *ContractMeta) String() string

func (*ContractMeta) XXX_DiscardUnknown

func (m *ContractMeta) XXX_DiscardUnknown()

func (*ContractMeta) XXX_Marshal

func (m *ContractMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ContractMeta) XXX_Merge

func (m *ContractMeta) XXX_Merge(src proto.Message)

func (*ContractMeta) XXX_Size

func (m *ContractMeta) XXX_Size() int

func (*ContractMeta) XXX_Unmarshal

func (m *ContractMeta) XXX_Unmarshal(b []byte) error

type ContractMeta_Schedule

type ContractMeta_Schedule int32
const (
	ContractMeta_MONTHLY   ContractMeta_Schedule = 0
	ContractMeta_QUARTERLY ContractMeta_Schedule = 1
	ContractMeta_ANNUALLY  ContractMeta_Schedule = 2
)

func (ContractMeta_Schedule) EnumDescriptor

func (ContractMeta_Schedule) EnumDescriptor() ([]byte, []int)

func (ContractMeta_Schedule) String

func (x ContractMeta_Schedule) String() string

type Contract_ContractState

type Contract_ContractState int32
const (
	Contract_DRAFT    Contract_ContractState = 0
	Contract_SIGNED   Contract_ContractState = 1
	Contract_UPLOADED Contract_ContractState = 2
	Contract_LOST     Contract_ContractState = 3
	Contract_CANCELED Contract_ContractState = 4
	Contract_CLOSED   Contract_ContractState = 5
)

func (Contract_ContractState) EnumDescriptor

func (Contract_ContractState) EnumDescriptor() ([]byte, []int)

func (Contract_ContractState) String

func (x Contract_ContractState) String() string

type FileChallengeQuestions

type FileChallengeQuestions struct {
	FileHash             []byte                `protobuf:"bytes,1,opt,name=file_hash,json=fileHash,proto3" json:"file_hash,omitempty"`
	ShardQuestions       []*ChallengeQuestions `protobuf:"bytes,2,rep,name=shard_questions,json=shardQuestions,proto3" json:"shard_questions,omitempty"`
	XXX_NoUnkeyedLiteral struct{}              `json:"-"`
	XXX_unrecognized     []byte                `json:"-"`
	XXX_sizecache        int32                 `json:"-"`
}

func (*FileChallengeQuestions) Descriptor

func (*FileChallengeQuestions) Descriptor() ([]byte, []int)

func (*FileChallengeQuestions) GetFileHash

func (m *FileChallengeQuestions) GetFileHash() []byte

func (*FileChallengeQuestions) GetShardQuestions

func (m *FileChallengeQuestions) GetShardQuestions() []*ChallengeQuestions

func (*FileChallengeQuestions) ProtoMessage

func (*FileChallengeQuestions) ProtoMessage()

func (*FileChallengeQuestions) Reset

func (m *FileChallengeQuestions) Reset()

func (*FileChallengeQuestions) String

func (m *FileChallengeQuestions) String() string

func (*FileChallengeQuestions) XXX_DiscardUnknown

func (m *FileChallengeQuestions) XXX_DiscardUnknown()

func (*FileChallengeQuestions) XXX_Marshal

func (m *FileChallengeQuestions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FileChallengeQuestions) XXX_Merge

func (m *FileChallengeQuestions) XXX_Merge(src proto.Message)

func (*FileChallengeQuestions) XXX_Size

func (m *FileChallengeQuestions) XXX_Size() int

func (*FileChallengeQuestions) XXX_Unmarshal

func (m *FileChallengeQuestions) XXX_Unmarshal(b []byte) error

type FileStoreMeta

type FileStoreMeta struct {
	//file store meta prepared by renter, will not changed after proposal
	RenterAddress        []byte           `protobuf:"bytes,1,opt,name=renter_address,json=renterAddress,proto3" json:"renter_address,omitempty"`
	FileHash             []byte           `protobuf:"bytes,2,opt,name=file_hash,json=fileHash,proto3" json:"file_hash,omitempty"`
	FileSize             int64            `protobuf:"varint,3,opt,name=file_size,json=fileSize,proto3" json:"file_size,omitempty"`
	RentStart            *types.Timestamp `protobuf:"bytes,4,opt,name=rent_start,json=rentStart,proto3" json:"rent_start,omitempty"`
	RentEnd              *types.Timestamp `protobuf:"bytes,5,opt,name=rent_end,json=rentEnd,proto3" json:"rent_end,omitempty"`
	CheckFrequence       int32            `protobuf:"varint,6,opt,name=check_frequence,json=checkFrequence,proto3" json:"check_frequence,omitempty"`
	GuardFee             int64            `protobuf:"varint,7,opt,name=guard_fee,json=guardFee,proto3" json:"guard_fee,omitempty"`
	EscrowFee            int64            `protobuf:"varint,8,opt,name=escrow_fee,json=escrowFee,proto3" json:"escrow_fee,omitempty"`
	ShardCount           int32            `protobuf:"varint,9,opt,name=shard_count,json=shardCount,proto3" json:"shard_count,omitempty"`
	MinimumShards        int32            `protobuf:"varint,10,opt,name=minimum_shards,json=minimumShards,proto3" json:"minimum_shards,omitempty"`
	RecoverThreshold     int32            `protobuf:"varint,11,opt,name=recover_threshold,json=recoverThreshold,proto3" json:"recover_threshold,omitempty"`
	EscrowAddress        []byte           `protobuf:"bytes,12,opt,name=escrow_address,json=escrowAddress,proto3" json:"escrow_address,omitempty"`
	GuardAddress         []byte           `protobuf:"bytes,13,opt,name=guard_address,json=guardAddress,proto3" json:"guard_address,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (*FileStoreMeta) Descriptor

func (*FileStoreMeta) Descriptor() ([]byte, []int)

func (*FileStoreMeta) GetCheckFrequence

func (m *FileStoreMeta) GetCheckFrequence() int32

func (*FileStoreMeta) GetEscrowAddress

func (m *FileStoreMeta) GetEscrowAddress() []byte

func (*FileStoreMeta) GetEscrowFee

func (m *FileStoreMeta) GetEscrowFee() int64

func (*FileStoreMeta) GetFileHash

func (m *FileStoreMeta) GetFileHash() []byte

func (*FileStoreMeta) GetFileSize

func (m *FileStoreMeta) GetFileSize() int64

func (*FileStoreMeta) GetGuardAddress

func (m *FileStoreMeta) GetGuardAddress() []byte

func (*FileStoreMeta) GetGuardFee

func (m *FileStoreMeta) GetGuardFee() int64

func (*FileStoreMeta) GetMinimumShards

func (m *FileStoreMeta) GetMinimumShards() int32

func (*FileStoreMeta) GetRecoverThreshold

func (m *FileStoreMeta) GetRecoverThreshold() int32

func (*FileStoreMeta) GetRentEnd

func (m *FileStoreMeta) GetRentEnd() *types.Timestamp

func (*FileStoreMeta) GetRentStart

func (m *FileStoreMeta) GetRentStart() *types.Timestamp

func (*FileStoreMeta) GetRenterAddress

func (m *FileStoreMeta) GetRenterAddress() []byte

func (*FileStoreMeta) GetShardCount

func (m *FileStoreMeta) GetShardCount() int32

func (*FileStoreMeta) ProtoMessage

func (*FileStoreMeta) ProtoMessage()

func (*FileStoreMeta) Reset

func (m *FileStoreMeta) Reset()

func (*FileStoreMeta) String

func (m *FileStoreMeta) String() string

func (*FileStoreMeta) XXX_DiscardUnknown

func (m *FileStoreMeta) XXX_DiscardUnknown()

func (*FileStoreMeta) XXX_Marshal

func (m *FileStoreMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FileStoreMeta) XXX_Merge

func (m *FileStoreMeta) XXX_Merge(src proto.Message)

func (*FileStoreMeta) XXX_Size

func (m *FileStoreMeta) XXX_Size() int

func (*FileStoreMeta) XXX_Unmarshal

func (m *FileStoreMeta) XXX_Unmarshal(b []byte) error

type FileStoreStatus

type FileStoreStatus struct {
	FileStoreMeta        *FileStoreMeta            `protobuf:"bytes,1,opt,name=file_store_meta,json=fileStoreMeta,proto3" json:"file_store_meta,omitempty"`
	State                FileStoreStatus_MetaState `protobuf:"varint,2,opt,name=state,proto3,enum=guard.FileStoreStatus_MetaState" json:"state,omitempty"`
	Contracts            []*Contract               `protobuf:"bytes,3,rep,name=contracts,proto3" json:"contracts,omitempty"`
	RenterSignature      []byte                    `protobuf:"bytes,4,opt,name=renter_signature,json=renterSignature,proto3" json:"renter_signature,omitempty"`
	GuardReceiveTime     *types.Timestamp          `protobuf:"bytes,5,opt,name=guard_receive_time,json=guardReceiveTime,proto3" json:"guard_receive_time,omitempty"`
	ChangeLog            []*Log                    `protobuf:"bytes,6,rep,name=change_log,json=changeLog,proto3" json:"change_log,omitempty"`
	CurentTime           *types.Timestamp          `protobuf:"bytes,7,opt,name=curent_time,json=curentTime,proto3" json:"curent_time,omitempty"`
	GuardSignature       []byte                    `protobuf:"bytes,8,opt,name=guard_signature,json=guardSignature,proto3" json:"guard_signature,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                  `json:"-"`
	XXX_unrecognized     []byte                    `json:"-"`
	XXX_sizecache        int32                     `json:"-"`
}

func (*FileStoreStatus) Descriptor

func (*FileStoreStatus) Descriptor() ([]byte, []int)

func (*FileStoreStatus) GetChangeLog

func (m *FileStoreStatus) GetChangeLog() []*Log

func (*FileStoreStatus) GetContracts

func (m *FileStoreStatus) GetContracts() []*Contract

func (*FileStoreStatus) GetCurentTime

func (m *FileStoreStatus) GetCurentTime() *types.Timestamp

func (*FileStoreStatus) GetFileStoreMeta

func (m *FileStoreStatus) GetFileStoreMeta() *FileStoreMeta

func (*FileStoreStatus) GetGuardReceiveTime

func (m *FileStoreStatus) GetGuardReceiveTime() *types.Timestamp

func (*FileStoreStatus) GetGuardSignature

func (m *FileStoreStatus) GetGuardSignature() []byte

func (*FileStoreStatus) GetRenterSignature

func (m *FileStoreStatus) GetRenterSignature() []byte

func (*FileStoreStatus) GetState

func (*FileStoreStatus) ProtoMessage

func (*FileStoreStatus) ProtoMessage()

func (*FileStoreStatus) Reset

func (m *FileStoreStatus) Reset()

func (*FileStoreStatus) String

func (m *FileStoreStatus) String() string

func (*FileStoreStatus) XXX_DiscardUnknown

func (m *FileStoreStatus) XXX_DiscardUnknown()

func (*FileStoreStatus) XXX_Marshal

func (m *FileStoreStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FileStoreStatus) XXX_Merge

func (m *FileStoreStatus) XXX_Merge(src proto.Message)

func (*FileStoreStatus) XXX_Size

func (m *FileStoreStatus) XXX_Size() int

func (*FileStoreStatus) XXX_Unmarshal

func (m *FileStoreStatus) XXX_Unmarshal(b []byte) error

type FileStoreStatus_MetaState

type FileStoreStatus_MetaState int32
const (
	FileStoreStatus_DRAFT        FileStoreStatus_MetaState = 0
	FileStoreStatus_UPLOADING    FileStoreStatus_MetaState = 1
	FileStoreStatus_RUNNING      FileStoreStatus_MetaState = 2
	FileStoreStatus_PARTIAL_LOST FileStoreStatus_MetaState = 3
	FileStoreStatus_LOST         FileStoreStatus_MetaState = 4
	FileStoreStatus_DONE         FileStoreStatus_MetaState = 5
)

func (FileStoreStatus_MetaState) EnumDescriptor

func (FileStoreStatus_MetaState) EnumDescriptor() ([]byte, []int)

func (FileStoreStatus_MetaState) String

func (x FileStoreStatus_MetaState) String() string

type GuardServiceClient

type GuardServiceClient interface {
	SubmitFileStoreMeta(ctx context.Context, in *FileStoreStatus, opts ...grpc.CallOption) (*Result, error)
	StatusInfo(ctx context.Context, in *shared.RuntimeInfoRequest, opts ...grpc.CallOption) (*shared.RuntimeInfoReport, error)
	SendQuestions(ctx context.Context, in *FileChallengeQuestions, opts ...grpc.CallOption) (*Result, error)
	CheckFileStoreMeta(ctx context.Context, in *CheckFileStoreMetaRequest, opts ...grpc.CallOption) (*FileStoreStatus, error)
}

GuardServiceClient is the client API for GuardService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewGuardServiceClient

func NewGuardServiceClient(cc *grpc.ClientConn) GuardServiceClient

type GuardServiceServer

type GuardServiceServer interface {
	SubmitFileStoreMeta(context.Context, *FileStoreStatus) (*Result, error)
	StatusInfo(context.Context, *shared.RuntimeInfoRequest) (*shared.RuntimeInfoReport, error)
	SendQuestions(context.Context, *FileChallengeQuestions) (*Result, error)
	CheckFileStoreMeta(context.Context, *CheckFileStoreMetaRequest) (*FileStoreStatus, error)
}

GuardServiceServer is the server API for GuardService service.

type Log

type Log struct {
	ChangeTime           *types.Timestamp `protobuf:"bytes,1,opt,name=change_time,json=changeTime,proto3" json:"change_time,omitempty"`
	ChangeOriginator     []byte           `protobuf:"bytes,2,opt,name=change_originator,json=changeOriginator,proto3" json:"change_originator,omitempty"`
	Change               []byte           `protobuf:"bytes,3,opt,name=change,proto3" json:"change,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (*Log) Descriptor

func (*Log) Descriptor() ([]byte, []int)

func (*Log) GetChange

func (m *Log) GetChange() []byte

func (*Log) GetChangeOriginator

func (m *Log) GetChangeOriginator() []byte

func (*Log) GetChangeTime

func (m *Log) GetChangeTime() *types.Timestamp

func (*Log) ProtoMessage

func (*Log) ProtoMessage()

func (*Log) Reset

func (m *Log) Reset()

func (*Log) String

func (m *Log) String() string

func (*Log) XXX_DiscardUnknown

func (m *Log) XXX_DiscardUnknown()

func (*Log) XXX_Marshal

func (m *Log) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Log) XXX_Merge

func (m *Log) XXX_Merge(src proto.Message)

func (*Log) XXX_Size

func (m *Log) XXX_Size() int

func (*Log) XXX_Unmarshal

func (m *Log) XXX_Unmarshal(b []byte) error

type ProofOfReplicateChallenge

type ProofOfReplicateChallenge struct {
	Question             *ChallengeQuestion `protobuf:"bytes,1,opt,name=question,proto3" json:"question,omitempty"`
	ChallengeTime        *types.Timestamp   `protobuf:"bytes,2,opt,name=challenge_time,json=challengeTime,proto3" json:"challenge_time,omitempty"`
	GuardAddress         []byte             `protobuf:"bytes,3,opt,name=guard_address,json=guardAddress,proto3" json:"guard_address,omitempty"`
	GuardSignature       []byte             `protobuf:"bytes,4,opt,name=guard_signature,json=guardSignature,proto3" json:"guard_signature,omitempty"`
	HostAnswer           []byte             `protobuf:"bytes,5,opt,name=host_answer,json=hostAnswer,proto3" json:"host_answer,omitempty"`
	HostSignTime         *types.Timestamp   `protobuf:"bytes,6,opt,name=host_sign_time,json=hostSignTime,proto3" json:"host_sign_time,omitempty"`
	HostSignature        []byte             `protobuf:"bytes,7,opt,name=host_signature,json=hostSignature,proto3" json:"host_signature,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

func (*ProofOfReplicateChallenge) Descriptor

func (*ProofOfReplicateChallenge) Descriptor() ([]byte, []int)

func (*ProofOfReplicateChallenge) GetChallengeTime

func (m *ProofOfReplicateChallenge) GetChallengeTime() *types.Timestamp

func (*ProofOfReplicateChallenge) GetGuardAddress

func (m *ProofOfReplicateChallenge) GetGuardAddress() []byte

func (*ProofOfReplicateChallenge) GetGuardSignature

func (m *ProofOfReplicateChallenge) GetGuardSignature() []byte

func (*ProofOfReplicateChallenge) GetHostAnswer

func (m *ProofOfReplicateChallenge) GetHostAnswer() []byte

func (*ProofOfReplicateChallenge) GetHostSignTime

func (m *ProofOfReplicateChallenge) GetHostSignTime() *types.Timestamp

func (*ProofOfReplicateChallenge) GetHostSignature

func (m *ProofOfReplicateChallenge) GetHostSignature() []byte

func (*ProofOfReplicateChallenge) GetQuestion

func (m *ProofOfReplicateChallenge) GetQuestion() *ChallengeQuestion

func (*ProofOfReplicateChallenge) ProtoMessage

func (*ProofOfReplicateChallenge) ProtoMessage()

func (*ProofOfReplicateChallenge) Reset

func (m *ProofOfReplicateChallenge) Reset()

func (*ProofOfReplicateChallenge) String

func (m *ProofOfReplicateChallenge) String() string

func (*ProofOfReplicateChallenge) XXX_DiscardUnknown

func (m *ProofOfReplicateChallenge) XXX_DiscardUnknown()

func (*ProofOfReplicateChallenge) XXX_Marshal

func (m *ProofOfReplicateChallenge) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ProofOfReplicateChallenge) XXX_Merge

func (m *ProofOfReplicateChallenge) XXX_Merge(src proto.Message)

func (*ProofOfReplicateChallenge) XXX_Size

func (m *ProofOfReplicateChallenge) XXX_Size() int

func (*ProofOfReplicateChallenge) XXX_Unmarshal

func (m *ProofOfReplicateChallenge) XXX_Unmarshal(b []byte) error

type ResponseCode

type ResponseCode int32
const (
	ResponseCode_SUCCESS                ResponseCode = 0
	ResponseCode_SIGNATURE_FORMAT_ERROR ResponseCode = 1
	ResponseCode_COMPUTE_ADDRESS_ERROR  ResponseCode = 2
	ResponseCode_OTHER_ERROR            ResponseCode = 20
)

func (ResponseCode) EnumDescriptor

func (ResponseCode) EnumDescriptor() ([]byte, []int)

func (ResponseCode) String

func (x ResponseCode) String() string

type Result

type Result struct {
	Code                 ResponseCode     `protobuf:"varint,1,opt,name=code,proto3,enum=guard.ResponseCode" json:"code,omitempty"`
	Message              string           `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	ResponseTime         *types.Timestamp `protobuf:"bytes,3,opt,name=response_time,json=responseTime,proto3" json:"response_time,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (*Result) Descriptor

func (*Result) Descriptor() ([]byte, []int)

func (*Result) GetCode

func (m *Result) GetCode() ResponseCode

func (*Result) GetMessage

func (m *Result) GetMessage() string

func (*Result) GetResponseTime

func (m *Result) GetResponseTime() *types.Timestamp

func (*Result) ProtoMessage

func (*Result) ProtoMessage()

func (*Result) Reset

func (m *Result) Reset()

func (*Result) String

func (m *Result) String() string

func (*Result) XXX_DiscardUnknown

func (m *Result) XXX_DiscardUnknown()

func (*Result) XXX_Marshal

func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Result) XXX_Merge

func (m *Result) XXX_Merge(src proto.Message)

func (*Result) XXX_Size

func (m *Result) XXX_Size() int

func (*Result) XXX_Unmarshal

func (m *Result) XXX_Unmarshal(b []byte) error

type UnimplementedGuardServiceServer

type UnimplementedGuardServiceServer struct {
}

UnimplementedGuardServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedGuardServiceServer) CheckFileStoreMeta

func (*UnimplementedGuardServiceServer) SendQuestions

func (*UnimplementedGuardServiceServer) StatusInfo

func (*UnimplementedGuardServiceServer) SubmitFileStoreMeta

func (*UnimplementedGuardServiceServer) SubmitFileStoreMeta(ctx context.Context, req *FileStoreStatus) (*Result, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL