CLI and library for uploading files to Arweave.

Overview

crates.io build status docs.rs Crates.io

arloader

Command line application and library for effortlessly uploading files to Arweave. Arweave enables you to store documents and applications forever.

Upload gigabytes of files with one command specifying a glob pattern to match files against. Files are read and posted to arweave.net asynchronously and computationally intensive bundle preparation is performed in parallel across multiple threads.

Installation

  1. If you're on Linux, you can install the binary from the releases on github. Otherwise, of if you prefer, you can install from crates.io once you have rust installed.
cargo install arloader
  1. Get an Arweave wallet json file here.

  2. If you're going to use AR to pay for transactions, get AR tokens. I've been using gate.io despite the high withdrawal fees and KYC delays.

  3. If you're going to use SOL, get a Solana wallet json file and transfer some SOL to it.

Usage

If you're uploading more than one file, you should pretty much always be using bundles. Bundles take multiple files and packages them together in a single transaction. This is better than uploading multiple individual files because you only have to wait for one transaction to be confirmed. Once the bundle transaction is confirmed, all of your files will be available. Larger transactions with larger rewards are more attractive to miners, which means a larger bundled transaction is more likely to get written quickly than a bunch of smaller individual ones.

Arloader accepts file glob patterns and defaults to creating a bundle for your files.

Arweave gateways only index bundles up to 250MB. Arloader will create as many bundles as necessary to upload all of your files. Your files are read asynchronously, bundled in parallel across multiple threads and then posted to arweave.net asynchronously.

  1. To get an estimate of the cost of uploading your files run
arloader estimate "<GLOB>"

Make sure to include quotes around your glob patterns, otherwise your shell will expand them into a list of files. Arloader expects a glob pattern, not a list of files.

  1. To upload your files run
arloader upload "<GLOB>" --log-dir "<LOG_DIR>"

This kicks off the process of uploading a stream of bundles created from your files. The default bundle size is 100 MB, but you can specify a different size with the --bundle-size flag up to 250 MB. The example output below had a bundle size of 5000 bytes.

bundle txid                                   items      KB  status       confirms
------------------------------------------------------------------------------------
 QGPFcZq91lQgmmz2l7rQHkSQpgfJi-Vhv47oTqIYLm4       2       3  Submitted           0
 _-bhdsi4irDEWz8R9wXT-1c06WVQVSMAmQxVF9OkW94       2       3  Submitted           0
 -OAWdFiGS4NKOZXVJG3yZ0yN4xydGOhfQGX2FCdlG88       2       3  Submitted           0
 UBWGFKyTrUVaCa7wi_181FjAd545vdoHmBQEdlaVdA4       2       3  Submitted           0
 qzQlASZrQXNF9HYIOTPjEZL9uy1U9Ou086kCkQWqld0       2       3  Submitted           0

A json status object gets written to LOG_DIR for each uploaded bundle with a file name of <TXID>.json. It has the transaction id, reward, creation time and ids and paths of the files included in the bundle.

{
    "id": "_-bhdsi4irDEWz8R9wXT-1c06WVQVSMAmQxVF9OkW94",
    "status": "Submitted",
    "file_paths": {
        "tests/fixtures/8.png": {
            "id": "0jd-NTQUZhmnKRY-kMt2vEcmSqgzKOLX_P3QYw6CaNE"
        },
        "tests/fixtures/9.png": {
            "id": "1XdiLkoZ5POHsNx7eLyRgisjnxTLzW8SxGsRcb22j84"
        }
    },
    "number_of_files": 2,
    "data_size": 3546,
    "created_at": "2021-11-23T05:47:41.948103600Z",
    "last_modified": "2021-11-23T05:47:41.948107100Z",
    "reward": 50947968
}
  1. After uploading your files, you'll want to check on their status to make sure the have been uploaded successfully and that they ultimately are confirmed at least 25 times before you can be absolutely certain they have been permanently uploaded.
arloader update-status --log-dir "<LOG_DIR>"

This will read the files in <LOG_DIR>, looking for a valid transaction id as a file stem, and then go out to the network to update the status of each. The example below contained two sets of bundles, one still pending and one with 45 confirmations.

bundle txid                                   items      KB  status       confirms
------------------------------------------------------------------------------------
 -OAWdFiGS4NKOZXVJG3yZ0yN4xydGOhfQGX2FCdlG88       2       3  Pending             0
 _-bhdsi4irDEWz8R9wXT-1c06WVQVSMAmQxVF9OkW94       2       3  Pending             0
 qzQlASZrQXNF9HYIOTPjEZL9uy1U9Ou086kCkQWqld0       2       3  Pending             0
 QGPFcZq91lQgmmz2l7rQHkSQpgfJi-Vhv47oTqIYLm4       2       3  Pending             0
 UBWGFKyTrUVaCa7wi_181FjAd545vdoHmBQEdlaVdA4       2       3  Pending             0
 KuuEZpbfCbw6izMeN3knWlpzmaFhnrDL9dUKCW2LQHw       2       3  Confirmed          45
 IRToYYvsftCiR71sfW5qt8XCzBFotwoDFBoEMEtrMrU       2       3  Confirmed          45
 M2QZYxUqw3ZJ2KXzU4pfw9fFIkVOSrJbSpE7NAvHLvo       2       3  Confirmed          45
 qvci4i6Mfr-5_NHI1bL-Omv16QEUw3iiirzv4fXefnM       2       3  Confirmed          45
 NAP2vTKQdMG_eKyKBYz3876T4yBFl4oYFYqwwwnHbFA       2       3  Confirmed          45
  1. Once you have a sufficient number of confirmations of your files, you may want to create a manifest file, which is used by the Arweave gateways to provide relative paths to your files. In order to do that, you run
