Skip to content

Commit

Permalink
Merge branch 'master' into refactor-positions
Browse files Browse the repository at this point in the history
  • Loading branch information
zielvna committed Feb 24, 2024
2 parents d28dc37 + fec4b12 commit f5486ee
Show file tree
Hide file tree
Showing 16 changed files with 6,553 additions and 7 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build and Tests

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
name: Build contract and run tests
runs-on: ubuntu-latest

steps:
- name: Checkout source code
uses: actions/checkout@v3

- name: Install packages
run: npm install

- name: Build contract and run tests
run: |
chmod +x tests.sh
./tests.sh
shell: bash

17 changes: 17 additions & 0 deletions alephium-stack/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
start-devnet:
@echo ''
cd devnet && echo '' && docker-compose up -d --force-recreate --remove-orphans
@echo ''
@echo 'Useful resouces:'
@echo ' - Node Swagger: http://127.0.0.1:22973/docs'
@echo ' - Explorer Swagger: http://127.0.0.1:9090/docs'
@echo ' - Explorer Frontend: http://localhost:23000'
@echo ''

stop-devnet:
@echo ''
cd devnet && echo '' && docker-compose down

restart-devnet:
@make stop-devnet
@make start-devnet
29 changes: 29 additions & 0 deletions alephium-stack/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## Devnet

### Start

```
make start-devnet
```

Node Swagger: http://127.0.0.1:22973/docs

Explorer Swagger: http://127.0.0.1:9090/docs

Explorer frontend: http://localhost:23000

### Stop

```
make stop-devnet
```

### Restart

```
make restart-devnet
```

### Usage

Make sure to use port `22973` for the node host and `23000` for the explorer frontend.
55 changes: 55 additions & 0 deletions alephium-stack/devnet/devnet.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Import this mnemonic to have 4'000'000 token allocated for your addresses
#
# vault alarm sad mass witness property virus style good flower rice alpha viable evidence run glare pretty scout evil judge enroll refuse another lava

alephium.genesis.allocations = [
{
address = "1DrDyTr9RpRsQnDnXo2YRiPzPW4ooHX5LLoqXrqfMrpQH",
amount = 1000000000000000000000000,
lock-duration = 0 seconds
},
{
address = "14UAjZ3qcmEVKdTo84Kwf4RprTQi86w2TefnnGFjov9xF",
amount = 1000000000000000000000000,
lock-duration = 0 seconds
},
{
address = "15jjExDyS8q3Wqk9v29PCQ21jDqubDrD8WQdgn6VW2oi4",
amount = 1000000000000000000000000,
lock-duration = 0 seconds
},
{
address = "17cBiTcWhung3WDLuc9ja5Y7BMus5Q7CD9wYBxS1r1P2R",
amount = 1000000000000000000000000,
lock-duration = 0 seconds
}
]
alephium.consensus.num-zeros-at-least-in-hash = 0
alephium.consensus.uncle-dependency-gap-time = 0 seconds
alephium.network.leman-hard-fork-timestamp = 0

alephium.network.network-id = 4
alephium.discovery.bootstrap = []
alephium.wallet.locking-timeout = 99999 minutes
alephium.mempool.auto-mine-for-dev = true
alephium.node.event-log.enabled=true
alephium.node.event-log.index-by-tx-id = true
alephium.node.event-log.index-by-block-hash = true

alephium.network.rest-port = 22973
alephium.network.ws-port = 21973
alephium.network.miner-api-port = 20973
alephium.api.network-interface = "0.0.0.0"
alephium.api.api-key-enabled = false
alephium.mining.api-interface = "0.0.0.0"
alephium.network.bind-address = "0.0.0.0:19973"
alephium.network.internal-address = "alephium:19973"
alephium.network.coordinator-address = "alephium:19973"

