-
Notifications
You must be signed in to change notification settings - Fork 505
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
feat : adds functionality to import and export IPNS keys in the IPFS WebUI #2348
base: main
Are you sure you want to change the base?
Changes from all commits
a0049bc
a80c661
4fab5e1
06d9175
3cbf55b
d2b141f
2b6bdc7
4e9a56d
6b6bc0d
a2b04ba
d350c44
cc6d74a
6fd4629
9fef755
de63efd
509eb4c
a043d45
952e349
753a6a4
da26389
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,14 +47,12 @@ const ipnsBundle = { | |
doRemoveIpnsKey: (name) => async ({ getIpfs, store }) => { | ||
const ipfs = getIpfs() | ||
await ipfs.key.rm(name) | ||
|
||
store.doFetchIpnsKeys() | ||
}, | ||
|
||
doRenameIpnsKey: (oldName, newName) => async ({ getIpfs, store }) => { | ||
const ipfs = getIpfs() | ||
await ipfs.key.rename(oldName, newName) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please undo changes to lines that are not needed for your PR. |
||
store.doFetchIpnsKeys() | ||
}, | ||
|
||
|
@@ -63,9 +61,20 @@ const ipnsBundle = { | |
await ipfs.name.publish(cid, { key }) | ||
}, | ||
|
||
doImportIpnsKey: (file) => async ({ getIpfs, store }) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we're missing an implementation of this function now |
||
const ipfs = getIpfs() | ||
const reader = new FileReader() | ||
reader.onload = async (event) => { | ||
const key = event.target.result | ||
await ipfs.key.import(file.name, key) | ||
store.doFetchIpnsKeys() | ||
} | ||
reader.readAsText(file) | ||
}, | ||
|
||
|
||
|
||
doUpdateExpectedPublishTime: (time) => async ({ store, dispatch }) => { | ||
// moderate expectation: publishing should take no longer than average | ||
// between old expectation and the length of the last publish + some buffer | ||
Comment on lines
-67
to
-68
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't remove comments |
||
const oldExpectedTime = store.selectExpectedPublishTime() | ||
const avg = Math.floor((time * 1.5 + oldExpectedTime) / 2) | ||
await writeSetting('expectedPublishTime', avg) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please undo changes to lines that are not needed for your PR.