Refactored the SonrApp struct by reorganizing and grouping the keepers and other fields.

This commit is contained in:
Prad Nukala
2024-07-07 17:45:08 -04:00
committed by Prad Nukala (aider)
parent f6b04e1599
commit 6c1c3d5f8f
8 changed files with 50 additions and 433 deletions
+36
View File
@@ -0,0 +1,36 @@
package app
import (
"github.com/ipfs/kubo/client/rpc"
)
var (
ChainID = "testnet"
ValAddr = "val1"
)
// 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
}