arloader upload-manifest --log-dir "<LOG_DIR>"

where <LOG_DIR> is the directory containing your bundle status json files. This will go through and consolidate the paths from each of the bundles, create a consolidated manifest, upload it to Arweave and then write a file named manifest_<TXID>.jsonto <LOG_DIR>. Once the transaction uploading the manifest has been confirmed, you will be able to access your files and both https://arweave.net/<BUNDLE_ITEM_ID> and https://arweave.net<MANIFEST_ID>/<FILE_PATH> where MANIFEST_ID is the id of the manifest transaction and FILE_PATH is the relative path of the file included in the GLOB pattern you specified with the upload command.

{
    "id_paths": [
        "https://arweave.net/aCdWUSXMoDWGzjc55dtGV1H-cVVwWsCWQK02JNkIPVE",
        "https://arweave.net/j8CkOBNAXDhYW2Tsw5r3JhQXUaFcxWqiemQVlBRB3Xc",
        "https://arweave.net/hG4UvTIN_xxcg1gv_k2HwEO5RHv67iUp70LqVjJe6QQ",
        "https://arweave.net/297e1JxgnSv6MABn8XEeZOgXW_zDKv-C5mhHAS6NaAY",
        "https://arweave.net/DLI1O46CSAu-iVClAuRt7bTw0Kp71hMMnQowBT2i_gI",
        "https://arweave.net/T-03eMzyk_ribRHHsoNEmhoWWpMj7xCICh0A-p5yUOc",
        "https://arweave.net/xBolTrDkS-2-zDP0efRaq81Mc9rQg1LjgPsp1V3GJks",
        "https://arweave.net/doXvNsNq3bEX-aVzl-068xa3sPvmOmMAxLrDKvRnYcM",
        "https://arweave.net/oGa3YtiFUObfxAEM8SNp0Pij9oKuX_N6zJ7R9cjQ6h8",
        "https://arweave.net/qK8OOc6r9K4mFqnnSEfqSEct97V7Bgsvobes4gaad14"
    ],
    "relative_paths": [
        "https://arweave.net/n3WrgRsplTDvCe_TIMPXWfhXIT-OsGQ9y78Gz11-jKI/tests/fixtures/0.png",
        "https://arweave.net/n3WrgRsplTDvCe_TIMPXWfhXIT-OsGQ9y78Gz11-jKI/tests/fixtures/1.png",
        "https://arweave.net/n3WrgRsplTDvCe_TIMPXWfhXIT-OsGQ9y78Gz11-jKI/tests/fixtures/2.png",
        "https://arweave.net/n3WrgRsplTDvCe_TIMPXWfhXIT-OsGQ9y78Gz11-jKI/tests/fixtures/3.png",
        "https://arweave.net/n3WrgRsplTDvCe_TIMPXWfhXIT-OsGQ9y78Gz11-jKI/tests/fixtures/4.png",
        "https://arweave.net/n3WrgRsplTDvCe_TIMPXWfhXIT-OsGQ9y78Gz11-jKI/tests/fixtures/5.png",
        "https://arweave.net/n3WrgRsplTDvCe_TIMPXWfhXIT-OsGQ9y78Gz11-jKI/tests/fixtures/6.png",
        "https://arweave.net/n3WrgRsplTDvCe_TIMPXWfhXIT-OsGQ9y78Gz11-jKI/tests/fixtures/7.png",
        "https://arweave.net/n3WrgRsplTDvCe_TIMPXWfhXIT-OsGQ9y78Gz11-jKI/tests/fixtures/8.png",
        "https://arweave.net/n3WrgRsplTDvCe_TIMPXWfhXIT-OsGQ9y78Gz11-jKI/tests/fixtures/9.png"
    ]
}

You can run the following command to get an update on the status of your manifest transaction.

arloader get-status `<MANIFEST_ID>`

Usage with SOL

You can use SOL to pay for your transactions without going through the hassle of procuring AR tokens.

Arloader usage is pretty much exactly the same as above, with the addition of the --with-sol flag.

  1. To get an estimate of the cost of uploading your files run
arloader estimate "<GLOB>" --with-sol
  1. To upload your files run
arloader upload "<GLOB>" --log-dir "<LOG_DIR>" --with sol

This will create the same stream of bundles that gets created without using SOL and then goes out to an api to get your transactions signed. Once the SOL payment transaction has gone through, the signature comes back from the api and gets added to your bundle transaction. Then the transaction gets uploaded directly to the arweave.net gateway from your computer.

Reward Multiplier

Arweave is limited to approximately 1,000 transactions every two minutes so if you happen to submit your transaction at a time when there are a lot of pending transactions, it may take longer to get written, or if there are enough more attractive transaction, i.e, with higher rewards, it may not get written at all. To check the current number of pending transactions, run

arloader pending

and that will print the number of pending transactions every second for one minute.

 pending tx
-------------------------------------------------------------------------------------------------
  118 | ▥▥▥
  123 | ▥▥▥
  124 | ▥▥▥
  224 | ▥▥▥▥▥
  125 | ▥▥▥
  326 | ▥▥▥▥▥▥▥
  128 | ▥▥▥

