All Projects → Giveth → feathers-giveth

Giveth / feathers-giveth

Licence: MIT license
Featherjs server for caching giveth data.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to feathers-giveth

kleros-api-DEPRECATED
A Javascript library that makes it easy to build relayers and other DApps that use the Kleros protocol. DEPRECATED use https://github.com/kleros/archon for interfacing with standard arbitration contracts.
Stars: ✭ 20 (-76.47%)
Mutual labels:  dapp, testrpc
svelte-box
A truffle box for svelte
Stars: ✭ 60 (-29.41%)
Mutual labels:  dapp, testrpc
defi
Tools for use in DeFi. Impermanent Loss calculations, staking and farming strategies, coingecko and pancakeswap API queries, liquidity pools and more
Stars: ✭ 464 (+445.88%)
Mutual labels:  dapp
starter-kit-gsn
An OpenZeppelin starter kit focused on GSN.
Stars: ✭ 39 (-54.12%)
Mutual labels:  dapp
create-truffle-dapp
Create and deploy Truffle projects with no configuration.
Stars: ✭ 17 (-80%)
Mutual labels:  dapp
tzprofiles
Create portable verified profiles on Tezos with public accounts.
Stars: ✭ 37 (-56.47%)
Mutual labels:  dapp
haal
Hääl - Anonymous Electronic Voting System on Public Blockchains
Stars: ✭ 96 (+12.94%)
Mutual labels:  dapp
docker-eth-dev
Hacking together a containerized environment for Ethereum development with Truffle using Parity
Stars: ✭ 22 (-74.12%)
Mutual labels:  testrpc
bloqly
Bloqly: JavaScript Smart Contracts Engine + SQL database
Stars: ✭ 29 (-65.88%)
Mutual labels:  dapp
solidity-contracts
📦 Resources for the Ethereum Smart Contract Development tutorial series.
Stars: ✭ 64 (-24.71%)
Mutual labels:  testrpc
rchain-api
An API for rchain dapps to communicate with the blockchain
Stars: ✭ 22 (-74.12%)
Mutual labels:  dapp
trampoline
A complete dapp development framework for Nervos Network
Stars: ✭ 27 (-68.24%)
Mutual labels:  dapp
court
The Kleros court user interface.
Stars: ✭ 19 (-77.65%)
Mutual labels:  dapp
Artion-Client
Client app for Artion, a global NFT marketplace on Fantom Opera.
Stars: ✭ 71 (-16.47%)
Mutual labels:  dapp
BankRollerApp
Desktop application for bankroller. Invest BET and take reward for random generation.
Stars: ✭ 38 (-55.29%)
Mutual labels:  dapp
bcdhub
Better Call Dev backend
Stars: ✭ 30 (-64.71%)
Mutual labels:  dapp
NFT-Dapp-Boilerplate
A highly scalable NFT and DEFI boilerplate with pre added web3 and different wallets with a focus on performance and best practices
Stars: ✭ 51 (-40%)
Mutual labels:  dapp
foodprint
Algorand dApp for blockchain-enabled food transparency and traceability in local food supply chains. For use by smallholder farmers, food co-operatives and consumers.
Stars: ✭ 43 (-49.41%)
Mutual labels:  dapp
foundry
Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
Stars: ✭ 4,623 (+5338.82%)
Mutual labels:  dapp
alchemy
An app for collaborative networks (DAOs), based on the DAO stack.
Stars: ✭ 137 (+61.18%)
Mutual labels:  dapp

CI/CD

Feathers Giveth

Real-time json cache server for blockchain data

Note: Please use develop branch for contributing.

Welcome to the server code for Giveth's dapp. The dapp uses feathers as a cache for its blockchain transactions. By utilizing websockets on both the blockchain and client devices, we can receive and push updates simultaneously to all users in real time.

Table of content

Getting Started

Install

  • Linux

    If your operative system is any distrubution of linux you can use an All in One installation scripts special thanks to Dapp contributor Jurek Brisbane, available here along with a youtube video

  • Any OS

    1. Click Star on this repo near the top-right corner of this web page (if you want to).
    2. Join our slack if you haven't already.
    3. Fork this repo by clicking Fork button in top-right corner of this web page. Continue to follow instruction steps from your own feathers-giveth repo.
    4. The rest of these steps must be done from your machine's command line. Clone your own "feathers-giveth" repo. Copy the link from the "Clone or download" button near the top right of this repo's home page.
      git clone {paste your own repo link here}
      
    5. Change directories to feathers-giveth:
      cd feathers-giveth
      
    6. Make sure you have NodeJS (v10.24.0 or higher), yarn (v0.27.5 or higher), and npm (5.4.1 or higher) installed.
    7. Install dependencies from within feathers-giveth directory:
      npm install
      
      • note: due to a bug in yarn, yarn install currently does not work
    8. Install Mongo (we recommend installing via Brew)
    9. Run Mongo in a terminal window mongod or in the background mongod --fork --syslog
    10. Install Redis (we recommend install via Brew brew install redis)
    11. Run Redis in terminal window redis-server or in the background redis-server --daemonize yes
    12. (optionally) Install IPFS (we recommend installing via Brew)
    • If you don't install ipfs, image uploading will be affected. You can update the config ipfsGateway value to use a public ipfs gateway ex. https://ipfs.io/ipfs/, however your uploads will be removed at some point

