Compare commits

..

3 Commits

Author SHA1 Message Date
AdityaSalunkhe21
2af41abee9 Implement retry transaction pattern 2025-02-07 06:05:59 +00:00
3dd1ff74ab Set tx hash as image file name in pinata (#17)
Part of https://www.notion.so/Upload-generated-image-to-IPFS-190a6b22d47280f1ba81e860b7ca4ae1

Co-authored-by: Shreerang Kale <shreerangkale@gmail.com>
Reviewed-on: #17
2025-02-07 06:05:06 +00:00
d3e6f7ad12 Update deploy script to handle records dir (#15)
Part of https://www.notion.so/Option-to-post-paid-for-memes-to-twitter-x-18ca6b22d4728051804ef4f55065d5ba

Reviewed-on: #15
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2025-02-06 15:55:10 +00:00
4 changed files with 5 additions and 4 deletions

View File

@ -69,6 +69,7 @@
* Deploy `sol-mem-gen` App:
```bash
# In sol-mem-gen/deploy dir
docker run -it \
-v ./:/app/deploy -w /app/deploy \
-e DEPLOYMENT_DNS=memes.markto.market \

View File

@ -38,7 +38,7 @@ if [ -z "$NEW_APPLICATION_VERSION" ] || [ "1" == "$NEW_APPLICATION_VERSION" ]; t
fi
# Generate application-record.yml with incremented version
mkdir records
mkdir -p records
RECORD_FILE=./records/application-record.yml
cat >$RECORD_FILE <<EOF

View File

@ -97,7 +97,7 @@ export async function POST(req: NextRequest): Promise<NextResponse> {
)
}
const pinataResult = await uploadToPinata(imageUrl);
const pinataResult = await uploadToPinata(imageUrl, transactionSignature);
if (pinataResult.error) {
return NextResponse.json(

View File

@ -12,9 +12,9 @@ const pinata = new PinataSDK({
pinataGateway: process.env.PINATA_GATEWAY,
});
export async function uploadToPinata(imageUrl: string): Promise<FluxGenerationResult> {
export async function uploadToPinata(imageUrl: string, transactionSignature: string): Promise<FluxGenerationResult> {
try {
const upload = await pinata.upload.url(imageUrl);
const upload = await pinata.upload.url(imageUrl, { metadata: { name: transactionSignature }});
const publicURL = await pinata.gateways.convert(upload.IpfsHash);