Documentation ¶
Index ¶
- Constants
- func ComputeChunkCost(chunkIndex int, chunkSize int) (int, error)
- func Delete(scConfig *config.SCConfig, walletConfig config.WalletConfig, ...) (*string, error)
- func DivideIntoChunks(data []byte, chunkSize int) [][]byte
- func Fetch(network *config.NetworkInfos, websiteAddress string) ([]byte, error)
- func GetFirstCreationTimestamp(network *config.NetworkInfos, websiteAddress string) (uint64, error)
- func GetLastUpdateTimestamp(network *config.NetworkInfos, websiteAddress string) (uint64, error)
- func GetNumberOfChunks(client *node.Client, websiteAddress string) (int32, error)
- func GetOwner(network *config.NetworkInfos, websiteAddress string) (string, error)
- func UploadChunk(websiteAddress string, walletConfig pkgConfig.WalletConfig, ...) (operationID string, err error)
- type DeploymentResult
Constants ¶
View Source
const (
ChunkSize = 64_000 // 64KB
)
Variables ¶
This section is empty.
Functions ¶
func ComputeChunkCost ¶
ComputeChunkCost computes the cost of uploading a chunk to a website. The cost is computed based on the size of the chunk and the index of the chunk. The cost of the first chunk includes the cost of nbChunk key creation.
TODO: This function should be updated to avoid sending coins for chunks that do not require it.
- chunk X in storage has chunkSize bytes, so we should not send coins for it.
- chunk X in storage has 30% of chunkSize bytes, so we should only the missing 70% of chunkSize bytes in coins.
func Delete ¶
func Delete(scConfig *config.SCConfig, walletConfig config.WalletConfig, networkInfos *msConfig.NetworkInfos, address string, ) (*string, error)
func DivideIntoChunks ¶
func Fetch ¶
func Fetch(network *config.NetworkInfos, websiteAddress string) ([]byte, error)
Fetch retrieves the complete data of a website as bytes.
func GetFirstCreationTimestamp ¶
func GetFirstCreationTimestamp(network *config.NetworkInfos, websiteAddress string) (uint64, error)
func GetLastUpdateTimestamp ¶
func GetLastUpdateTimestamp(network *config.NetworkInfos, websiteAddress string) (uint64, error)
func GetNumberOfChunks ¶
GetNumberOfChunks fetches and returns the number of chunks for the website.
func GetOwner ¶
func GetOwner(network *config.NetworkInfos, websiteAddress string) (string, error)
GetOwner retrieves the owner of the website.
func UploadChunk ¶
Types ¶
type DeploymentResult ¶
func Deploy ¶
func Deploy(walletNickname string, networkInfos *msConfig.NetworkInfos, scConfig *pkgConfig.SCConfig) (*DeploymentResult, error)
Click to show internal directories.
Click to hide internal directories.