Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task 1 start bitcoin node #26

Merged
merged 6 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added members/v1xingyue/images/image-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added members/v1xingyue/images/image-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added members/v1xingyue/images/image-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added members/v1xingyue/images/image-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added members/v1xingyue/images/image-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added members/v1xingyue/images/image-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added members/v1xingyue/images/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions members/v1xingyue/journal.md
Original file line number Diff line number Diff line change
@@ -1 +1,69 @@
# 学习日志

## 搭建比特币节点

1. 下载程序

下载地址: [https://bitcoincore.org/en/download/](https://bitcoincore.org/en/download/)
根据你的操作系统选择对应的程序。

2. 运行 bitcoind 启动节点

下载解压,目录结构如下:

![alt text](images/image.png)

3. 启动节点

```shell
./bin/bitcoind
```

节点同步状态如下:

先经历一个比较漫长的 `Pre-synchronizing` 阶段
![alt text](images/image-1.png)

再经历一个比较漫长的 `Synchronizing blockheaders` 阶段
![alt text](images/image-3.png)

最后,开始同步区块

![alt text](images/image-4.png)

4. 查看节点信息

```shell
./bin/bitcoin-cli -getinfo
```

![alt text](images/image-2.png)

获取同步的区块高度

```shell
./bin/bitcoin-cli -getblockcount
```

![alt text](images/image-5.png)

5. 方便 rpc 请求,配置文件 `bitcoin.conf` 添加 rpc 授权信息

```conf
rpcuser=admin
rpcpassword=admin
```

启动的时候,使用全路径指定配置文件:

```shell
./bin/bitcoind -conf=/root/bitcoin-27.1/bitcoin.conf
```

curl 使用 rpc 调用,获取节点信息:

```shell
curl -u admin:admin --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockchaininfo", "params": [] }' http://127.0.0.1:8332/ | jq
```

![alt text](images/image-6.png)
Loading