Node
public class Node
Node is a class that wraps a golang node
object
Should not be used on its own
-
Closes this node instance
Throws
NodeError
: If the closing of the node failedDeclaration
Swift
public func close() throws
-
Serves node API over UDS
Throws
NodeError
: If the node failed to serveDeclaration
Swift
public func serveAPI(onUDS: String) throws
Parameters
onUDS
The UDS path to serve on
-
Serves node API over TCP
Throws
NodeError
: If the node failed to serveDeclaration
Swift
public func serveAPI(onTCPPort: String) throws -> String
Parameters
onTCPPort
The TCP port to serve on
Return Value
The TCP/IP MultiAddr the node is serving on
-
Serves node Gateway over the given Multiaddr
Throws
NodeError
: If the node failed to serveDeclaration
Swift
public func serveGateway(onMultiaddr: String, writable: Bool = false) throws -> String
Parameters
onMultiaddr
The multiaddr to serve on
writable
If true: will also support support
POST
,PUT
, andDELETE
methods. -
Serves any multiaddr (api & gateway) inside
Addresses.Api
andAddresses.Gateway
in the config (if any)Throws
NodeError
: If the node failed to serveDeclaration
Swift
public func serve() throws
Return Value
The TCP/IP MultiAddr the node is serving on