# arbitrary mining addresses
alephium.mining.miner-addresses = [
"1FsroWmeJPBhcPiUr37pWXdojRBe6jdey9uukEXk1TheA",
"1CQvSXsmM5BMFKguKDPpNUfw1idiut8UifLtT8748JdHc",
"193maApeJWrz9GFwWCfa982ccLARVE9Y1WgKSJaUs7UAx",
"16fZKYPCZJv2TP3FArA9FLUQceTS9U8xVnSjxFG9MBKyY"
]
119 changes: 119 additions & 0 deletions alephium-stack/devnet/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
version: "3.3"

services:
alephium:
image: alephium/alephium:v2.8.4
restart: "no"
ports:
- 19973:19973/tcp
- 19973:19973/udp
- 127.0.0.1:20973:20973
- 127.0.0.1:21973:21973
- 127.0.0.1:22973:22973
security_opt:
- no-new-privileges:true
volumes:
- ./devnet.conf:/alephium-home/.alephium/user.conf
# - ~/.alephium:/alephium-home/.alephium
environment:
ALEPHIUM_FILE_LOG_LEVEL: "DEBUG"
healthcheck:
test: ["CMD", "curl", "http://127.0.0.1:22973/infos/self-clique"]
timeout: 45s

postgres:
container_name: alephium_explorer_postgres
image: postgres
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-explorer}
PGDATA: /data/postgres
ports:
- "127.0.0.1:19974:5432"
restart: unless-stopped
healthcheck:
test: ["CMD", "pg_isready", "-q", "-d", "postgres", "-U", "postgres"]
timeout: 45s
interval: 10s

pgadmin:
container_name: alephium_explorer_pgadmin
image: dpage/pgadmin4
depends_on:
- postgres
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
PGADMIN_CONFIG_SERVER_MODE: "False"

ports:
- "${PGADMIN_PORT:-5050}:80"
restart: unless-stopped

explorer-backend:
container_name: alephium_explorer_backend
image: alephium/explorer-backend:v1.16.1
depends_on:
postgres:
condition: service_healthy
alephium:
condition: service_healthy
restart: unless-stopped
ports:
- 9090:9090
security_opt:
- no-new-privileges:true
environment:
- EXPLORER_HOST=0.0.0.0
- EXPLORER_PORT=9090
- BLOCKFLOW_HOST=alephium
- BLOCKFLOW_PORT=22973
- BLOCKFLOW_NETWORK_ID=4
- DB_NAME=${POSTGRES_DB:-explorer}
- DB_HOST=postgres
- DB_PORT=5432
- DB_USER=${POSTGRES_USER:-postgres}
- DB_PASSWORD=${POSTGRES_PASSWORD:-postgres}
- EXPLORER_READONLY=false
# - ALEPHIUM_API_KEY=0000000000000000000000000000000000000000000000000000000000000000

explorer-frontend:
container_name: alephium_explorer_frontend
image: alephium/explorer:1.8.2
depends_on:
- explorer-backend
restart: "no"
ports:
- 23000:3000
security_opt:
- no-new-privileges:true
environment:
- __VITE_BACKEND_URL__=http://localhost:9090
- __VITE_NETWORK_TYPE__=testnet

# grafana:
# image: grafana/grafana:7.2.1
# depends_on:
# - prometheus
# ports:
# - 3000:3000
# volumes:
# - ./grafana/provisioning/:/etc/grafana/provisioning
# env_file:
# - ./grafana/config.monitoring
# restart: unless-stopped

# prometheus:
# image: prom/prometheus:v2.21.0
# depends_on:
# - alephium
# - explorer-backend
# volumes:
# - ./prometheus/:/etc/prometheus
# command:
# - "--config.file=/etc/prometheus/prometheus.yml"
# - "--storage.tsdb.path=/prometheus"
# - "--web.console.libraries=/usr/share/prometheus/console_libraries"
# - "--web.console.templates=/usr/share/prometheus/consoles"
# restart: unless-stopped
2 changes: 2 additions & 0 deletions alephium-stack/devnet/grafana/config.monitoring
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
GF_SECURITY_ADMIN_PASSWORD=admin
GF_USERS_ALLOW_SIGN_UP=false
Loading

0 comments on commit f5486ee

Please sign in to comment.