Skip to content
This repository was archived by the owner on Oct 4, 2024. It is now read-only.

Commit 2db1d99

Browse files
pefontanapefontana
andauthored
Remove testnet (#424)
Co-authored-by: pefontana <fontana.pedro93@gmail.coom>
1 parent dafd85b commit 2db1d99

File tree

24 files changed

+208
-300
lines changed

24 files changed

+208
-300
lines changed

.env.example

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
export DB_TYPE= # set to postgresql if you want to use postgresql, empty otherwise (sqlite).
22
export DISABLE_MAINNET_SYNC=true # Set to true if you want to disable mainnet sync
3-
export DISABLE_TESTNET_SYNC=true # Set to true if you want to disable testnet sync
43
export DISABLE_SEPOLIA_SYNC=true # Set to true if you want to disable sepolia sync
54
export RPC_API_HOST=<YOUR_RPC_API_HOST> # Set to your mainnet rpc api host, is will be used in the explorer as "Mainnet"
6-
export TESTNET_RPC_API_HOST=<YOUR_TESTNET_RPC_API_HOST> # Set to your testnet rpc api host, is will be used in the explorer as "Testnet"
75
export SEPOLIA_RPC_API_HOST=<YOUR_SEPOLIA_RPC_API_HOST> # Set to your sepolia rpc api host, is will be used in the explorer as "Sepolia"
86
export DB_NAME=<DB_NAME> # set DB creds
97
export DB_USER=<DB_USER>
108
export DB_PASS=<DB_PASS>
119
export DB_HOST=<DB_HOST>
12-

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ permissions:
1515

1616
jobs:
1717
build:
18-
env:
18+
env:
1919
RPC_API_HOST: ${{ secrets.RPC_API_HOST }}
20-
TESTNET_RPC_API_HOST: ${{ secrets.TESTNET_RPC_API_HOST }}
2120
SEPOLIA_RPC_API_HOST: ${{ secrets.SEPOLIA_RPC_API_HOST }}
2221
name: Build and test
2322
runs-on: ubuntu-latest

.github/workflows/deploy-production.yaml

Lines changed: 48 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -9,66 +9,62 @@ on:
99
- v**
1010

1111
jobs:
12-
1312
build-deploy:
1413
name: Build and deploy to production
1514
runs-on: ubuntu-latest
1615
environment:
1716
name: production
1817
url: https://starkcompass.com/
1918
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3.3.0
2021

21-
- name: Checkout
22-
uses: actions/checkout@v3.3.0
23-
24-
- name: Tailscale
25-
uses: tailscale/github-action@v2
26-
with:
27-
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
28-
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
29-
tags: tag:ci
22+
- name: Tailscale
23+
uses: tailscale/github-action@v2
24+
with:
25+
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
26+
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
27+
tags: tag:ci
3028

31-
- name: Create ssh private key file from env var
32-
env:
33-
SSH_KEY: ${{ secrets.SSH_KEY }}
34-
TS_HOST: ${{ vars.TS_HOST }}
35-
run: |
36-
mkdir ~/.ssh/
37-
sed -E 's/(-+(BEGIN|END) OPENSSH PRIVATE KEY-+) *| +/\1\n/g' <<< "$SSH_KEY" > ~/.ssh/id_ed25519
38-
chmod 400 ~/.ssh/id_ed25519
39-
retries=5; until ssh-keyscan $TS_HOST >> ~/.ssh/known_hosts || [ $retries -eq 0 ]; do ((retries--)); sleep 5; done
29+
- name: Create ssh private key file from env var
30+
env:
31+
SSH_KEY: ${{ secrets.SSH_KEY }}
32+
TS_HOST: ${{ vars.TS_HOST }}
33+
run: |
34+
mkdir ~/.ssh/
35+
sed -E 's/(-+(BEGIN|END) OPENSSH PRIVATE KEY-+) *| +/\1\n/g' <<< "$SSH_KEY" > ~/.ssh/id_ed25519
36+
chmod 400 ~/.ssh/id_ed25519
37+
retries=5; until ssh-keyscan $TS_HOST >> ~/.ssh/known_hosts || [ $retries -eq 0 ]; do ((retries--)); sleep 5; done
4038
41-
- name: Install ansible
42-
run: |
43-
pip install ansible
39+
- name: Install ansible
40+
run: |
41+
pip install ansible
4442
45-
- name: "Deploy with ansible"
46-
env:
47-
MIX_ENV: ${{ vars.MIX_ENV }}
48-
DB_TYPE: ${{ vars.DB_TYPE }}
49-
DATABASE_URL: ${{ secrets.DATABASE_URL }}
50-
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
51-
PHX_HOST: ${{ vars.PHX_HOST }}
52-
PHX_SERVER: ${{ vars.PHX_SERVER }}
53-
RPC_API_HOST: ${{ secrets.RPC_API_HOST }}
54-
TESTNET_RPC_API_HOST: ${{ secrets.TESTNET_RPC_API_HOST }}
55-
SEPOLIA_RPC_API_HOST: ${{ secrets.SEPOLIA_RPC_API_HOST }}
56-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
57-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
58-
AWS_REGION: ${{ vars.AWS_REGION }}
59-
PROVER_STORAGE: ${{ vars.PROVER_STORAGE }}
60-
ANSIBLE_SSH_PKEY_DIR: "~/.ssh/id_ed25519"
61-
TS_HOST: ${{ vars.TS_HOST }}
62-
TS_USER: ${{ vars.TS_USER }}
63-
GIT_BRANCH: ${{ github.head_ref || github.ref_name }}
64-
ANSIBLE_STDOUT_CALLBACK: "yaml"
65-
NEWRELIC_KEY: ${{ secrets.NEWRELIC_KEY }}
66-
NEWRELIC_APP_NAME: ${{ vars.NEWRELIC_APP_NAME }}
67-
SENTRY_ENV: "production"
68-
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
69-
ENABLE_MAINNET_SYNC: "true"
70-
ENABLE_TESTNET_SYNC: "true"
71-
ENABLE_SEPOLIA_SYNC: "true"
72-
ENABLE_GATEWAY_DATA: "true"
73-
run: |
74-
ansible-playbook -i ansible/inventory.yaml ansible/playbooks/deployment.yaml
43+
- name: "Deploy with ansible"
44+
env:
45+
MIX_ENV: ${{ vars.MIX_ENV }}
46+
DB_TYPE: ${{ vars.DB_TYPE }}
47+
DATABASE_URL: ${{ secrets.DATABASE_URL }}
48+
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
49+
PHX_HOST: ${{ vars.PHX_HOST }}
50+
PHX_SERVER: ${{ vars.PHX_SERVER }}
51+
RPC_API_HOST: ${{ secrets.RPC_API_HOST }}
52+
SEPOLIA_RPC_API_HOST: ${{ secrets.SEPOLIA_RPC_API_HOST }}
53+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
54+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
55+
AWS_REGION: ${{ vars.AWS_REGION }}
56+
PROVER_STORAGE: ${{ vars.PROVER_STORAGE }}
57+
ANSIBLE_SSH_PKEY_DIR: "~/.ssh/id_ed25519"
58+
TS_HOST: ${{ vars.TS_HOST }}
59+
TS_USER: ${{ vars.TS_USER }}
60+
GIT_BRANCH: ${{ github.head_ref || github.ref_name }}
61+
ANSIBLE_STDOUT_CALLBACK: "yaml"
62+
NEWRELIC_KEY: ${{ secrets.NEWRELIC_KEY }}
63+
NEWRELIC_APP_NAME: ${{ vars.NEWRELIC_APP_NAME }}
64+
SENTRY_ENV: "production"
65+
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
66+
ENABLE_MAINNET_SYNC: "true"
67+
ENABLE_SEPOLIA_SYNC: "true"
68+
ENABLE_GATEWAY_DATA: "true"
69+
run: |
70+
ansible-playbook -i ansible/inventory.yaml ansible/playbooks/deployment.yaml

.github/workflows/deploy-testing.yaml

Lines changed: 48 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ on:
1010
workflow_dispatch:
1111

1212
jobs:
13-
1413
build-deploy:
1514
name: Build and deploy to testing
1615
runs-on: ubuntu-latest
@@ -19,57 +18,55 @@ jobs:
1918
url: https://testing.starkcompass.com/
2019

2120
steps:
22-
- name: Checkout
23-
uses: actions/checkout@v3.3.0
21+
- name: Checkout
22+
uses: actions/checkout@v3.3.0
2423

25-
- name: Tailscale
26-
uses: tailscale/github-action@v2
27-
with:
28-
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
29-
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
30-
tags: tag:ci
24+
- name: Tailscale
25+
uses: tailscale/github-action@v2
26+
with:
27+
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
28+
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
29+
tags: tag:ci
3130

32-
- name: Create ssh private key file from env var
33-
env:
34-
SSH_KEY: ${{ secrets.SSH_KEY }}
35-
TS_HOST: ${{ vars.TS_HOST }}
36-
run: |
37-
mkdir ~/.ssh/
38-
sed -E 's/(-+(BEGIN|END) OPENSSH PRIVATE KEY-+) *| +/\1\n/g' <<< "$SSH_KEY" > ~/.ssh/id_ed25519
39-
chmod 400 ~/.ssh/id_ed25519
40-
retries=5; until ssh-keyscan $TS_HOST >> ~/.ssh/known_hosts || [ $retries -eq 0 ]; do ((retries--)); sleep 5; done
31+
- name: Create ssh private key file from env var
32+
env:
33+
SSH_KEY: ${{ secrets.SSH_KEY }}
34+
TS_HOST: ${{ vars.TS_HOST }}
35+
run: |
36+
mkdir ~/.ssh/
37+
sed -E 's/(-+(BEGIN|END) OPENSSH PRIVATE KEY-+) *| +/\1\n/g' <<< "$SSH_KEY" > ~/.ssh/id_ed25519
38+
chmod 400 ~/.ssh/id_ed25519
39+
retries=5; until ssh-keyscan $TS_HOST >> ~/.ssh/known_hosts || [ $retries -eq 0 ]; do ((retries--)); sleep 5; done
4140
42-
- name: Install ansible
43-
run: |
44-
pip install ansible
41+
- name: Install ansible
42+
run: |
43+
pip install ansible
4544
46-
- name: "Deploy with ansible"
47-
env:
48-
MIX_ENV: ${{ vars.MIX_ENV }}
49-
DB_TYPE: ${{ vars.DB_TYPE }}
50-
DATABASE_URL: ${{ secrets.DATABASE_URL }}
51-
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
52-
PHX_HOST: ${{ vars.PHX_HOST }}
53-
PHX_SERVER: ${{ vars.PHX_SERVER }}
54-
RPC_API_HOST: ${{ secrets.RPC_API_HOST }}
55-
TESTNET_RPC_API_HOST: ${{ secrets.TESTNET_RPC_API_HOST }}
56-
SEPOLIA_RPC_API_HOST: ${{ secrets.SEPOLIA_RPC_API_HOST }}
57-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
58-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
59-
AWS_REGION: ${{ vars.AWS_REGION }}
60-
PROVER_STORAGE: ${{ vars.PROVER_STORAGE }}
61-
ANSIBLE_SSH_PKEY_DIR: "~/.ssh/id_ed25519"
62-
TS_HOST: ${{ vars.TS_HOST }}
63-
TS_USER: ${{ vars.TS_USER }}
64-
GIT_BRANCH: ${{ github.head_ref || github.ref_name }}
65-
ANSIBLE_STDOUT_CALLBACK: "yaml"
66-
ENABLE_MAINNET_SYNC: "true"
67-
ENABLE_TESTNET_SYNC: "true"
68-
ENABLE_SEPOLIA_SYNC: "true"
69-
ENABLE_GATEWAY_DATA: "true"
70-
NEWRELIC_KEY: ${{ secrets.NEWRELIC_KEY }}
71-
NEWRELIC_APP_NAME: ${{ vars.NEWRELIC_APP_NAME }}
72-
SENTRY_ENV: "testing"
73-
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
74-
run: |
75-
ansible-playbook -i ansible/inventory.yaml ansible/playbooks/deployment.yaml
45+
- name: "Deploy with ansible"
46+
env:
47+
MIX_ENV: ${{ vars.MIX_ENV }}
48+
DB_TYPE: ${{ vars.DB_TYPE }}
49+
DATABASE_URL: ${{ secrets.DATABASE_URL }}
50+
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
51+
PHX_HOST: ${{ vars.PHX_HOST }}
52+
PHX_SERVER: ${{ vars.PHX_SERVER }}
53+
RPC_API_HOST: ${{ secrets.RPC_API_HOST }}
54+
SEPOLIA_RPC_API_HOST: ${{ secrets.SEPOLIA_RPC_API_HOST }}
55+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
56+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
57+
AWS_REGION: ${{ vars.AWS_REGION }}
58+
PROVER_STORAGE: ${{ vars.PROVER_STORAGE }}
59+
ANSIBLE_SSH_PKEY_DIR: "~/.ssh/id_ed25519"
60+
TS_HOST: ${{ vars.TS_HOST }}
61+
TS_USER: ${{ vars.TS_USER }}
62+
GIT_BRANCH: ${{ github.head_ref || github.ref_name }}
63+
ANSIBLE_STDOUT_CALLBACK: "yaml"
64+
ENABLE_MAINNET_SYNC: "true"
65+
ENABLE_SEPOLIA_SYNC: "true"
66+
ENABLE_GATEWAY_DATA: "true"
67+
NEWRELIC_KEY: ${{ secrets.NEWRELIC_KEY }}
68+
NEWRELIC_APP_NAME: ${{ vars.NEWRELIC_APP_NAME }}
69+
SENTRY_ENV: "testing"
70+
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
71+
run: |
72+
ansible-playbook -i ansible/inventory.yaml ansible/playbooks/deployment.yaml

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626

2727
## Local development
2828

29-
If you run `make` it will print out the available targets:
29+
If you run `make` it will print out the available targets:
3030
```
31-
% make
31+
% make
3232
Usage:
3333
run : Starts the Elixir backend server.
3434
setup : Sets up everything necessary to build and run the explorer.
@@ -37,7 +37,7 @@ Usage:
3737
```
3838

3939
### Setup
40-
Once you have the requirements installed and set up, you can proceed to building and running the project.
40+
Once you have the requirements installed and set up, you can proceed to building and running the project.
4141

4242
```bash
4343
make setup
@@ -58,7 +58,6 @@ Set the following environment variables:
5858

5959
```bash
6060
export RPC_API_HOST=your_rpc_hostname
61-
export TESTNET_RPC_API_HOST=testnet_rpc_hostname
6261
export SEPOLIA_RPC_API_HOST=sepolia_rpc_hostname
6362
```
6463

@@ -102,7 +101,6 @@ The synchronization process is activated by default, you can turn it off by conf
102101

103102
```bash
104103
export DISABLE_MAINNET_SYNC=true
105-
export DISABLE_TESTNET_SYNC=true
106104
export DISABLE_SEPOLIA_SYNC=true
107105
```
108106

@@ -114,7 +112,7 @@ There are 3 things to keep in mind here:
114112
1. Amount of requests:
115113
If you have any constraint on how many requests you can make: keep an eye on that,
116114
because the State Synchronization System can do a lot of requests per second.
117-
2. Disk Usage: We're still measuring it, but we expect it to be considerable
115+
2. Disk Usage: We're still measuring it, but we expect it to be considerable
118116
after running it for a couple of days.
119117
3. If you are going to sync a large amount of blocks, we *strongly* suggest to use PostgreSQL instead of SQLite. You can check how to swap the DB in [this section](#using-stark-compass-with-postgresql).
120118

@@ -156,7 +154,7 @@ docker-compose up postgres
156154

157155
## Contributing
158156

159-
We appreciate your interest in contributing to the Stark Compass Explorer! Your contributions can help make this project even better.
157+
We appreciate your interest in contributing to the Stark Compass Explorer! Your contributions can help make this project even better.
160158

161159
PRs are more than welcome if you want to collaborate to the project. If you don't know how to implement a feature, you are still welcome to create an issue!
162160

0 commit comments

Comments
 (0)