---
# System prepended metadata

title: Bitcoin Oracle bootstrap procedures (A+B)
tags: [ALEX]

---

## A) Simple client approach:
### Tested on:
HW: 2 GB RAM (check w/ Devops)
SO: Ubuntu 22.04.4 LTS

### Base requirements:
- unzip
- Docker (refine proposed minimal installation)
- direnv
- asdf

### Procedure 
1) Clone Alex' Bitcoin Oracle
    `git clone git@github.com:alexgo-io/bitcoin-oracle.git`
2) Change to root Oracle directory
    `cd bitcoin-oracle/`
3) Register plugins for the version manager
    `awk '{ system("asdf plugin-add " $1) }' < .tool-versions`
4) Install tools with version manager
    `asdf install`
5) Install dependencies
    `pnpm install`
6) Allow the project files for the environment loader
    `direnv allow`
7) Run dockerized validator
    `nx run validator:container`
--
8) Make a file to port the validator needed env variables
    ```
    $ cat validator-env.list 
    STACKS_VALIDATOR_ACCOUNT_ADDRESS
    STACKS_VALIDATOR_ACCOUNT_SECRET
    VALIDATOR_GENESIS_BLOCK_HEIGHT
    STACKS_API_URL
    STACKS_DEPLOYER_ACCOUNT_ADDRESS
    STACKS_NETWORK_TYPE
    ```
9) Run the validator generated docker image
    ```
    docker run --env-file validator-env.list -d <image-id>
    ```
    
## B) Development Environment approach:
### Tested on:
HW: 2 GB RAM (check w/ Devops) [in VMs fs.inotify.max_user_watches may need to be changed]
SO: Ubuntu 22.04.4 LTS

### Base requirements:
- unzip
- jq
- Docker (refine proposed minimal installation)
- Docker compose
- direnv
- asdf

### Procedure 
01) Clone Alex' Bitcoin Oracle
    `git clone git@github.com:alexgo-io/bitcoin-oracle.git`
02) Change to root Oracle directory
    `cd bitcoin-oracle/`
03) Register plugins for the version manager
    `awk '{ system("asdf plugin-add " $1) }' < .tool-versions`
04) Install tools with version manager
    `asdf install`
05) Install dependencies
    `pnpm install`
06) Create .envrc.override file with necessary environment variables:
```
    export OK_ACCESS_KEY=""
    export BIS_ACCESS_KEY=""
    export UNISAT_API_KEY=""
```
07) Allow the project files for the environment loader
    `direnv allow`
08) Create DEV docker network
    `docker network create brc20_oracle_network`
09) Start DEV environment:
    9.1) `dev` (OR `dev-database dev-vault dev-redis`)
    9.2) `dev-stacks reset` (start in another shell)
10) Start Apps (start in another shell):
    10.1) `nx serve api-server`
    10.2) `nx serve bitcoin-sync`
    10.3) `nx serve validator`
    10.4) `nx serve relayer`
    10.5) `nx serve indexer`


(reviewed)