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