Open mchliu opened 8 years ago
我估計要修改 zmq 這塊的 code
Sorry for eng message. My IME is broken on this machine
I guess here is a good start point: https://github.com/APCLab/bitcoin/blob/master/src/net.cpp
NVM LET ME SEE SEE
@iblis17 你的意思是說看完這份嗎?還是說要找什麼東西
@HuaYang-Chang
Please figure out the following question.
There is lots of API in net.cpp
. Do not read the implementation first. Just show me:
net.hpp
? Just show me a list of file name.net.hpp
is invoked? Please show the chain of invoking.Do NOT read the implementation, now, we only need to understand the architecture.
@HuaYang-Chang I guess 5 hr is enough for drawing this big picture. Doxygen may help you. Can you make it?
@iblis17 我們找到了 在doxygen上都有 要全列出來嗎? 還是要接下一個任務了
OK, I figured out it already: The machinery is here: https://bitcoin.org/en/developer-guide#peer-discovery
The hard-coded DNS seed is here: https://github.com/bitcoin/bitcoin/blob/d612837814020ae832499d18e6ee5eb919a87907/src/chainparams.cpp#L117-L122.
Also found some doc about dns seed operators: https://github.com/bitcoin/bitcoin/blob/a6a860796a44a2805a58391a009ba22752f64e32/doc/dnsseed-policy.md
In order to build our own network, we can simply bypass the bootstrapping via DNS. We do not need DNS, we only need to provide a hard-coded peers.dat
(this file is a BDB file). And bitcoin core will load the peers from it.
@mchliu So now please fetch a normal peers.dat
from bitcoin network first. Exam the BDB file, then create a custom one for us.
@iblis17 It's kind of hard for us to understand what u're saying although u said it cleary.
We don't really understand the whole structure of this whole network, so we can't understand what all these information that u mentioned is about, including what DNS seed is and what it's for.
Do u mind telling us its brief ideas? Or we can also try ask google some question.
@mchliu The description on developer wiki (the link is previous mentioned) is quite clear already. Please try to understand it first. I think it already provide enough info about connection to peers.
After reading it, we tell me how to make bitcoin core connect to our own peer based on the machinery the wiki revealed to you.
@iblis17 喔就把連的節點換掉阿^^
就 RPC getpeerinfo 不是會看到是連那些節點
就在code裡換成你想連的,都不連就變自己一條blockchain
@iblis17 我去問了一下我同學他是JOHN說
@mchliu 對啊
@mchliu 我看不懂你後面那篇回覆
@iblis17 下面那則不重要啦哈 所以我們有需要改變方針嗎 還是繼續照你說的研究
@mchliu 是啊
@iblis17 今晚也要是嘛
@mchliu 對啊
@iblis17 2130?
@mchliu ok
@iblis17
我在執行bitcoind -daemon
時出現
Error: Unable to start HTTP server. See debug log for details.
你知道哪裡出狀況嗎?
@mchliu 這我當然不會知道。
試試把 之前在 background 跑的 bitcoind kill 掉
ps aux | grep bitcoind
找到 pid 之後 kill
掉
@mchliu unix 的基礎知識 想辦法會啊....
@mchliu 除非你現在跟我說「我不碰任何 open source software」,那麼不會就沒差
@iblis17 你怎麼都TAG我哈哈哈哈 @HuaYang-Chang
Ha, 看錯
@iblis17
BTW
這些基本知識應該去哪邊吸收阿
我也是不會 :v
因為我又遇到昨天的那個already running 的問題了哈
胡搞瞎搞中
@mchliu 上次說的鳥哥還記得嘛?
@iblis17 還是鳥哥是吧 OK
@iblis17 請問下 前幾次跑不過 過一陣子突然跑過了 這是什麼情況 電腦丟搞?
@mchliu 要看看 log 了
這個問題就好像,今天你跑去問醫生:「醫生。之前幾天不太舒服,可是今天早上突然好了。這是啥情形?」 醫生則會 開始 debug: 第一步 查 log, 問問你之前的 就醫記錄,最近吃了啥 ... etc 這些都是 log
@iblis17 了解 因為我發現一件有點難過的事情 就是peers.dat會重生 mcliu@doric:~$ cd .bitcoin/ mcliu@doric:~/.bitcoin$ ls banlist.dat blocks database debug.log wallet.dat bitcoind.pid chainstate db.log fee_estimates.dat mcliu@doric:~/.bitcoin$ ls banlist.dat blocks database debug.log peers.dat bitcoind.pid chainstate db.log fee_estimates.dat wallet.dat
@mchliu peers.dat 重生沒問題啊, 而且重生也是預期的行為
重點是 peers.dat 裡面的內容,而不是重生的問題
@iblis17 我用getpeerinfo看 找到的東西跟砍掉前找到的東西一樣
@mchliu 是 bypass dns seed 的版本?
然後丟出個實際 output 上來看看
@iblis17 bypass dns seed直接不能MAKE
@mchliu show me the code?
You can copy/paste the output of git diff
here
@iblis17 研究如何使用GIT DIFF中 CODE只有單純把那段註解掉而已
那麼 compile error 的 message ?
那是華洋跑的 他還沒回我 我正在自己試 sry
@iblis17 他說不能連到HTTP SERVER
hychang@doric:~/bitcoin/src$ Error: Unable to start HTTP server. See debug log for details. bitcoind: scheduler.cpp:19: CScheduler::~CScheduler(): Assertion `nThreadsServicingQueue == 0' failed.
@iblis17 華洋在鬧 我成功
@iblis17 是成功跑過了可是 還是會找到PEER
@mchliu 那麼 code 丟出來,我也跑看看
@iblis17 直接把我的branch拿走吧 mchliu
@iblis17 嘔對了雖然還是找的到PEER 但是速度跟之前差很多 感覺是擋掉很大一部分了
@iblis17 i tried to run instruction like getblocktemplate but it returns error: Bitcoin is not connected and getgenerate, setgenerate it returns error: method not found
I'm wondering that maybe something is missing
@iblis17 BTW I edit the codes without peer connections and save them in my branch take it if u need them
請問 @iblis17 大大 目標是要建一個新的區塊鏈 聽你說目前是會連到原本的區塊鏈
所以我們要建一個新的是要把網路斷掉嗎?
阿實際該如何執行哩