Skip to content

offerpool/offerpool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

offerpool

A decentralized database of chia offers with a bare bones UI and API.

Anyone can run an instance of offerpool and offers will sync across all instances within seconds via ipfs pub-sub.

In addition to the orbitdb offer table, offers are stored locally in a postgres table with the details of the offer as well as the offer's current status which is maintained by a background job.

Running locally

  1. Install Node v16, Python3, and Chia v1.4+
  2. Install and start the offer helper python service
  3. In ./client run npm install && npm run build to build the front end
  4. In ./backend run docker compose -p offerpool up -d to start the database and ipfs daemon
  5. In ./backend copy env.example to .env and change the CHIA_SSL_DIR variable to be the full path of your wallet rpc ssl certs directory
  6. In ./backend run npm run build to compile the TypeScript to Javascript
  7. In ./backend run npm run start-worker to start the backend worker process, this will keep offers up to date
  8. In ./backend run npm run start-worker-sync to start the backend worker process that syncs offers from orbitdb, initial sync could take 30+ minutes
  9. In ./backend run npm run start and go to http://localhost:3000

API

Get Offers

GET /api/v1/offers?page_size=[1-100]&page=[1-n]&offered=[cat id or known cat code]&requested=[cat id or known cat code]&valid=[all || true (default) || false]

Add Offer

POST /api/v1/offers 
{
    "offer": "offer1..."
}
{
    "success": boolean,
    "error_message": "reason for failure if success if false"
}

Send Coffee

OfferPool's XCH Address xch1hk74cqlndr8zv9aqzgnemxhff830t94wu2s0re79n82j09hhwy5qfpy4mm

About

Distributed database of chia offers with a simple API and basic Web UI

Topics

Resources

License

Stars

Watchers

Forks

Contributors