# Create a poll post
Upon completing this challenge, you will be rewarded 50 Desmos Tokens.
Please note that in order to prevent spam, you will receive the reward just for the first multimedia post you create. No tokens will be awarded for later posts.
v0.3.0 along with poll, we've also implemented the possibility of creating posts containing multimedia files. Such files can be images, GIFs or even other file types.
# Creating your first multimedia post
Creating a multimedia post is very similar to creating a plain text post. The only difference is that you need to perform an additional step: uploading the multimedia file you want to attach to the post to IPFS.
To do so, you can use our IPFS Web UI. Uploading a multimedia file with it it's pretty straightforward:
- Click on the "Add" button.
- Click on the "File" button.
- Select the file you want to upload.
- The file is now uploaded, and you can see it inside the list of files.
- Click on the three dots icon on the right of the corresponding line.
- Select the "Share link" option.
- Click on the "Copy" button.
Once you have obtained the IPFS hash of the file, to create a multimedia post you can use the following command
desmoscli tx posts create "<Subspace>" "<Message>" true \ --media '<URI,MimeType>" \ --chain-id morpheus-3000 \ --from <your-key-name> --yes
Each media should be specified independently using the
--media flag, which must be a string composed of two parts:
- The first, being the URI that identifies the multimedia file. In our case it will be the IPFS link.
- The second being the MimeType of the multimedia file.
An example of such command is:
desmoscli tx posts create "4e188d9c17150037d5199bbdb91ae1eb2a78a15aca04cb35530cccb81494b36e" "I am Batman!" false \ --media "https://ipfs.desmos.network/ipfs/QmPWWWaqkXQ5ub96r6Hz7dsYUZXuaEnwe14cEsyGfwfsCD,image/jpeg" \ --chain-id morpheus-3000 \ --from jack --yes
Know more about posts
If you want to know more about posts and how they are composed of, including the medias, please refer to the official Desmos documentation.
Once you've run that command you will be asked to type the password you've chosen during the setup and after having inserted it properly you should see something like this:
height: 0 txhash: C5375D02CDA05AFC3B8381CCFBF02E34C3448CA0C9264B17EC0E123E403BBE3B codespace: "" code: 0 data: "" rawlog: '' logs:  info: "" gaswanted: 0 gasused: 0 tx: null timestamp: ""
To make sure the transaction has been processed successfully, you can query it using the following command:
desmoscli query tx <hash> --trust-node --output json # Example # desmoscli query tx C5375D02CDA05AFC3B8381CCFBF02E34C3448CA0C9264B17EC0E123E403BBE3B --trust-node --output json
This will return you the JSON representation of the transaction itself.
# Getting the reward
After you've created a multimedia post, to make sure you receive your reward please following this procedure:
Create a fork of this repo inside your private GitHub profile.
If you do not know how to do it, follow the GitHub fork guide.
Pull the fork locally:
git clone https://github.com/<your-name>/primer.git ~/desmos-primer cd ~/desmos-primer1
Make sure your fork is up to date with the Primer repository:
git remote add upstream https://github.com/desmos-labs/primer.git git fetch upstream git rebase upstream/master1
Create a file named after your GitHub username containing the post creation transaction hash:
echo "<tx-hash>" >> ./phase-3/challenges/multimedia/<your-github-name> # Example # echo "C5375D02CDA05AFC3B8381CCFBF02E34C3448CA0C9264B17EC0E123E403BBE3B" >> ./phase-3/challenges/multimedia/RiccardoM1
Commit the changes, push them to your forked repo and create a pull request. If you do not know how to create one, refer to the GitHub Pull Requests guide.