You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are 2 ways of getting an executable version of filecoin node or miner. The First is to get executables by [downloading](https://github.com/filecoin-project/cpp-filecoin/releases"cpp-filecoin releases"). The second is to build executables by yourself, see **Advanced building**. To begin running a node you will need `node` executable.
* **genesis file** - this is a special pre-set file with the initial block, which will configure the initial state of your node, sets network parameters like sector size, recalls time, e.t.c and defines miner-list with the first network miner.
66
-
67
-
you also can download that [snapshots](https://fil-chain-snapshots-fallback.s3.amazonaws.com/mainnet/minimal_finality_stateroots_latest.car "snapshots store") for a less time-assuming connection and synchronization to the popular filecoin networks.
68
-
More about snapshot management [here](https://docs.filecoin.io/get-started/lotus/chain/#restoring-a-custom-snapshot "snapshot documentation").
69
-
2. After all the preparations you can launch a node:
70
-
* link working directory, which will be a storage for all node-associated files. It can be done with `--repo` flag
71
-
* One more important linking is configuration and genesis files, you can pass paths to them with `--config CONFIG_FILE` and `--genesis GENESIS_FILE` respectively.
72
-
* For specifying peers listening port you need to pass `--port PORT` flag
73
-
* In case you want to specify api port for a node + miner configuration or multi-node configuration, you can do that with `--api API_PORT`
74
-
* Example of the command: `node_exec --repo path_to_node_repo --genesis genesis.car --config config.cfg --port 8080 --api 1235`
2. build lotus cli client with command: `make build`
85
-
3. In case you want to connect to interopnet, build lotus with `make interopnet`
86
-
## Work with Lotus-CLI
87
-
88
-
1. For proper miner work you will need a bls wallet, which can be made with lotus-cli by using the following command: `$lotus --repo REPO wallet new bls`, after the execution of this command you will revive the public address of your new account, and a private key in `<repo of your working node>/keystore`.
89
-
2. Also, you may need to put some Filecoins on your account from other addresses you may have, and you can do it with `lotus --repo REPO send --from SENDER_ADDRESS DISTANATION_ADDRESS`
90
-
91
-
3. In case you want to get some Filecoins, you can buy them on stocks with the usage of your public address.
92
-
93
-
4. Other advanced commands you may find in [filecoin-docs about lotus CLI](https://docs.filecoin.io/get-started/lotus/installation/#interact-with-the-daemon "lotus CLI documentation").
94
-
## Fuhon miner establishing
95
-
To start mining at first you need to configure and run Fuhon or Lotus node. Before all make sure that your node had successfully **connected** and updated to the current **block height** (actual network block number). Also, your node's api port should be opened for connection.
96
-
97
-
To provide wallet functions and oracle information be sure to run lotus-cli at first. You can find how to do it in **Lotus-CLI establishing**.
98
-
99
-
Once all the needed modules will be started, you can continue with the miner configuration.
100
-
101
-
1. Create miner work directory (f.e. `$mkdir miner`)
102
-
2. Download [miner executable](https://github.com/filecoin-project/cpp-filecoin/releases "executables releases") and put it in work directory
103
-
3.Copy proof parameters json file with command: `cp /<path to cpp-filecoin>/core/proofs/parameters.json MINER_REPO/proof-params.json`
104
-
4. Run your miner with ` --repo REPO --miner-repo MINER_REPO --owner PUBLIC_ADRESS --miner-api MINER_API_PORT --sector-size SECTOR_SIZE`
24
+
Target C++ compilers are:
25
+
* GCC 9.3.0
26
+
* Clang 9.0.1
27
+
* AppleClang 12.0.0
28
+
29
+
### Lotus CLI
30
+
`fuhon-node` supports subset of `lotus` CLI commands.
31
+
You may download [pre-built binaries](https://github.com/filecoin-project/lotus/releases) or build [lotus](https://github.com/filecoin-project/lotus) from source.
To generate GitHub token follow the [instructions](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). Make sure `read:packages` and `write:packages` permissions are granted.
122
68
123
-
5. At this stage you will need a build directory, which can be created with `mkdir BUILD_REPO`
124
-
125
-
6. Build cmake with the following command: `cmake . -B BUILD_DIR`
1. To start up a lotus node at first you need to get a [lotus executable](https://github.com/filecoin-project/lotus/releases/ "lotus releases")
140
-
2. You can run your lotus node with the next command: `$lotus --repo REPO daemon --genesis genesis.car --profile bootstrapper`, more about running lotus software can be found in [filecoin-docs](https://docs.filecoin.io/get-started/lotus/installation "lotus filecoin documentation").
141
-
3. Fuhon-miner establishing is described in **Fuhon miner establishing**
142
-
### Fuhon-node and Lotus-miner
143
-
1. Establishing a Fuhon node is described in **Fuhon node establishing**
144
-
2. Lotus miner can be established in the following way:
145
-
- to begin with you need your own bls wallet(described in **Working with Lotus-CLI**)
146
-
- init your miner with the command: `lotus-miner --repo REPO --miner-repo MINER_REPO init --nosync --owner BLS_WALLET_ADDR --sector-size SECTOR_SIZE`
147
-
- to know more about lotus software establishing, read [filecoin-docs](https://docs.filecoin.io/get-started/lotus/installation/#minimal-requirements "lotus establishing guide")
89
+
Create following `fuhon-mainnet/config.cfg` file
90
+
```properties
91
+
# use downloaded snapshot file (do not delete that file)
92
+
use-snapshot=mainnet-snapshot.car
148
93
149
-
## Docker configuration
150
-
Will be soon!
94
+
# bootstrap peers from https://github.com/filecoin-project/lotus/blob/master/build/bootstrap/mainnet.pi
To run a new filecoin network, you should run at least one node, and a miner (miners are a representation of the network power, so the more miners connected and sealed, the more power your network will have). In this guide, we will consider a network of two nodes and two miners(genesis and common ones)
103
+
### Docker-compose example
155
104
156
-
1. To run the first node you will need to generate a new genesis file which will be an initial instruction for all new connected nodes.
- build lotus-seed with `$make lotus-seed` or `make debug` - for debug version initiation,
161
-
or `make 2k` for a version with 2 KiB sector size or `make interopnet` for interopnet version.
109
+
## CodeStyle
162
110
163
-
- Generate genesis and preseal. Ensure lotus-seed was built in the previous step and run script node `$genesis.js DIR 1` to generate genesis. `DIR` - directory where genesis and presealed sectors will be generated, 1 - number of sectors for a miner. In case your lotus executables lay in a custom directory or script can not find them, you can link lotus target with `LOTUS=/<path to your lotus executable>/lotus node genesis.js <directory where results will be> <sealing sectors upper bound>`
111
+
We follow [CppCoreGuidelines](https://github.com/isocpp/CppCoreGuidelines).
164
112
165
-
2. Run your node-1 with new genesis file as it was done in chapter **Fuhon node establishing**
113
+
Please use clang-format 11.0.0 with provided [.clang-format](.clang-format) file to autoformat the code.
166
114
167
-
3. Run your node-2 as the 1st one, but be sure to open api port on it with `--api API_PORT`
115
+
## Maintenance
168
116
169
-
4. Connect node-2 to node-1 by commands:
170
-
`addr=$(lotus --repo REPO1 net listen | grep 127.0.0.1)`
5. After generating a new genesis file, you will also receive genesis.json with declared miners list, these are addresses of the initial miners.
119
+
Tickets: Can be opened in GitHub Issues.
174
120
175
-
6. To start miner that is declared in genesis file (step 5) you can use chapter **Fuhon miner establishing** but with some major changes.
176
-
You will also need the following flags to be provided: `--genesis-miner`, `--actor ACTOR`, `--pre-sealed-sectors PRESEAL_DIR`, `--pre-sealed-metadata PRESEAL_JSON`.
121
+
## Hunter cache upload
177
122
178
-
7. To start a new miner just follow the steps declared in **Fuhon miner establishing**, or you can run lotus miner using [filecoin-docs](https://docs.filecoin.io/get-started/lotus/installation/#minimal-requirements "lotus establishing guide")
179
-
8. After two nodes will be connected and your miner will work, a new filecoin network starting to exist, since that moment you can share your peers to invite new participants.
123
+
If you have access and want to upload to [hunter-binary-cache](https://github.com/soramitsu/hunter-binary-cache), you need to add your GitHub token with `read:packages` and `write:packages` permissions.
124
+
To generate GitHub token follow the [instructions](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line).
0 commit comments