Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit 60bee6a

Browse files
authored
fix: support keychain without pass (#3212)
- add support for ed25519 and secp256k1 keys for the ipfs PeerId - add support for using ed25519 and secp256k1 keys with ipns - add support for keychain without a pass, this fixes several keychain commands - fix `name publish`, ttl should be optional but wasn't being allowed Includes changes in ipfs/js-ipfs#3208 Key gen and key listing now works: ```sh $ jsipfs key gen --type=ed25519 my-ed-key generated QmUPJZ3ghsnkRVgYjrMrSC8MbbZTzcezn6mH7vY9vTbrMY my-ed-key $ jsipfs key list QmUPJZ3ghsnkRVgYjrMrSC8MbbZTzcezn6mH7vY9vTbrMY my-ed-key QmYPxJJb8Mpa6JjQj7hCTF4ajn2SE1HFLRoAnCbymTGzyC self ``` IPNS Publishing now works properly, including using other key types: ```sh jsipfs name publish -k my-ed-key /ipfs/QmP7WDyEdkFu2nfj35SUEB7fk3iKCHpcrCVbGk1HXZU22a Published to 12D3KooWGmSq6u3yZeXqeqSmQpJWKQGGdCxrZQAUZBzsbSM2kCE6: /ipfs/QmP7WDyEdkFu2nfj35SUEB7fk3iKCHpcrCVbGk1HXZU22a ``` I also fixed a couple of the example tests, they weren't waiting for IPFS to start before executing the tests, which could cause them to intermittently fail. BREAKING CHANGE: remove support for key.export over the http api
1 parent c0dfa05 commit 60bee6a

File tree

7 files changed

+14
-9
lines changed

7 files changed

+14
-9
lines changed

browser-browserify/public/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<body>
1616
<h1>JS IPFS - Add data to IPFS from the browser</h1>
1717
<textarea id="source" placeholder="Enter some text here"></textarea>
18-
<button id="store">Add text to ipfs</button>
18+
<button id="store" style="display: none">Add text to ipfs</button>
1919
<div id="output" style="display: none">
2020
<div>found in ipfs:</div>
2121
<div class="content" id="cid">[ipfs cid]</div>

browser-browserify/src/index.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
const IPFS = require('ipfs')
44

55
document.addEventListener('DOMContentLoaded', async () => {
6-
const node = await IPFS.create({ repo: String(Math.random() + Date.now()) })
6+
const node = await IPFS.create({
7+
repo: String(Math.random() + Date.now()),
8+
init: { alogorithm: 'ed25519' }
9+
10+
})
11+
const button = document.getElementById('store')
712

813
console.log('IPFS node is ready')
914

@@ -25,5 +30,6 @@ document.addEventListener('DOMContentLoaded', async () => {
2530
}
2631
}
2732

28-
document.getElementById('store').onclick = store
33+
button.onclick = store
34+
button.setAttribute('style', 'display: inline')
2935
})

browser-browserify/test.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ module.exports = {
99
.waitForElementVisible('#source')
1010
.setValue('#source', 'hello')
1111
.waitForElementVisible('#store')
12-
.pause(1000)
1312
.click('#store')
14-
.waitForElementVisible('#output')
13+
.waitForElementVisible('#output', 5e3, 100)
1514

1615
browser.expect.element('#cid').text.to.contain('QmWfVY9y3xjsixTgbd9AorQxH7VtMpzfx2HaWtsoUYecaX')
1716
browser.expect.element('#content').text.to.contain('hello')

circuit-relaying/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ <h1>IPFS Simple Messaging</h1>
4646
<div class="row">
4747
<div class="box row">
4848
<label>Peer id:</label>
49-
<ul id="peer-id"></ul>
49+
<ul id="peer-id" style="display:none"></ul>
5050
</div>
5151
<div class="box addrs-box">
5252
<label>Addresses:</label>

circuit-relaying/src/app.js

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ document.addEventListener('DOMContentLoaded', async () => {
5454

5555
let room = createRoom(roomName)
5656

57+
$peerId.setAttribute('style', '')
5758
$peerId.innerHTML = `<li>${info.id}</li>`
5859

5960
$send.addEventListener('click', () => {

circuit-relaying/src/helpers.js

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const $msgs = document.querySelector('#msgs')
77
const $addrs = document.querySelector('#addrs')
88
const $peers = document.querySelector('#peers')
99
const $pAddrs = document.querySelector('#peers-addrs')
10-
const delay = require('delay')
1110

1211
const NAMESPACE = 'ipfs-quick-msg'
1312

circuit-relaying/test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ module.exports[pkg.name] = function (browser) {
9191

9292
browser
9393
.url(process.env.IPFS_EXAMPLE_TEST_URL)
94-
.waitForElementVisible('#peer')
94+
.waitForElementVisible('#peer-id') // Wait for ipfs to start
9595
.clearValue('#peer')
9696
.setValue('#peer', process.env.IPFS_RELAY_ADDRESS)
97-
.pause(1000)
97+
.pause(100)
9898
.click('#connect')
9999

100100
browser.expect.element('#peers-addrs').text.to.contain(process.env.IPFS_RELAY_ID)

0 commit comments

Comments
 (0)