bm-create-enc-payload/inject.sh

38 lines
896 B
Bash
Executable File

#!/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>"