diff --git a/codex/contracts/requests.nim b/codex/contracts/requests.nim index cae3c55a..f9a52f03 100644 --- a/codex/contracts/requests.nim +++ b/codex/contracts/requests.nim @@ -17,14 +17,13 @@ type duration*: UInt256 proofProbability*: UInt256 reward*: UInt256 + slots*: uint64 StorageContent* = object cid*: string erasure*: StorageErasure por*: StoragePoR StorageErasure* = object totalChunks*: uint64 - totalNodes*: uint64 - nodeId*: uint64 StoragePoR* = object u*: seq[byte] publicKey*: seq[byte] @@ -44,7 +43,8 @@ func fromTuple(_: type StorageAsk, tupl: tuple): StorageAsk = size: tupl[0], duration: tupl[1], proofProbability: tupl[2], - reward: tupl[3] + reward: tupl[3], + slots: tupl[4] ) func fromTuple(_: type StorageContent, tupl: tuple): StorageContent = @@ -56,9 +56,7 @@ func fromTuple(_: type StorageContent, tupl: tuple): StorageContent = func fromTuple(_: type StorageErasure, tupl: tuple): StorageErasure = StorageErasure( - totalChunks: tupl[0], - totalNodes: tupl[1], - nodeId: tupl[2] + totalChunks: tupl[0] ) func fromTuple(_: type StoragePoR, tupl: tuple): StoragePoR = diff --git a/codex/node.nim b/codex/node.nim index 4caf83e2..eab72388 100644 --- a/codex/node.nim +++ b/codex/node.nim @@ -268,8 +268,6 @@ proc requestStorage*(self: CodexNodeRef, cid: $encodedBlk.cid, erasure: StorageErasure( totalChunks: encoded.len.uint64, - totalNodes: 1, # TODO: store on multiple nodes - nodeId: 0 # TODO: store on multiple nodes ), por: StoragePor( u: @[], # TODO: PoR setup diff --git a/tests/contracts/examples.nim b/tests/contracts/examples.nim index f096b079..af504259 100644 --- a/tests/contracts/examples.nim +++ b/tests/contracts/examples.nim @@ -16,14 +16,13 @@ proc example*(_: type StorageRequest): StorageRequest = size: (1 * 1024 * 1024 * 1024).u256, # 1 Gigabyte duration: (10 * 60 * 60).u256, # 10 hours proofProbability: 4.u256, # require a proof roughly once every 4 periods - reward: 84.u256 + reward: 84.u256, + slots: 42 ), content: StorageContent( cid: "zb2rhheVmk3bLks5MgzTqyznLu1zqGH5jrfTA1eAZXrjx7Vob", erasure: StorageErasure( totalChunks: 12, - totalNodes: 4, - nodeId: 3 ), por: StoragePor( u: @(array[480, byte].example),