mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-04 10:21:40 +00:00
(no commit message provided)
This commit is contained in:
Vendored
+37
@@ -0,0 +1,37 @@
|
||||
package env
|
||||
|
||||
import (
|
||||
"github.com/ipfs/kubo/client/rpc"
|
||||
)
|
||||
|
||||
var (
|
||||
ChainID = "testnet"
|
||||
ValAddr = "val1"
|
||||
NodeDir = ".sonr"
|
||||
)
|
||||
|
||||
// Initialize initializes the local configuration values
|
||||
func init() {
|
||||
}
|
||||
|
||||
// SetLocalContextSessionID sets the session ID for the local context
|
||||
func SetLocalValidatorAddress(address string) {
|
||||
ValAddr = address
|
||||
}
|
||||
|
||||
// SetLocalContextChainID sets the chain ID for the local
|
||||
func SetLocalChainID(id string) {
|
||||
ChainID = id
|
||||
}
|
||||
|
||||
// IPFSClient is an interface for interacting with an IPFS node.
|
||||
type IPFSClient = *rpc.HttpApi
|
||||
|
||||
// NewLocalClient creates a new IPFS client that connects to the local IPFS node.
|
||||
func GetIPFSClient() (IPFSClient, error) {
|
||||
rpcClient, err := rpc.NewLocalApi()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rpcClient, nil
|
||||
}
|
||||
Reference in New Issue
Block a user