Skip to content

Commit

Permalink
Added method to get identity keypair
Browse files Browse the repository at this point in the history
  • Loading branch information
RangerMauve committed Feb 11, 2020
1 parent 1158f80 commit 5922fa2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ async function SDK ({

// I think this is used to create a persisted identity?
const noiseSeed = corestore._deriveSecret(applicationName, 'replication-keypair')
const keyPair = HypercoreProtocol.keyPair(noiseSeed)
swarm.listen({
keyPair: HypercoreProtocol.keyPair(noiseSeed)
keyPair
})

return {
Expand All @@ -88,6 +89,10 @@ async function SDK ({
_dns: dns
}

async function getIdentity() {
return keyPair
}

function destroy (cb) {
for (const drive of drives.values()) {
drive.close()
Expand Down

0 comments on commit 5922fa2

Please sign in to comment.