Skip to content

A decentralized web3 app, running 100% on-chain on the Internet Computer, that lets any user start mobilizations by creating campaigns of four different kinds: donations, votes, signatures and fundraising

License

Notifications You must be signed in to change notification settings

av1ctor/metamob

Repository files navigation

alt text

https://site.metamob.app/

A decentralized web3 app, running 100% on-chain on the Internet Computer, that lets any user start mobilizations by creating campaigns of four different kinds: donations, votes, signatures and fundraising

alt text

TODO:

  • Move finished campaigns to a archive canister
  • Create neurons-like to stake/lock MMT's
  • Donations and fundraising campaigns should allow min and max values
  • Add NFid support
  • Create a fundraising campaign with tiers for metamob itself

Running locally:

1. install a local Bitcoin network

2. start dfx

  • Run: dfx start --enable-bitcoin Note: if there's already a ~/.local/share/dfx/network/local folder, it must be DELETED if dfx wasn't initialized, at the very first time, with the --enable-bitcoin option, or else the local replica will silently disable the bitcoin features

3. deploy the local internet_identity canister:

  • Add to dfx.json: "internet_identity": {"type": "custom", "wasm": "canisters-dev/internet_identity.wasm", "candid": "canisters-dev/internet_identity.did", "build": ""},
  • Run: ./scripts/deploy-ii.sh
  • Copy the local II address and replace the II_URL_LOCAL variable at .env with http://127.0.0.1:4943/?canisterId=**II_CANISTER_ID**
  • Remove from dfx.json: "internet_identity": ...

4. deploy the local ledger canister:

5. create the metamob canister

  • Run: dfx canister create metamob

6. create the btcwallet canister

  • Run: dfx canister create btcwallet

7. create the emailer canister

  • Run: dfx canister create emailer

8. deploy the metamob token:

  • Run: ./scripts/deploy-mmt.sh

9. deploy the logger:

  • Run: ./scripts/deploy-logger.sh

10. deploy the btcwallet:

  • Run: ./scripts/deploy-btcwallet.sh

11. deploy the emailer:

  • Set your https://sendinblue.com/ API key executing "export SENDINBLUE_API_KEY=..."
  • Run: ./scripts/deploy-emailer.sh

12. deploy the file store:

13. deploy metamob backend:

  • Run: npm install
  • Run: npm run dev:back

14. configure the frontend

  • Change the "const [form, setForm] = useState({" at site/src/views/users/user/Create.tsx to include "roles: [[{admin: null}]], active: [true],"
  • Run: npm run dev:generate
  • Run: npm run dev:front
  • Go to the login page and create a new Internet Identity anchor: http://localhost:8080/
  • Create a new account with the admin role
  • Revert the changes done at the 1st step above
  • Create new categories and places at the http://localhost:8080/#/admin page
  • Find out the ADMIN_ACCOUNT_IDENTIFIER_32_BYTES_IN_HEX at your profile page (the "Ledger account id" field)

15. tranfer ICP from the LEDGER_ACC to the admin account:

  • Run: dfx ledger transfer --amount 10000.0 --ledger-canister-id LEDGER_CANISTER_ID --memo 1234 ADMIN_ACCOUNT_IDENTIFIER_32_BYTES_IN_HEX

16. (optional) deploy the mydaocoin for testing:

  • Add to dfx.json: "mydaocoin": {"main": "src/mydaocoin/token.mo","type": "motoko"},
  • Fill on ./scripts/deploy-mydaocoin.sh: ADMIN_PRINCIPAL
  • Run: ./scripts/deploy-mydaocoin.sh
  • Remove from dfx.json: "mydaocoin": ...

17. (optional) send BTC locally

  • Run:
    1. ./bin/bitcoin-cli -conf=$(pwd)/bitcoin.conf createwallet "test" (or load if one exists: ./bin/bitcoin-cli -conf=$(pwd)/bitcoin.conf loadwallet "test")
    2. ./bin/bitcoin-cli -conf=$(pwd)/bitcoin.conf getnewaddress
    3. ./bin/bitcoin-cli -conf=$(pwd)/bitcoin.conf generatetoaddress 1 ADDRESS_GENERATED_BY_THE_COMMAND_ABOVE
    4. ./bin/bitcoin-cli -conf=$(pwd)/bitcoin.conf generatetoaddress 100 mtbZzVBwLnDmhH4pE9QynWAgh6H3aC1E6M
    5. ./bin/bitcoin-cli -conf=$(pwd)/bitcoin.conf sendtoaddress BTC_ADDRESS_SHOWN_BY_THE_DONATION_OR_BOOST_DIALOG VALUE_IN_DECIMAL
    6. ./bin/bitcoin-cli -conf=$(pwd)/bitcoin.conf generatetoaddress 100 mtbZzVBwLnDmhH4pE9QynWAgh6H3aC1E6M

About

A decentralized web3 app, running 100% on-chain on the Internet Computer, that lets any user start mobilizations by creating campaigns of four different kinds: donations, votes, signatures and fundraising

Topics

Resources

License

Stars

Watchers

Forks