mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-04 02:11:40 +00:00
feature/migrate models (#16)
* feat: add new supported attestation formats to genesis * feat: refactor keyType to keytype enum * refactor: remove unused imports and code * refactor: update main.go to use src package * refactor: move web-related structs from to * refactor: move client middleware package to root * refactor: remove unused IndexedDB dependency * feat: update worker implementation to use * feat: add Caddyfile and Caddy configuration for vault service * refactor(config): move keyshare and address to Motr config * fix: validate service origin in AllocateVault * chore: remove IndexedDB configuration * feat: add support for IPNS-based vault access
This commit is contained in:
+14
-6
@@ -18,12 +18,11 @@ var indexData []byte
|
||||
var swJSData []byte
|
||||
|
||||
// NewDWNConfigFile uses the config template to generate the dwn config file
|
||||
func NewDWNConfigFile(keyshareJSON string, adddress string) (files.Node, error) {
|
||||
func NewDWNConfigFile(keyshareJSON string, adddress string, chainID string) (files.Node, error) {
|
||||
dwnCfg := &dwn.Config{
|
||||
Keyshare: &keyshareJSON,
|
||||
Address: &adddress,
|
||||
Ipfs: defaultIPFSConfig(),
|
||||
Sonr: defaultSonrConfig(),
|
||||
Motr: createMotrConfig(keyshareJSON, adddress, "sonr.id"),
|
||||
Ipfs: defaultIPFSConfig(),
|
||||
Sonr: defaultSonrConfig(chainID),
|
||||
}
|
||||
dwnConfigData, err := json.Marshal(dwnCfg)
|
||||
if err != nil {
|
||||
@@ -47,6 +46,14 @@ func SWJSFile() files.Node {
|
||||
return files.NewBytesFile(swJSData)
|
||||
}
|
||||
|
||||
func createMotrConfig(keyshareJSON string, adddress string, origin string) *dwn.Motr {
|
||||
return &dwn.Motr{
|
||||
Keyshare: keyshareJSON,
|
||||
Address: adddress,
|
||||
Origin: origin,
|
||||
}
|
||||
}
|
||||
|
||||
func defaultIPFSConfig() *dwn.IPFS {
|
||||
return &dwn.IPFS{
|
||||
ApiUrl: "https://api.sonr-ipfs.land",
|
||||
@@ -54,11 +61,12 @@ func defaultIPFSConfig() *dwn.IPFS {
|
||||
}
|
||||
}
|
||||
|
||||
func defaultSonrConfig() *dwn.Sonr {
|
||||
func defaultSonrConfig(chainID string) *dwn.Sonr {
|
||||
return &dwn.Sonr{
|
||||
ApiUrl: "https://api.sonr.land",
|
||||
GrpcUrl: "https://grpc.sonr.land",
|
||||
RpcUrl: "https://rpc.sonr.land",
|
||||
WebSocketUrl: "wss://rpc.sonr.land/ws",
|
||||
ChainId: chainID,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user