Given that Arloader bundles by default, your transaction is hopefully relatively attractive and you don't need to increase the reward to get it written in a timely fashion. However, if you see that there are a lot of transactions pending and you want to be sure your transaction goes through quickly, you can adjust the reward with --reward-multiplier followed by something tha can be parsed as a float between 0.0 and 10.0. The reward included in your transaction will then be multiplied by this factor when it gets submitted. Similar to the --with-sol flag, you can add --reward-multiplier to both estimate and upload commands.

Usage without Bundles

You can add the --no-bundle flag if for some reason you want to create individual transactions. This works with both estimate and upload commands. In that case individual status objects are written to LOG_DIR and you can run update-status to update them from the network and status-report for a count of transactions by status.

Comments
  • Insanely high upload time?

    Insanely high upload time?

    Hey team!

    Was not sure where the best place to put this was, but figured it couldn't hurt to have it here in case any other users experience this.

    My scenario: Our project already minted and we want to add an extra attributes field in the metadata to specify the rarity of that NFT. This needs to be done for all 750 NFT's and we can easily update the URI that points to the metadata with something like metaboss. The problem we face is figuring out the best way to upload the updated JSONS into arweave.

    The issue: I did some testing with only 1 JSON file following the available documentation. I used SOL and also specified the maximum amount for reward multiplier. Even with the increased rewards, the upload for a single JSON file took roughly 40 minutes before it showed up.

    Is there something I am doing wrong for it to take so long? Is there a better way to achieve what we are trying to do?

    Any help would be greatly appreciated!

    opened by nprodas 14
  • NotFound when using multiplier 0 to 3

    NotFound when using multiplier 0 to 3

    bundle txid items KB status confirms

    fkESPupWBD-TVpXaBGJC-ta7--UDjtdiJ-Uap2WMSEo 4000 3173 NotFound 0 Updated 1 statuses.

    Is there any work around for this issue or anyway to get the sol back?

    opened by mccode415 13
  • Getting StatusCodeNotOk errors after trying to upload with SOL

    Getting StatusCodeNotOk errors after trying to upload with SOL

    Hi, this is my first time using your tool and I've been having issues all day trying to upload a single png/json pair. The operation fails but the SOL do get deducted from my wallet each time.

    The same issues happen both when running upload or upload-nfts. This is what I'm doing (I'm using mainnet-beta):

    arloader upload assets/0.png --sol-keypair-path ~/.config/solana/my_wallet_keypair.json --with-sol --ar-default-keypair output:

    Uploading 1 files with 93 KB of data in 1 bundle transactions...
    
    StatusCodeNotOk
    
    Uploaded 0 KB in 0 files in 0 bundle transaction(s). Run `arloader update-status assets/arloader_2Ot4PVp1jrA` to update statuses.
    

    or arloader upload-nfts assets/*.png --with-sol --sol-keypair-path ~/.config/solana/my_wallet_keypair.json --ar-default-keypair output:

    Uploading assets...
    
    Uploading 1 files with 93 KB of data in 1 bundle transactions...
    
    Retrying Solana transaction (1 of 10)...
    StatusCodeNotOk
    
    Uploaded 0 KB in 0 files in 0 bundle transaction(s). Run `arloader update-status assets/arloader_nk2gGXUQ7C8/assets/` to update statuses.
    
    Uploading manifest for images...
    
    No bundle statuses found in assets/arloader_nk2gGXUQ7C8/assets/
    thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /Users/mjuarezlopez/.cargo/registry/src/github.com-1ecc6299db9ec823/arloader-0.1.60/src/commands.rs:802:6
    

    Both operations create empty arloader_<RANDOM_CHARS> folders.

    I tried using --reward-multiplier of 2 and 3 without luck. I also tried using the --no-bundle option with upload command but that doesn't seem to work at all.

    opened by murki 10
  • crash when tx status returns internal server error

    crash when tx status returns internal server error

    currently tx status endpoint on arweave http server returns internal server error and this isn't currently handled in arloader so we get this crash: thread 'tokio-runtime-worker' panicked at 'internal error: entered unreachable code', github.com-1ecc6299db9ec823/arloader-0.1.59/src/lib.rs:1271:18

    opened by ozgrakkurt 10
  • Trying to upload png/json

    Trying to upload png/json

    Hi,

    Any Ideas what is going on here?

    $ ./arloader upload-nfts inc/a/. --with-sol --sol-keypair-path wallet.json --ar-default-keypair

    Uploading assets...

    Uploading 598 files with 249510 KB of data in 3 bundle transactions...

    bundle txid items KB status confirms

    uYpDF2_4DvBywQu2geqXeut4c7C4yMjiC7gQ-UhaZYk 239 98271 Submitted 0 Retrying Solana transaction (1 of 10)... TOZyZxnOGyra5LPhlEcCO1UgS7sXMnFdC9JrQTxPIyk 236 99834 Submitted 0 Retrying Solana transaction (1 of 10)... klFh_4YuuKYDphaHmvIEUTcB6K8ErenJfL9JwUduDb0 123 51404 Submitted 0

    Uploaded 249510 KB in 598 files in 3 bundle transaction(s). Run arloader update-status inc/a/arloader_Bhd-BmCczr0/assets/ to update statuses.

    Uploading manifest for images...

    Uploaded manifest for 598 files and wrote to inc/a/arloader_Bhd-BmCczr0/assets/manifest_Lgp1zj-QYDn9yaXKsiaxpJAOkTdrfXETTYn6KaCGG0Q.json.

    Run arloader get-status Lgp1zj-QYDn9yaXKsiaxpJAOkTdrfXETTYn6KaCGG0Q to confirm manifest transaction.

    Updating metadata with links from manifest...

    Error: SerdeJson(Error("EOF while parsing a value", line: 1, column: 0))

    opened by ryansorr1 9
  • Transaction for upload-nfts complete, but files inaccessible

    Transaction for upload-nfts complete, but files inaccessible

    Metadata: https://viewblock.io/arweave/tx/CYxzfb6gKuU1-KEUAVQUDZTpBOOi8iLcGA71EuOc9jk

    Images: https://viewblock.io/arweave/tx/yeFIaMr8plqwgvW6jQqOm7CQYLXl2HWTf8NfuAtADi8

    I used the upload-nfts command to upload a test set of 100 NFTs, but even after several hundred confirmations none of the bundled transactions return anything but the standard 'not found' page on arweave.net.

    Here's an example of one of the bundled transactions that should return an image: https://arweave.net/-DM0oTxVYX8esq8fn79ifxAoNJRpyZHhXmYTsVAGMjE

    It doesn't seem to be a one off issue for me; I first ran into this issue yesterday, and I eventually gave up on this transaction and tried to use the same command again this morning to the same result.

    In case these are needed as well, these are the links to the new transaction bundles: Images: https://viewblock.io/arweave/tx/23-cH3-AAYCYPCp43fD1Im1iNgED3NoDcNwTAisIXOY

    Metadata: https://viewblock.io/arweave/tx/hK9cpjqHYnUi3IwIY_om8pMNgxcgInAR2Tt2fmvFnmM

    opened by nickr2001 6
  • Constant issues with uploading nft set - StatusCodeNotOk

    Constant issues with uploading nft set - StatusCodeNotOk

    Using upload-nft results in StatusCodeNotOk.

    AR tokens get deducted, adding a reward multiplier does not work. Resulting bundle is crrupted and fails verification.

    Any idea what can help ?

    I am using the latest build to this date.

    opened by oliexe 6
  • Error doesn't implement Send

    Error doesn't implement Send

    this makes it very hard to use the Arweave since the errors it returns are !Send and that makes the Futures themselves !Send which makes running them in tokio not possible without LocalSet

    opened by ozgrakkurt 5
  • Bundles never being accepted

    Bundles never being accepted

    https://explorer.solana.com/address/9Em18kRiGNBA1Rrx8oNBnftKj8dcFXFYyDchXQcKSV5r

    arloader upload \*.mp4 --with-sol --sol-keypair-path ~/.config/solana/devnet.json --ar-default-keypair --bundle-size 50

     bundle txid                                   items      KB  status       confirms
    ------------------------------------------------------------------------------------
     L4YIOSLxpHLEL8oFk13rmVIMYXvMGTujMtRM0EMUBu4       3   38912  NotFound            0
     qsnuTQrhqxOoHxhJu_4RVOs-8JgGcf6OQHN9aF14Nlc       4   46121  NotFound            0
     h5IM9BIsfKZtKAZou3VuK3w-seTZnHf9dYWrCN7GowA       4   47642  NotFound            0
     Maac9oFEM2eTjp2iqiawljIjfY7SRDfCHngVIEvNyk0       3   39039  NotFound            0
     ZHuvQK60Eza4lWoIhTKstArSdlXUlzlFZA2F008QMIs       3   32708  NotFound            0
     4l18ZbtydWyvkkAJiUaq02vJJlsbuueWrITyZC6anIo       4   45692  NotFound            0
     quu63L_f-MCulXqaYOEJVd-8zNwm8PbyJuOKo58fDkU       4   46956  NotFound            0
     2OC_xvDoLKkBkh0sLDIQGhaVeksCWkSX7sDoVt3ijec       4   44346  NotFound            0
     YSnLMv67I0vWwOHiYCY0uDI9Cq8OUJRSra18evFZ1Is       4   49219  NotFound            0
    

    arloader upload *.webp --with-sol --sol-keypair-path ~/.config/solana/devnet.json --ar-default-keypair --bundle-size 50

     bundle txid                                   items      KB  status       confirms
    ------------------------------------------------------------------------------------
     RXp4t5Ex-nJ0GIwbxDS_FpSMrP9KuCpq_rZO7ErG-2I      33   25983  NotFound            0
    

    Am I able to get my SOL back if a transaction is never taken by a miner?

    opened by Jac0xb 4
  • estimate command requires an ar-keypair-path even with --with-sol flag

    estimate command requires an ar-keypair-path even with --with-sol flag

    $ arloader estimate "" --with-sol error: The following required arguments were not provided: --ar-keypair-path <AR_KEYPAIR_PATH>

    USAGE: arloader --ar-keypair-path <AR_KEYPAIR_PATH> --base-url <AR_BASE_URL>

    For more information try --help

    opened by jameslin101 4
  • Rust nightly toolchain

    Rust nightly toolchain

    As I can see there is only on feature from nightly — #![feature(derive_default_enum)], to derive default trait for status. But with that it's not possible to use this crate as lib in stable toolchain.

    opened by iupii 3
  • allow customization in client

    allow customization in client

    This PR allows for the customization of the reqwest client that the arweave struct uses. This way I can pass custom headers to all the requests in an easy manner such as this:

            let mut headers = header::HeaderMap::new();
            headers.insert(
                "X-Network",
                header::HeaderValue::from_static("arweave.testnet"),
            );
            let mut builder = Client::builder();
            builder = builder.default_headers(headers);
    
            let c = builder.build().unwrap();
    
            let r = c
                .get("http://localhost:1984/tx/ready_for_mining")
                .header("Content-Type", "application/x-www-form-urlencoded")
                .send()
                .await?
                .text()
                .await?;
    

    Also added actual methods for last_tx and tx_anchor

    Thanks for this lib :)

    opened by Dev43 0
  • Cannot create w2w transaction

    Cannot create w2w transaction

    I'm trying to create an data-empty transaction with target and quantity other than 0, a wallet 2 wallet transaction. Is this even supported? Is there a way of doing this?

    Here is my attempt:

    async fn main() {
        let path = PathBuf::from_str("wallet.json").unwrap();
        let arweave = 
            Arweave::from_keypair_path(path, Url::from_str("https://arweave.net").unwrap())
            .await
            .unwrap();
        
        let price_terms = arweave
            .get_price_terms(1.0)
            .await
            .unwrap();
        println!("{:?}", price_terms);
        
        let mut tx = arweave.create_transaction(vec![10], None, None, price_terms, false).await.unwrap();
        tx.target = Base64::from_str("PAgdonEn9f5xd-UbYdCX40Sj28eltQVnxz6bbUijeVY").unwrap();
        tx.quantity = 100000;
        dbg!(json!(&tx));
    
    
        let sig_tx = arweave
            .sign_transaction(tx)
            .unwrap();
    
        dbg!(json!(&sig_tx));
        
        let res = arweave
            .post_transaction(&sig_tx)
            .await;
    
        dbg!(res);
    }
    

    Apparently, the merkle generated when the target is present and quantity is different from zero is not being generated correctly.

    opened by bluekirby1111 0
  • StatusNotOK

    StatusNotOK

    Hi. i need to upload an json file to arweave with rust(im using arloader = "0.1.63"). but i got a StatusCodeNotOk error.

    it makes empty folder (ex: SZ2g5l-q7M4) and after an error the folder is deleted by itself.

    Also it takes fee, even with error StatusCodeNotOk:

    https://explorer.solana.com/tx/5YDUWr4s8RE52LKivnCBjWqGXM1YN1mBK1rLvj3Yq9NJZ5t5ASofnvFWBouWvg167UQdEwkVbEt9xFnEYTWA4J6

    but with CLI everything is ok, no errors.

    arloader upload xxx.json --with-sol --sol-keypair-path /Users/x/.config/solana/id.json --ar-default-keypair
    

    Any ideas why?

    Error:

    thread 'main' panicked at '----- err: status code not ok', src/upload_files_2.rs:199:21
    stack backtrace:
       0:        0x10b4b9ef4 - std::backtrace_rs::backtrace::libunwind::trace::hc513dadde6954c86
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
       1:        0x10b4b9ef4 - std::backtrace_rs::backtrace::trace_unsynchronized::hef5b528e06275835
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
       2:        0x10b4b9ef4 - std::sys_common::backtrace::_print_fmt::hd90f3854346e0ebc
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:66:5
       3:        0x10b4b9ef4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h85521558a183f368
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:45:22
       4:        0x10b4d509b - core::fmt::write::h01631fae0d2b98bc
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/fmt/mod.rs:1197:17
       5:        0x10b4b4ab8 - std::io::Write::write_fmt::h675dde99a2999169
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/io/mod.rs:1672:15
       6:        0x10b4bb89d - std::sys_common::backtrace::_print::h9f1d91ee7cd2be55
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:48:5
       7:        0x10b4bb89d - std::sys_common::backtrace::print::h4ad640f11cc29383
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:35:9
       8:        0x10b4bb89d - std::panicking::default_hook::{{closure}}::h5e5df492d229fd65
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:295:22
       9:        0x10b4bb5f4 - std::panicking::default_hook::h18647b59f1a84ee2
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:314:9
      10:        0x10b4bbdd8 - std::panicking::rust_panic_with_hook::hd9ead35a68ccc55e
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:698:17
      11:        0x10b4bbd13 - std::panicking::begin_panic_handler::{{closure}}::h6fca91c5e1dc2f30
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:588:13
      12:        0x10b4ba377 - std::sys_common::backtrace::__rust_end_short_backtrace::h4ff3025d9a0a0490
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:138:18
      13:        0x10b4bb9ea - rust_begin_unwind
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:584:5
      14:        0x10b4efbb3 - core::panicking::panic_fmt::h3d9f795ee387ef8d
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panicking.rs:142:14
      15:        0x10ab37cc2 - nft_metadata::upload_files_2::test_upload_file_from_path_with_sol::{{closure}}::hb8fe6cce227e8978
                                   at /Users/viktor/SolanaWorkspace/nft-metadata/src/upload_files_2.rs:199:21
      16:        0x10ab27497 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::he32511af53025e80
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/future/mod.rs:91:19
      17:        0x10ab0cb01 - tokio::park::thread::CachedParkThread::block_on::{{closure}}::hf98dcba3d89e9394
                                   at /Users/viktor/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.1/src/park/thread.rs:263:54
      18:        0x10aaf43e8 - tokio::coop::with_budget::{{closure}}::h8f3cef8a0094aa0a
                                   at /Users/viktor/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.1/src/coop.rs:106:9
      19:        0x10aafbf0e - std::thread::local::LocalKey<T>::try_with::h2592c78968e826ec
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/thread/local.rs:445:16
      20:        0x10aafbcb4 - std::thread::local::LocalKey<T>::with::h7a0b1186cdee89b9
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/thread/local.rs:421:9
      21:        0x10ab0c4de - tokio::coop::with_budget::h60f98d0ff60a035c
                                   at /Users/viktor/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.1/src/coop.rs:99:5
      22:        0x10ab0c4de - tokio::coop::budget::h8e386e495c4b0c28
                                   at /Users/viktor/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.1/src/coop.rs:76:5
      23:        0x10ab0c4de - tokio::park::thread::CachedParkThread::block_on::h0c7bb7f1c9c5cfbe
                                   at /Users/viktor/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.1/src/park/thread.rs:263:31
      24:        0x10ab0adcd - tokio::runtime::enter::Enter::block_on::h41508e85a19c1a26
                                   at /Users/viktor/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.1/src/runtime/enter.rs:151:13
      25:        0x10aaf2eef - tokio::runtime::thread_pool::ThreadPool::block_on::h55293f9165436576
                                   at /Users/viktor/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.1/src/runtime/thread_pool/mod.rs:77:9
      26:        0x10ab2d520 - tokio::runtime::Runtime::block_on::h78e12c21ffd62b54
                                   at /Users/viktor/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.1/src/runtime/mod.rs:463:43
      27:        0x10ab1d180 - nft_metadata::upload_files_2::test_upload_file_from_path_with_sol::hb8917331bc9bc0dc
                                   at /Users/viktor/SolanaWorkspace/nft-metadata/src/upload_files_2.rs:208:5
      28:        0x10ab0aa09 - nft_metadata::main::he3f7432529c9137b
                                   at /Users/viktor/SolanaWorkspace/nft-metadata/src/main.rs:33:13
      29:        0x10aaff68e - core::ops::function::FnOnce::call_once::h2886063610811728
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/ops/function.rs:248:5
      30:        0x10aafc821 - std::sys_common::backtrace::__rust_begin_short_backtrace::hac21c6f8c37f6631
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/sys_common/backtrace.rs:122:18
      31:        0x10ab1c924 - std::rt::lang_start::{{closure}}::hab33639a50e1c439
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/rt.rs:145:18
      32:        0x10b4af28e - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h7b036f15aca60adb
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/ops/function.rs:280:13
      33:        0x10b4af28e - std::panicking::try::do_call::hf6119ec0466800e8
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:492:40
      34:        0x10b4af28e - std::panicking::try::hcda27a2b6f836f01
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:456:19
      35:        0x10b4af28e - std::panic::catch_unwind::hde37ab35642f072b
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panic.rs:137:14
      36:        0x10b4af28e - std::rt::lang_start_internal::{{closure}}::h103d9f9a51ce5b21
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/rt.rs:128:48
      37:        0x10b4af28e - std::panicking::try::do_call::h0e10440d51723322
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:492:40
      38:        0x10b4af28e - std::panicking::try::h738bcf26bd63f912
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:456:19
      39:        0x10b4af28e - std::panic::catch_unwind::hc9eba21b74d8966b
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panic.rs:137:14
      40:        0x10b4af28e - std::rt::lang_start_internal::h3fd5cff071397f19
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/rt.rs:128:20
      41:        0x10ab1c8fe - std::rt::lang_start::h40d9b716e1344c4c
                                   at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/rt.rs:144:17
      42:        0x10ab0aa36 - _main
    cod005hctln:src viktor$ 
    

    my code:

     use arloader::{
        error::Error,
        solana::{SOLANA_MAIN_URL, SOL_AR_BASE_URL},
        utils::TempDir,
        Arweave,
    };
    use solana_sdk::signer::keypair;
    use std::{path::PathBuf, str::FromStr};
    use url::Url;
    
    async fn get_arweave() -> Result<Arweave, Error> {
        let ar_keypair_path = PathBuf::from("/Users/viktor/SolanaWorkspace/arweave-key-CAJ7UsUYpeRAp4gb8-mm9k-6a2H8XEWTPQeGYzuFSOU.json");
    
        let arweave = match Arweave::from_keypair_path(
            ar_keypair_path,
            Url::from_str("https://arweave.net").unwrap(),
        )
        .await
        {
            Ok(arweave) => arweave,
            Err(e) => panic!("----- arweave error: {}", e),
        };
    
        Ok(arweave)
    }
    
    #[tokio::main]
    pub async fn upload_file_with_sol() -> Result<(), Error> {
        let solana_url = SOLANA_MAIN_URL.parse::<Url>()?;
        let sol_ar_url = SOL_AR_BASE_URL.parse::<Url>()?.join("sol")?;
        let keypair = PathBuf::from("/Users/viktor/.config/solana/id.json");
        println!("{}", keypair.exists());
    
        let from_keypair = keypair::read_keypair_file("/Users/viktor/.config/solana/id.json")?;
    
        let arweave = get_arweave().await?;
    
        let file_path = PathBuf::from("tests/fixtures/1.json");
        let temp_log_dir = TempDir::from_str("tests/fixtures/").await?;
        let log_dir = temp_log_dir.0.clone();
    
        println!("------- solana_url: {}", solana_url);
        println!("------- sol_ar_url: {}", sol_ar_url);
        println!("------- file_path: {:?}", &file_path);
        println!("{}", file_path.exists());
        println!("------- log_dir: {:?}", log_dir);
        println!("{}", log_dir.exists());
    
        let status = arweave
            .upload_file_from_path_with_sol(
                file_path.clone(),
                None,
                None,
                None,
                (0, 0), // (5,5) doesn't work either
                solana_url.clone(),
                url::Url::parse("https://arloader.io/sol").unwrap(),
                &from_keypair,
            )
            .await;
    
        match status {
            Ok(x) => x,
            Err(err) => panic!("----- err: {:#}", err),
        };
    
        // println!("{:?}", status);
    
        let read_status = arweave.read_status(file_path, log_dir.clone()).await?;
        println!("{:?}", &read_status);
        Ok(())
    }
    
    
    opened by ViktorKirjanov 6
  • get-status JSON output panics

    get-status JSON output panics

    • Installed through cargo on macOS.
    • Attempting to get status of a tx with JSON output panics
    • This tx is pending at the time
    arloader get-status Y-sqEXggvUCoGaeYJfpGKg7LLNCORBiAGBKyG5aYIhM --output json
    thread 'main' panicked at 'byte index 32 is out of bounds of ``', library/core/src/str/mod.rs:107:9
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    
    opened by dmichael 2
  • what am i doing wrong?

    what am i doing wrong?

    freshskates@not-localhost:/mnt/c/Users/freshskates/Desktop/Languages/Blockchain/test/exclusives$ arloader upload-nfts ./*.gif --with-sol --sol-keypair-path ~/.config/solana/test.json --ar-default-keypair
    
    
    Uploading assets...
    
    Uploading 1 files with 263 KB of data in 1 bundle transactions...
    
    StatusCodeNotOk
    
    Uploaded 0 KB in 0 files in 0 bundle transaction(s). Run `arloader update-status ./arloader_MA0-zRzXZQ4/assets/` to update statuses.
    
    
    Uploading manifest for images...
    
    No bundle statuses found in ./arloader_MA0-zRzXZQ4/assets/
    thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/freshskates/.cargo/registry/src/github.com-1ecc6299db9ec823/arloader-0.1.63/src/commands.rs:802:6
    stack backtrace:
       0:     0x555bd019dc8d - std::backtrace_rs::backtrace::libunwind::trace::hee56aa883c63acb5
                                   at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
       1:     0x555bd019dc8d - std::backtrace_rs::backtrace::trace_unsynchronized::he7cac0994dc78c4c
                                   at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
       2:     0x555bd019dc8d - std::sys_common::backtrace::_print_fmt::hdc12a102f76753bd
                                   at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/sys_common/backtrace.rs:67:5
       3:     0x555bd019dc8d - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf7faa06c147903ce
                                   at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/sys_common/backtrace.rs:46:22
       4:     0x555bcffac2bc - core::fmt::write::h66e8369cb6d370fa
                                   at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/core/src/fmt/mod.rs:1168:17
       5:     0x555bd0177d54 - std::io::Write::write_fmt::h74797452eefbc651
                                   at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/io/mod.rs:1653:15
       6:     0x555bd019ef35 - std::sys_common::backtrace::_print::h82e64c28f7109909
                                   at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/sys_common/backtrace.rs:49:5
       7:     0x555bd019ef35 - std::sys_common::backtrace::print::hef2d97a7e889059a
                                   at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/sys_common/backtrace.rs:36:9
       8:     0x555bd019ef35 - std::panicking::default_hook::{{closure}}::hc4f2f631c593350e
                                   at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/panicking.rs:211:50
       9:     0x555bd019fdca - std::panicking::default_hook::he01061695065e502
                                   at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/panicking.rs:228:9
      10:     0x555bd019fdca - std::panicking::rust_panic_with_hook::h3ad36e38c2432eec
                                   at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/panicking.rs:606:17
      11:     0x555bd019f886 - std::panicking::begin_panic_handler::{{closure}}::hc909e1e15fb3ebac
                                   at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/panicking.rs:500:13
      12:     0x555bd019f826 - std::sys_common::backtrace::__rust_end_short_backtrace::hfcf0febb37587b3d
                                   at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/sys_common/backtrace.rs:139:18
      13:     0x555bd019f7e2 - rust_begin_unwind
                                   at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/std/src/panicking.rs:498:5
      14:     0x555bcfe2a0f0 - core::panicking::panic_fmt::h6a50bf58d4eb52b4
                                   at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/core/src/panicking.rs:110:14
      15:     0x555bcfe2a24c - core::panicking::panic::h2379521af04ff957
                                   at /rustc/89b9f7b284aacc5f8613438b80e4dd7bdd10549e/library/core/src/panicking.rs:48:5
      16:     0x555bcfe68cbc - arloader::commands::command_upload_nfts::{{closure}}::hb74ad99e1a56c002
      17:     0x555bcfe50653 - arloader::main::{{closure}}::hd22cca23b22f2d15
      18:     0x555bcff038d4 - tokio::runtime::Runtime::block_on::h93430bb1a19d2393
      19:     0x555bcff46d03 - arloader::main::h0920b29802615e26
      20:     0x555bcfee68e3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h8613cfdecd68f448
      21:     0x555bcff46327 - main
      22:     0x7f81c37e70b3 - __libc_start_main
      23:     0x555bcfe3682e - _start
      24:                0x0 - <unknown>
      
    

    what could I be doing wrong?

    opened by freshskates 11
  • StatusNotOK

    StatusNotOK

    When uploading with sol, I am continuously having an issue of StatusNotOK. I looked back through all the issues where some say its an Arweave network issue, some say its a Solana network issue, and then some say update the arloader version. I've been trying to upload this set for 3 days and haven't had any luck. Does anyone have a known solution or is it really just wait and be patient? Also, for one of these failed attempts, is there a way to restart it so it just goes back and tries to upload the bundles that it previously failed on?

    opened by reidelkins 13
Releases(v0.1.63)
Owner
Caleb Everett
Caleb Everett
A commmand line tool for uploading homework coded on the dcloud server onto specific google drive course folders.

A commmand line tool for uploading homework coded on the dcloud server onto specific google drive course folders.

Daniel Kogan 2 Sep 8, 2022
A file server that supports static serving, uploading, searching, accessing control, webdav...

Dufs Dufs is a distinctive utility file server that supports static serving, uploading, searching, accessing control, webdav... Features Serve static

null 3.6k Oct 30, 2023
This CLI utility facilitates effortless manipulation and exploration of TOML, YAML, JSON and RON files.

???????? This CLI utility facilitates effortless manipulation and exploration of TOML, YAML, JSON and RON files.

Moe 3 Apr 26, 2023
A tool that allow you to run SQL-like query on local files instead of database files using the GitQL SDK.

FileQL - File Query Language FileQL is a tool that allow you to run SQL-like query on local files instead of database files using the GitQL SDK. Sampl

Amr Hesham 39 Mar 12, 2024
CLI Tool for tagging and organizing files by tags.

wutag ?? ??️ CLI tool for tagging and organizing files by tags. Install If you use arch Linux and have AUR repositories set up you can use your favour

Wojciech Kępka 32 Dec 6, 2022
CLI tool to bake your fresh and hot MD files

At least once in your Rust dev lifetime you wanted to make sure all code examples in your markdown files are up-to-date, correct and code is formated, but you couldn't make that done with already existing tools - fear not!

Patryk Budzyński 39 May 8, 2021
miniserve - a CLI tool to serve files and dirs over HTTP

?? For when you really just want to serve some files over HTTP right now!

Sven-Hendrik Haase 4.1k Jan 6, 2023
Voila is a domain-specific language launched through CLI tool for operating with files and directories in massive amounts in a fast & reliable way.

Voila is a domain-specific language designed for doing complex operations to folders & files. It is based on a CLI tool, although you can write your V

Guillem Jara 86 Dec 12, 2022
A simple CLI for combining json and yaml files

A simple CLI for combining json and yaml files

Avencera 16 Jul 4, 2022
A cli tool to download specific GitHub directories or files

cloneit A cli tool to download specific GitHub directories or files. Installation From git git clone https://github.com/alok8bb/cloneit cd cloneit car

Alok 54 Dec 20, 2022
An ultra-fast CLI app that fixes JSON files in large codebase or folders

minosse An ultra fast CLI app that fixes json files in large codebase or folders USAGE: minosse [OPTIONS] <input-dir> FLAGS: -h, --help Prints

Antonino Bertulla 5 Oct 17, 2022
A CLI tool to rename files to randomly generated strings.

rng-rename A CLI tool to rename files to randomly generated strings. Why? Suppose you downloaded a few hundred images to use as your desktop wallpaper

null 2 Feb 24, 2022
A CLI tool used for rendering Blender files to a cropped spritesheet

BuilderGenerator A CLI tool used for rendering Blender files to a cropped spritesheet Clients Rust

Eric Olson 1 Feb 18, 2022
CLI application to run clang-format on a set of files specified using globs in a JSON configuration file.

run_clang_format CLI application for running clang-format for an existing .clang-format file on a set of files, specified using globs in a .json confi

martin 6 Dec 16, 2022
CLI application to run clang-tidy on a set of files specified using globs in a JSON configuration file.

run-clang-tidy CLI application for running clang-tidy for an existing .clang-tidy file on a set of files, specified using globs in a .json configurati

martin 7 Nov 4, 2022
BoilerFiles is a CLI for downloading your boilerplate files from a public GitHub template repo.

BoilerFiles Available on crates.io. BoilerFiles is a CLI for downloading your boilerplate files from a public GitHub template repo. Features Are you t

Jan Müller 4 Oct 1, 2022
'apk-yara-checker' is a little CLI tool written in Rust to check Yara rules against a folder of APK files.

apk-yara-checker 'apk-yara-checker' is a little CLI tool written in Rust to check Yara rules against a folder of APK files. You have to pass the folde

alberto__segura 15 Oct 5, 2022
CLI tool to find duplicate files based on their hashes.

Dupper Dupper is a CLI tool that helps you identify duplicate files based on their hashes (using the Seahash hashing algorithm). Installation You can

Rubén J.R. 4 Dec 27, 2022
CLI tool to convert image files.

?? F1sh CLI tool to convert image files. ??️ Supported formats File Supported AviF ✅ BMP ✅ DDS ✅ Farbfeld ✅ GIF ✅ HEIF ❌ ICO ✅ JPEG ✅ OpenEXR ✅ PNG ✅

Sammwy 5 Apr 3, 2023