Skip to content

Instantly share code, notes, and snippets.

@lukehedger
Created October 13, 2017 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukehedger/2a94c65b50b40b154a54daf9b51f8cc5 to your computer and use it in GitHub Desktop.
Save lukehedger/2a94c65b50b40b154a54daf9b51f8cc5 to your computer and use it in GitHub Desktop.
Download and process META-ID metadata signature from Swarm
web3.bzz.download(metadataAddress.slice(2))
.then(rawMetadata =>
Object.keys(rawMetadata).map(path => ({
[`${path}`]: JSON.parse(rawMetadata[path].data.toString())
}))
.reduce((o, v) => Object.assign({}, o, v), {})
)
.then(metadata => console.log(metadata))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment