Skip to content

Stays: book accommodation on-chain, pay in crypto, and help Ukraine

Notifications You must be signed in to change notification settings

Galeaf11/stays

 
 

Repository files navigation

Stays: on-chain bookings

Installation

Make sure you have node and nvm installed:

nvm use v16
npm install -g yarn
npm install -g lerna
yarn install
lerna bootstrap

Make sure to run lerna bootstrap after any git pull or whenever you have a problem with missing dependencies.

Local Development

  • Sign Up for Web3.Storage, get an API key

  • Create a packages/smart-contracts/.env file (if you don't have one) and add the Web3.Storage API key to it there as follows

    WEB3STORAGE_KEY=<Web3.Storage API key>
    
  • Open packages/smart-contracts in two terminal windows. Run yarn start:node in one and then yarn start:setup in the other one. Make sure to copy one of the private keys displayed after you run yarn start:node.

  • Add to packages/dapp/.env config:

    FAST_REFRESH=true
    BROWSER=false
    HTTPS=true
    REACT_APP_LOG_LEVEL=debug
    REACT_APP_FILE_WEB3STORAGE_KEY=<Web3.Storage API key>
    REACT_APP_NETWORK_ID=31337
    REACT_APP_NETWORK_PROVIDER=http://127.0.0.1:8545
    REACT_APP_CONTRACT_ADDRESS=0x5FbDB2315678afecb367f032d93F642f64180aa3
    
  • Add Hardhat Testnet network to Metamask

    • URL: http://127.0.0.1:8545
    • Chain ID: 31337
  • Add to Metamask some of the private keys from the hardhat console output that will be displayed when you run yarn start:node

  • Start the Dapp from packages/dapp: yarn start

Sokol Testnet

Contract Address: 0x0cc294153cE26686DE79E2c6bD76027D136ddfF7 (etherscan)

  • Get SPOA (Sokol Testned DAI)

  • Get your Google Maps API KEY (for getting GPS from Address)

  • Change packages/dapp/.env config:

    FAST_REFRESH=true
    BROWSER=false
    HTTPS=true
    REACT_APP_LOG_LEVEL=debug
    REACT_APP_FILE_WEB3STORAGE_KEY=<Web3.Storage API key>
    REACT_APP_GOOGLE_API_KEY=<GOOGLE_API_KEY>
    REACT_APP_MODE=production
    REACT_APP_NETWORK_ID=77
    REACT_APP_NETWORK_PROVIDER=https://sokol.poa.network
    REACT_APP_CONTRACT_ADDRESS=0x0cc294153cE26686DE79E2c6bD76027D136ddfF7
    
  • Add Sokol Testnet to Metamask:

    • URL: https://sokol.poa.network
    • Chain ID: 77
  • Start the Dapp from packages/dapp: yarn start

About

Stays: book accommodation on-chain, pay in crypto, and help Ukraine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 95.5%
  • Solidity 3.4%
  • Other 1.1%