Skip to content

Meme Generator - a proof of concept of LikeCoin content footprint

License

Notifications You must be signed in to change notification settings

likecoin/likecoin-poc

Repository files navigation

Meme Generator

NSP Status

a proof of concept of LikeCoin content footprint

Live Demo

https://meme.like.community

Quick startup

How it works

/upload

POST endpoint for uploading new image file with metadata

  • The image fingerprint is generated by puting the uploaded image into sha256() function.
  • The image is then added to local ipfs by ipfs.add(), yielding its ipfs address.
  • The fingerprint, ipfs address and other metadata are then written to the smart contract by calling ethjs-signer and sendRawTransaction.
  • The result eth transaction hash is then sent back to frontend for tracking.

/query/:key

GET endpoint for query metadata given its fingerprint

  • Using ethjs-contract, we call likeContract.get() with the input key(fingerprint) as the param.
  • The result in array format is converted into key-value mapping, then returned to frontend.

/meme/:key

POST endpoint for creating meme image base on another existing image with fingerprint

  • Similar to query, likeContract.get() is called to extract metadata from the fingerprint.
  • The actual image data is retrieved by calling ipfs.cat() with the ipfs address stored in metadata.
  • The image data is then pass to imageMagick for annotating text.
  • The result of imageMagick is then pass to sha256() and ipfs.add() again for yielding fingerprint and ipfs address.
  • The new fingerprint and ipfs address, together with the parent fingerprint contained in the metadata is written into smart contract by sendRawTransaction().
  • The result eth transaction hash is then sent back to frontend for tracking.

Smart contract used

like-media-contracts-poc

About

Meme Generator - a proof of concept of LikeCoin content footprint

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published