Skip to content

Commit

Permalink
R2 repo migration (#22)
Browse files Browse the repository at this point in the history
* R2 repo migration

* remove extra line
  • Loading branch information
royceroyceroyce authored Nov 26, 2024
1 parent 0cda3ab commit 5c80414
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ This issue will be fixed in the next release.
Additionally, you can get the latest snapshot url and sha256 checksum as below:

```
$ curl https://opbnb-snapshot-mainnet.bnbchain.org/geth-pbss-latest
geth-pbss-20240525.tar.gz
$ curl https://pub-2ea2209b4ee74f4398c5ac50c3b2efeb.r2.dev/geth-mainnet-pbss-latest
geth-mainnet-pbss-20241122.tar.gz
$ curl https://opbnb-snapshot-mainnet.bnbchain.org/geth-pbss-20240525.tar.gz.sha256
d361af99362f3e6c55984e4aff127fffe9939e5c28274450f4b168b04d87370a geth-pbss-20240525.tar.gz
$ curl https://pub-2ea2209b4ee74f4398c5ac50c3b2efeb.r2.dev/geth-mainnet-pbss-20241122.tar.gz.sha256
d361af99362f3e6c55984e4aff127fffe9939e5c28274450f4b168b04d87370a geth-mainnet-pbss-20241122.tar.gz
```

## Usage

### Step 1: Download the snapshot and decompress it.

```bash
wget -q -O - https://opbnb-snapshot-mainnet.bnbchain.org/geth-pbss-20240525.tar.gz | tar -xvf -
wget -q -O - https://pub-2ea2209b4ee74f4398c5ac50c3b2efeb.r2.dev/geth-pbss-20241122.tar.gz | tar -xvf -
```

### Step 2: Replace the data.
Expand Down
20 changes: 10 additions & 10 deletions auto_update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ function getSnapshotURL(
): string {
const dateString = date.toISOString().substr(0, 10).replace(/-/g, "");
if (network === "mainnet") {
return `https://opbnb-snapshot-mainnet.bnbchain.org/geth-${dateString}.tar.gz`;
return `https://pub-2ea2209b4ee74f4398c5ac50c3b2efeb.r2.dev/geth-mainnet-${dateString}.tar.gz`;
} else if (network === "mainnet_prune") {
return `https://opbnb-snapshot-mainnet.bnbchain.org/geth-prune-${dateString}.tar.gz`;
return `https://pub-2ea2209b4ee74f4398c5ac50c3b2efeb.r2.dev/geth-mainnet-prune-${dateString}.tar.gz`;
} else if (network === "mainnet_pbss") {
return `https://opbnb-snapshot-mainnet.bnbchain.org/geth-pbss-${dateString}.tar.gz`;
return `https://pub-2ea2209b4ee74f4398c5ac50c3b2efeb.r2.dev/geth-mainnet-pbss-${dateString}.tar.gz`;
} else if (network === "testnet_pbss") {
return `https://opbnb-snapshot-testnet.bnbchain.org/geth-pbss-${dateString}.tar.gz`;
return `https://pub-2ea2209b4ee74f4398c5ac50c3b2efeb.r2.dev/geth-testnet-pbss-${dateString}.tar.gz`;
} else if (network === "testnet") {
return `https://opbnb-snapshot-testnet.bnbchain.org/geth-${dateString}.tar.gz`;
return `https://pub-2ea2209b4ee74f4398c5ac50c3b2efeb.r2.dev/geth-testnet-${dateString}.tar.gz`;
} else {
throw new Error("invalid network");
}
Expand Down Expand Up @@ -83,15 +83,15 @@ function getLatestSnapshotURL(
| "testnet_pbss"
) {
if (network === "mainnet") {
return `https://opbnb-snapshot-mainnet.bnbchain.org/geth-latest`;
return `https://pub-2ea2209b4ee74f4398c5ac50c3b2efeb.r2.dev/geth-mainnet-latest`;
} else if (network === "mainnet_prune") {
return `https://opbnb-snapshot-mainnet.bnbchain.org/geth-prune-latest`;
return `https://pub-2ea2209b4ee74f4398c5ac50c3b2efeb.r2.dev/geth-mainnet-prune-latest`;
} else if (network === "mainnet_pbss") {
return `https://opbnb-snapshot-mainnet.bnbchain.org/geth-pbss-latest`;
return `https://pub-2ea2209b4ee74f4398c5ac50c3b2efeb.r2.dev/geth-mainnet-pbss-latest`;
} else if (network === "testnet_pbss") {
return `https://opbnb-snapshot-testnet.bnbchain.org/geth-pbss-latest`;
return `https://pub-2ea2209b4ee74f4398c5ac50c3b2efeb.r2.dev/geth-testnet-pbss-latest`;
} else if (network === "testnet") {
return `https://opbnb-snapshot-testnet.bnbchain.org/geth-latest`;
return `https://pub-2ea2209b4ee74f4398c5ac50c3b2efeb.r2.dev/geth-testnet-latest`;
} else {
throw new Error("invalid network");
}
Expand Down

0 comments on commit 5c80414

Please sign in to comment.