This repository contains simple examples demonstrating how to interact with the LAOS blockchain. For further documentation about LAOS, the following can be of interest:
To run the node.js examples, first install dependencies via:
npm ci
To send write transactions to the LAOS network, the sender needs to own a minimal amount of funds. Please use this faucet if needed.
Rename the example.env
file to .env
, and fill in the three fields:
- The private key field must start with
0x...
, and the corresponding account must have acquired tokens from the faucet. This field is required. - The examples use Pinata to upload and store data in IPFS. To use the
ipfs-uploader.js
example, either use your Pinata API key or create a free Pinata account to get one. Paste the key and secret in the fields in the .env file. If you are minting using IPFS addresses from different source, you need not fill in these fields.
Each script contains comments in its code that should make it understandable. Modify the required values to adapt to your needs (e.g. contract addresses, recipient of mints, etc.).
Run the scripts via:
node script_name.js
The fastest way to bridgelessly mint an asset on Ethereum or Polygon (without paying any ETH or MATIC) is to use existing collections that have Public Minting enabled.
The steps are as follows:
- Place an image that you would like to be associated with the asset in the
./imgs
folder. - Edit the
main()
function of theipfs-uploader.js
script to use the path to the image, as well as the title, description, and associated metadata of the asset. Run the script. - Paste the resulting
ipfs://...
output fromipfs-uploader.js
into thetokenURI
variable of thesingle-mint.js
script. - Ensure that the
klaosCollectionAddr
andtoAddress
variables are set to your requirements, as explained in the script comments. Run the script. - The output of the script is a
tokenID
.
If you used the suggested public collections in the example, the minted assets can be viewed at:
-
For assets minted in the Ethereum public contract:
https://apps.klaos.io/asset/1/0x56d77B72C8A7322D2F63bBd17EacB5AeB8671925/<tokenID>
-
For assets minted in the Polygon public contract, the asset can be viewed at:
https://apps.klaos.io/asset/137/0x30ebd8d3e9b5b303d2b0a81c5cc0ce90ff185e9c/<tokenID>