2021-11-02 08:04:51 +00:00
|
|
|
const { ethers } = require("hardhat")
|
2022-02-15 16:01:54 +00:00
|
|
|
const { now, hours } = require("./time")
|
2022-04-06 12:26:56 +00:00
|
|
|
const { hexlify, randomBytes } = ethers.utils
|
2021-11-02 08:04:51 +00:00
|
|
|
|
2021-11-02 08:45:49 +00:00
|
|
|
const exampleRequest = () => ({
|
2022-02-17 10:00:18 +00:00
|
|
|
client: hexlify(randomBytes(20)),
|
2022-04-06 12:26:56 +00:00
|
|
|
ask: {
|
2022-08-02 09:41:49 +00:00
|
|
|
slots: 4,
|
|
|
|
slotSize: 1 * 1024 * 1024 * 1024, // 1 Gigabyte
|
2022-04-06 12:26:56 +00:00
|
|
|
duration: hours(10),
|
|
|
|
proofProbability: 4, // require a proof roughly once every 4 periods
|
2022-06-13 11:19:33 +00:00
|
|
|
reward: 84,
|
2022-08-24 05:30:55 +00:00
|
|
|
maxSlotLoss: 2,
|
2022-04-06 12:26:56 +00:00
|
|
|
},
|
|
|
|
content: {
|
|
|
|
cid: "zb2rhheVmk3bLks5MgzTqyznLu1zqGH5jrfTA1eAZXrjx7Vob",
|
|
|
|
erasure: {
|
|
|
|
totalChunks: 12,
|
|
|
|
},
|
|
|
|
por: {
|
|
|
|
u: Array.from(randomBytes(480)),
|
|
|
|
publicKey: Array.from(randomBytes(96)),
|
|
|
|
name: Array.from(randomBytes(512)),
|
|
|
|
},
|
|
|
|
},
|
2022-02-17 11:24:27 +00:00
|
|
|
expiry: now() + hours(1),
|
2022-02-16 09:50:00 +00:00
|
|
|
nonce: hexlify(randomBytes(32)),
|
2021-11-02 08:45:49 +00:00
|
|
|
})
|
|
|
|
|
2022-02-15 16:01:54 +00:00
|
|
|
const exampleLock = () => ({
|
2022-02-16 09:50:00 +00:00
|
|
|
id: hexlify(randomBytes(32)),
|
2022-02-15 16:01:54 +00:00
|
|
|
expiry: now() + hours(1),
|
|
|
|
})
|
|
|
|
|
2022-06-13 10:17:37 +00:00
|
|
|
module.exports = { exampleRequest, exampleLock }
|