Dweb - web publishing, RESTful web apps, versioned data and

Mmh I had the same problem on mainnet at first when updating scratchpads. I made 2 observations:

  • If you just wait until the update call return, then you immediately drop the autonomi client, then the update will not be properly propagated
  • If you wait for the update call to return, then get that pointer in a loop until the counter matches the one you expect, then you can drop the client safely and assume the pointer is now valid

That’s what I do for my scratchpads, I would expect that the pointer mechanism is not so different

3 Likes

That’s very interesting. Although it doesn’t make sense to me why that would work, because I don’t see how the client getting the Pointer would affect whether it is properly updated.

@Anselme can you comment on this?

FYI @Champii, given what you’d said about Scratchpads - just before I read this I was thinking, I’ll use them alongside Pointers for my History type until Pointers work!

Now I’m not so sure. If you’ve found a way to ensure Scratchpads work though, I agree it should feed into getting Pointers to work too. I was wondering why one would work and not the other. It’s all a bit puzzling, and this has been the bain of my life for over a year now, first with Registers (old style), then with Pointers, and possibly if I try it, also Scratcpads! All have worked perfectly on local testnets and not on any of the live networks.

2 Likes

Oh well, welcome in my life haha. I’ve had a revelation yesterday that maybe I got all those failures (upload AND download) because of my network/wifi.

I’ve rented a VPS to try one more time, and I then had 0 (zero) errors, fluid processes, no weird NotEnoughCopies or RecordNotFound or Timeout (i get some of them here and there, but a retry always work)
I had very weird behavior that a scratchpad would download correctly the first 2 times. then RecordNotFound until the end of times. Very strange, but never had that on a dedicated VPS.

It also worked perfectly on testnet, but unconsistantly on mainnet.

Your problem made me think of that, maybe it’s related :slight_smile:

7 Likes

Oh btw if you need a rubber duck to help debug your code, or just chat about this or that architecure choice, or anything, I’m always up to help a fellow rust developer :slight_smile:

1 Like

Thanks, that’s kind of you. TBH the Rust compiler makes it hard for me to write buggy code. Switching to Rust was such a great move by David - ten years ago.

But when I need to think things through I write. I’ve so solved many problems while writing up an issue or a request for help!

Same here, and for the little story I even got into Rust because of this project haha. To be able to read and recode the SafeNetwork to understand how it works and what were the main obstacles back then (still have my own working version of their Hashgraph algorithm PARSEC, and an embryo of dht based network with closed goupes and stuff ^^).
I never looked back, I’ve been doing rust for almost 10 years now, I don’t see this changing in the near future. Never had de chance to say that out loud so: Thank you MaidSafe <3

Haha, happened to me many times too ! And with the raise of AI it’s even easier for one to challenge his ideas and brainstorm quickly without living your IDE :slight_smile:

10 Likes

Were you a long time lurker on this forum then? :sweat_smile:

Great to hear you have been following the project for so long. My Rust journey only started a few years ago and didn’t reallt gather steam until a year ago. I like it though.

I do find the strictness of the compiler both a blessing and a curse though. I like to hack unsafe prototypes together sometimes, which Rust works against me on. For building something in a more formal way, it works well though.

3 Likes

Kinda yes :slight_smile: I’m not much of a poster, particularly when I have nothing to show ^^

Oh man, the concept of the network completely blew my mind at that time (still does), I built a few toy projects back then to use it but it was nowhere near the state of today. I’ve just been looking every few month to see the progress and then one day, “What do you mean ‘Released’?” And then here I am haha

That’s the beauty of it yes ! It forces you to code right from the beginning, which can be challenging for quick prototyping :stuck_out_tongue:

6 Likes

As it’s such a slow news day :laughing: I thought I’d mention…

dweb v0.7.0

This release brings dweb CLI bang up to date with enhancements for clients in the latest Autonomi release. I’ve also simplified / reduced quite a bit of the client-side code, and included support for connecting to the alpha network (untested because I wasn’t invited to join in with that :face_exhaling:).

Code-name Winsome

I have an app working that I’m finishing off - just one more feature :laughing: - and then will try uploading and using with the live network.

Maybe it would be a good idea to use it and dweb to pre-test the alpha network @chriso?

It uses Scratchpads, Pointer, GraphEntry and Archive (private) all via the dweb REST API. So it shows how to build standard web apps for Autonomi with nothing more than HTML/CSS/JavaScript. It’s a single page of HTML (~40k) so I will be able to upload it, the only question is whether it works with mainnet.

If it works live it will be a fun thing to play with. I hope to upload it in the next day or two.

10 Likes

I’ve posted a little about the upcoming (codename) Winsome release but only the uncool cats will see it. :rofl:

Still working on that last feature but it will be well worth it - as long as it works on the live network :laughing: :folded_hands:

4 Likes

Miracles are happening, and I don’t mean me finishing a demo app!! Live now I bring you ScratchChat… :tada:

This dynamic web app shows how to use the dweb REST API for Autonomi. It is a single 64kB HTML file and loads everything from Autonomi, including custom avatar images that you can upload yourself.

Be gentle with it! For a while at least.

Anyone fancy trying this out with me?

Current version:

$ dweb --version
dweb-cli 0.3.4

To update:

cargo install dweb-cli --locked

Off you go:

dweb serve

and in another terminal…

dweb open 40ea2e530a60645363ae561c8a50c165f79d8a034c4458f68f1b848c11386e45

You will need a wallet to get started but once it has created two Scratchpads use is freeeeeeeee!

When it finishes initialising, copy my address and add me to your follows (and click Save settings). Then paste your address here so we can follow you.

My address is:

a83c68c0d90c592037b769bb5cfaa7f669db39a7c23f02b0b52abf3bd50293e93b790383155de26b22fab9b15d0cdc0b

Source on github:

27 Likes

You are a legend happbeing.

15 Likes

How do i set my wallet to be used by dweb?

2 Likes

It uses the same environment variable as the ant client @scottefc86

3 Likes

done that dweb still cant find the private key?

1 Like

You need to close and open the current terminal again

4 Likes

Oooooh - I assume you wrote that to your .bashrc

If that wasn’t the case you need to stop the dweb serve and start it from the terminal with the set env variable

2 Likes

yeah restarting the terminal worked :ok_hand:

6 Likes

my address
8bb26365e57ba4d57c649ff36321e06d238da7ce66ecd84321478f7b60d8c101c7d2ccd545d0619244ee57baeb20f0ce

4 Likes

How long should it take? Does it work on all browsers, I’m on Brave? I have been waiting for several minutes, but I’m stuck at:

Share your ScratchChat address:
Getting your address...

When running dweb serve it seemed to start OK. It asked my wallet password and after getting it, showed correct balances.

Does this indicate a problem:

FAILED to find resource for path: '/favicon.ico'

Are the messages sent via ScratchChat encrypted?