Skip to content

Commit

Permalink
chore: add console log to check delegation
Browse files Browse the repository at this point in the history
  • Loading branch information
0xExp-po committed Dec 9, 2024
1 parent 3b66ef1 commit 7258ee0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion dapp/src/pages/api/w3up-delegation.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,19 @@ async function backend(did) {
"filecoin/offer",
"upload/add",
];
const expiration = Math.floor(Date.now() / 1000) + 10;
const expiration = Math.floor(Date.now() / 1000) + 86400;
const expirationDate = new Date(expiration * 1000);
console.log("expiration time:", expirationDate.toUTCString());

const delegation = await client.createDelegation(audience, abilities, {
expiration,
});

console.log(
"delegation expire time:",
new Date(delegation.expiration * 1000).toUTCString(),
);

const archive = await delegation.archive();
return archive.ok;
}

0 comments on commit 7258ee0

Please sign in to comment.