Closed synctext closed 3 months ago
Not yet read the required background reading. @kandrio checked out the superapp, confused about the modules. Also @AkiSchmatzler
from the example trustchain docs
Initiator creates a proposal halfBlock, signs it with his private key, creates the wrapper halfBlockBroadcast that contains the proposal block. He sends the broadcast to everyone. The receiver (the one which the transaction is intended for) creates an agreement block (AgreementHalfBlock), they sign it. Then, they put the proposal and the ageeement in a block (halfBlockPair) (which represents the completed transaction) and broadcast it to the network (halfBlockPairBroadcast message). The fact that everyone in the network is aware of every step of the transaction (broadcast of proposal and agreement) assures its integrity.
this link contains all the stuff we need to create our community and send our messages over the network : overlay kotlin ipv8
@luukvancampen mainly got his hands dirty with the code in the weekend. At the current state, our app is able to:
NOTE: It seems that step 2 (sending of proposals) does not work consistently. We noticed that in some cases, the sender sends a proposal and no pop-up shows up in the receiver's device. We have been trying to debug this for hours, but no solution has been found yet. We could use some feedback on if this is expected and how to tackle it.
Development repo: https://github.com/luukvancampen/blockchain-engineering
Here is how the main app looks like currently:
Significant experience with @luukvancampen, the "1000" button is exactly what is needed. Just a bit worried that we don't have 5 working developers. Bonus point: fix the tutorial or expand with details within a Pull Request. Code for binary transfer testing (part of the digital Euro): with lost packet reporting Updated digital Euro and packet loss report and try out those IPv8 improvement PRs Everybody was a bit stuck, try to get 3 emulators to talk to each other. Reliable foundations for future sprints.
Next internal meeting: Wednesday, March 8th at 17:00
Here are the next tasks we want to achieve, along with the developers that own them:
community
as shown in the PR (https://github.com/ChrisSBras/trustchain-superapp/pull/4/files) @mehulbhuradia UniquenessConstaint
error sometimes when the receiver tries to insert an incoming transaction into their SQLite database. @kandrio
SQLite
database as well, hence the Uniqueness
error.I'll use this comment to expose my progress on extending the Detoks
app to show the list of connected bootstrap servers.
Here's the piece of code that loads a List
of the IPv4Addresses
of the bootstrap servers into bootstrap_servers
:
import nl.tudelft.ipv8.Community
val bootstrap_servers = Community.DEFAULT_ADDRESSES
Actually, DEFAULT_ADDRESSES
looks like this:
DEFAULT_ADDRESSES: List<IPv4Address> = listOf(
// Dispersy
// Address("130.161.119.206", 6421),
// ...
// IPv8
// Address("131.180.27.161", 6521),
// ...
// py-ipv8 + LibNaCL
IPv4Address("131.180.27.161", 6427),
// kotlin-ipv8
IPv4Address("131.180.27.188", 1337),
IPv4Address("131.180.27.187", 1337)
)
Indeed, if we take a look at the debug
UI feature (uses the code from above) of the superapp, we can verify that the only addresses that are shown are the ones that are uncommented in DEFAULT_ADDRESSES
:
We want to show something similar in the Detoks
app as well.
TO BE CONTINUED: For further updates, see the following comment by @AkiSchmatzler who took over this effort:
Proposal
Currently, the following happens:
Agreement
block is created and sent.We'll consider this effort successful if:
Proposal
dissapears from the UI of the receiver once the user clicks on the CONFIRM
button.Proposal
gets notified that it has been accepted by the receiver.createAgreement
API functionIn order to implement the functionality described in goal [1], we created the createAgreement
API function that does the following:
Proposal
from the local proposals
database (contains all incoming un-confirmed Proposals
)proposalAdapter
that the proposals
ArrayList
is updated (so that the confirmed proposal dissappears from the UI)Agreement
block to the sender of the Proposal
, using the createAgreementBlock
API function of the ipv8
library.Here's how the createAgreement
API function looks like so far...
private fun createAgreement(block: TrustChainBlock, proposalAdapter: ProposalAdapter) {
for (i in proposals.indices) {
if (proposals[i].block == block) {
proposals.removeAt(i)
proposalAdapter.notifyItemRemoved(i)
break
}
}
// Get a reference to the TrustChain community
val trustchain = IPv8Android.getInstance().getOverlay<TrustChainCommunity>()!!
// Create an Agreement Block
trustchain.createAgreementBlock(block, mapOf<Any?, Any?>())
}
In the bootstrap-servers branch of our development repo, I added a button bootsrap_servers, which when pressed opens a popup window showing the bootsrap servers :
[update] the popup now also shows the walkable addresses, the WAN and the LAN addresses. There are some issues with showing the bootstrap servers as up or down --> to discuss in next meeting
I made sure that the "1000" button works. It sends 1000 proposals to the specified peer and the peer signs them. The sender of the proposals then shows in the app how many agreements it has received and to what proposals the agreements are, so we can do basic packet drop detection. All proposals are assigned a number from 0 up until 999 in order to count received agreements. Each "benchmark run" get its own UUID so we do not accidentally count an agreement for the wrong benchmark.
We will have an optional meeting saturday at 13:00. The next meeting will be monday at 17:00. Both meetings will be online.
Progress last sprint cycle:
Andrei (tudatt):
LightweightTxAppKt
that can be run seamlessly in the terminalTransactionEngine
API V1 and its implementation TransactionEngineImpl
that can be extended by any Community, so it can benefit from sendTransaction
functionalityLightweightTxApp
using TokenTransactionEngine
.Progress last sprint cycle:
Kostas (kandrio
):
master
branch.Progress last sprint cycle:
Mehul(mehulbhuradia):
progress last week (@AkiSchmatzler ):
trying to profile with flamegraphs the progress of the dummy nodes --> still to finish as there were some compatibility issues yet to resolve, but should be done in the next day.
Example flamegraph trace : Since the generated image are SVGs, we can zoom in to see further details for each running thread.
Luuks progress:
Tasks going forward: (meeting on 25/3/23)
Progress last sprint cycle:
Kostas (kandrio
):
TransactionEngine
API and our LightweightTxApp
:
Progress last sprint cycle:
Andrei (tudatt):
branch benchmark
:
TransactionEngineBenchmark
class which is to be used for all benchamrk workloads. Its responsibility is to set up benchmarking test cases and then evaluate TokenTransactionEngine
's sendTransaction
functionality called with various parametersTransactionEngineBenchmark
class and added a few myself.LightweightTxApp.kt
Questions: Right now we are only sending the block object TrustchainBlock
because of the convenience of using the Builder. Should we consider creating our own, even simpler block?
Progress last sprint cycle. We now have the falemgraphs for :
We can now identify bottlenecks in those functions. The call to functions that have some pseudo-randomness in them seems to be a bottleneck at the moment. Example :
we can see thazt our unencryptedRandomSigned function is mostly bottlenecked by the nextBytes() function. In the future, we will change the funcrtion accordingly so as to use another faster function.
Progress last sprint cycle:
Mehul(mehulbhuradia):
Luuks progress:
Unpolished APK: https://luukvancampen.stackstorage.com/s/1RzuNuFYpzLYGrQH
The first few steps of benchmarking can be done and it shows the time in nanoseconds it took. When pressing the 1000 button for a peer, it starts a 1000 trustchain transaction benchmark. There are some bugs in that which I will resolve. You can also create a single transaction with a peer, which the other peer then has to confirm.
for signed permanently blocks, time is equally divided between building the block and storing it in storage, there is not much to optimize here, except if we would try and rewrite the function from the Trustchain to not use StringBuffer.append()
, as it seems to be the biggest bottleneck. For the SQL storage, the getLatestQuery()
call seems to be the biggest bottleneck. (same goes for signed blocks that are not permanently stored).
--> todo: further analysis and write the results in the report, which needs to be linked in the readme
Luuk's progress:
Links to original video's:
Link to APK:
Progress last sprint cycle:
Kostas (kandrio
):
TransactionEngine
API and our LightweightTxApp
:
software development methodology
used by this team
have you ever written down MUST HAVE and SHOULD have requirements?
Hi team, can you please address the email that group II sent to you? Thanks!
@InvictusRMC at what email did they send it?
@InvictusRMC at what email did they send it?
@kandrio apparently they only contacted @AkiSchmatzler on aki.schmatzler@gmail.com.
@InvictusRMC at what email did they send it?
@kandrio apparently they only contacted @AkiSchmatzler on aki.schmatzler@gmail.com.
I answered the group earlier today w the method i followed; I told them to get back to me if they still any further issues
Benchmark
"Run Benchmark" button is full-width of the screen, no shadowscompare
, not autostarting, press "run benchmark" would be intuitive.
Token transaction engine. Create a lightweight and fast token transaction engine for mobile devices. Your engine should be able to process 1000 transactions per second with standard 4G connectivity. Record these transactions within a simple SQLite backend. Realise simple primitives such as send/receive token primitives. Required background reading: ConTrib: Universal and Decentralized Accounting in Shared-Resource Systems.