github.com/status-im/status-go@v1.1.0/cmd/spiff-workflow/README.md (about)

     1  ### How to build
     2  
     3  You must have go installed.
     4  Then you can run, from `cmd/spiff-workflow`
     5  
     6  ```
     7  go build --mod=vendor
     8  ```
     9  
    10  which should create a `spiff-workflow` executable
    11  
    12  ### How to run
    13  ```
    14  ./spiff-workflow --seed-phrase "your seed phrase"
    15  ```
    16  
    17  
    18  The parameters are:
    19  
    20  `seed-phrase`: the seed phrase of the account to be created
    21  
    22  The db will be created in the `./tmp` directory, and it will erase any previous data
    23  The server will be listening on `localhost:8545` and it will respond to RPC calls.
    24  
    25  
    26  ### Sending a message
    27  
    28  First add the user as a contact (if you have a message):
    29  
    30  ```
    31     curl -XPOST http://localhost:8545 -H 'Content-type: application/json' -d '{"jsonrpc":"2.0","method":"wakuext_sendContactRequest","params":[{"id": "0x04d3c86dfc77b195b705e1831935066076018aa0d7c40044829801ebbfe9b06480ce4662072bf16a3ca7cb8f6289207614deceaf7d33e099dfc9281610375fec08", "message": "hello"}],"id":1}'
    32  ```
    33  
    34  If you don't want to send a message:
    35  
    36  ```
    37     curl -XPOST http://localhost:8545 -H 'Content-type: application/json' -d '{"jsonrpc":"2.0","method":"wakuext_addContact","params":[{"id": "0x04d3c86dfc77b195b705e1831935066076018aa0d7c40044829801ebbfe9b06480ce4662072bf16a3ca7cb8f6289207614deceaf7d33e099dfc9281610375fec08"}],"id":1}'
    38  ```
    39  
    40  
    41  Accept the contact request in the receiving device (you should see a notification in the activity center)
    42  
    43  
    44  ```
    45  curl -XPOST http://localhost:8545 -H 'Content-type: application/json' -d '{"jsonrpc":"2.0","method":"wakuext_sendOneToOneMessage","params":[{"id": "0x04e431a0baaac2602052f259d4304371d0e0d86cb024497899cf3e82211ff17a9723d8ca67b6575a700086b2aa6ab0df4dab1f8e94114912f269fc6b1ee6764a58", "message": "hello"}],"id":1}'
    46  ```
    47  
    48  Just replace `id` with the public key you want to use, and `message` with the text you want to send.
    49  
    50  
    51  ### Creating a private group chat
    52  
    53  To create a private group chat, you need interactions on both devices.
    54  
    55  First add the user as a contact:
    56  
    57  ```
    58     curl -XPOST http://localhost:8545 -H 'Content-type: application/json' -d '{"jsonrpc":"2.0","method":"wakuext_sendContactRequest","params":[{"id": "0x04d3c86dfc77b195b705e1831935066076018aa0d7c40044829801ebbfe9b06480ce4662072bf16a3ca7cb8f6289207614deceaf7d33e099dfc9281610375fec08", "message": "hello"}],"id":1}'
    59  ```
    60  
    61  Accept the contact request in the receiving device (you should see a notification in the activity center)
    62  
    63  Then create a group chat with the member(s):
    64  
    65  ```
    66  curl -XPOST http://localhost:8545 -H 'Content-type: application/json' -d '{"jsonrpc":"2.0","method":"wakuext_createGroupChatWithMembers","params":[null, "group-chat-name", ["0x04d3c86dfc77b195b705e1831935066076018aa0d7c40044829801ebbfe9b06480ce4662072bf16a3ca7cb8f6289207614deceaf7d33e099dfc9281610375fec08"]],"id":1}'
    67  ```
    68  
    69  You will need to note the ID returned by the response, for example, in the response:
    70  
    71  ```
    72  {"jsonrpc":"2.0","id":1,"result":{"chats":[{"id":"8291eae1-338c-4481-9997-04edd2d2bbed-0x0490cbce029eaf094c7f2dcf1feb2d60e91ab1498847eb29fa98cc5ea5a36666b3f9ada142f3080f5074abd942c863438f6af9475f30781790c7e36f9acd2ac93e","name":"group-chat-name",
    73  ```
    74  The ID is:
    75  
    76  ```
    77  "8291eae1-338c-4481-9997-04edd2d2bbed-0x0490cbce029eaf094c7f2dcf1feb2d60e91ab1498847eb29fa98cc5ea5a36666b3f9ada142f3080f5074abd942c863438f6af9475f30781790c7e36f9acd2ac93e"
    78  ```
    79  
    80  You can then send messages to this group chat similarly as you send messages for 1-to-1 chats, using the id of the newly created chat:
    81  
    82  ```
    83  curl -XPOST http://localhost:8545 -H 'Content-type: application/json' -d '{"jsonrpc":"2.0","method":"wakuext_sendGroupChatMessage","params":[{"id": "8291eae1-338c-4481-9997-04edd2d2bbed-0x0490cbce029eaf094c7f2dcf1feb2d60e91ab1498847eb29fa98cc5ea5a36666b3f9ada142f3080f5074abd942c863438f6af9475f30781790c7e36f9acd2ac93e", "message": "hello"}],"id":1}'
    84  ```
    85  
    86  Mind that if you restart the node, you will need to create a new group chat, since we are currently not keeping storage on restart.