ScratchChat - join the chatters and post your address on this topic

ScratchChat is a demo app that uses Scratchpads via the dweb REST API.

Messaging is free once ScratchChat has been initialised, because it uses Autonomi Scratchpads to share messages. You will though need a funded wallet to pay to create them in the first place.

So to get chatting:

  • Setup a Wallet
  • Install dweb
  • Use ScratchChat
  • Find People to chat with

Set up a Wallet

  1. Check if you have a wallet using the ant-cli (install with cargo install ant-cli if you don’t have it yet):

    ant wallet balance
    
  2. If you don’t have a wallet yet, create it with ant wallet create or import an existing wallet for which you already have the private key, with ant wallet import

  3. If you don’t have funds, head over to the Autonomi Community Faucet

  4. You will need to share the secret key of your wallet with dweb, so get your secret key with:

    ant wallet export
    
  5. On Linux and MacOS you can either put export SECRET_KEY=<PRIVATE-KEY> in your .bashrc and then open a new terminal, or pass it when you start the dweb server with:

    export SECRET_KEY=<PRIVATE-KEY> dweb serve
    

Install dweb

If you don’t have Rust you will need to install that first - see Get Rust.

If you have Rust installed:

cargo install dweb-cli --locked

Note: when installing dweb on Ubuntu, you may encounter missing openssl libraries. Do a sudo apt update and then sudo apt install librust-openssl-dev, and finally restart the dweb install.

Once you have dweb installed you’ll be able to find other websites and apps in the awesome index with dweb open awesome.

Use ScratchChat

Once you have a funded wallet and have installed dweb-cli, start the dweb server:

dweb serve

In a different terminal, open ScratchChat:

dweb open scratchchat

When ScratchChat loads for the first time, it creates two Scratchpads to store your settings and share your messages, and then shows your address in the UI.

You need to add someone’s ScratchChat address as a ‘follow’ to see their messages, and they need to add your address to see yours. So post your address in this thread if you want others to follow and chat with you.

ScratchChat works more like a social network such as Mastodon or Twitter, but with a chat style interface.

Messaging is free!

Although you need a wallet with a tiny amount of ARB-ETH and ANT to pay for the creation of two Scratchpads (current cost ~2 cents), that’s it. And thanks to @ambled who made the Autonomi Community Faucet and some generous donors, you can get enough tokens to do all that for free. (See Set up a Wallet).

Scratchpads cost more to create than a regular ‘chunk’ stored on Autonomi, and this pays for them to be updated for free. But they are still very cheap (about 2 cents right now, which seems appropriate :rofl:).

The Autonomi Community Faucet can be used to start your journey by issuing your initial funds. You should receive enough funds to create your Scratchpads and upload a small image to use as your avatar.

Find People to chat with

Share your address in a reply and I’ll add it to the list below:

happybeing  a83c68c0d90c592037b769bb5cfaa7f669db39a7c23f02b0b52abf3bd50293e93b790383155de26b22fab9b15d0cdc0b
ambled / xd7 a344fca57238f1f198ed72ca3dd21809b00be0365c95599b16eb7a7c11069c94ebcae690169553c870c38aa369dcc5cc
Toivo 8ca210b850277d1a7e875e8f39af625872e4f2859e811a87942330f062ec0eb6f06a0fae322209c2fefbb9c418600912

southside  8ce56fcf2c4772f5265f21a7778b8abe0d0dcf7e93028adc4c5b9ea1ba39bb8d7fcf187764dbb98821900f8314057a6e

If you want to create more personas and chat with their unique ScratchChat address you can do this by loading ScratchChat and then adding the name of a persona to the URL in the address bar. Something like this:

http://127.0.0.1:34375/?person=mark2

Add an Avatar

You’ll need the address of a small image file to paste into ‘My Settings’ (don’t forget to ‘Save Changes’).

If you want to upload an image to use as an avatar you can do this as follows:

ant file upload -p --max-fee-per-gas 10000000 <filename>

The faucet should have provided enough funds to do this too.

24 Likes

Brilliant stuff! Can’t wait to take a look at the code of this when I have the chance!

5 Likes

Very nice! Is all comms through scratchpads or is there some direct messaging too?

2 Likes

Just Scratchpads - main purpose is to show (and test!) use of those and of how to build web apps using the REST API.

9 Likes

How exciting! Does the wallet need to be funded with some ANT and ETH on Arbitrum?

3 Likes

It cost me 0.00000050 ANT (x6), 0.00000254 ETH (x2) for PayForQuotes,
Plus there was an additional 0.00000052 ETH transaction labelled as Approval that Happy hasn’t mentioned.

Thanks! That’s around $0.01 so that is doable just now to test and have fun with.

And the ANT isn’t worth mentioning. Even when ANT gets to $1000 :wink:

2 Likes

Based on this data, I have adjusted the faucet to issue 0.000005 ANT to cover the cost of starting the scratchchat addresses. I have also reset the drip, so past users can get a new higher drip.

1 Like

I just create two Scratchpads! No idea what the API did in terms of transactions, I just checked the total was tiny.

@Southside reported that updates were being charged whereas I was sure they weren’t. I’ve not looked into that, but Autonomi have also said they should be free (on a github issue).

Thanks for adjusting the faucet! Would you write something in the OP explaining how to get going using it? It is a wiki so you should be able to edit, or if not post it here.

2 Likes

@Southside has realised his mistake.
I had 5 transactions - started scratchpad twice (in Brave and Firefox) and then uploaded an avatar.

Sorry for the confusion.

2 Likes

:thinking: nah, different browser won’t do that. So you have four, but I’ll just assume you can’t count for now :laughing:

3 Likes

Assume for now that the sun is shining, I can’t see the laptop screen and I am more concerned with topping up on Vitamin D than sorting this out right now. Lots of wee jobs to do outside and a couple of big ones I have been avoiding.

I will keep MetaMask and Arbiscan open later tonight while I fire up Scratchpad on a single browser and see just what is what.

Assuming I can’t count is a possibly valid hypothesis though…

2 Likes

I have not been able to dive into much of the tech lately, but right now I assume that for every message you’d like to post here, you’d need to sign a transactions to pay for upload. How would we be able to do this in the future to have people use a chat app like this like their regular day whatsapp or signal?

No, as noted you only pay to create a new persona which is about 1c at the moment. All messages are freeeeeeee.

1 Like

That’s awesome! How does that work exactly? Assuming every message is a chunk on the network?

It’s a feature of the Scratchpad data type.

3 Likes

It’s cool to have it free, but can it be so, or is there a possibility overburden the network this way?

2 Likes

Important question recently discussed in a different topic - unfortunately access to it is restricted so…

tl;dr: it’s probably ok.

1 Like

Thanks, but:

Oops! That page doesn’t exist or is private.

1 Like

Oh, sorry - you’ll have to take my word for it :rofl:

2 Likes