I AM IMMUTABLE! Blogging with IMIM

I’d like to share the latest incarnation of the IMIM blogging app on Autonomi. IMIM is shorthand for I’M IMmutable, as once your immutable blogs have been uploaded, you cannot be muted! :imp:

I’ll do a proper write up of how it all works, but I wanted to write a brief introduction and let folks have a play with it.


(Blog index with a mixture of media and etag caching)

In short, IMIM is an Angular app, built using Typescript, which expects an sn_httpd backend.

IMIM can read any public archive that you point it at. You don’t need to upload your own service, nor any Javascript or Typescript. You don’t need to worry about anyone leaching your hosting bandwidth. You just point it to your archive address, then let it render your Markdown files, complete with images and videos!

The easiest way to give it a spin is by grabbing the latest sn_httpd docker image (see here), starting a local container and taking a look at my test blog here.

Note that the IMIM app needs to run in /imim/, so it depends on a rudimentary/experimental DNS address. If you use the docker container, this is already setup, so it should resolve automatically.

So, fed up of reading my ancient articles? Why not try creating your own blog? Follow the following steps:

  1. Create a nice article written in Markdown.
  2. Save it to a folder (e.g. myblog), along with any images you’ve used.
  3. Upload the files to Autonomi as a public archive, e.g. ant file upload -p myblog.
  4. Save the address (e.g. 7ca488701eb318c05ecfea806245199f85d7987d5f73f7afea4a68b2437e5285), then use it as your IMIM blog URL, e.g. http://localhost:8080/imim/blog/7ca488701eb318c05ecfea806245199f85d7987d5f73f7afea4a68b2437e5285/.

There will be more to come, but I wanted to share this with everyone, so folks can put up their own blogs.

Feel free to poke around at the source code for my articles (it’s a public archive) for inspiration!

Limitations

  • To have dynamic blogs, they should resolve to a name. As registers aren’t working well and their replacement isn’t published in API form yet, we aren’t quite there yet. Once it is possible, I’ll update the code. Note that sn_httpd does the name resolution, currently.
  • Videos can only be mp4 files and they are slow due to the Autonomi API not directly supporting streaming, currently. However, they do load and you can play them!

If there are any questions, please post them here and I’ll do my best to answer them. I’ll also use this thread to let everyone know when there are new versions.

Links:

32 Likes

Im failing at this but its network errors rather than IMIM errors


