giveth / feathers-giveth Goto Github PK
View Code? Open in Web Editor NEWFeatherjs server for caching giveth data.
License: MIT License
Featherjs server for caching giveth data.
License: MIT License
Hi, I have a problem by running npm install
. I got the following error:
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EAI_AGAIN: request to https://registry.npmjs.org/feathers-authentication failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443
npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/node-libs-browser/node_modules/path-browserify):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: request to https://registry.npmjs.org/path-browserify failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443
npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/os-browserify failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443
npm ERR! A complete log of this run can be found in: ...
I'm using:
Ubuntu 16.04
node v8.9.0
npm 5.5.1
yarn 1.3.2
@perissology commented on Tue Sep 26 2017
to keep things consistent
@satyavh commented on Fri Sep 29 2017
This has been done on the React side, I'm copying this story over the Feathers repro, because we still need to rename the /causes
service to /dacs
When you get incoming donations that are not made by you, they need to be delegated.
We delegate (for now) by patching the donation. But if donorAddress
is not the currentUser, then Feathers throws a not authorized error, which means the client cannot patch the donation.
we don't use the whitelist in the uploads service, but it would probably be a good idea to do that.
reported by @mattfink on slack
Reproduce:
Now testrpc throws Runtime Error: invalid opcode
and the donation fails
We should secure the feathers models to avoid any unwanted fields entering the database.
Reproduce:
Transaction: 0x322d6735b0b15d53092c9b7aa1ed5bb30344b4a14d763f7d00116a97fe54e0c8
Gas usage: 196219
Block Number: 32
Block Time: Fri Nov 24 2017 13:44:59 GMT+0100 (CET)
Runtime Error: invalid opcode
As discussed:
we can disable whitelists in the config.json file.
update the whitelist service to return an empty whitelist if the whitelist is disabled
Reproduce:
This will fail both locally as well as on alpha. The error in the browser console is:
"Error: the tx doesn't have the correct nonce. acco…les/ethereumjs-testrpc/build/cli.node.js:81513:3)", code: -32000}
code: -32000
message: "Error: the tx doesn't have the correct nonce. account has nonce of: 15 tx has nonce of: 14↵
no errors in feathers / testrpc
Add as a schema: includeProposedProject
Then we can show in the UI at my donations, for each donation, where the money now actually is.
Reproduce:
rm -rf data
node --harmony deploy.js
testrpcDeterministicAccount0.json
from Giveth-Dapp reproNow you will get this error:
info: after: authentication/challenges - Method: create
info: error: authentication - Method: create: Challenge = k2KWCVXhwC3rgHQgyMGH
error: NotAuthenticated: Challenge = k2KWCVXhwC3rgHQgyMGH
at NotAuthenticated (/Users/satya/Development/feathers-giveth/node_modules/feathers-errors/lib/index.js:100:17)
at /Users/satya/Development/feathers-giveth/node_modules/feathers-authentication/lib/hooks/authenticate.js:102:31
at <anonymous>
info: after: authentication/challenges - Method: get
info: error: users - Method: get: No record found for id '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1'
error: NotFound: No record found for id '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1'
at NotFound (/Users/satya/Development/feathers-giveth/node_modules/feathers-errors/lib/index.js:121:17)
at /Users/satya/Development/feathers-giveth/node_modules/feathers-nedb/lib/index.js:146:17
at <anonymous>
We should fetch the wallet balance before the donation popup is shown, so we can make sure the donator does not donate more than is in the wallet.
We need to provide notifications when something in the dapp happens. People are not going to check out the dapp all the time to see what happens, we need to bring the info to them.
Could be email, slack, etc.
Can we include the following fields in the milestone model, as per the mock:
When I try, I get transaction error:
proxyConsole.js:56 Error: Invalid JSON RPC response: {"id":5,"jsonrpc":"2.0"}
No errors in testrpc and feathers console
There's a check in the Dapp (My Milestones) on the milestone property mined
. That property is not returned form the /milestones
service. Hence, the request withdrawal
functionality does not appear in the UI
currently we don't do any schema validation for the entities.
add it. Feathersjs docs contain an example.
User story 1: As a developer, I don't want to have to worry about formatting styles. I want code to autoformat whenever I save. I want to completely remove any thinking of formatting from my workflow.
User story 2: As a reviewer, I want to ensure that code is formatted correctly and I don't have to review formatting errors and comment on them.
Type: Developer Tool
There are multiple editor integrations such as VSCode, Sublime, Atom, Vim and more.
In addition with Prettier ESLint we can get the power of ESLint --fix to automatically fix Prettier errors automatically even when not using any plugins.
Links:
https://github.com/prettier/prettier/
https://prettier.io/
https://prettier.io/docs/en/eslint.html
While coding I have a formatting style guide that I am forced to follow and if I don't I get linting errors which could potentially break builds.
Actual behavior
Currently developers have to think about maintaining the current style of formatting and coding and thinking hard about this wastes time to think of other more important problems.
Summary:
I will add Prettier and Prettier ESLint integration and write up a Formatting.md file to explain how to use this in a few editors of choice.
This is open to suggestions/feedback.
This services currently only returns the ownerId
but we show the avatar
, name
etc of the donor.
currently we recursively include
, which returns a lot of extra data. The ui only needs a few of these.
update the schemas to only include the necessary data.
Actually @alanborger is going to do this, but I need to implement the css
If we find a tx that was successful, but feathers didn't p/u the event for some reason, call the appropriate event handler for the tx logs so feathers is updated appropriatly
we assign the user a giverId when their first donation is mined, or the first time they create a profile. If they donate a second time before the 1st tx is mined, we will send the donate tx w/ giverId 0 which will create another giverId. This can lead to a single user having multiple giverIds.
Figure out a way to deal with this
Currently there is no authentication to milestones or donations.
Configure milestones and donations services to use authentication to limit access to data particular to the owner who created it.
the lpp-dac
, lpp-milestone
, and lpp-campaign
plugins extend the Owned
contract. The Owned
contract emits the following events:
OwnershipRequested
OwnershipTransferred
OwnershipRemoved
We should listen to these events, and update the dac/campaign/milestone in feathers as appropriate
When delegating money away from DACs/Causes, the donations will currently disappear from that DAC/Cause. That means we cannot show the total amount raised for that DAC/Campaign.
So in case all money has been delegated, the total amount raised will show 0
That is not a very good incentive for new donors. Plus it will show the DAC/Campaign has no community
Reproduce:
I expect the donation to have a 'delegated' label, which is set in the UI by proposedProject > 0
However the donation has proposedProject: "0"
see #70 (comment) for context.
We can then remove the setting of prevStatus
in the dapp
Is that already
The giveth-dapp needs a connection url to connect with featherjs
If a chain reorg happens, we need to update feathers to reflect the new state.
I saved a log file where a chain reorg happened on the feathers develop server.
We should update the donation counters if a donation is refunded, otherwise it's possible for someone to keep donating and refunding to make their dac look better
If user.giverId
> 0, don't allow setting it to 0
this can be done via a hook in users.hooks.js
. implementing #39 will fix this as well
"Error: VM Exception while executing eth_estimateGas: invalid opcode
at /Users/satya/Development/feathers-giveth/node_modules/ethereumjs-testrpc/build/cli.node.js:65907:17
at /Users/satya/Development/feathers-giveth/node_modules/ethereumjs-testrpc/build/cli.node.js:85139:5
at /Users/satya/Development/feathers-giveth/node_modules/ethereumjs-testrpc/build/cli.node.js:4783:9
at /Users/satya/Development/feathers-giveth/node_modules/ethereumjs-testrpc/build/cli.node.js:1343:16
at replenish (/Users/satya/Development/feathers-giveth/node_modules/ethereumjs-testrpc/build/cli.node.js:1863:25)
at iterateeCallback (/Users/satya/Development/feathers-giveth/node_modules/ethereumjs-testrpc/build/cli.node.js:1853:17)
at /Users/satya/Development/feathers-giveth/node_modules/ethereumjs-testrpc/build/cli.node.js:1828:16
at /Users/satya/Development/feathers-giveth/node_modules/ethereumjs-testrpc/build/cli.node.js:4780:13
at /Users/satya/Development/feathers-giveth/node_modules/ethereumjs-testrpc/build/cli.node.js:85135:9
at /Users/satya/Development/feathers-giveth/node_modules/ethereumjs-testrpc/build/cli.node.js:81420:7"
reproduce:
Expected:
3. I expect the commit and reject button to show up (status: to_approve
).
I also expect proposedProject
to be set so it will show a nice 'delegated' label.
Which means, I cannot edit my campaign anymore.
It also crashes the UI because it is looking for an owner
object in the campaign object. That owner object is not included anymore
Disabled buttons are a pain the UX ass...
Reproduce:
Now check the feathers console
_addMilestone error -> Error: Returned error: Error: VM Exception while executing eth_call: invalid opcode
at /Users/satya/Development/feathers-giveth/node_modules/ethereumjs-testrpc/build/cli.node.js:65907:17
at /Users/satya/Development/feathers-giveth/node_modules/ethereumjs-testrpc/build/cli.node.js:85139:5
at /Users/satya/Development/feathers-giveth/node_modules/ethereumjs-testrpc/build/cli.node.js:4783:9
at /Users/satya/Development/feathers-giveth/node_modules/ethereumjs-testrpc/build/cli.node.js:1343:16
at replenish (/Users/satya/Development/feathers-giveth/node_modules/ethereumjs-testrpc/build/cli.node.js:1863:25)
at iterateeCallback (/Users/satya/Development/feathers-giveth/node_modules/ethereumjs-testrpc/build/cli.node.js:1853:17)
at /Users/satya/Development/feathers-giveth/node_modules/ethereumjs-testrpc/build/cli.node.js:1828:16
at /Users/satya/Development/feathers-giveth/node_modules/ethereumjs-testrpc/build/cli.node.js:4780:13
at /Users/satya/Development/feathers-giveth/node_modules/ethereumjs-testrpc/build/cli.node.js:85135:9
at /Users/satya/Development/feathers-giveth/node_modules/ethereumjs-testrpc/build/cli.node.js:81420:7
at Object.ErrorResponse (/Users/satya/Development/feathers-giveth/node_modules/web3/packages/web3-core-helpers/src/errors.js:29:16)
at Object.<anonymous> (/Users/satya/Development/feathers-giveth/node_modules/web3/packages/web3-core-requestmanager/src/index.js:137:36)
at /Users/satya/Development/feathers-giveth/node_modules/web3/packages/web3-providers-ws/src/index.js:76:44
at Array.forEach (native)
at W3CWebSocket.WebsocketProvider.connection.onmessage (/Users/satya/Development/feathers-giveth/node_modules/web3/packages/web3-providers-ws/src/index.js:53:36)
at W3CWebSocket._dispatchEvent [as dispatchEvent] (/Users/satya/Development/feathers-giveth/node_modules/web3/packages/web3-providers-ws/node_modules/yaeti/lib/EventTarget.js:107:17)
at W3CWebSocket.onMessage (/Users/satya/Development/feathers-giveth/node_modules/web3/packages/web3-providers-ws/node_modules/websocket/lib/W3CWebSocket.js:234:14)
at WebSocketConnection.<anonymous> (/Users/satya/Development/feathers-giveth/node_modules/web3/packages/web3-providers-ws/node_modules/websocket/lib/W3CWebSocket.js:205:19)
at emitOne (events.js:115:13)
at WebSocketConnection.emit (events.js:210:7)
at WebSocketConnection.processFrame (/Users/satya/Development/feathers-giveth/node_modules/web3/packages/web3-providers-ws/node_modules/websocket/lib/WebSocketConnection.js:547:26)
at /Users/satya/Development/feathers-giveth/node_modules/web3/packages/web3-providers-ws/node_modules/websocket/lib/WebSocketConnection.js:321:40
at _combinedTickCallback (internal/process/next_tick.js:95:7)
at process._tickCallback (internal/process/next_tick.js:161:9)
example:
causes.remove(some-id)
does trigger all the remove events correctly, so I can remove the cause from the UI. But when I fetch the causes again from the backend, they are all there again.
Can we include the following fields in the causes model, as per the mock:
Reproduce:
now check feathers console. It generates the event correctly:
handling GenerateTokens Event: { logIndex: 3,
transactionIndex: 0,
transactionHash: '0xf9c7dea9a656140676706ab700bcbb308d34f6c6808808f7b55148336c4a4eb2',
blockHash: '0xc25020a3d9e842a3557f3b300eff663faaa4e6856e6d9f1ac3cd9ba095022bc5',
blockNumber: 27,
address: '0xC89Ce4735882C9F0f0FE26686c53074E09B0D550',
type: 'mined',
id: 'log_7adb2dd4',
returnValues:
Result {
'0': '0x5b1869D9A4C187F2EAa108f3062412ecf0526b24',
'1': '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1',
'2': '2000000000000000000',
liquidPledging: '0x5b1869D9A4C187F2EAa108f3062412ecf0526b24',
addr: '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1',
amount: '2000000000000000000' },
event: 'GenerateTokens',
signature: '0xf8a6cdb77a67632a46c21be3e7ca9b2519ecd39d21e514f9222c5b2f19ce23ed',
raw:
{ data: '0x00000000000000000000000090f8bf6a479f320ead074411a4b0e7944ea8c9c10000000000000000000000000000000000000000000000001bc16d674ec80000',
topics:
[ '0xf8a6cdb77a67632a46c21be3e7ca9b2519ecd39d21e514f9222c5b2f19ce23ed',
'0x0000000000000000000000005b1869d9a4c187f2eaa108f3062412ecf0526b24' ] } }
But it also throws errors and tokens are not saved in database
SkyLight is kind of hard to use because stateless doesn't have all the callbacks that controlled modals have. So either we find a replacement, or fork and extend.
It is necessary to include the _id of the type that the donation was made to, for querying the right donation.
Example:
Fetch all donation/history for DAC with { _id: abcd }
It is possible to overwrite a users name in feathers when an addGiver event is handled.
Don't read the name from liquidPledging if feathers already contains a name for the giver
Currently we track the amount of donations with donationCount
. But we want to show the unique amount of people who support a project. So we need to add something like peopleCount
to the donationsHistory.hook.js
. This needs to count the unique givers for an entity.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.