mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-27 07:57:30 +08:00
init: lowpower profile
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
This commit is contained in:
@ -39,6 +39,8 @@ Available profiles:
|
|||||||
running IPFS on machines with public IPv4 addresses.
|
running IPFS on machines with public IPv4 addresses.
|
||||||
'test' - Reduces external interference of IPFS daemon, this
|
'test' - Reduces external interference of IPFS daemon, this
|
||||||
is useful when using the daemon in test environments.
|
is useful when using the daemon in test environments.
|
||||||
|
'lowpower' - Reduces daemon overhead on the system. May affect node
|
||||||
|
functionality.
|
||||||
|
|
||||||
ipfs uses a repository in the local file system. By default, the repo is
|
ipfs uses a repository in the local file system. By default, the repo is
|
||||||
located at ~/.ipfs. To change the repo location, set the $IPFS_PATH
|
located at ~/.ipfs. To change the repo location, set the $IPFS_PATH
|
||||||
|
@ -73,6 +73,11 @@ var Profiles = map[string]Transformer{
|
|||||||
c.Datastore.Spec = DefaultDatastoreConfig().Spec
|
c.Datastore.Spec = DefaultDatastoreConfig().Spec
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
|
"lowpower": func(c *Config) error {
|
||||||
|
c.Discovery.Routing = "dhtclient"
|
||||||
|
c.Reprovider.Interval = "0"
|
||||||
|
return nil
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
func appendSingle(a []string, b []string) []string {
|
func appendSingle(a []string, b []string) []string {
|
||||||
|
@ -167,6 +167,20 @@ test_expect_success "clean up ipfs dir" '
|
|||||||
rm -rf "$IPFS_PATH"
|
rm -rf "$IPFS_PATH"
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success "'ipfs init --profile=lowpower' succeeds" '
|
||||||
|
BITS="1024" &&
|
||||||
|
ipfs init --bits="$BITS" --profile=lowpower
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success "'ipfs config Discovery.Routing' looks good" '
|
||||||
|
ipfs config Discovery.Routing > actual_config &&
|
||||||
|
test $(cat actual_config) = "dhtclient"
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success "clean up ipfs dir" '
|
||||||
|
rm -rf "$IPFS_PATH"
|
||||||
|
'
|
||||||
|
|
||||||
test_init_ipfs
|
test_init_ipfs
|
||||||
|
|
||||||
test_launch_ipfs_daemon
|
test_launch_ipfs_daemon
|
||||||
|
@ -45,7 +45,8 @@ CONFIG_SET_JSON_TEST='{
|
|||||||
"MDNS": {
|
"MDNS": {
|
||||||
"Enabled": true,
|
"Enabled": true,
|
||||||
"Interval": 10
|
"Interval": 10
|
||||||
}
|
},
|
||||||
|
"Routing": "dht"
|
||||||
}'
|
}'
|
||||||
|
|
||||||
test_profile_apply_revert() {
|
test_profile_apply_revert() {
|
||||||
|
Reference in New Issue
Block a user