shadow / shadow-plugin-bitcoin

A Shadow plug-in that runs the Bitcoin Satoshi reference software
https://shadow.github.io
Other
25 stars 23 forks source link

undocumented usage #7

Open whywaita opened 7 years ago

whywaita commented 7 years ago

Hi Contributers!

I want customize bitcoin transaction. (The purpose is research of bitcoin) First, I want to reproduce this paper. but, it is not documented.

Please teach how to build like this paper. 🙇 🙇 (If there is a problem with the exchange on GitHub, there is no problem with e-mail.)

whywaita commented 7 years ago

I think, I should use attacks-features branch. Really?

robgjansen commented 7 years ago

I haven't been actively using this plug-in, but I think the master branch should have the best chance of working. I'm not sure which branch you should use if you are trying to reproduce a specific experiment - maybe @amiller has an idea?

amiller commented 7 years ago

Hi @whywaita, you should use the master branch for building the plugin, since is most likely to be updated for newer bitcoin code. The other branches have some useful config scripts though. Which experiment do you want to reproduce first, i.e. the transaction propagation experiment or the mapOrphanTransactions demonstration?

I can't find checked in anywhere the config file we generated for the 6000 node experiment, unfortunately. You'll have to create your own script to create a config file for however many instances of nodes you want to simulate. You can get the nodes to connect to each other just by passing a list of "-connect=bcdnode129 -connect=bcdnode17" etc. options in each command line. Let me know if this helps I can describe this in a bit more detail if you need it.

Let me know if you are able to run the default experiment in the master branch, with 2 nodes (that will show you've built everything correctly)?

whywaita commented 7 years ago

Thank you for response!

@amiller @robgjansen

I'm successful to build master branch, and use two node. (default shadow.config.xml) But, I think, two node have not transaction.

This is shadow.log . http://www.mma.club.uec.ac.jp/~why/shadow.log_20161126.txt

shadow output only like sentence.

00:00:01.624697 [thread-0] 00:01:58.000000000 [shadow-message] [bcdnode1~11.0.0.2] [_tracker_logNode] [shadow-heartbeat] [node] 1,0,0,0.003575,0,0.000000;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0

Maybe, All except Cpu usage are 0.

Are there any ideas?

amiller commented 7 years ago

This log looks fine. You can see from the log that the two nodes connect to each other and exchange version messages.

To inject a transaction, I found the easiest way is to create a separate program that just turns on, connects to a Bitcoin node, and sends it a transaction. An example of this is in the attacks-features branch, but you'd need to customize it to send whatever kind of transaction you want. https://github.com/shadow/shadow-plugin-bitcoin/blob/attacks-features/src/injector/injector.c

whywaita commented 7 years ago

namely, do you need to merge the attacks-features branch on the master branch to add transactions?

amiller commented 7 years ago

I don't want to clutter the master branch with this example. However, maybe the best way to proceed is to merge the master branch onto the attacks-features branch. This should give it a few updates including building a newer version of Bitcoin. I'll be grateful if you try that and see if there are any conflicts!

whywaita commented 7 years ago

I also think there are any conflicts.

Should I patch attacks-features to master branch? (maybe, I need injector and same python tools)