Sign inSign up

sk33z3r/loopygen-cli

By sk33z3r

•Updated over 4 years ago

LooPyGen CLI Image for Server Applications

Image
0

258

sk33z3r/loopygen-cli repository overview

⁠LooPyGen CLI

A Docker image of LooPyGen's python and node backend to be run as a headless application on a server.

The aim is to provide LooPyGen as a CLI client for use in servers with dApps. As with the UI version, this requires a MetaMask or GameStopNFT wallet to run transfers.

It also requires storing private keys on the server, so it would be wise to use a dev wallet and only fund it with just enough for whatever transactions it would be performing. Although we encrypt the keys and store them in a Docker volume, you still need to pass a passphrase for the key file in a command argument or custom dotenv setup to automate the process.

Please make sure you understand the implications before moving forward with a server implementation, and that we never recommend using your main wallet for this kind of usage.

Notes:

  • You can clean up old images with: docker image prune
  • Your config files are encrypted and stored in a Docker volume that is persistent on updates. Destroy the volume with: docker volume prune
  • If you desire to access the shell of the container for any reason, do so with: ./loopygen-cli.sh bash
  • If you pass your config passphrase on the command line, it should be base64 encoded first. All transfer and mint commands accept this additional argument:
    --configpass $(echo -n "passphrase" | basenc --base64)
    

⁠Server Image Generation

If you plan to run the headless version in order to take advantage of server processing resources, such as high quality video or GIF collections, then you will need to make a collections folder available to the container on the server that includes your traits and source layers.

The easiest way to do this is to run the LooPyGen GUI locally to create and setup your collection files. Then you can copy your local collections folder to the server. If you keep the folder named collections and run the loopygen-cli.sh script at the same folder level, the container will automaticaly have access to the files.

For instance, your folder structure should look like this:

appdir/
    ├ collections/
    └ loopygen-cli.sh

⁠Usage

Download the script from GitHub with to your local working directory

# using wGET
$ wget -O ./loopygen-cli.sh https://github.com/sk33z3r/LooPyGen/blob/main/cli.sh && chmod +x loopygen-cli.sh
# using cURL
$ curl https://github.com/sk33z3r/LooPyGen/blob/main/cli.sh -o loopygen-cli.sh && chmod +x loopygen-cli.sh

Pull the latest image

$ ./loopygen-cli.sh update

Run a command

$ ./loopygen-cli.sh {command}
⁠Commands

Replace {command} with one of the below commands.

>> Click to Show Config Commands

Encrypt your mint configuration

encrypt --mint

Encrypt your transfer configuration

encrypt --transfer
>> Click to Show Image Generator Commands

Basic run:

generate --count XXX

Delete previously generated images before generating a new set:

generate --empty --count XXX

Start generating from a specific ID number:

generate --count XXX --id YY

If you have a beefy computer, you can try to generate images simultaneously to speed up the process:

generate --count XXX --threaded
>> Click to Show Metadata Generator Commands

Basic run, after generating images:

metadata

Delete previously generated metadata before generating a new set:

metadata --empty
>> Click to Show Minting Commands

Batch mint a collection:

mint --name <my_nft_collection> --amount 1

Mint a specific set of IDs:

mint --name <my_nft_collection> --start <startID> --end <endID> --amount 1

Mint a single CID:

mint --cid Qmau1Sx2hLTkLmXsu2dD28yMZtL3Pzs2uKqP2MeHZPm93V --amount 100

Test run a mint (shows only what the script would do, but doesn't actually do it):

mint --name <my_nft_collection> --testmint --amount 100
>> Click to Show CID Calculator Commands

To scan CID files, input a path relative to your working directory.

The file must be at your current level or lower, and not outside of the directory. For instance, ../other-dir/somefile would not work.

CIDv0:

cid ./relative/path/to/file

CIDv1:

cid --cid-version=1 ./relative/path/to/file

Tag summary

Content type

Image

Digest

Size

92.5 MB

Last updated

over 4 years ago

docker pull sk33z3r/loopygen-cli