Run server

The feathers server will need to connect to an ethereum node via websockets. Typically this will be a local TestRPC instance. The configuration param blockchain.nodeUrl is used to establish a connection. The default nodeUrl is ws://localhost:8545

  1. We need to deploy any contract to that we intend to call. NOTE: The following cmd will clear the data dir, thus starting off in a clean state.

    yarn deploy-local
    

    After deploying local, make sure to copy-paste the MiniMeToken address in default.json

  2. We provide an easy way to start the bridge & 2 ganache-cli instances. VERY IMPORTANT: this command enables Home Ganache and Foreign Ganache networks, if you are using MetaMask you will need to add a Custom RPC to your networks config,http://localhost:8546 will be Foreign Ganache, and Home Ganache is normally added by default which is http://localhost:8545 if needed.

    yarn start:networks
    
  3. Since the bridge & ganache-cli is now running, open a new terminal window and navigate to the same feathers-giveth directory.

  4. Optionally open a new terminal window and start the ipfs daemon

    ipfs daemon
    
  5. Run db migration files ( if this the first time you want to start application, it's not needed to run migrations)

     ./node_modules/.bin/migrate-mongo up
    
  6. Start your app

    yarn start
    

Kill Ganache

If you run into errors like wallet balance not loading, it is very likely that Ganache is stuck netstat -vanp tcp | grep 8545 Find the process that is listening on *.8545 and 127.0.0.1.8545 and kill it with kill -9 PID (which is in the last colomn)

IPFS Support

If the ipfsApi is a valid ipfs node that we can connect to, we will pin every ipfs hash that is stored in feathers. We currently do not remove any orphaned (hashes with no references in feathers) ipfs hashs. In the future we will provide a script that you can run as a cronjob to unpin any orphaned hashes.

Video Walkthrough

Video tutorial walkthrough here: https://tinyurl.com/y9lx6jrl

Scripts

The feathers-giveth/scripts directory contains a few scripts to help development.

  • deploy.js - deploys a new vault & liquidPledging contract

  • getState.js - prints the current state of the deployed vault & liquidPledging contracts.

  • confirm.js - confirms any payments that are pending in the vault

  • makeUserAdmin.js - make a user admin

Testing

Simply run yarn test and all your tests in the /src directory will be run. It's included some integration tests so for running tests, you need to run a mongodb in your local system (on port 27017)

Debugging

You can control the logging level with the LOG_LEVEL env variable. Available levels can be found at: https://github.com/winstonjs/winston/tree/2.x#logging-levels

To enable debug logging simply start the server with LOG_LEVEL=debug yarn start

Usage

Each of these services are available via rest or websockets:

campaigns
communities
donations
donationsHistory
traces
uploads
users
emails
homePaymentsTransactions
subscriptions

If the server is using default configurations, you can see data for any of these services through your web browser at http://localhost:3030/SERVICE_NAME

PS: For accessing all features like creating communities and campaigns it's suggested to make isAdmin field true, for your user in you local MongoDb

Production

We use docker-compose for orchestration of our docker containers in our production servers.

  • make Make sure you have a file named production.json in config folder
  • Install docker and docker-compose on your server
  • run this command: docker-compose -f docker-compose-production.yml up -d

PS: It's good to see Github Actions config to better understanding of deploy structure

RSK

  1. You will need to download the rsk node. After installing, you will run the node w/ the regtest network for local development.
java -jar rskj-core-0.5.2-ORCHID-all.jar co.rsk.Start --regtest

or

java -Drsk.conf.file=rsk.conf -jar rskj-core-0.5.2-ORCHID-all.jar co.rsk.Start
  1. We need to deploy any contracts that we intend to call. NOTE: You will also need to ensure that your rsk node is in a clean state (reset) for the configured addresses to be correct.

    npm run deploy-local:rsk
    
  2. Optionally open a new terminal window and start the ipfs daemon

    ipfs daemon
    
  3. Start your app

    yarn start:rsk
    

Audit Log

The Audit log system logs every Create, Update, Patch and Remove on Campaigns, Traces, Events, Users, PledgeAdmins, Communities, Donations For enabling audit log locally you should change enableAuditLog in config to true, then

  • cd elk
  • docker-compose up

And then after logging in localhost:5601 with user:elastic, password: changeme you can see the logs

Donations Diagram

This diagram demonstrates how donations are created and how status will be changed, if you want to edit diagram just change https://mermaid.ink/img/ to https://mermaid-js.github.io/mermaid-live-editor/edit/# in below link

A Solid arrow mean a new donation will be created after this action, and dotted arrows are used when existing donations are modified.

Help

For more info on how to work with feathers checkout out their docs on service methods, service events, and database querying.

Also feel free to reach out to us on slack for any help or to share ideas.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].