fix: include timestamp in curl command (#31)

Co-authored-by: Vaclav Pavlin <vaclav@status.im>
This commit is contained in:
fryorcraken 2024-02-02 07:03:49 +11:00 committed by GitHub
parent 47fbd2fce4
commit 72c77adaf9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 4 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
**/.DS_Store
.env
keystore
postgresql
rln_tree

View File

@ -14,7 +14,7 @@ You need:
* Ethereum Sepolia account with some balance <0.01 Eth. Get some [here](https://www.infura.io/faucet/sepolia).
* A password to protect your rln membership.
There is `.env.example` available for you as a template to use for providing the above values. The process when working with `.env` files is to copy the `.env.example`, store it as `.env` and edit the values there.
`docker-compose` [will read the `./.env` file](https://docs.docker.com/compose/environment-variables/set-environment-variables/#additional-information-3) from the filesystem. There is `.env.example` available for you as a template to use for providing the above values. The process when working with `.env` files is to copy the `.env.example`, store it as `.env` and edit the values there.
```
cp .env.example .env
@ -23,6 +23,7 @@ ${EDITOR} .env
Make sure to **NOT** place any secrets into `.env.example`, as they might be unintentionally published in the Git repository.
**🔑 1. Register RLN membership**
The RLN membership is your access key to The Waku Network. Its registration is done onchain, and allows your nwaku node to publish messages in a decentralized and private way, respecting some [rate limits](https://rfc.vac.dev/spec/64/#rate-limit-exceeded).
@ -62,7 +63,7 @@ curl http://127.0.0.1:8645/debug/v1/info
```
curl -X POST "http://127.0.0.1:8645/relay/v1/auto/messages" \
-H "content-type: application/json" \
-d '{"payload":"'$(echo -n "Hello Waku Network - from Anonymous User" | base64)'","contentTopic":"/my-app/2/chatroom-1/proto"}'
-d '{"payload":"'$(echo -n "Hello Waku Network - from Anonymous User" | base64)'","contentTopic":"/my-app/2/chatroom-1/proto","timestamp":$(date +%s%N)}'
```
**Get messages sent to a `contentTopic`**. Note that any store node in the network is used to reply.

View File

@ -1,11 +1,15 @@
#!/bin/sh
if test -f $(pwd)/keystore/keystore.json; then
echo "keystore/keystore.json alredy exists. Use it instead of creating a new one."
if test -f ./keystore/keystore.json; then
echo "keystore/keystore.json already exists. Use it instead of creating a new one."
echo "Exiting"
exit 1
fi
mkdir -p ./keystore
if test -f .env; then
echo "Using .env file"
. $(pwd)/.env