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