Giter Site home page Giter Site logo

kgozman / sample-nft-project Goto Github PK

View Code? Open in Web Editor NEW

This project forked from f-o-a-m/sample-nft-project

0.0 0.0 0.0 1.2 MB

FOAM Signal Marketplace

PureScript 48.72% Makefile 2.05% Haskell 41.66% TSQL 0.44% JavaScript 3.20% HTML 0.10% PLpgSQL 3.35% CSS 0.49%

sample-nft-project's Introduction

sample-nft-project

Build Status

A sample NFT marketplace for buying and selling FOAM Signals.

Install Requirements

Requires npm, node and stack. This project uses chanterelle for deploying contracts and generating Purescript FFI bindings.

You'll also need libpq bindings. On Ubuntu run

apt-get install -y libpq-dev

Makefile

There is a Makefile with commands for building different stages of the project and setting default environment variables. You can do

make help

to see a help menu.

Rinkeby deployment

The app is deployed here

The contracts are deployed here:

Deploying

1. Install dependencies

make install

2. Compile smart contracts and generate bindings

make compile-contracts

This generates a Contracts directory in dapp/src, as specified in chanterelle.json.

3. Start services and run migrations

Note that both table creation and migration runs from within docker, to avoid having to install psql and flyway on the host machine.

docker-compose up -d
make migrate

4. Deploy contracts to ethereum

make deploy-contracts

5. Build the backend

make build-server build-indexer

6. Build the frontend

make build-purs build-dapp frontend-build

7. Start the app

In three separate terminals, run

make run-indexer
make run-server
make frontend-start

Detailed documentation

More detailed documentation are available for the following components:

Testing

The application comes with both a unit and an end-to-end test suite.

Unit tests

To run the unit-tests, make sure that the docker services are running:

docker-compose up -d

Then run:

make test-dapp

This will create an ephemeral deployment of the smart contracts and run tests against them.

End-to-end tests

The end-to-end tests demonstrate the full lifecycle of the different components of the stack. To run them, you should have a deployment already by following steps 1-7 above (you can skip make frontend-start). Once the contracts are deployed and the indexer and the server are running, run:

make test-e2e

The tests are written in PureScript and will set up listeners from Ethereum, the server as websockets (via the indexer) and will trigger contract interactions and test the pipeline by anticipating the correct response from the services. It can also compare the data from the services with that emitted as events from Ethereum itself.

Other

How to get some ETH locally?

  • To get some ETH and FOAM add your MetaMask address to FAUCET_ADDRESS and run
FAUCET_ADDRESS={YOUR_METAMASK_ACCOUNT} make faucet-locally
  • To get more FOAM, use FAUCET_VALUE to add any value you want, e.g.
FAUCET_ADDRESS={YOUR_METAMASK_ACCOUNT} FAUCET_VALUE=224455 make faucet-locally

How to create some Signals?

  • To create some Signals add your MetaMask address to FAUCET_ADDRESS and run
OWNER_ADDRESS={YOUR_METAMASK_ACCOUNT} make signal-locally
  • To create more Signals, use SIGNAL_COUNT to set custom amount of signals you want, e.g.
SIGNAL_COUNT=4 OWNER_ADDRESS={YOUR_METAMASK_ACCOUNT} make signal-locally

sample-nft-project's People

Contributors

ivanthetricourne avatar kejace avatar martyall avatar charlescrain avatar safareli avatar iostat avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.