mirror of
https://github.com/onsonr/sonr.git
synced 2025-03-10 13:07:09 +00:00
feat: optimize IPFS configuration for better performance
This commit is contained in:
parent
08035b6f85
commit
da199b0d76
@ -3,9 +3,16 @@
|
||||
# Exit immediately if a command exits with a non-zero status.
|
||||
set -e
|
||||
|
||||
# Initialize IPFS
|
||||
# check if ~/.ipfs exists, if not create it
|
||||
if [ ! -d ~/.ipfs ]; then
|
||||
ipfs init
|
||||
setup_ipfs
|
||||
start_ipfs
|
||||
else
|
||||
start_ipfs
|
||||
fi
|
||||
|
||||
function setup_ipfs() {
|
||||
# Optimize local discovery and connectivity
|
||||
ipfs config --json Discovery.MDNS.Enabled true
|
||||
ipfs config --json Routing.Type "dhtclient"
|
||||
@ -35,6 +42,9 @@ ipfs config Addresses.Gateway /ip4/127.0.0.1/tcp/8080
|
||||
# Enable experimental features
|
||||
ipfs config --json Experimental.FilestoreEnabled true
|
||||
ipfs config --json Experimental.UrlstoreEnabled true
|
||||
}
|
||||
|
||||
function start_ipfs() {
|
||||
# Start the IPFS daemon with additional options for better performance and compatibility
|
||||
ipfs daemon --enable-gc --migrate --enable-pubsub-experiment --enable-namesys-pubsub
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user