Skip to content

Commit 2077903

Browse files
committed
resolve merge conflict
2 parents 9148111 + bc91354 commit 2077903

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+3354
-529
lines changed

.dockerignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
docker/devnet/data
2+
react/node_modules
3+
# filecoin-ffi installation
4+
build/.filecoin-install
5+
extern/filecoin-ffi/.install-filcrypto
6+
extern/filecoin-ffi/filcrypto.*
7+
extern/filecoin-ffi/libfilcrypto.a
8+
# local binaries
9+
boost*
10+
devnet

README.md

Lines changed: 246 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,79 +4,290 @@ Boost is a tool for Filecoin storage providers to manage data storage and retrie
44

55
See the docs at [https://boost.filecoin.io](https://boost.filecoin.io/getting-started) to get started.
66

7-
## For development:
7+
## Table of Contents
88

9+
- [Building and Installing Boost](#building-and-installing-boost)
10+
- [Running Boost for development](#running-boost-for-development)
11+
- [Running Boost devnet in Docker](#running-boost-devnet-in-docker)
12+
- [License](#license)
913

10-
1. Install using instructions in the building and installation section in [the docs](https://boost.filecoin.io/getting-started#building-and-installing).
14+
## Building and Installing Boost
1115

12-
2. Make sure you have a local Lotus fullnode and miner running and listening to `localhost:1234` and `localhost:2345` respectively, for example with a devnet:
16+
Compile and install using the instructions at the `Building and installing` section in [the docs](https://boost.filecoin.io/getting-started#building-and-installing).
1317

18+
## Running Boost for development
19+
20+
To run Boost on your development machine, you will need to set up a devnet:
21+
22+
1. Remove any existing Lotus and Boost repositories
1423
```
15-
devnet
24+
rm -rf ~/.lotusmarkets ~/.lotus ~/.lotusminer ~/.genesis_sectors
25+
rm -rf ~/.boost
1626
```
1727

18-
Note that currently `devnet` is using the default paths that `lotus` and `lotus-miner` use for their repositories, and you should make sure these directories are empty:
28+
2. Build Lotus in debug mode
1929

30+
The version of lotus needs to match the version in Boost's go.mod
2031
```
21-
LOTUS_PATH=~/.lotus
22-
LOTUS_MINER_PATH=~/.lotusminer
32+
cd lotus
33+
git checkout <tag>
34+
make debug
35+
```
36+
37+
3. Install Lotus
2338

24-
rm -rf ~/.lotus ~/.lotusminer
39+
The devnet script uses the installed `lotus` and `lotus-miner` binaries to run the miner and daemon.
40+
```
41+
make install
42+
install -C ./lotus-seed /usr/local/bin/lotus-seed
2543
```
2644

45+
4. Build Boost in debug mode
2746

28-
3. Create Boost repository
47+
Double check if environment variables are set:
48+
```
49+
export LIBRARY_PATH=/opt/homebrew/lib
50+
export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH"
51+
```
2952

53+
Build and install
3054
```
31-
export $(lotus auth api-info --perm=admin)
32-
export $(lotus-miner auth api-info --perm=admin)
55+
cd boost
56+
make debug
57+
make install
58+
```
59+
60+
5. Start the devnet
3361

34-
boostd --vv init \
35-
--api-sealer=`lotus-miner auth api-info --perm=admin` \
36-
--api-sector-index=`lotus-miner auth api-info --perm=admin` \
37-
--wallet-publish-storage-deals=`lotus wallet new bls` \
38-
--wallet-deal-collateral=`lotus wallet new bls` \
39-
--max-staging-deals-bytes=50000000000
62+
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.
63+
```
64+
cd boost
65+
./devnet
4066
```
4167

42-
4. Run the Boost daemon service
68+
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.
4369

70+
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`:
71+
```
72+
rm -rf ~/.lotusmarkets && rm -rf ~/.lotus && rm -rf ~/.lotusminer && rm -rf ~/.genesis_sectors
4473
```
45-
export $(lotus auth api-info --perm=admin)
4674

47-
boostd --vv run
75+
6. Wait for `lotus-miner` to come up (through the command above)
76+
77+
Unset these variables as they interfere with the `lotus-miner` command.
78+
```
79+
unset MINER_API_INFO
80+
unset FULLNODE_API_INFO
4881
```
4982

50-
5. Interact with Boost
83+
Then repeatedly run this command until it succeeds:
84+
```
85+
lotus-miner auth api-info --perm=admin
86+
```
5187

52-
Pass the client address (wallet) and the provider address to the `dummydeal` command.
53-
Note that
54-
- the client address is the address of a wallet with funds in `lotus wallet list`
55-
- you can find the provider address in `~/.boost/config.toml` under the config key `Wallets.Miner`
88+
7. Get the authentication tokens to connect to the lotus daemon and miner:
5689

5790
```
58-
boostd dummydeal <client address> <provider address>
91+
export ENV_MINER_API_INFO=`lotus-miner auth api-info --perm=admin`
92+
export ENV_FULLNODE_API_INFO=`lotus auth api-info --perm=admin`
93+
94+
export MINER_API_INFO=`echo $ENV_MINER_API_INFO | awk '{split($0,a,"="); print a[2]}'`
95+
export FULLNODE_API_INFO=`echo $ENV_FULLNODE_API_INFO | awk '{split($0,a,"="); print a[2]}'`
96+
97+
echo MINER_API_INFO=$MINER_API_INFO
98+
echo FULLNODE_API_INFO=$FULLNODE_API_INFO
5999
```
60100

61-
## Running the UI in Development Mode:
101+
8. Create the wallets needed for Boost
62102

63-
1. Run the server
103+
```
104+
export DEFAULT_WALLET=`lotus wallet list | tail -1 | awk '{print $1}'`
105+
export COLLAT_WALLET=`lotus wallet new bls`
106+
export PUBMSG_WALLET=`lotus wallet new bls`
107+
export CLIENT_WALLET=`lotus wallet new bls`
108+
```
109+
110+
9. Add funds to the wallets
64111

65112
```
66-
cd react
67-
npm install
68-
npm start
113+
lotus send --from $DEFAULT_WALLET $COLLAT_WALLET 10
114+
lotus send --from $DEFAULT_WALLET $PUBMSG_WALLET 10
115+
lotus send --from $DEFAULT_WALLET $CLIENT_WALLET 10
69116
```
70117

71-
2. Open UI
118+
Run this command repeatedly until each wallet you created has 10 FIL:
119+
```
120+
lotus wallet list
121+
```
122+
123+
This should take about 10 seconds.
124+
125+
10. Set the Publish Message Wallet as a control address on the miner
72126

73127
```
74-
http://localhost:3000
128+
lotus-miner actor control set --really-do-it $PUBMSG_WALLET
75129
```
76130

77-
## Running a devnet:
131+
11. Add funds into the Market Actor escrow for the client and Collateral wallets
132+
133+
```
134+
lotus wallet market add --from $DEFAULT_WALLET --address $CLIENT_WALLET 5
135+
lotus wallet market add --address $COLLAT_WALLET 5
136+
```
78137

79-
Follow the instructions in the [devnet guide](./documentation/devnet.md)
138+
12. Initialize Boost / Create Boost repository
139+
140+
```
141+
boostd -vv init \
142+
--api-sealer=$MINER_API_INFO \
143+
--api-sector-index=$MINER_API_INFO \
144+
--wallet-publish-storage-deals=$PUBMSG_WALLET \
145+
--wallet-deal-collateral=$COLLAT_WALLET \
146+
--max-staging-deals-bytes=2000000000
147+
```
148+
149+
13. Build the Web UI
150+
```
151+
make react
152+
```
153+
154+
14. Edit config to set a fixed listen address
155+
156+
Edit `~/.boost/config.toml`
157+
158+
Set the port in the `ListenAddresses` key to `50000`
159+
```
160+
[Libp2p]
161+
ListenAddresses = ["/ip4/0.0.0.0/tcp/50000", "/ip6/::/tcp/0"]
162+
```
163+
164+
15. Run Boost
165+
```
166+
boostd -vv run
167+
```
168+
169+
Note the peer ID of the boost instance:
170+
```
171+
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]}"}
172+
```
173+
In this example: `12D3KooWQNNWNiJ1mieEk9EHjDVF2qBc1FSjJGEzwjnMJzteApaW`
174+
175+
14. Set the peer ID and multi-address of the miner on chain
176+
```
177+
lotus-miner actor set-peer-id <peer id>
178+
lotus-miner actor set-addrs /ip4/127.0.0.1/tcp/50000
179+
```
180+
181+
16. Open the Web UI
182+
183+
Open http://localhost:8080 to see the Boost UI
184+
185+
### Make a deal with Boost
186+
187+
1. Initialize the Boost client
188+
```
189+
boost init
190+
```
191+
192+
This will output the address of the wallet (it's safe to run the init command repeatedly).
193+
194+
2. Send funds to the client wallet
195+
```
196+
lotus send --from=$DEFAULT_WALLET <client wallet> 10
197+
```
198+
199+
3. Follow the guide at https://boost.filecoin.io/tutorials/how-to-store-files-with-boost-on-filecoin
200+
201+
Note that above you already ran a command to export FULLNODE_API (and point it to your local devnet lotus daemon).
202+
203+
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.
204+
205+
## Running Boost devnet in Docker
206+
207+
### Building Docker images
208+
209+
1. Select Lotus version, for example: `lotus_version=1.17.1-rc2`. It must be the tag name of [the Lotus git repo](https://github.com/filecoin-project/lotus/tags) without `v` prefix.
210+
211+
2. Select Boost version, for example: `boost_version=1.3.0-rc1`.
212+
213+
3. Build images
214+
215+
```
216+
cd docker/devnet
217+
make build/all
218+
```
219+
220+
If you need to build a different version, edit the `.env` file.
221+
222+
### Start devnet docker stack
223+
224+
1. Run
225+
226+
```
227+
cd docker/devnet
228+
docker compose up -d
229+
```
230+
231+
It will spin up `lotus`, `lotus-miner`, `boost`, `booster-http` and `demo-http-server` containers. All temporary data will be saved in `./data` folder.
232+
233+
The initial setup could take up to 20 min or more as it needs to download Filecoin proof parameters. During the initial setup, it is normal to see error messages in the log. Containers are waiting for the lotus to be ready. It may timeout several times. Restart is expected to be managed by `docker`.
234+
235+
2. Try opening the Boost GUI http://localhost:8080 . Devnet is ready to operate when the URL opens and indicates no errors on the startup page.
236+
237+
You can inspect the status using `docker compose logs -f`.
238+
239+
### Start monitoring docker stack
240+
241+
```
242+
docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions
243+
244+
cd docker/monitoring
245+
docker compose up -d
246+
```
247+
248+
### Connect monitoring stack to devnet stack
249+
250+
```
251+
docker network connect devnet tempo
252+
```
253+
254+
### Explore Grafana / Tempo and search for traces
255+
256+
http://localhost:3333
257+
258+
### Making a deal
259+
260+
The `boost` container is packed with `boost` and `lotus` clients. You can connect to the container with the command `docker compose exec boost /bin/bash` and follow instructions for [storing files with Boost guide](https://boost.filecoin.io/tutorials/how-to-store-files-with-boost-on-filecoin). But the recommended startup is to follow the semi-interactive demo first:
261+
262+
```
263+
# Attach to a running boost container
264+
docker compose exec boost /bin/bash
265+
266+
# Execute the demo script /app/sample/make-a-deal.sh
267+
root@83260455bbd2:/app# ./sample/make-a-deal.sh
268+
```
269+
270+
### Accessing Lotus from localhost
271+
272+
By default the [docker-compose.yaml](./docker-compose.yaml) does not expose any port of the `lotus` container. To access the `lotus` from a local machine:
273+
1. You can either expose `1234` in [docker-compose.yaml](./docker-compose.yaml) or find the IP of the `lotus` container using `docker inspect lotus | grep IPAddress` command.
274+
2. Get the `FULLNODE_API_INFO`
275+
```
276+
docker exec -it lotus lotus auth api-info --perm=admin
277+
FULLNODE_API_INFO=eyJ...ms4:/dns/lotus/tcp/1234/http
278+
```
279+
3. Change the `dns/lotus/tcp/1234/http` to `ip4/<127.0.0.1 or container's IP>/tcp/1234/http` for the use in `FULLNODE_API_INFO`.
280+
281+
### Cleaning up
282+
283+
To stop containers and drop everything:
284+
```
285+
docker compose down --rmi local
286+
287+
rm -rf ./data
288+
289+
rm -rf /var/tmp/filecoin-proof-parameters
290+
```
80291

81292
## License
82293

build/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package build
22

33
var CurrentCommit string
44

5-
const BuildVersion = "1.4.0-rc1"
5+
const BuildVersion = "1.4.0-rc2"
66

77
func UserVersion() string {
88
return BuildVersion + CurrentCommit

0 commit comments

Comments
 (0)