bm-create-enc-payload/inject.sh

38 lines
896 B
Bash
Raw Normal View History

2022-12-23 03:55:26 +01:00
#!/bin/bash
if [ -z "$1" ]; then
echo "Specify password as first argument"
exit 1
fi
if [ -z "$2" ]; then
echo "Specify payload as first argument"
exit 1
fi
password="$1"
payload="$2"
curl --location --request POST 'https://disseminate-preencrypted.bitmessage.dev' \
-u api:${password} \
--header 'Content-Type: application/xml' \
--data-raw "<methodCall>
<methodName>disseminatePreEncryptedMsg</methodName>
<params>
<encryptedPayload>
<value>$payload</value>
</encryptedPayload>
<requiredAverageProofOfWorkNonceTrialsPerByte>
<value>
<int>1000</int>
</value>
</requiredAverageProofOfWorkNonceTrialsPerByte>
<requiredPayloadLengthExtraBytes>
<value>
<int>1000</int>
</value>
</requiredPayloadLengthExtraBytes>
</params>
</methodCall>"