{"id":24551985,"url":"https://github.com/mlabs-haskell/seabug","last_synced_at":"2025-04-15T22:20:22.902Z","repository":{"id":37544106,"uuid":"480363178","full_name":"mlabs-haskell/seabug","owner":"mlabs-haskell","description":"Combined components for Seabug deployment","archived":false,"fork":false,"pushed_at":"2023-01-05T16:03:58.000Z","size":212,"stargazers_count":6,"open_issues_count":11,"forks_count":2,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-03-29T02:04:19.907Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mlabs-haskell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-11T12:08:13.000Z","updated_at":"2022-08-24T20:13:03.000Z","dependencies_parsed_at":"2023-02-04T06:35:13.285Z","dependency_job_id":null,"html_url":"https://github.com/mlabs-haskell/seabug","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlabs-haskell%2Fseabug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlabs-haskell%2Fseabug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlabs-haskell%2Fseabug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlabs-haskell%2Fseabug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlabs-haskell","download_url":"https://codeload.github.com/mlabs-haskell/seabug/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249161869,"owners_count":21222568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-23T01:19:39.140Z","updated_at":"2025-04-15T22:20:22.885Z","avatar_url":"https://github.com/mlabs-haskell.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Seabug\n\n- [Prerequisites](#prerequisites)\n- [Usage](#usage)\n  * [Clone repo](#clone-repo)\n  * [Enter nix shell](#enter-nix-shell)\n  * [Setup `nft.storage` key](#setup--nftstorage--key)\n  * [Optional: Copy testnet node database](#optional--copy-testnet-node-database)\n  * [Start services](#start-services)\n  * [Optional: Mint your own NFTs](#optional--mint-your-own-nfts)\n- [Maintenance](#maintenance)\n  * [Updating dependencies](#updating-dependencies)\n  * [Targeting different networks](#targeting-different-networks)\n  * [Adding new off-chain contracts](#adding-new-off-chain-contracts)\n  * [Known errors](#known-errors)\n- [Components](#components)\n  * [`nft-marketplace`](#-nft-marketplace-)\n  * [`ogmios-datum-cache`](#-ogmios-datum-cache-)\n  * [`ogmios`](#-ogmios-)\n  * [`postgresql`](#-postgresql-)\n  * [`nft-marketplace-server`](#-nft-marketplace-server-)\n  * [`cardano-transaction-lib-server`](#-cardano-transaction-lib-server-)\n  * [`cardano-node`](#-cardano-node-)\n  * [Onchain SmartContracts](#onchain-smartcontracts)\n\n## Prerequisites\n\n- nix\n- [IOHK binary cache](https://github.com/input-output-hk/plutus#how-to-set-up-the-iohk-binary-caches)\n- arion - Provided by devshell\n- [docker](https://docs.docker.com/get-docker/)\n- [nami wallet](https://namiwallet.io/) installed as browser extension\n- Funds in wallet obtained from [faucet](https://faucet.preview.world.dev.cardano.org/basic-faucet)\n\n## Usage\n\n### Clone repo\n\n```shell\ngit clone --recurse-submodules git@github.com:mlabs-haskell/seabug.git\ncd seabug\n```\n\n### Enter nix shell\n\n```shell\nnix develop --extra-experimental-features nix-command --extra-experimental-features flakes\n```\nFrom now, execute every command in the devshell created by the above command.\n\nNote: if you run into a permission error when executing the above command, you may need to run `sudo chmod 777 -R /nix`, then run the above command again. Be aware that more restrictive file permissions may be safer.\n\n### Setup `nft.storage` key\n\nReplace `NFT_STORAGE_KEY_HERE` in `arion-compose.nix` with your key. You can obtain free API key from [nft.storage](https://nft.storage/).\n\n### Optional: Copy testnet node database\n\nIf you have node db you can copy it to `data/cardano-node/cardano-node-data` to save hours on initial sync.\n```shell\nmkdir -p data/cardano-node/cardano-node-data\ncp -r /path/to/old/db data/cardano-node/cardano-node-data/.\n```\n\n### Start services\n\n```shell\n./buildFrontend.sh\narion up\n```\n\nPlease note that `arion up` will require a full cardano node to sync, which can take some time.  At time of writing (April, 2022), the current tip is at slot 56000000 and counting.\n\nOnce the chain is synced, you should be able to view the dApp UI from `localhost:8080`\n\nEnsure that Nami is set to Preview, that you have some Test Ada (see [the faucet](https://faucet.preview.world.dev.cardano.org/basic-faucet)), and that you've set collateral in Nami.\n\n### Optional: Mint your own NFTs\n\nSee the minting section in `seabug-contracts/README.md`. The following section describes how to upload an image and get its IPFS CID.\n\n#### Upload NFT image\n\nIf you have an image:\n\n``` shell\ncd seabug\nscripts/upload-image.sh\nArguments: \u003cIMAGE_FILE\u003e \u003cTITLE\u003e \u003cDESCRIPTION\u003e\nscripts/upload-image.sh 'image.jpeg' 'Title' 'Description'\n```\n\nThis will add the image to IPFS and the postgres database, and should print out something like:\n\n```\nIMAGE: image.jpeg\nTITLE: Title\nDESC: Description\n\u003e IMAGE_HASH: 4cefddfb4f62a3c68d08863cc299a2d6411174c8ff3325d21239ad3b5dcbf21c\n\u003e IPFS_HASH: bafkreicm57o7wt3cupdi2ceghtbjtiwwieixjsh7gms5eerzvu5v3s7sdq\n\u003e IPFS Base36 CID: k2cwueakfq42m0c5y33czg6ces3tj9b1xlv59krz88y2r8m18e2zxee4\n```\n\nThe `IPFS Base36 CID` value can be used to continue the minting process.\n\n## Maintenance\n\n### Updating dependencies\n\n- CTL: see [the docs](https://github.com/Plutonomicon/cardano-transaction-lib/blob/develop/doc/ctl-as-dependency.md)\n- Submodules: assuming submodules have been setup locally ([see docs](https://git-scm.com/book/en/v2/Git-Tools-Submodules)), just change to the new commit in the submodule, then stage and commit in the main `seabug` repo.\n- Purescript/JavaScript dependencies: these are managed in the submodules through the standard package management systems for the languages. For submodules using CTL (`seabug-contracts`), just be sure to follow the CTL docs to avoid conflicts in dependencies\n- Haskell dependencies: managed in [nix flakes](https://nixos.wiki/wiki/Flakes)\n- Runtime dependencies: also managed by flakes and [Arion](https://docs.hercules-ci.com/arion/)\n\n### Targeting different networks\n\nSee [this PR](https://github.com/mlabs-haskell/seabug/pull/25) as an example of switching to the preview network. The general steps are:\n\n- Update the [network in arion-compose.nix](https://github.com/mlabs-haskell/seabug/blob/68cdadfcd364076be467fe2dd2de4c06d35d4f3b/arion-compose.nix#L13-16)\n- Make a blockfrost project pointing to the correct network, and update the blockfrost project ids throughout the project\n- Update the network ids throughout the project\n- Update the blockfrost api url in `seabug-contracts`\n\n### Adding new off-chain contracts\n\nSee the [CTL docs](https://github.com/Plutonomicon/cardano-transaction-lib/tree/develop/doc). Off-chain contracts are stored in the `seabug-contracts` submodule.\n\n### Known errors\n\n\u003e WebSocket connection to ws://localho.st:9999/ws failed: WebSocket is closed before the connection is established\n\u003e Error: [object Object]\n\u003e at push.../seabug-contracts/output.js.exports.error\n\nTry waiting a bit and reloading the page. Likely just ODC needing some time to start up.\n\n## Components\n\n### `nft-marketplace`\n\nFrontend for Seabug marketplace, interacts with Cardano blockchain using `cardano-transaction-lib`.\n\n### `seabug-contract`\n\nNFT marketplace contracts in purescript. Onchain part was hardcoded as binary.\n\n### `ogmios-datum-cache`\n\nCaches datums of NFTs that are on available marketplace.\n\n### `ogmios`\n\nA lightweight interface for `cardano-node`. Used for `cardano-transaction-lib` and `ogmios-datum-cache` to interact with blockchain.\n\n### `postgresql`\n\nDatabase used to store images data (in addition to IPFS), artists data and datums stored by `ogmios-datum-cache`.\n\n### `nft-marketplace-server`\n\nBackend server used for storing storing image and artists data and uploading artworks to IPFS node.\n\n### `cardano-transaction-lib-server`\n\nA small server used to provide services to the `cardano-transaction-lib` frontend that cannot be achieved using Purescript.\n\n### `cardano-node`\n\nRelay node of Cardano blockchain.\n\n### Onchain SmartContracts\n\n- [Minting policy](https://github.com/mlabs-haskell/plutus-use-cases/blob/927eade6aa9ad37bf2e9acaf8a14ae2fc304b5ba/mlabs/src/Mlabs/EfficientNFT/Token.hs)\n- [Locking script](https://github.com/mlabs-haskell/plutus-use-cases/blob/927eade6aa9ad37bf2e9acaf8a14ae2fc304b5ba/mlabs/src/Mlabs/EfficientNFT/Lock.hs)\n- [Marketplace script](https://github.com/mlabs-haskell/plutus-use-cases/blob/927eade6aa9ad37bf2e9acaf8a14ae2fc304b5ba/mlabs/src/Mlabs/EfficientNFT/Marketplace.hs)\n- [Fee collecting script](https://github.com/mlabs-haskell/plutus-use-cases/blob/927eade6aa9ad37bf2e9acaf8a14ae2fc304b5ba/mlabs/src/Mlabs/EfficientNFT/Dao.hs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlabs-haskell%2Fseabug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlabs-haskell%2Fseabug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlabs-haskell%2Fseabug/lists"}