Skip to content

Commit

Permalink
update README.md (#1576)
Browse files Browse the repository at this point in the history
  • Loading branch information
nonsense authored Jul 19, 2023
1 parent b566d2e commit e4ff69d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 189 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ docsgen-openrpc-boost: docsgen-openrpc-bin

## DOCKER IMAGES
docker_user?=filecoin
lotus_version?=v1.23.0-rc1
lotus_version?=v1.23.2
ffi_from_source?=0
build_lotus?=0
ifeq ($(build_lotus),1)
Expand Down
190 changes: 2 additions & 188 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,194 +15,8 @@ See the docs at [https://boost.filecoin.io](https://boost.filecoin.io/getting-st

Compile and install using the instructions at the `Building and installing` section in [the docs](https://boost.filecoin.io/getting-started#building-and-installing).

## Running Boost for development
## Running Boost devnet in Docker for development

To run Boost on your development machine, you will need to set up a devnet:

1. Remove any existing Lotus and Boost repositories
```
rm -rf ~/.lotusmarkets ~/.lotus ~/.lotusminer ~/.genesis_sectors
rm -rf ~/.boost
```

2. Build Lotus in debug mode

The version of lotus needs to match the version in Boost's go.mod
```
cd lotus
git checkout <tag>
make debug
```

3. Install Lotus

The devnet script uses the installed `lotus` and `lotus-miner` binaries to run the miner and daemon.
```
make install
install -C ./lotus-seed /usr/local/bin/lotus-seed
```

4. Build Boost in debug mode

Double check if environment variables are set:
```
export LIBRARY_PATH=/opt/homebrew/lib
export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH"
```

Build and install
```
cd boost
make debug
make install
```

5. Start the devnet

The following command will use the binaries that you built and installed above, and will run `lotus`, `lotus-miner` and `lotus-seed`. The `lotus` version must match the version in Boost's go.mod.
```
cd boost
./devnet
```

The first time you run it, it will download the Filecoin proof parameters. It will take at least 10 minutes depending on your connection speed. You may need to restart the command multiple times as your terminal will probably timeout before it finishes downloading everything.

The devnet isn't designed to be restartable. After it has been successfully run once, you'll have to clear out the previous data before re-running `./devnet`:
```
rm -rf ~/.lotusmarkets && rm -rf ~/.lotus && rm -rf ~/.lotusminer && rm -rf ~/.genesis_sectors
```

6. Wait for `lotus-miner` to come up (through the command above)

Unset these variables as they interfere with the `lotus-miner` command.
```
unset MINER_API_INFO
unset FULLNODE_API_INFO
```

Then repeatedly run this command until it succeeds:
```
lotus-miner auth api-info --perm=admin
```

7. Get the authentication tokens to connect to the lotus daemon and miner:

```
export ENV_MINER_API_INFO=`lotus-miner auth api-info --perm=admin`
export ENV_FULLNODE_API_INFO=`lotus auth api-info --perm=admin`
export MINER_API_INFO=`echo $ENV_MINER_API_INFO | awk '{split($0,a,"="); print a[2]}'`
export FULLNODE_API_INFO=`echo $ENV_FULLNODE_API_INFO | awk '{split($0,a,"="); print a[2]}'`
echo MINER_API_INFO=$MINER_API_INFO
echo FULLNODE_API_INFO=$FULLNODE_API_INFO
```

8. Create the wallets needed for Boost

```
export DEFAULT_WALLET=`lotus wallet list | tail -1 | awk '{print $1}'`
export COLLAT_WALLET=`lotus wallet new bls`
export PUBMSG_WALLET=`lotus wallet new bls`
export CLIENT_WALLET=`lotus wallet new bls`
```

9. Add funds to the wallets

```
lotus send --from $DEFAULT_WALLET $COLLAT_WALLET 10
lotus send --from $DEFAULT_WALLET $PUBMSG_WALLET 10
lotus send --from $DEFAULT_WALLET $CLIENT_WALLET 10
```

Run this command repeatedly until each wallet you created has 10 FIL:
```
lotus wallet list
```

This should take about 10 seconds.

10. Set the Publish Message Wallet as a control address on the miner

```
lotus-miner actor control set --really-do-it $PUBMSG_WALLET
```

11. Add funds into the Market Actor escrow for the client and Collateral wallets

```
lotus wallet market add --from $DEFAULT_WALLET --address $CLIENT_WALLET 5
lotus wallet market add --address $COLLAT_WALLET 5
```

12. Initialize Boost / Create Boost repository

```
boostd -vv init \
--api-sealer=$MINER_API_INFO \
--api-sector-index=$MINER_API_INFO \
--wallet-publish-storage-deals=$PUBMSG_WALLET \
--wallet-deal-collateral=$COLLAT_WALLET \
--max-staging-deals-bytes=2000000000
```

13. Build the Web UI
```
make react
```

14. Edit config to set a fixed listen address

Edit `~/.boost/config.toml`

Set the port in the `ListenAddresses` key to `50000`
```
[Libp2p]
ListenAddresses = ["/ip4/0.0.0.0/tcp/50000", "/ip6/::/tcp/0"]
```

15. Run Boost
```
boostd -vv run
```

Note the peer ID of the boost instance:
```
2022-06-10T09:32:28.819Z INFO boostd boostd/run.go:114 Boost libp2p node listening {"maddr": "{12D3KooWQNNWNiJ1mieEk9EHjDVF2qBc1FSjJGEzwjnMJzteApaW: [/ip4/172.17.0.2/tcp/50000 /ip4/127.0.0.1/tcp/50000]}"}
```
In this example: `12D3KooWQNNWNiJ1mieEk9EHjDVF2qBc1FSjJGEzwjnMJzteApaW`

14. Set the peer ID and multi-address of the miner on chain
```
lotus-miner actor set-peer-id <peer id>
lotus-miner actor set-addrs /ip4/127.0.0.1/tcp/50000
```

16. Open the Web UI

Open http://localhost:8080 to see the Boost UI

### Make a deal with Boost

1. Initialize the Boost client
```
boost init
```

This will output the address of the wallet (it's safe to run the init command repeatedly).

2. Send funds to the client wallet
```
lotus send --from=$DEFAULT_WALLET <client wallet> 10
```

3. Follow the guide at https://boost.filecoin.io/tutorials/how-to-store-files-with-boost-on-filecoin

Note that above you already ran a command to export FULLNODE_API (and point it to your local devnet lotus daemon).

Note also that the provider address is `t01000` and you will need to supply an appropriate `--storage-price` when using `boost deal` since the devnet has a minimum price. Alternatively, using "Settings" in the Boost web UI to set the deal price to zero.

## Running Boost devnet in Docker
### Prerequisites
* Install Docker - https://docs.docker.com/get-docker/

Expand All @@ -221,7 +35,7 @@ make clean docker/all ffi_from_source=1 build_lotus=1

If you need to build containers using a specific version of lotus then provide the version as a parameter, e.g. `make clean docker/all lotus_version=v1.20.0-rc2 build_lotus=1`. The version must be a tag or a remote branch name of [Lotus git repo](https://github.com/filecoin-project/lotus).

### Start devnet docker stack
### Start devnet Docker stack

1. Run

Expand Down
4 changes: 4 additions & 0 deletions docker/monitoring/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
- ./tempo-data:/tmp/tempo
ports:
- "14268:14268" # jaeger ingest
restart: unless-stopped
logging:
driver: loki
options:
Expand All @@ -31,6 +32,7 @@ services:
- JAEGER_ENDPOINT=http://tempo:14268/api/traces # send traces to Tempo
- JAEGER_SAMPLER_TYPE=const
- JAEGER_SAMPLER_PARAM=1
restart: unless-stopped
logging:
driver: loki
options:
Expand All @@ -42,6 +44,7 @@ services:
command: [ "--config.file=/etc/prometheus.yaml" ]
volumes:
- ./${PROMETHEUS_CONFIG_FILE:-prometheus.yaml}:/etc/prometheus.yaml
restart: unless-stopped
ports:
- "9190:9090"
## Uncomment and modify this section depending on your Filecoin deployment.
Expand Down Expand Up @@ -76,6 +79,7 @@ services:
GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH: "/var/lib/grafana/dashboards/exported_dashboard.json"
ports:
- "3333:3000"
restart: unless-stopped
logging:
driver: loki
options:
Expand Down

0 comments on commit e4ff69d

Please sign in to comment.