Documentation ¶
Index ¶
- Constants
- func CheckPassport(currBlockHeight uint64, passportData []byte) (common.Address, error)
- func CheckPdpProve(nodeAddr common.Address, blockHash []byte, fileBlockCount uint64, ...) error
- func DecodeBool(source *common.ZeroCopySource) (bool, error)
- func DecodeVarBytes(source *common.ZeroCopySource) ([]byte, error)
- func EncRet(ret bool, info []byte) []byte
- func FsCancelFileRead(native *native.NativeService) ([]byte, error)
- func FsCreateSpace(native *native.NativeService) ([]byte, error)
- func FsDeleteFiles(native *native.NativeService) ([]byte, error)
- func FsDeleteSpace(native *native.NativeService) ([]byte, error)
- func FsFileProve(native *native.NativeService) ([]byte, error)
- func FsGetFileHashList(native *native.NativeService) ([]byte, error)
- func FsGetFileInfo(native *native.NativeService) ([]byte, error)
- func FsGetGlobalParam(native *native.NativeService) ([]byte, error)
- func FsGetNodeInfoList(native *native.NativeService) ([]byte, error)
- func FsGetPdpInfoList(native *native.NativeService) ([]byte, error)
- func FsGetReadPledge(native *native.NativeService) ([]byte, error)
- func FsGetSpaceInfo(native *native.NativeService) ([]byte, error)
- func FsGetWhiteList(native *native.NativeService) ([]byte, error)
- func FsNodeCancel(native *native.NativeService) ([]byte, error)
- func FsNodeQuery(native *native.NativeService) ([]byte, error)
- func FsNodeRegister(native *native.NativeService) ([]byte, error)
- func FsNodeUpdate(native *native.NativeService) ([]byte, error)
- func FsNodeWithDrawProfit(native *native.NativeService) ([]byte, error)
- func FsReadFilePledge(native *native.NativeService) ([]byte, error)
- func FsReadFileSettle(native *native.NativeService) ([]byte, error)
- func FsRenewFiles(native *native.NativeService) ([]byte, error)
- func FsSetGlobalParam(native *native.NativeService) ([]byte, error)
- func FsSetWhiteList(native *native.NativeService) ([]byte, error)
- func FsStoreFiles(native *native.NativeService) ([]byte, error)
- func FsTransferFiles(native *native.NativeService) ([]byte, error)
- func FsUpdateSpace(native *native.NativeService) ([]byte, error)
- func GenFsFileInfoKey(contract common.Address, fileOwner common.Address, fileHash []byte) []byte
- func GenFsFileInfoPrefix(contract common.Address, fileOwner common.Address) []byte
- func GenFsFileOwnerKey(contract common.Address, fileHash []byte) []byte
- func GenFsNodeInfoKey(contract common.Address, nodeAddr common.Address) []byte
- func GenFsNodeInfoPrefix(contract common.Address) []byte
- func GenFsPdpRecordKey(contract common.Address, fileHash []byte, fileOwner common.Address, ...) []byte
- func GenFsPdpRecordPrefix(contract common.Address, fileHash []byte, fileOwner common.Address) []byte
- func GenFsReadPledgeKey(contract common.Address, downloader common.Address, fileHash []byte) []byte
- func GenFsSpaceKey(contract common.Address, spaceOwner common.Address) []byte
- func GenFsWhiteListKey(contract common.Address, fileOwner common.Address, fileHash []byte) []byte
- func GenGlobalParamKey(contract common.Address) []byte
- func InitFs()
- func RegisterFsContract(native *native.NativeService)
- type Errors
- type FileDel
- type FileDelList
- type FileHash
- type FileHashList
- type FileInfo
- type FileInfoList
- type FileReNew
- type FileReNewList
- type FileReadSettleSlice
- type FileTransfer
- type FileTransferList
- type FileWhiteList
- type FsGlobalParam
- type FsNodeInfo
- type FsNodeInfoList
- type GetReadPledge
- type Passport
- type PdpData
- type PdpRecord
- type PdpRecordKey
- type PdpRecordList
- type ReadPlan
- type ReadPledge
- type RetInfo
- type SpaceInfo
- type SpaceUpdate
- type WhiteList
Constants ¶
View Source
const ( DefaultPassportExpire = 9 //block count. passport expire for GetFileHashList DefaultNodeMinVolume = 1024 * 1024 //kb. min total volume with fsNode DefaultNodePerKbPledge = 1 //fsNode's pledge for participant DefaultMinDownLoadFee = 1 //min download fee for single task* DefaultGasPerKbForRead = 1 //cost for ontfs-sdk read from fsNode* DefaultGasPerKbForSaveWithFile = 1 //cost for ontfs-sdk save from fsNode* DefaultGasPerKbForSaveWithSpace = 1 //cost for ontfs-sdk save from fsNode* DefaultPdpHeightIV = 8 //pdp challenge height IV DefaultPerBlockSize = 256 //kb. DefaultPdpBlockNum = 32 )
View Source
const ( FileStorageTypeUseSpace = 0 FileStorageTypeUseFile = 1 )
View Source
const ( FS_SET_GLOBAL_PARAM = "FsSetGlobalParam" FS_GET_GLOBAL_PARAM = "FsGetGlobalParam" FS_NODE_REGISTER = "FsNodeRegister" FS_NODE_QUERY = "FsNodeQuery" FS_NODE_UPDATE = "FsNodeUpdate" FS_NODE_CANCEL = "FsNodeCancel" FS_FILE_PROVE = "FsFileProve" FS_NODE_WITH_DRAW_PROFIT = "FsNodeWithDrawProfit" FS_GET_NODE_LIST = "FsGetNodeList" FS_GET_PDP_INFO_LIST = "FsGetPdpInfoList" FS_STORE_FILES = "FsStoreFiles" FS_RENEW_FILES = "FsRenewFiles" FS_DELETE_FILES = "FsDeleteFiles" FS_TRANSFER_FILES = "FsTransferFiles" FS_GET_FILE_INFO = "FsGetFileInfo" FS_GET_FILE_LIST = "FsGetFileList" FS_READ_FILE_PLEDGE = "FsReadFilePledge" FS_READ_FILE_SETTLE = "FsReadFileSettle" FS_GET_READ_PLEDGE = "FsGetReadPledge" FS_CANCEL_FILE_READ = "FsCancelFileRead" FS_SET_WHITE_LIST = "FsSetWhiteList" FS_GET_WHITE_LIST = "FsGetWhiteList" FS_CREATE_SPACE = "FsCreateSpace" FS_DELETE_SPACE = "FsDeleteSpace" FS_UPDATE_SPACE = "FsUpdateSpace" FS_GET_SPACE_INFO = "FsGetSpaceInfo" )
View Source
const ( ONTFS_GLOBAL_PARAM = "ontFsGlobalParam" ONTFS_NODE_INFO = "ontFsNodeInfo" ONTFS_FILE_INFO = "ontFsFileInfo" ONTFS_FILE_PDP = "ontFsFilePdp" ONTFS_FILE_OWNER = "ontFsFileOwner" ONTFS_FILE_WHITE_LIST = "ontFsFileWhiteList" ONTFS_FILE_READ_PLEDGE = "ontFsFileReadPledge" ONTFS_FILE_SPACE = "ontFsFileSpace" )
Variables ¶
This section is empty.
Functions ¶
func CheckPassport ¶
func CheckPdpProve ¶
func DecodeBool ¶
func DecodeBool(source *common.ZeroCopySource) (bool, error)
func DecodeVarBytes ¶
func DecodeVarBytes(source *common.ZeroCopySource) ([]byte, error)
func FsCancelFileRead ¶
func FsCancelFileRead(native *native.NativeService) ([]byte, error)
func FsCreateSpace ¶
func FsCreateSpace(native *native.NativeService) ([]byte, error)
func FsDeleteFiles ¶
func FsDeleteFiles(native *native.NativeService) ([]byte, error)
func FsDeleteSpace ¶
func FsDeleteSpace(native *native.NativeService) ([]byte, error)
func FsFileProve ¶
func FsFileProve(native *native.NativeService) ([]byte, error)
func FsGetFileHashList ¶
func FsGetFileHashList(native *native.NativeService) ([]byte, error)
func FsGetFileInfo ¶
func FsGetFileInfo(native *native.NativeService) ([]byte, error)
func FsGetGlobalParam ¶
func FsGetGlobalParam(native *native.NativeService) ([]byte, error)
func FsGetNodeInfoList ¶
func FsGetNodeInfoList(native *native.NativeService) ([]byte, error)
func FsGetPdpInfoList ¶
func FsGetPdpInfoList(native *native.NativeService) ([]byte, error)
func FsGetReadPledge ¶
func FsGetReadPledge(native *native.NativeService) ([]byte, error)
func FsGetSpaceInfo ¶
func FsGetSpaceInfo(native *native.NativeService) ([]byte, error)
func FsGetWhiteList ¶
func FsGetWhiteList(native *native.NativeService) ([]byte, error)
func FsNodeCancel ¶
func FsNodeCancel(native *native.NativeService) ([]byte, error)
func FsNodeQuery ¶
func FsNodeQuery(native *native.NativeService) ([]byte, error)
func FsNodeRegister ¶
func FsNodeRegister(native *native.NativeService) ([]byte, error)
func FsNodeUpdate ¶
func FsNodeUpdate(native *native.NativeService) ([]byte, error)
func FsNodeWithDrawProfit ¶
func FsNodeWithDrawProfit(native *native.NativeService) ([]byte, error)
func FsReadFilePledge ¶
func FsReadFilePledge(native *native.NativeService) ([]byte, error)
func FsReadFileSettle ¶
func FsReadFileSettle(native *native.NativeService) ([]byte, error)
func FsRenewFiles ¶
func FsRenewFiles(native *native.NativeService) ([]byte, error)
func FsSetGlobalParam ¶
func FsSetGlobalParam(native *native.NativeService) ([]byte, error)
func FsSetWhiteList ¶
func FsSetWhiteList(native *native.NativeService) ([]byte, error)
func FsStoreFiles ¶
func FsStoreFiles(native *native.NativeService) ([]byte, error)
func FsTransferFiles ¶
func FsTransferFiles(native *native.NativeService) ([]byte, error)
func FsUpdateSpace ¶
func FsUpdateSpace(native *native.NativeService) ([]byte, error)
func GenFsFileInfoKey ¶
func GenFsFileInfoPrefix ¶
func GenFsNodeInfoKey ¶
func GenFsNodeInfoPrefix ¶
func GenFsPdpRecordKey ¶
func GenFsPdpRecordPrefix ¶
func GenFsReadPledgeKey ¶
func GenFsWhiteListKey ¶
func GenGlobalParamKey ¶
func RegisterFsContract ¶
func RegisterFsContract(native *native.NativeService)
Types ¶
type Errors ¶
func (*Errors) AddErrorsEvent ¶
func (this *Errors) AddErrorsEvent(native *native.NativeService)
func (*Errors) AddObjectError ¶
func (*Errors) FromString ¶
type FileDel ¶
type FileDel struct {
FileHash []byte
}
func (*FileDel) Deserialization ¶
func (this *FileDel) Deserialization(source *common.ZeroCopySource) error
func (*FileDel) Serialization ¶
func (this *FileDel) Serialization(sink *common.ZeroCopySink)
type FileDelList ¶
type FileDelList struct {
FilesDel []FileDel
}
func (*FileDelList) Deserialization ¶
func (this *FileDelList) Deserialization(source *common.ZeroCopySource) error
func (*FileDelList) Serialization ¶
func (this *FileDelList) Serialization(sink *common.ZeroCopySink)
type FileHashList ¶
type FileHashList struct {
FilesH []FileHash
}
func (*FileHashList) Deserialization ¶
func (this *FileHashList) Deserialization(source *common.ZeroCopySource) error
func (*FileHashList) Serialization ¶
func (this *FileHashList) Serialization(sink *common.ZeroCopySink)
type FileInfo ¶
type FileInfo struct { FileHash []byte FileOwner common.Address FileDesc []byte FileBlockCount uint64 RealFileSize uint64 CopyNumber uint64 PayAmount uint64 RestAmount uint64 FileCost uint64 FirstPdp bool PdpInterval uint64 TimeStart uint64 TimeExpired uint64 PdpParam []byte ValidFlag bool StorageType uint64 }
func (*FileInfo) Deserialization ¶
func (this *FileInfo) Deserialization(source *common.ZeroCopySource) error
func (*FileInfo) Serialization ¶
func (this *FileInfo) Serialization(sink *common.ZeroCopySink)
type FileInfoList ¶
type FileInfoList struct {
FilesI []FileInfo
}
func (*FileInfoList) Deserialization ¶
func (this *FileInfoList) Deserialization(source *common.ZeroCopySource) error
func (*FileInfoList) Serialization ¶
func (this *FileInfoList) Serialization(sink *common.ZeroCopySink)
type FileReNew ¶
type FileReNew struct { FileHash []byte FileOwner common.Address Payer common.Address NewTimeExpired uint64 }
func (*FileReNew) Deserialization ¶
func (this *FileReNew) Deserialization(source *common.ZeroCopySource) error
func (*FileReNew) Serialization ¶
func (this *FileReNew) Serialization(sink *common.ZeroCopySink)
type FileReNewList ¶
type FileReNewList struct {
FilesReNew []FileReNew
}
func (*FileReNewList) Deserialization ¶
func (this *FileReNewList) Deserialization(source *common.ZeroCopySource) error
func (*FileReNewList) Serialization ¶
func (this *FileReNewList) Serialization(sink *common.ZeroCopySink)
type FileReadSettleSlice ¶
type FileReadSettleSlice struct { FileHash []byte PayFrom common.Address PayTo common.Address SliceId uint64 PledgeHeight uint64 Sig []byte PubKey []byte }
func (*FileReadSettleSlice) Deserialization ¶
func (this *FileReadSettleSlice) Deserialization(source *common.ZeroCopySource) error
func (*FileReadSettleSlice) Serialization ¶
func (this *FileReadSettleSlice) Serialization(sink *common.ZeroCopySink)
type FileTransfer ¶
func (*FileTransfer) Deserialization ¶
func (this *FileTransfer) Deserialization(source *common.ZeroCopySource) error
func (*FileTransfer) Serialization ¶
func (this *FileTransfer) Serialization(sink *common.ZeroCopySink)
type FileTransferList ¶
type FileTransferList struct {
FilesTransfer []FileTransfer
}
func (*FileTransferList) Deserialization ¶
func (this *FileTransferList) Deserialization(source *common.ZeroCopySource) error
func (*FileTransferList) Serialization ¶
func (this *FileTransferList) Serialization(sink *common.ZeroCopySink)
type FileWhiteList ¶
func (*FileWhiteList) Deserialization ¶
func (this *FileWhiteList) Deserialization(source *common.ZeroCopySource) error
func (*FileWhiteList) Serialization ¶
func (this *FileWhiteList) Serialization(sink *common.ZeroCopySink)
type FsGlobalParam ¶
type FsGlobalParam struct { MinDownLoadFee uint64 //min download fee for single task NodeMinVolume uint64 //min total volume with fsNode NodePerKbPledge uint64 //fsNode's pledge for participant GasPerKbForRead uint64 //cost for ontfs-sdk read from fsNode GasPerKbForSaveWithFile uint64 //cost for ontfs-sdk save from fsNode GasPerKbForSaveWithSpace uint64 //cost for ontfs-sdk save from fsNode }
func (*FsGlobalParam) Deserialization ¶
func (this *FsGlobalParam) Deserialization(source *common.ZeroCopySource) error
func (*FsGlobalParam) Serialization ¶
func (this *FsGlobalParam) Serialization(sink *common.ZeroCopySink)
type FsNodeInfo ¶
type FsNodeInfo struct { Pledge uint64 Profit uint64 Volume uint64 RestVol uint64 ServiceTime uint64 MinPdpInterval uint64 NodeAddr common.Address NodeNetAddr []byte }
func (*FsNodeInfo) Deserialization ¶
func (this *FsNodeInfo) Deserialization(source *common.ZeroCopySource) error
func (*FsNodeInfo) Serialization ¶
func (this *FsNodeInfo) Serialization(sink *common.ZeroCopySink)
type FsNodeInfoList ¶
type FsNodeInfoList struct {
NodesInfo []FsNodeInfo
}
func (*FsNodeInfoList) Deserialization ¶
func (this *FsNodeInfoList) Deserialization(source *common.ZeroCopySource) error
func (*FsNodeInfoList) Serialization ¶
func (this *FsNodeInfoList) Serialization(sink *common.ZeroCopySink)
type GetReadPledge ¶
func (*GetReadPledge) Deserialization ¶
func (this *GetReadPledge) Deserialization(source *common.ZeroCopySource) error
func (*GetReadPledge) Serialization ¶
func (this *GetReadPledge) Serialization(sink *common.ZeroCopySink)
type Passport ¶
type Passport struct { BlockHeight uint64 BlockHash []byte WalletAddr common.Address PublicKey []byte Signature []byte }
func (*Passport) Deserialization ¶
func (this *Passport) Deserialization(source *common.ZeroCopySource) error
func (*Passport) Serialization ¶
func (this *Passport) Serialization(sink *common.ZeroCopySink)
type PdpData ¶
type PdpData struct { NodeAddr common.Address FileHash []byte ProveData []byte ChallengeHeight uint64 }
func (*PdpData) Deserialization ¶
func (this *PdpData) Deserialization(source *common.ZeroCopySource) error
func (*PdpData) Serialization ¶
func (this *PdpData) Serialization(sink *common.ZeroCopySink)
type PdpRecord ¶
type PdpRecord struct { NodeAddr common.Address FileHash []byte FileOwner common.Address PdpCount uint64 // pdp times LastPdpTime uint64 NextHeight uint64 //pdp next challenge height SettleFlag bool }
func (*PdpRecord) Deserialization ¶
func (this *PdpRecord) Deserialization(source *common.ZeroCopySource) error
func (*PdpRecord) Serialization ¶
func (this *PdpRecord) Serialization(sink *common.ZeroCopySink)
type PdpRecordKey ¶
type PdpRecordKey struct {
RecordKey []byte
}
type PdpRecordList ¶
type PdpRecordList struct {
PdpRecords []PdpRecord
}
func (*PdpRecordList) Deserialization ¶
func (this *PdpRecordList) Deserialization(source *common.ZeroCopySource) error
func (*PdpRecordList) Serialization ¶
func (this *PdpRecordList) Serialization(sink *common.ZeroCopySink)
type ReadPlan ¶
func (*ReadPlan) Deserialization ¶
func (this *ReadPlan) Deserialization(source *common.ZeroCopySource) error
func (*ReadPlan) Serialization ¶
func (this *ReadPlan) Serialization(sink *common.ZeroCopySink)
type ReadPledge ¶
type ReadPledge struct { FileHash []byte Downloader common.Address BlockHeight uint64 ExpireHeight uint64 RestMoney uint64 ReadPlans []ReadPlan }
func (*ReadPledge) Deserialization ¶
func (this *ReadPledge) Deserialization(source *common.ZeroCopySource) error
func (*ReadPledge) Serialization ¶
func (this *ReadPledge) Serialization(sink *common.ZeroCopySink)
type RetInfo ¶
func (*RetInfo) Deserialization ¶
func (this *RetInfo) Deserialization(source *common.ZeroCopySource) error
func (*RetInfo) Serialization ¶
func (this *RetInfo) Serialization(sink *common.ZeroCopySink)
type SpaceInfo ¶
type SpaceInfo struct { SpaceOwner common.Address Volume uint64 RestVol uint64 CopyNumber uint64 PayAmount uint64 RestAmount uint64 PdpInterval uint64 TimeStart uint64 TimeExpired uint64 ValidFlag bool }
func (*SpaceInfo) Deserialization ¶
func (this *SpaceInfo) Deserialization(source *common.ZeroCopySource) error
func (*SpaceInfo) Serialization ¶
func (this *SpaceInfo) Serialization(sink *common.ZeroCopySink)
type SpaceUpdate ¶
type SpaceUpdate struct { SpaceOwner common.Address Payer common.Address NewVolume uint64 NewTimeExpired uint64 }
func (*SpaceUpdate) Deserialization ¶
func (this *SpaceUpdate) Deserialization(source *common.ZeroCopySource) error
func (*SpaceUpdate) Serialization ¶
func (this *SpaceUpdate) Serialization(sink *common.ZeroCopySink)
type WhiteList ¶
func (*WhiteList) Deserialization ¶
func (this *WhiteList) Deserialization(source *common.ZeroCopySource) error
func (*WhiteList) Serialization ¶
func (this *WhiteList) Serialization(sink *common.ZeroCopySink)
Source Files ¶
- app_sdk.go
- constants.go
- errors.go
- file_del.go
- file_get_pledge.go
- file_info.go
- file_pdp_data.go
- file_pdp_record.go
- file_read_pledge.go
- file_read_settle_slice.go
- file_renew.go
- file_transfer.go
- file_white_list.go
- global_param.go
- init.go
- node_business.go
- node_govern.go
- node_info.go
- passport.go
- result_info.go
- space.go
- space_update.go
- utils.go
- vk.go
Click to show internal directories.
Click to hide internal directories.