Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/enterprise blobber #1565

Merged
merged 3 commits into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion wasmsdk/allocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func getAllocationBlobbers(preferredBlobberURLs []string,
}

func createAllocation(datashards, parityshards int, size int64,
minReadPrice, maxReadPrice, minWritePrice, maxWritePrice int64, lock int64, blobberIds, blobberAuthTickets []string, setThirdPartyExtendable, force bool) (
minReadPrice, maxReadPrice, minWritePrice, maxWritePrice int64, lock int64, blobberIds, blobberAuthTickets []string, setThirdPartyExtendable, IsEnterprise, force bool) (
*transaction.Transaction, error) {

options := sdk.CreateAllocationOptions{
Expand All @@ -80,6 +80,7 @@ func createAllocation(datashards, parityshards int, size int64,
Lock: uint64(lock),
BlobberIds: blobberIds,
ThirdPartyExtendable: setThirdPartyExtendable,
IsEnterprise: IsEnterprise,
BlobberAuthTickets: blobberAuthTickets,
Force: force,
}
Expand Down
6 changes: 4 additions & 2 deletions zboxcore/sdk/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,7 @@ type CreateAllocationOptions struct {
BlobberIds []string
BlobberAuthTickets []string
ThirdPartyExtendable bool
IsEnterprise bool
FileOptionsParams *FileOptionsParameters
Force bool
}
Expand All @@ -1045,14 +1046,14 @@ func CreateAllocationWith(options CreateAllocationOptions) (
return CreateAllocationForOwner(client.GetClientID(),
client.GetClientPublicKey(), options.DataShards, options.ParityShards,
options.Size, options.ReadPrice, options.WritePrice, options.Lock,
options.BlobberIds, options.BlobberAuthTickets, options.ThirdPartyExtendable, options.Force, options.FileOptionsParams)
options.BlobberIds, options.BlobberAuthTickets, options.ThirdPartyExtendable, options.IsEnterprise, options.Force, options.FileOptionsParams)
}

func CreateAllocationForOwner(
owner, ownerpublickey string,
datashards, parityshards int, size int64,
readPrice, writePrice PriceRange,
lock uint64, preferredBlobberIds, blobberAuthTickets []string, thirdPartyExtendable, force bool, fileOptionsParams *FileOptionsParameters,
lock uint64, preferredBlobberIds, blobberAuthTickets []string, thirdPartyExtendable, IsEnterprise, force bool, fileOptionsParams *FileOptionsParameters,
) (hash string, nonce int64, txn *transaction.Transaction, err error) {

if lock > math.MaxInt64 {
Expand All @@ -1077,6 +1078,7 @@ func CreateAllocationForOwner(
allocationRequest["owner_public_key"] = ownerpublickey
allocationRequest["third_party_extendable"] = thirdPartyExtendable
allocationRequest["file_options_changed"], allocationRequest["file_options"] = calculateAllocationFileOptions(63 /*0011 1111*/, fileOptionsParams)
allocationRequest["is_enterprise"] = IsEnterprise

var sn = transaction.SmartContractTxnData{
Name: transaction.NEW_ALLOCATION_REQUEST,
Expand Down
Loading