Skip to content

Monas-project/Filecoin-Data-Economy-Hackathon

Repository files navigation

Monas Prototype

System Overview

Learn more about the Prototype: here
Monas Docs: here
Monas Slides: here

PushProtocol Signer Info(Ethereum Sepolia)

Address: 0x69d3E7219CE2259654EcBBFf9597936BaDF5Be52

Deployed TableLand Contract(FileCoin Testnet)

Address: 0x0d5D749BEbB9521c9604727aB22091a924b4aDd4

Usage

  • setup

    • backend

      create .env & set below values

      PRIVATE_KEY=
      GAS_REPORT=
      COINMARKETCAP_API_KEY=
    • cryptree

      create .env & set below values

      INFURA_BASE_URL="https://polygon-mumbai.infura.io/v3"
      INFURA_PROJECT_ID="XXXXXXXXXXXXXXXX"
      PRIVATE_KEY="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      TABLE_CONTRACT_ADDRESS="0x4b48841d4b32C4650E4ABc117A03FE8B51f38F68" # 一旦これで固定
      SECRET_MESSAGE="Please sign this message to authenticate."
      API_SECRET_KEY="your-secret-key"
      ALGORITHM="HS256"
      AWS_ACCESS_KEY_ID="XXXXXXXXXXXXXXXXXXXXX"
      AWS_SECRET_ACCESS_KEY="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    • frontend

      create .env.local & set below values

      NEXT_PUBLIC_ENABLE_TESTNETS=
      NEXT_PUBLIC_API_BASE_URL=
      WALLET_CONNECT_PROJECT_ID=
      SEPOLIA_RPC_URL=
      PUSH_PROTOCOL_PRIVATE_KEY=
      SECRET_MESSAGE="Please sign this message to authenticate."
  • install

    yarn

    !! Attention !! Please set Python's version 3.9

    cd pkgs/cryptree
    python3 -m venv cryptree
    source cryptree/bin/activate
    pip3 install -r requirements.txt
  • frontend build

    yarn frontend build
  • frontend dev

    yarn frontend dev
  • smartcontract build

    yarn backend compile
  • smartcontract test

    yarn backend test
  • smartcontract deploy

    yarn backend deploy:filecoinCalibration
  • task getBalance

    cd pkgs/backend && npx hardhat getBalance --account 0x51908F598A5e0d8F1A3bAbFa6DF76F9704daD072 --network filecoinCalibration
  • task getAllTableData

    cd pkgs/backend && npx hardhat getAllTableData --tablename fileinfo_table_314159_728
    results: []
  • task insertData

    cd pkgs/backend && npx hardhat insertData --rootid "0x2cfb66d732c42332174297788fb69fba6c4bef842d95205ebfde1a126997b953" --filecid "0x2cfb66d732c42332174297788fb69fba6c4bef842d95205ebfde1a126997b953" --network filecoinCalibration
  • task setRootHash

    cd pkgs/backend && npx hardhat setRootHash --roothash "0x2cfb66d732c42332174297788fb69fba6c4bef842d95205ebfde1a126997b953" --network filecoinCalibration
  • task getRootHash

    cd pkgs/backend && npx hardhat getRootHash --network filecoinCalibration
  • task delete data

    cd pkgs/backend && npx hardhat deleteData --id 4 --network filecoinCalibration
  • task update data

    cd pkgs/backend && npx hardhat updateData --id 3 --rootid "0x2cfb66d732c42332174297788fb69fba6c4bef842d95205ebfde1a126997b977" --filecid "0x2cfb66d732c42332174297788fb69fba6c4bef842d95205ebfde1a126997b988" --network filecoinCalibration
  • task setAccessControl

    cd pkgs/backend && npx hardhat setAccessControl --network filecoinCalibration

Screenshots

References:

  1. FEVM Quickstart
  2. FileCoin Calibration - Explorer
  3. TableLand - GetStarted
  4. TableLand - HP
  5. TableLand - Deployed contracts
  6. Filfox Contract Verification API Documents
  7. TableLand Studio
  8. wagmi V1 signMessage
  9. PushProtocol SDK - RestAPI