Skip to main content
9 events
when toggle format what by license comment
Jul 20, 2017 at 12:07 vote accept porfavorite
Jul 9, 2017 at 14:18 comment added porfavorite Got it, thank you! I'll try. But still I hoped maybe there are some another ways to do it, because why we call it Decentralized Application if we still use a pretty centralized architecture using a typical server..
Jul 9, 2017 at 10:43 comment added Sanchit You can always control from which account the transaction(the function call) is happening. By default, it would be accounts[0] or eth.coinbase but if you want to use some other account for a specific function call. You can do it like this - ContractName.function(arg, {from: accounts[i]}). In this case, msg.sender would not be the owner(accounts[0]).
Jul 9, 2017 at 10:29 comment added porfavorite thanks, but I meant that if I use nodejs server that interacts with the ethereum node using my deploying account, that means that all HTTP requests to the nodejs server will be processed by this server using my 'owner' contract, which means the msg.sender will be owner and the onlyMember modifier doesn't make much sense. That's why I asked maybe somehow I should use another contract on my ethereum node, not which I used to deploy the contract.
Jul 9, 2017 at 9:52 comment added Sanchit I implemented OnlyMember modifier in one of the contracts I wrote, you can take a look for the reference - github.com/inovizz/lms/blob/master/contracts/LMS.sol
Jul 9, 2017 at 9:51 comment added Sanchit You don't need to deploy another contract. You can create another modifier like OnlyMember, which will not have owner privileges but would be able to access some information which you want them to access.
Jul 9, 2017 at 9:47 comment added Sanchit NodeJS will work as a middleware and there has to be a provider in a background for your DApp to work and your DApp's UI shall talk to NodeJS server through HTTP requests as you mentioned.
Jul 9, 2017 at 8:52 comment added porfavorite So if there is a provider like meta or mist, I should just use them. Then if there is no provider, I should just send HTTP requests to my NodeJS server, right? I didn't really work with backend, so sorry if I got something wrong. One more question: in my contract there are functions that can be run by owner address only. Does it mean that if I want users get some info via my owner account I should add new functions, so they didn't get more info than they should? Or I just need to deploy contract from one account and then use another one to use it in nodejs server? Thank you anyway!
Jul 8, 2017 at 21:12 history answered Sanchit CC BY-SA 3.0