Skip to content

Commit 15018e2

Browse files
committed
feat: support bitcoin testnet4 network
1 parent 9873fa7 commit 15018e2

File tree

16 files changed

+127
-6
lines changed

16 files changed

+127
-6
lines changed

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ prerender-server/node_modules
1111
data_bitcoin_mainnet
1212
data_liquid_mainnet
1313
data_bitcoin_testnet
14+
data_bitcoin_testnet4
1415
data_bitcoin_regtest
1516
data_liquid_regtest
1617
www/libwally
1718
data_liquid_testnet
1819
data_bitcoin_signet
19-
gitlab/
20+
gitlab/

API.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ JSON over RESTful HTTP. Amounts are always represented in satoshis.
44

55
The blockstream.info public APIs are available at:
66
- Bitcoin: https://blockstream.info/api/
7-
- Bitcoin Testnet: https://blockstream.info/testnet/api/
7+
- Bitcoin Testnet3: https://blockstream.info/testnet/api/
88
- Liquid: https://blockstream.info/liquid/api/
99
- Liquid Testnet: https://blockstream.info/liquidtestnet/api/
1010

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,15 @@ docker run -p 50001:50001 -p 8084:80 \
172172
bash -c "/srv/explorer/run.sh bitcoin-testnet explorer"
173173
```
174174

175+
## How to run the explorer for Bitcoin testnet4
176+
177+
```
178+
docker run -p 50001:50001 -p 8084:80 \
179+
--volume $PWD/data_bitcoin_testnet4:/data \
180+
--rm -i -t esplora \
181+
bash -c "/srv/explorer/run.sh bitcoin-testnet4 explorer"
182+
```
183+
175184
## How to run the explorer for Bitcoin signet
176185

177186
```bash

contrib/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ RUN source /root/.nvm/nvm.sh \
2626
npm run dist -- bitcoin-mainnet \
2727
&& DEST=/srv/explorer/static/bitcoin-testnet \
2828
npm run dist -- bitcoin-testnet \
29+
&& DEST=/srv/explorer/static/bitcoin-testnet4 \
30+
npm run dist -- bitcoin-testnet4 \
2931
&& DEST=/srv/explorer/static/bitcoin-signet \
3032
npm run dist -- bitcoin-signet \
3133
&& DEST=/srv/explorer/static/bitcoin-regtest \
@@ -40,6 +42,8 @@ RUN source /root/.nvm/nvm.sh \
4042
npm run dist -- bitcoin-mainnet blockstream \
4143
&& DEST=/srv/explorer/static/bitcoin-testnet-blockstream \
4244
npm run dist -- bitcoin-testnet blockstream \
45+
&& DEST=/srv/explorer/static/bitcoin-testnet4-blockstream \
46+
npm run dist -- bitcoin-testnet4 blockstream \
4347
&& DEST=/srv/explorer/static/bitcoin-signet-blockstream \
4448
npm run dist -- bitcoin-signet blockstream \
4549
&& DEST=/srv/explorer/static/bitcoin-regtest-blockstream \

contrib/Dockerfile.base

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ RUN source /root/.cargo/env \
6565
&& mkdir -p /srv/explorer/electrs{,_liquid} \
6666
&& git clone --no-checkout https://github.com/blockstream/electrs.git \
6767
&& (cd electrs \
68-
&& git checkout 306f66acf2ab10bcd99b8012e95a0de30b2cc012 \
68+
&& git checkout 2163573d2e6a8a9028035524243a2b1a51445cc1 \
6969
&& cp contrib/popular-scripts.txt /srv/explorer \
7070
&& cargo install --root /srv/explorer/electrs_bitcoin --locked --path . --features electrum-discovery \
7171
&& cargo install --root /srv/explorer/electrs_liquid --locked --path . --features electrum-discovery,liquid \
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
testnet4=1
2+
[testnet4]
3+
server=1
4+
peerbloomfilters=0
5+
enforcenodebloom=1
6+
disablewallet=1
7+
listenonion=1
8+
listen=1
9+
mempoolfullrbf=1
10+
blocknotify=pkill -USR1 electrs
11+
maxmempool=1000
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
export SITE_TITLE='Bitcoin Testnet4 Explorer'
4+
export HOME_TITLE='Bitcoin Testnet4 Explorer'
5+
export NATIVE_ASSET_LABEL=tBTC
6+
export NATIVE_ASSET_NAME='Bitcoin Testnet4'
7+
8+
export MENU_ACTIVE='Bitcoin Testnet4'
9+
export BASE_HREF=${BASE_HREF:-'/testnet4/'}
10+
11+
export CUSTOM_ASSETS="$CUSTOM_ASSETS flavors/bitcoin-testnet4/www/*"
12+
export CUSTOM_CSS="$CUSTOM_CSS flavors/bitcoin-testnet4/extras.css"
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#BitcoinTestnet, #LiquidTestnet{
2+
display: block;
3+
}
4+
5+
#Bitcoin, #Liquid{
6+
display: none;
7+
}
8+
9+
.main-nav li.active a{
10+
border: 1px solid rgba(168, 184, 201, 1);
11+
}
12+
13+
.sub-nav .active {
14+
border-bottom: solid 2px rgba(168, 184, 201, 1);
15+
}
16+
17+
.details-btn > div {
18+
color: rgba(168, 184, 201, 1);
19+
border: 1px solid rgba(168, 184, 201, 1);
20+
}
21+
22+
.transaction-box > .footer > div:nth-child(3) {
23+
color: rgba(168, 184, 201, 1);
24+
}
25+
26+
.navbar {
27+
background-image: linear-gradient(-90deg, rgba(84, 103, 124, 1) 0%, rgba(29, 72, 111, 1) 18%, rgba(24, 53, 80, 1) 36%, rgba(29, 37, 48, 1) 58%, rgba(14, 16, 17, 1) 100%);
28+
}
29+
30+
.sub-nav a sup.highlight{
31+
display: none;
32+
}
33+
34+
.main-nav li a{
35+
color: #78838e;
36+
}
37+
38+
.nav-link:hover{
39+
color: white !important;
40+
}
41+
42+
.sub-navbar:before {
43+
content: "Bitcoin Testnet4 is used for testing. Funds have no value!";
44+
width: 100%;
45+
height: 35px;
46+
background: #ba042a;
47+
position: absolute;
48+
margin-top: -10px;
49+
text-align: center;
50+
font-size: 14px;
51+
line-height: 2.4;
52+
}
53+
54+
.sub-nav-container{
55+
margin-top: 25px;
56+
}
57+
58+
.table-title, .block-header-title, .transaction-header-title{
59+
display: flex;
60+
}
61+
62+
.table-title:after, .block-header-title:after, .transaction-header-title:after {
63+
content: "Testnet4";
64+
font-size: 13px;
65+
background-color: rgb(48 59 70);
66+
padding: 3px 12px;
67+
border-radius: 30px;
68+
margin-left: 15px;
69+
display: inline-block;
70+
align-self: center;
71+
}
1.42 KB
Loading
930 Bytes
Loading

0 commit comments

Comments
 (0)