Skip to content

Commit

Permalink
Fix how setup runs ipfs init (#519)
Browse files Browse the repository at this point in the history
* fix ipfs init

* bump version
  • Loading branch information
walkah authored May 21, 2021
1 parent 54541ec commit aa0781e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 24 deletions.
26 changes: 10 additions & 16 deletions fission-cli/library/Fission/CLI/IPFS/Configure.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,24 @@ module Fission.CLI.IPFS.Configure
, enableRelay
) where

import qualified RIO.ByteString.Lazy as Lazy
import qualified RIO.ByteString.Lazy as Lazy

import Network.IPFS.Local.Class as IPFS
import qualified Network.IPFS.Process.Error as IPFS
import qualified Network.IPFS.Types as IPFS
import Network.IPFS.Local.Class as IPFS
import qualified Network.IPFS.Process.Error as IPFS

import Turtle

import Fission.Prelude

import Fission.CLI.Environment hiding (init)
import Fission.CLI.Environment.Path

init :: (MonadIO m, MonadEnvironment m) => m ExitCode
init ::
( MonadLocalIPFS m
, MonadRaise m
, m `Raises` IPFS.Error
)
=> m IPFS.RawMessage
init = do
IPFS.BinPath ipfsPath <- globalIPFSBin
ipfsRepo <- globalIPFSRepo
-- Needs to be run manually because it's a prerequesite for the daemon
runProcess . fromString $ intercalate " "
[ "IPFS_PATH=" <> ipfsRepo
, ipfsPath
, "init"
, "&> /dev/null"
]
ensureM $ IPFS.runLocal ["init"] ""

setBootstrap :: forall m . MonadLocalIPFS m => m (Either IPFS.Error ())
setBootstrap =
Expand Down
14 changes: 7 additions & 7 deletions fission-cli/library/Fission/CLI/IPFS/Executable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Fission.CLI.IPFS.Executable
import qualified RIO.ByteString.Lazy as Lazy
import qualified RIO.Text as Text

import qualified Turtle as Turtle
import qualified Turtle

import Network.IPFS
import qualified Network.IPFS.File.Types as File
Expand Down Expand Up @@ -70,10 +70,10 @@ place' host = do

logUser @Text "🎛️ Configuring managed IPFS"

IPFS.Config.init
void $ IPFS.Config.enableRelay
void IPFS.Config.init
void IPFS.Config.enableRelay

void $ IPFS.Config.setApiAddress
void $ IPFS.Config.setBootstrap
void $ IPFS.Config.setGatewayAddress
void $ IPFS.Config.setSwarmAddresses
void IPFS.Config.setApiAddress
void IPFS.Config.setBootstrap
void IPFS.Config.setGatewayAddress
void IPFS.Config.setSwarmAddresses
2 changes: 1 addition & 1 deletion fission-cli/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: fission-cli
version: '2.14.0.0'
version: '2.14.1.0'
category: CLI
author:
- Brooklyn Zelenka
Expand Down

0 comments on commit aa0781e

Please sign in to comment.