2020-11-08 21:23:19 -05:00
|
|
|
# development
|
|
|
|
|
|
2021-09-02 14:01:13 -07:00
|
|
|
### Run in development mode:
|
2020-11-08 21:23:19 -05:00
|
|
|
|
2021-09-02 14:01:13 -07:00
|
|
|
#### Background services
|
2020-11-08 21:23:19 -05:00
|
|
|
|
2021-09-02 14:01:13 -07:00
|
|
|
- Start the required background services in docker:
|
|
|
|
|
```
|
2021-11-04 23:33:00 -07:00
|
|
|
cd docker
|
|
|
|
|
docker-compose build
|
|
|
|
|
docker-compose up
|
2021-09-02 14:01:13 -07:00
|
|
|
```
|
2021-10-04 15:12:45 -07:00
|
|
|
|
|
|
|
|
This will start the following services in containers:
|
|
|
|
|
* bitcoin-core
|
|
|
|
|
* lnd (for the containerized squeaknode)
|
|
|
|
|
* lnd (for the host squeaknode) with ~/.lnd directory mounted.
|
2021-10-04 18:33:16 -07:00
|
|
|
* a tor service
|
2021-10-04 15:12:45 -07:00
|
|
|
* a tor socks proxy
|
2021-10-04 19:24:51 -07:00
|
|
|
* a squeaknode (useful for testing p2p connections from your host machine)
|
2021-10-04 15:12:45 -07:00
|
|
|
|
|
|
|
|
You can go to http://localhost:12995/ to see the containerized squeaknode.
|
|
|
|
|
|
2021-09-02 14:01:13 -07:00
|
|
|
#### Squeaknode backend
|
|
|
|
|
|
2021-10-04 19:24:51 -07:00
|
|
|
You can also run your own squeaknode on your host machine.
|
|
|
|
|
|
2021-09-02 14:01:13 -07:00
|
|
|
- Install squeaknode:
|
2020-11-08 21:23:19 -05:00
|
|
|
```
|
2021-12-29 18:48:53 -08:00
|
|
|
python3 -m venv venv
|
2021-11-04 23:33:00 -07:00
|
|
|
source venv/bin/activate
|
|
|
|
|
pip install .
|
2021-09-02 14:01:13 -07:00
|
|
|
```
|
2021-10-04 19:18:45 -07:00
|
|
|
|
2022-06-09 17:58:18 -07:00
|
|
|
- Copy the `~/.lnd` directory from the docker container to your host machine.
|
2021-10-04 19:18:45 -07:00
|
|
|
```
|
2022-06-09 17:58:18 -07:00
|
|
|
docker cp lnd_client:/root/.lnd/ ~/.lnd
|
2021-10-04 19:18:45 -07:00
|
|
|
```
|
|
|
|
|
|
2021-09-02 14:01:13 -07:00
|
|
|
- Run squeaknode with authentication disabled:
|
|
|
|
|
```
|
2021-11-04 23:33:00 -07:00
|
|
|
SQUEAKNODE_WEBADMIN_ENABLED=TRUE \
|
2021-10-04 19:18:45 -07:00
|
|
|
SQUEAKNODE_WEBADMIN_LOGIN_DISABLED=TRUE \
|
|
|
|
|
SQUEAKNODE_WEBADMIN_ALLOW_CORS=TRUE \
|
|
|
|
|
SQUEAKNODE_NETWORK=testnet \
|
|
|
|
|
squeaknode --config config.ini
|
2021-09-02 14:01:13 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
#### Squeaknode frontend
|
|
|
|
|
|
2021-09-22 15:20:06 -07:00
|
|
|
- Install `protoc-gen-grpc-web` (https://github.com/grpc/grpc-web#code-generator-plugin)
|
2021-09-02 14:01:13 -07:00
|
|
|
- Run the frontend react app in dev mode:
|
|
|
|
|
```
|
2021-11-04 23:33:00 -07:00
|
|
|
cd frontend
|
|
|
|
|
make rundev
|
2020-11-08 21:23:19 -05:00
|
|
|
```
|
2022-04-12 05:38:32 -04:00
|
|
|
- Lint the frontend code:
|
|
|
|
|
```
|
|
|
|
|
node_modules/.bin/eslint .
|
|
|
|
|
```
|
|
|
|
|
or
|
|
|
|
|
```
|
|
|
|
|
node_modules/.bin/eslint . --fix
|
|
|
|
|
```
|
2021-10-04 15:12:45 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#### Connect to the containerized squeaknode
|
|
|
|
|
|
|
|
|
|
- To open a p2p connection from your host squeaknode to the containerized
|
|
|
|
|
squeaknode, use `localhost` as host and `18557` as port.
|