Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    André Vitor de Lima Matos
    @andrevmatos
    Look into the main.js file for the webUI, it contains a nice walkthrough of the steps needed
    Peter Holzer
    @PeHo89
    @andrevmatos Ok, so you think I am doing this correct here from a conceptional point of view? Ok, I will have a look.
    André Vitor de Lima Matos
    @andrevmatos
    Yes, in the concept, you got it, from what I know, just need to get the implementation right now =)
    Peter Holzer
    @PeHo89
    Ok, good to now anyway :) Many thanks!
    Peter Holzer
    @PeHo89
    Mhm, unfortunately I don't get it. I had a look into the main.js file. The steps I do are similar to that. Acutally I have to problems:
    • I can not request the python resourse with all of the RDN-* header (I get the error that the payment must be an integer, in my opinion it is)
    • I can not increment the channel balance permanently (loadChannelFromBlockchain -> incrementBalanceAndSign(0) -> verifyProof(proof object returned from 'incrementBalanceAndSign(0)') -> incrementBalanceAndSign(5) -> confirmPayment(proof object returned from 'incrementBalanceAndSign(5)')
    Peter Holzer
    @PeHo89
    @andrevmatos Do you have any further hints for me? I am sorry to demand you permanently but I would really like to get it running so that I can proceed with my project for university and because I am really interested in this topic.
    André Vitor de Lima Matos
    @andrevmatos
    loadChannelFromBlockchain will do the sign of the 0-balance proof, no need to incrementBalanceAndSign it. verifyProofshouldn't be run on the proof returned by incrmenetBalanceAndSign, but on the one composed by data returned by the server. You said you did read main.js, but I'd ask you to give a closer look
    Peter Holzer
    @PeHo89
    @andrevmatos Unfortunately I don't get it. Other question: I have this channel on the blockchain. Let's focus on my client app. I don't start the python echo server application. Shouldn't it be possible to load the channel from the blockchain and increment the balance? Why do I need a balance proof from the python echo server there? In my imagination I don't need the python echo server. I load the channel and increment it's balance. This should be independent from any service except the micro raiden and geth instance, right? So I would like to increment the balance on the channel but can not persist this. Everytime I load the channel it has 0 balance. Then I increment by 5. Then it has 5 balance. If I run the application it has again 0 balance but I expect it to have 5 and after my application run through it should have 10. But why this is not the case? This python echo server application is simply an demo. It has nothing to do with administrating the micro raiden network, right? So I absolutely don't get the application flow, I am sorry.
    Peter Holzer
    @PeHo89
    In my imagination the flow is the following: I have one service (in my case the python echo service server) where I would like to request a resource from. It responses with 402 and some important information within the eaders (price for the resource, addresses and so on). So next I can load a channel between my address and the address specified in the header (the address of the server) or create one if no one exists. Then I incrementAndSign the price and send this information within headers to the resource I want to have Infos from. The server takes this Infos and proves it in his own micro raiden instance. If everything is correct, it sends me the data provided by the resource.
    So If I simply would like to send someone money, I should be able to do so without requesting him, right? I only have to know its address. So why I am not able to do this in my application? Is there something wrong from the conceptional point of view?
    André Vitor de Lima Matos
    @andrevmatos

    @PeHo89 Conceptually, it's correct. You're not getting the implementation details and the constraints on web dapps: you can't be sure you'll always have the information available, as browser storage comes and goes easily (clear cache, opening it in a private tab, another device, etc).
    So, I'll walk you through the default case, assuming you can trust the local storage (the place where your client will save the channel data, as it can't put it on the blockchain): 1. open a channel, or loadStoredChannel from localStorage or a json file, wherever you saved it, 2. incrementBalanceAndSign, 3. set headers/cookies, redo request, 4. confirmPaymenton channel.next_proof once you're sure you got the resource you paid for, it'll save back the data to localStorage for the next run, 5. repeat from 2 as many times as you want, 5. close the channel once you don't intend to make other off-chain payments on it

    That was the "happy" case.
    But what happens if you don't have localStorage (as you don't in your node instance)? You have 2 sources for each part of the channel info: 1. the blockchain, so you know the channel details, but outdated (without balance proofs, i.e. balance=0), 2. the server, as it also stores your last payment data, which you where supposed to persist but didn't, but to get it to sent it for you, you need to "authorize" with it, through an outdated balance (even if it's a zero-balance proof, the initial/pristine/fromBlockchain one). So you don't need the server for incrementing the balance, but if you didn't persist the data with localStorage or any other mean, you need to beg the server to update you with what it knows about you. This workflow replaces the loadStoredChannel+confirmPayment (as there's nowhere to store it) withloadChannelFromBlockchain (which will give you the 0-balance channel) + redoing the request to get the data from the server, and verifyProof it to be sure you're not being fooled into signing a higher amount than you should

    So, you have two options: either setup a localStorage compatible instance in your node storage and do the first workflow, or do the 2nd one, asking the server for the info you're not storing (webui does the 2nd for the reasons presented before, web app storage isn't reliable)
    Peter Holzer
    @PeHo89
    @andrevmatos Thank you for your extensive answer! So incrementAndSign doesn't affect anything within the raiden network? Is this right? And how do I request the server to send me the information I am not storing?
    André Vitor de Lima Matos
    @andrevmatos
    No, it just increment the last balance proof (which, if you didn't load one from storage or from the server, will be 0) by the amount you provide it, sign and set it on channel.next_proof (to be persited with confirmPayment or replaced by verifyProof on the next server load). On µRaiden, there's no "raiden network", there's only your local state and the server state
    You request it by signing the zero-balance proof and doing the request, it'll then reply with a 402 response, with your last balance proof on headers/cookies, which you then (in the 2nd case) is supposed to load and verifyProof
    Please, read main.js carefully, the whole workflow is there, although somehow wrapped in some jQuery callbacks to keep the UI consistent, but with some jquery knowledge/homework, you can follow it there
    Peter Holzer
    @PeHo89

    @andrevmatos

    You request it by signing the zero-balance proof and doing the request, it'll then reply with a 402 response, with your last balance proof on headers/cookies, which you then (in the 2nd case) is supposed to load and verifyProof

    My problem is to trigger the server to send me the latest balance proof. So from the very beginning I do this steps: loadChannelFromBlockchain and then request the resource? Requesting the server with which data? With all the 7 RDN-* header? Which value has the RDN-Payment header to have? If I send a number there I get 500 internal server error back with this message in the body "Payment must be an integer". I do not receive my latets balance proof within headers or cookies. Mybe because I never did a persistent transaction between this two parties?

    Please, read main.js carefully, the whole workflow is there, although somehow wrapped in some jQuery callbacks to keep the UI consistent, but with some jquery knowledge/homework, you can follow it there

    I will try this again. Reading code unfortunately isn't the best way for me learning and understanding new technology. Documentation would be much easier for me.

    André Vitor de Lima Matos
    @andrevmatos
    @PeHo89 Yes, all fields are required. Please, try using cookies instead of headers (the names are the same), maybe some specifics on your server libraries is preventing the integer in the header to be recognized as such
    Peter Holzer
    @PeHo89
    Ok, I will do so. And the payment field is 0, right?
    André Vitor de Lima Matos
    @andrevmatos
    Yes for the "load" request. After that, you should verify the proof received in the 402 response to load it, increment and sign, re-fill the cookies and re-do the request
    Peter Holzer
    @PeHo89
    Ok, and the balance signature is undefined after loadChannelFromBlockchain, right?
    André Vitor de Lima Matos
    @andrevmatos
    Yes, you need to sign the 0-balance proof (e.g. with incrementBalanceAndSign(0))
    main.js is demo code, so it's part of the documentation. Nonetheless, these details are in all the extensive µRaiden documentation, both the server, m2m client, microraiden-js lib and demo documentation, but of course we're always open to PRs to improve it
    Peter Holzer
    @PeHo89
    @andrevmatos I got the 'hello' the first time! Cool! Thank you very very much! :) But I have the next problem: Trying it again I get the error "TypeError: this.channel.proof.balance.plus is not a function". This comes from the function incrementBalanceAndSign within the TS library. Do you know whats the point here?
    André Vitor de Lima Matos
    @andrevmatos
    @PeHo89 You should be providing it with a number. microraiden-ts uses BigNumber, you need to populate the balances with BigNumbers, instead of standard number. There're some helper functions to convert a number of wei tokens to bignumber and back
    Peter Holzer
    @PeHo89
    Yeesss! That hint solved it! Great!! THANKS!
    Peter Holzer
    @PeHo89
    @andrevmatos What if I close the channel after some transactions without a closing signature and without settling it before? I have to settle it right after closing it, right? But I can't load it anymore, so how can I do this?
    André Vitor de Lima Matos
    @andrevmatos
    settling is always done at the same time of closing (if cooperative close or the receiver is the one closing) or after settle timeout expired (when uncooperative close by the sender), if the receiver didn't challenge during this timeout
    Peter Holzer
    @PeHo89
    ah ok, so for now I only have to wait until the settle timeout expired to see the balance changes in metamask plugin e.g.?
    André Vitor de Lima Matos
    @andrevmatos
    the closing signature is the one by the receiver, saying it agrees with a given BP, iff the sender requested it because it wanted to do a cooperative close. without closing signature from receiver, it's a uncooperative close, which will start the settle timeout, after when the sender will be able to settle
    wait for the settle timeout to expire and do the settling
    Peter Holzer
    @PeHo89
    ok, but how can i do the settling? or I am able to load the channel again after the time expired?
    André Vitor de Lima Matos
    @andrevmatos
    you need to wait for the settle timeout, then call settleChannel. You're always able to load the channel as much times as needed. loadChannelFromBlockchain is just a helper (as I said), which do some smart checks to avoid you loading a channel which is inside the settle timeout (as you can't do anything with it anyway), allowing you to e.g. open a new channel and interact with it. If you forget the new channel and call this function again after settle timeout expires, it'll pick the old, to-be-settled channel again so you can settle it
    Peter Holzer
    @PeHo89
    Ok, then I will simply wait for settle timeout is expired, loadChannelFromBlockchain and call settleChannel. Then I hope to see the balance changes in MetaMask. Many many thanks again!! :) Btw How long is the timeout?
    André Vitor de Lima Matos
    @andrevmatos
    It's in the contract, I think latest deployment was like 1 or 2 days
    Peter Holzer
    @PeHo89
    Oh i saw, 500+ blocks. Thanks! Just for better understanding: what is this waiting period good for?
    André Vitor de Lima Matos
    @andrevmatos
    @PeHo89 As I said, is the period in which the receiver (if went offline) could comeback, see the closing event and present his side of the balance proof (the received amount), saving his tokens, or else the contract would only have the sender word for it
    raj jha
    @rajjha10_twitter

    "server won't accept this channel.
    Please, close+settle+forget, and open a new channel"

    this message is displayed on both chrome and firefox with metamask on the ropsten test network while accessing demo https://wikidemo.micro.raiden.network/wiki/Main_Page . it appears after depositing the TKN tokens and trying to sign them. Please suggest.

    André Vitor de Lima Matos
    @andrevmatos
    @rajjha10_twitter as I answered in your opened issue (#489), it was caused by the ropsten constantinople consensus issue between parity and geth. resync is underway, and everything should be working again soon. As it was stated in the log messages, despite an issue as big as a consensus issue in the ethereum node, the user's money (both client and server) were in their own hands, no custody involved, so the users, through a synced node in whichever fork they were, would be able to close the channel and reclaim their tokens, demonstrating the power of µRaiden and Raiden payment channels technology
    raj jha
    @rajjha10_twitter
    Thanks @andrevmatos for resolving issue (#489) . I do have one microraiden instance running on my local server. I am now facing same issue(#489) with that instance. Please let me know how I can fix my local microraiden instance?.
    André Vitor de Lima Matos
    @andrevmatos
    @rajjha10_twitter This error happens because of inconsistency between client and server's chain. Ensure both eth nodes are synced and on same chain
    raj jha
    @rajjha10_twitter
    @andrevmatos Please confirm the steps that I need to perform:
    1. Upgrade geth to latest version
    2. Resync ropsten testnet
    3. Restart microraiden server
      Please let me know if anything more to do?.
    André Vitor de Lima Matos
    @andrevmatos
    @rajjha10_twitter yes, that should be about it. The documentation holds on these matters, and the error you're seeing locally is caused by these chainsplits/setup/deploy issues, not codewise (FYI demo site is running exactly the setup you see in the docker folder in repository)
    hivemall
    @hivemall
    what is the current status of raiden, does it have its own mainnet, is it on the eth mainnet? i try to write proof of concept micropayment thesis and would like to use either lightning btc or raiden, but your raidos raidex raidn-netw and uradien, is overwhelming, could you shed light into what i would use now and which chains/testnets it tackles?
    raj jha
    @rajjha10_twitter
    Thanks @andrevmatos for your help. My local microraiden instance is working great now.
    Stefan Benten
    @stefanbenten
    Hey guys! Anyone joining/attending the Web3 Summit?
    André Vitor de Lima Matos
    @andrevmatos
    @stefanbenten I'll be there on the Wednesday
    Stefan Benten
    @stefanbenten
    @andrevmatos Would like to meet with you and talk about MicroRaiden if you like!
    André Vitor de Lima Matos
    @andrevmatos
    @stefanbenten of course, whenever may fit you