1. Go to this page and download the library: Download arweave/arweave-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
arweave / arweave-sdk example snippets
$arweave = new \Arweave\SDK\Arweave('http', '209.97.142.169', 1984);
$jwk = json_decode(file_get_contents('jwk.json'), true);
$wallet = new \Arweave\SDK\Support\Wallet($jwk);
$transaction = $arweave->createTransaction($wallet, [
'data' => '<html><head><title>Some page</title></head></html>',
'tags' => [
'Content-Type' => 'text/html'
]
]);
printf('Your transaction ID is %s', $transaction->getAttribute('id'));
// commit() sends the transaction to the network, once sent this can't be undone.
$arweave->api()->commit($transaction);
$arweave = new \Arweave\SDK\Arweave('http', '209.97.142.169', 1984);
$arweave->api()->getTransactionData('mvscO3JBlwweOnfkkHpc3fINQ6cUtn_g5aFY9af5TfQ')
$arweave = new \Arweave\SDK\Arweave('http', '209.97.142.169', 1984);