Uploading file: "IMIM/mince.md"
Error: 
   0: Failed to upload file
   1: Failed to upload file
   2: Error occurred during payment.
   3: Cost error: MarketPriceError(ContractError(TransportError(Transport(Custom(reqwest::Error { kind: Request, url: "https://sepolia-rollup.arbitrum.io/rpc", source: hyper_util::client::legacy::Error(Connect, ConnectError("dns error", Custom { kind: Uncategorized, error: "failed to lookup address information: Try again" })) })))))
   4: Market price error: ContractError(TransportError(Transport(Custom(reqwest::Error { kind: Request, url: "https://sepolia-rollup.arbitrum.io/rpc", source: hyper_util::client::legacy::Error(Connect, ConnectError("dns error", Custom { kind: Uncategorized, error: "failed to lookup address information: Try again" })) }))))
   5: error sending request for url (https://sepolia-rollup.arbitrum.io/rpc)
   6: error sending request for url (https://sepolia-rollup.arbitrum.io/rpc)
   7: client error (Connect)
   8: dns error: failed to lookup address information: Try again
   9: failed to lookup address information: Try again

I’ll postt this + logs in the Discord support channel

2 Likes

Uploads are definitely a pain right now.

My best tips are:

  • buy a better router (Mikrotik etc)
  • try uploading the files in the directory one by one first, then upload the archive
  • lots of patience and retries…

I’m sure the team are on it, as it’s a pretty big issue.

I may try to add upload support to IMIM and sn_httpd too, but it may have similar issues atm.

6 Likes

This is amazing! Such exciting times, thank you for this.

7 Likes

For those who don’t frequent Discord, I’ve added a couple of recent articles/posts by the team into a blog too. Feels good to be dog fooding! :laughing:

http://localhost:8080/imim/blog/461a04f3ca5bda84a149912bd25ce5e9a55801dc3a00ffde10b934fc7c617f22

(Obviously, you need sn_httpd running on localhost:8080 for the link to work! :sweat_smile:)

10 Likes

Very nice. Looking forward to having a play with this!

4 Likes

Looks great :100:

1 Like

I’ve pushed more changes which include the following:

  • Adds fonts to dist to remove dependency on clear net
  • Updates styles for better formatting on mobile devices

Combined with the latest version of sn_httpd, it’s looking pretty good, IMO!

Note that the latest sn_httpd release brings a big caching performance boost and IMIM switches between pages cleanly. I can’t actually see the loading spinner anymore for pages I’ve seen before and it only flashes up for new ones too. I’m super pleased with that! :sunglasses:

Mobile screenshot:

18 Likes

Hey @Traktion - what would be the best (most straightforward, fastest) way to convert an existing blog, say on Blogger or Wordpress, to markdown form suitable for IMIM?

1 Like

When I converted the recent Autonomi blog articles, I did the following:

  • copy/paste into a markdown UI, e.g. https://stackedit.io/
  • edit the markup until it looks about right
  • download images and manually add the image tags (above UI didn’t do that for me), with image path being the same as text (i.e. just use file name in markdown image tag)
  • store all assets in a directory, along with any other articles for the blog
  • upload the directory to Autonomi using 'ant file upload -p
  • note the xor it returns and then try it out with IMIM (/imim/blog/)

You could likes make a script to do the above. Some sort of text/html to markdown converter may do the job too, if one exists.

There isn’t really a simple preview mode, short of what a markdown UI will show. That is something I want to improve. It would be great to have a WYSIWYG editor built into IMIM that also uploads, etc. I’ll get to that soon, I hope, but need to add upload capabilities to sn_httpd first.

Hope that helps though! Looking forward to seeing more blogs uploaded! :grin:

2 Likes

Hi @Traktion,

Setting up some files to upload, but I have some questions. If I have, say, two blog posts ready to go, and a third I’m preparing, and I want them all to live on the same blog page, if I already uploaded the two, would I need to upload all three together in a new directory at that point?

If you want all 3 articles in the 1 blog, just put them all in 1 directory and upload it.

If some of the files have alread been uploaded, ant shouldn’t charge you for them again.

The blog home page is just a date ordered listing of the archive (directory). So it should put the newest article first.

Note, the ordering gets ignored sometimes. A wee bug I need to look at! :sweat_smile:

2 Likes

Is anyone getting asked for mad prices for upload?

Just had the second error like this


willie@gagarin:~/projects/maidsafe/upload-tests$ ant file upload -p upload_times.py
Logging to directory: "/home/willie/.local/share/autonomi/client/logs/log_2025-01-19_20-46-39"
🔗 Connected to the Network                                                                                                                           Uploading data to network...
Uploading file: "upload_times.py"
Upload completed in 17.74753872s
Error: 
   0: Failed to upload file
   1: Failed to upload file
   2: Error occurred during payment.
   3: Wallet error: ChunkPaymentsContract(RpcError(ErrorResp(ErrorPayload { code: -32000, message: "insufficient funds for gas * price + value: address 0xc753bA57E0F8Ba81bAcf73Ac1b9242733d39a646 have 107561452380000 want 241838801209194", data: None })))
   4: Chunk payments contract error: server returned an error response: error code -32000: insufficient funds for gas * price + value: address 0xc753bA57E0F8Ba81bAcf73Ac1b9242733d39a646 have 107561452380000 want 241838801209194
   5: server returned an error response: error code -32000: insufficient funds for gas * price + value: address 0xc753bA57E0F8Ba81bAcf73Ac1b9242733d39a646 have 107561452380000 want 241838801209194

Location:
   ant-cli/src/commands/file.rs:58

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

I have plenty ETH and ANT

Hmmm… what if I want to date them based on when they were written? I can envision people wanting to move their blogs over to Autonomi and have that feature available. Right now, uploaded files all have current dates in directory, though they were written over a few years. Maybe I can artificially change the dates?

2 Likes

I experimented with putting each blog post in its own directory and uploading the main directory containing all of the directories, and this worked well too.

3 Likes

I’ve not seen that error since a few test nets ago. Maybe try again later?

1 Like

More can be done for sure, but the date is at least when the file was first uploaded to Autonomi (not just the archive).

So, as long as people upload old articles chronologically, thet can be ordered correctly.

I was trying to lean of having as little metadata needed per blog as possible to begin with. Being able to use archives as containers and file dates for ordering makes things simple.

However, I can imagine blogs having config files in their archives to allow more customisation. Perhaps other Autonomi data types could be used too, but there is an inherent simplicity in using files and allows ant CLI to do the uploading.

2 Likes

There are certain liberties thar sn_httpd currently allows when retrieving files from archives. Primarily, this is because the base directory gets uploaded with the archive and . (current directory) uploads are broken in ant CLI atm.

As such, sn_httpd will attempt to retrieve files at paths that end with what is being looked up. This is probably why you can do what you’re doing.

However, this behaviour will likely change as exact matches are desirable (for a number of reasons). While things are still in flux, it’s ideal to keep things loose enough to ‘work’ with current tooling bugs/features.

By design, putting articles in the root of the archive is recommended. In future IMIM versions, things are likely to change, but this will probably remain true.

There is a question mark over what URLs should look like and having http://localhost:8080/imim/ is an annoying limitation right now. I’d like to have something like http://imim/ instead, so that the app sits at the URL root. This will help with allowing multiple IMIM versions, personal IMIM URLs etc. Btw, the latter is possible when accessing via a proxy server. However, I need graph data types to work to have it resolve both ways…

Regardless, the main thing is that flat archives, with markdown and media files will likely remain a constant, with other features added around them.

2 Likes

Are you sure you were trying to pay from the right wallet, that has the funds? I once got some silly prices, when trying to pay from a wallet that had nothing.

his error message points to insufficient ETH for gas fees (he just had a balance of 0.0001 which wasn’t enough for the TX)

4 Likes