mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-15 04:24:01 +01:00
Update start-ipfs-server.ps1
This commit is contained in:
parent
2e35a91d8c
commit
f1161e05c7
@ -1,8 +1,8 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Starts a local IPFS server as a daemon process
|
||||
Start an IPFS server
|
||||
.DESCRIPTION
|
||||
This script starts a local IPFS server as a daemon process.
|
||||
This PowerShell script starts a local IPFS server as a daemon process.
|
||||
.EXAMPLE
|
||||
PS> ./start-ipfs-server
|
||||
.NOTES
|
||||
@ -15,14 +15,15 @@ try {
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
""
|
||||
"👉 Step 1/5: Searching for IPFS executable..."
|
||||
" ($Step/$NumFolders) Pulling 📂$FolderName... "
|
||||
"⏳ (1/5) Searching for IPFS executable..."
|
||||
& ipfs --version
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'ipfs' - make sure IPFS is installed and available" }
|
||||
""
|
||||
"👉 Step 2/5: Initializing IPFS with server profile..."
|
||||
"⏳ (2/5) Initializing IPFS with server profile..."
|
||||
& ipfs init --profile server
|
||||
|
||||
"👉 Step 3/5: Configuring IPFS..."
|
||||
"⏳ (3/5) Configuring IPFS..."
|
||||
& ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001
|
||||
if ($lastExitCode -ne "0") { throw "'ipfs config Addresses.API' failed" }
|
||||
|
||||
@ -36,11 +37,11 @@ try {
|
||||
& ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '[\"PUT\", \"POST\"]'
|
||||
if ($lastExitCode -ne "0") { throw "'ipfs config Access-Control-Allow-Methods' failed" }
|
||||
""
|
||||
"👉 Step 4/5: Increasing UDP receive buffer size..."
|
||||
"⏳ (4/5) Increasing UDP receive buffer size..."
|
||||
& sudo sysctl -w net.core.rmem_max=2500000
|
||||
if ($lastExitCode -ne "0") { throw "'sysctl' failed" }
|
||||
""
|
||||
"👉 Step 5/5: Starting IPFS daemon..."
|
||||
"⏳ (5/5) Starting IPFS daemon..."
|
||||
# Start-Process nohup 'ipfs daemon'
|
||||
Start-Process nohup -ArgumentList 'ipfs','daemon' -RedirectStandardOutput "$HOME/console.out" -RedirectStandardError "$HOME/console.err"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user