Skip to content

Instantly share code, notes, and snippets.

@andresmgsl
Last active October 9, 2021 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andresmgsl/dc9acc8554b3e8a932a29c12bb7cb3b3 to your computer and use it in GitHub Desktop.
Save andresmgsl/dc9acc8554b3e8a932a29c12bb7cb3b3 to your computer and use it in GitHub Desktop.
Arweave Upload Text - Example

Arweave Upload Text - Example

First you have to install arweave (look in google who to do that). Remember there's not arweave TestNet or DevNet, so you have to use this https://github.com/ArweaveTeam/testweave-sdk

Moving on. Once you have testweave-docker cloned and ready to use, run the command

docker-compose up

You can have troubles if you have another app running in the 80 port, for example nginx, if you're using ubuntu 20.04 or later, you can do sudo systemctl stop nginx and there's all

Another possible error is that when you kill the local node, one or more docker containers could remain orphans, so to avoid that you run docker-compose down --remove-orphans

Now, with the arweave local node, you can start uploading files (This files will storage in your PC, obviously).

Starting the NextJs API.

You have to clone my monorepo and use the arweave lib to create de NestJs API. Install the @nrwl/nestjs dependency and generate your app using NX console or the following command

npx nx generate @nrwl/nest:application --name=arweave-api --no-interactive

To use 'arweave' you have to add the "esModuleInterop": true to the compilerOptions in the tsconfig.app.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment