Eventually the goal is a full port of the µRaiden project from Python to Java. However, initially - we're aiming for the bare min functionality to support micropayment channels between two peers such that we can automatically deploy channels from one entity with some initial deposit supplied by the initiator of the channel. The current version of code has been tested with Kovan testnet only for now. However, other testnet should also work after proper configurations.
- Parity installation. More information about parity intallation can be found https://www.parity.io/. The version of parity being used is 1.8.4-beta.
- Run your parity service with the following command:
parity --geth --chain kovan --force-ui --reseal-min-period 0 --jsonrpc-cors "*" --jsonrpc-apis web3,eth,net,parity,traces,rpc,personal
It may take a while to get syncronized.
We have deployed the CustomToken and RaidenMicroTransferChannels contracts. The ABI and addresses have been added in the configuration file rm-ethereum.conf
in this project.
./gradlew installDist
./gradlew run
or
./build/install/microraiden-java/bin/microraiden-java
./build/install/microraiden-java/bin/microraiden-java createAccount Alice
This version of the project now is very basic. We do not take any credentials from you when creating the account. A file Alice.pkey should be created with private key shown in plaintext.
./build/install/microraiden-java/bin/microraiden-java getAccountInfo Alice
If your parity service running correctly, you should see your AccountName, AccountID, AccountNonce, and AccountBalance.
Copy the AccountID and paste it here. Wait a period of time until the test ethers have been given to your account.
./build/install/microraiden-java/bin/microraiden-java buyToken Alice 0.1
./build/install/microraiden-java/bin/microraiden-java getTokenBalance Alice
./build/install/microraiden-java/bin/microraiden-java createAccount Bob
The token balance of Bob should be zero.
./build/install/microraiden-java/bin/microraiden-java createChannel Alice Bob 30
Wait until the transaction has been mined.
A channel key, a block number, and a URL should be shown in the terminal. The key can be used to see the created channel by pasting it into the channels
field in the URL page.
The token balance of Alice should be updated now since she puts 30 Tokens into the payment channel as deposit. However, Bob cannot receive it since the channel has not been closed.
./build/install/microraiden-java/bin/microraiden-java closeChannelCooperatively Alice Alice Bob 5351492 12.5
The first Alice
is the delegator who send the transcation to Kovan testnet. The second Alice
and Bob
are the token sender and receiver, respectively. 5351492
is the block number where the payment channel was created. 12.5
is the real amount of token that Alice eventually pays Bob.
The token balances of Alice and Bob should be updated.
All of these functions should work by signing transactions and relaying them into a superpeer. For now we'll just set the superpeer ip address but when integrated into RM, this part will be replaced by relaying it through the mesh to the superpeer.
- It is very important to noted that the ethererumj currently DOES NOT support the newest version of Solidity (0.4.19). Some of the new features in Solidity with version >= 0.4.16, such as key words
view
andpure
, are not compatible when using ethereumj to parse the application binary interface (ABI) of the smart contract. In order to install a paticular version solidity compiler (e.g. 0.4.15), please usebrew
command as shown here. - The smart contracts used in this project are not exactly the same as the smart contracts in µRaiden project. The smart contracts compatible with this project have been included in this repo already.
- Users can use
populus
to compile and deploy them onto the testnet. Referring the steps and configurations here is helpful. - After the smart contract deployment onto Kovan testnet, open file rm-ethereum.conf and update the address values.
- The updated configuration now is ready to work with this project.
- In order to see payment channels opened at your deployed smart contracts on Etherscan, you need to manusally assemble all pieces of solidity files and perform the solidity contract source code verification here.