File tree 5 files changed +24
-2
lines changed
5 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ Available profiles:
36
36
running IPFS on machines with public IPv4 addresses.
37
37
'test' - Reduces external interference of IPFS daemon, this
38
38
is useful when using the daemon in test environments.
39
+ 'lowpower' - Reduces daemon overhead on the system. May affect node
40
+ functionality.
39
41
40
42
ipfs uses a repository in the local file system. By default, the repo is
41
43
located at ~/.ipfs. To change the repo location, set the $IPFS_PATH
Original file line number Diff line number Diff line change 1
1
package config
2
2
3
3
type Discovery struct {
4
- MDNS MDNS
4
+ MDNS MDNS
5
5
6
6
//Routing sets default daemon routing mode.
7
7
Routing string
Original file line number Diff line number Diff line change @@ -41,4 +41,9 @@ var ConfigProfiles = map[string]func(*Config) error{
41
41
c .Discovery .MDNS .Enabled = false
42
42
return nil
43
43
},
44
+ "lowpower" : func (c * Config ) error {
45
+ c .Discovery .Routing = "dhtclient"
46
+ c .Reprovider .Interval = "0"
47
+ return nil
48
+ },
44
49
}
Original file line number Diff line number Diff line change @@ -167,6 +167,20 @@ test_expect_success "clean up ipfs dir" '
167
167
rm -rf "$IPFS_PATH"
168
168
'
169
169
170
+ test_expect_success " 'ipfs init --profile=lowpower' succeeds" '
171
+ BITS="1024" &&
172
+ ipfs init --bits="$BITS" --profile=lowpower
173
+ '
174
+
175
+ test_expect_success " 'ipfs config Discovery.Routing' looks good" '
176
+ ipfs config Discovery.Routing > actual_config &&
177
+ test $(cat actual_config) = "dhtclient"
178
+ '
179
+
180
+ test_expect_success " clean up ipfs dir" '
181
+ rm -rf "$IPFS_PATH"
182
+ '
183
+
170
184
test_init_ipfs
171
185
172
186
test_launch_ipfs_daemon
Original file line number Diff line number Diff line change @@ -45,7 +45,8 @@ CONFIG_SET_JSON_TEST='{
45
45
"MDNS": {
46
46
"Enabled": true,
47
47
"Interval": 10
48
- }
48
+ },
49
+ "Routing": "dht"
49
50
}'
50
51
51
52
test_config_cmd () {
You can’t perform that action at this time.
0 commit comments