mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
feat: add Motr support
This commit is contained in:
+3
-22
@@ -43,6 +43,9 @@
|
|||||||
"build:nebula": [
|
"build:nebula": [
|
||||||
"make nebula"
|
"make nebula"
|
||||||
],
|
],
|
||||||
|
"build:motr": [
|
||||||
|
"make motr"
|
||||||
|
],
|
||||||
"build:sonrd": [
|
"build:sonrd": [
|
||||||
"make motr",
|
"make motr",
|
||||||
"make build"
|
"make build"
|
||||||
@@ -61,33 +64,11 @@
|
|||||||
"gen:templ": [
|
"gen:templ": [
|
||||||
"make templ"
|
"make templ"
|
||||||
],
|
],
|
||||||
"start:hway": [
|
|
||||||
"make templ",
|
|
||||||
"make hway",
|
|
||||||
"make start-hway"
|
|
||||||
],
|
|
||||||
"start:testnet": [
|
|
||||||
"make templ",
|
|
||||||
"make install",
|
|
||||||
"make sh-testnet"
|
|
||||||
],
|
|
||||||
"start": [
|
"start": [
|
||||||
"process-compose up -f ./deploy/testnet/process-compose.yaml"
|
"process-compose up -f ./deploy/testnet/process-compose.yaml"
|
||||||
],
|
],
|
||||||
"stop": [
|
"stop": [
|
||||||
"process-compose down -f ./deploy/testnet/process-compose.yaml"
|
"process-compose down -f ./deploy/testnet/process-compose.yaml"
|
||||||
],
|
|
||||||
"test:e2e": [
|
|
||||||
"make templ",
|
|
||||||
"make test-e2e"
|
|
||||||
],
|
|
||||||
"test:unit": [
|
|
||||||
"make templ",
|
|
||||||
"make test-unit"
|
|
||||||
],
|
|
||||||
"test": [
|
|
||||||
"make templ",
|
|
||||||
"make test"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
package dwn
|
package dwn
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Ipfs *IPFS `pkl:"ipfs" json:"ipfs,omitempty"`
|
Ipfs *IPFS `pkl:"ipfs"`
|
||||||
|
|
||||||
Sonr *Sonr `pkl:"sonr" json:"sonr,omitempty"`
|
Sonr *Sonr `pkl:"sonr"`
|
||||||
|
|
||||||
Motr *Motr `pkl:"motr" json:"motr,omitempty"`
|
Motr *Motr `pkl:"motr"`
|
||||||
|
|
||||||
Schema *Schema `pkl:"schema" json:"schema,omitempty"`
|
Schema *Schema `pkl:"schema"`
|
||||||
|
|
||||||
ProxyUrl string `pkl:"proxyUrl" json:"proxyUrl,omitempty"`
|
ProxyUrl string `pkl:"proxyUrl"`
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@
|
|||||||
package dwn
|
package dwn
|
||||||
|
|
||||||
type IPFS struct {
|
type IPFS struct {
|
||||||
ApiUrl string `pkl:"apiUrl" json:"apiUrl,omitempty"`
|
ApiUrl string `pkl:"apiUrl"`
|
||||||
|
|
||||||
GatewayUrl string `pkl:"gatewayUrl" json:"gatewayUrl,omitempty"`
|
GatewayUrl string `pkl:"gatewayUrl"`
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -2,9 +2,9 @@
|
|||||||
package dwn
|
package dwn
|
||||||
|
|
||||||
type Motr struct {
|
type Motr struct {
|
||||||
Keyshare string `pkl:"keyshare" json:"keyshare,omitempty"`
|
Keyshare string `pkl:"keyshare"`
|
||||||
|
|
||||||
Address string `pkl:"address" json:"address,omitempty"`
|
Address string `pkl:"address"`
|
||||||
|
|
||||||
Origin string `pkl:"origin" json:"origin,omitempty"`
|
Origin string `pkl:"origin"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,19 +4,19 @@ package dwn
|
|||||||
type Schema struct {
|
type Schema struct {
|
||||||
Version int `pkl:"version"`
|
Version int `pkl:"version"`
|
||||||
|
|
||||||
Account string `pkl:"account" json:"account,omitempty"`
|
Account string `pkl:"account"`
|
||||||
|
|
||||||
Asset string `pkl:"asset" json:"asset,omitempty"`
|
Asset string `pkl:"asset"`
|
||||||
|
|
||||||
Chain string `pkl:"chain" json:"chain,omitempty"`
|
Chain string `pkl:"chain"`
|
||||||
|
|
||||||
Credential string `pkl:"credential" json:"credential,omitempty"`
|
Credential string `pkl:"credential"`
|
||||||
|
|
||||||
Jwk string `pkl:"jwk" json:"jwk,omitempty"`
|
Jwk string `pkl:"jwk"`
|
||||||
|
|
||||||
Grant string `pkl:"grant" json:"grant,omitempty"`
|
Grant string `pkl:"grant"`
|
||||||
|
|
||||||
Keyshare string `pkl:"keyshare" json:"keyshare,omitempty"`
|
Keyshare string `pkl:"keyshare"`
|
||||||
|
|
||||||
Profile string `pkl:"profile" json:"profile,omitempty"`
|
Profile string `pkl:"profile"`
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -2,13 +2,13 @@
|
|||||||
package dwn
|
package dwn
|
||||||
|
|
||||||
type Sonr struct {
|
type Sonr struct {
|
||||||
ApiUrl string `pkl:"apiUrl" json:"apiUrl,omitempty"`
|
ApiUrl string `pkl:"apiUrl"`
|
||||||
|
|
||||||
GrpcUrl string `pkl:"grpcUrl" json:"grpcUrl,omitempty"`
|
GrpcUrl string `pkl:"grpcUrl"`
|
||||||
|
|
||||||
RpcUrl string `pkl:"rpcUrl" json:"rpcUrl,omitempty"`
|
RpcUrl string `pkl:"rpcUrl"`
|
||||||
|
|
||||||
WebSocketUrl string `pkl:"webSocketUrl" json:"webSocketUrl,omitempty"`
|
WebSocketUrl string `pkl:"webSocketUrl"`
|
||||||
|
|
||||||
ChainId string `pkl:"chainId" json:"chainId,omitempty"`
|
ChainId string `pkl:"chainId"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
amends "https://pkl.sh/DWN.pkl";
|
||||||
|
|
||||||
|
dwn = new Config {
|
||||||
|
ipfs = new IPFS {
|
||||||
|
apiUrl = "https://api.sonr-ipfs.land";
|
||||||
|
gatewayUrl = "https://ipfs.sonr.land";
|
||||||
|
};
|
||||||
|
sonr = new Sonr {
|
||||||
|
apiUrl = "https://api.sonr.land";
|
||||||
|
grpcUrl = "https://grpc.sonr.land";
|
||||||
|
rpcUrl = "https://rpc.sonr.land";
|
||||||
|
webSocketUrl = "wss://rpc.sonr.land/ws";
|
||||||
|
chainId = "sonr";
|
||||||
|
};
|
||||||
|
motr = new Motr {
|
||||||
|
keyshare = JSON.parse(keyshare);
|
||||||
|
address = address;
|
||||||
|
origin = "sonr.id";
|
||||||
|
};
|
||||||
|
schema = new Schema {
|
||||||
|
version = 1;
|
||||||
|
account = "account";
|
||||||
|
asset = "asset";
|
||||||
|
chain = "chain";
|
||||||
|
credential = "credential";
|
||||||
|
jwk = "jwk";
|
||||||
|
grant = "grant";
|
||||||
|
keyshare = "keyshare";
|
||||||
|
profile = "profile";
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -6,7 +6,7 @@ type Feature struct {
|
|||||||
|
|
||||||
Description string `pkl:"description"`
|
Description string `pkl:"description"`
|
||||||
|
|
||||||
Icon string `pkl:"icon"`
|
Icon *string `pkl:"icon"`
|
||||||
|
|
||||||
Image *Image `pkl:"image"`
|
Image *Image `pkl:"image"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ type Highlights struct {
|
|||||||
|
|
||||||
Subheading string `pkl:"subheading"`
|
Subheading string `pkl:"subheading"`
|
||||||
|
|
||||||
Highlights []*Highlight `pkl:"highlights"`
|
Highlights []*Feature `pkl:"highlights"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,16 +3,4 @@ package models
|
|||||||
|
|
||||||
type Home struct {
|
type Home struct {
|
||||||
Hero *Hero `pkl:"hero"`
|
Hero *Hero `pkl:"hero"`
|
||||||
|
|
||||||
Highlights []*Highlight `pkl:"highlights"`
|
|
||||||
|
|
||||||
Features []*Features `pkl:"features"`
|
|
||||||
|
|
||||||
Bento *Bento `pkl:"bento"`
|
|
||||||
|
|
||||||
Lowlights []*Lowlights `pkl:"lowlights"`
|
|
||||||
|
|
||||||
CallToAction *CallToAction `pkl:"callToAction"`
|
|
||||||
|
|
||||||
Footer *Footer `pkl:"footer"`
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,15 +10,9 @@ func init() {
|
|||||||
pkl.RegisterMapping("models#Button", Button{})
|
pkl.RegisterMapping("models#Button", Button{})
|
||||||
pkl.RegisterMapping("models#Image", Image{})
|
pkl.RegisterMapping("models#Image", Image{})
|
||||||
pkl.RegisterMapping("models#Stat", Stat{})
|
pkl.RegisterMapping("models#Stat", Stat{})
|
||||||
pkl.RegisterMapping("models#Highlight", Highlight{})
|
|
||||||
pkl.RegisterMapping("models#Features", Features{})
|
|
||||||
pkl.RegisterMapping("models#Bento", Bento{})
|
|
||||||
pkl.RegisterMapping("models#Lowlights", Lowlights{})
|
|
||||||
pkl.RegisterMapping("models#CallToAction", CallToAction{})
|
|
||||||
pkl.RegisterMapping("models#Footer", Footer{})
|
|
||||||
pkl.RegisterMapping("models#SocialLink", SocialLink{})
|
|
||||||
pkl.RegisterMapping("models#Link", Link{})
|
|
||||||
pkl.RegisterMapping("models#Input", Input{})
|
pkl.RegisterMapping("models#Input", Input{})
|
||||||
|
pkl.RegisterMapping("models#Link", Link{})
|
||||||
|
pkl.RegisterMapping("models#SocialLink", SocialLink{})
|
||||||
pkl.RegisterMapping("models#Feature", Feature{})
|
pkl.RegisterMapping("models#Feature", Feature{})
|
||||||
pkl.RegisterMapping("models#Highlights", Highlights{})
|
pkl.RegisterMapping("models#Highlights", Highlights{})
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-50
@@ -6,92 +6,43 @@ import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
|
|||||||
|
|
||||||
typealias JSON = String
|
typealias JSON = String
|
||||||
|
|
||||||
class JsonField extends go.Field {
|
|
||||||
structTags {
|
|
||||||
["json"] = "%{name},omitempty"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class Config {
|
class Config {
|
||||||
@JsonField
|
|
||||||
ipfs: IPFS
|
ipfs: IPFS
|
||||||
|
|
||||||
@JsonField
|
|
||||||
sonr: Sonr
|
sonr: Sonr
|
||||||
|
|
||||||
@JsonField
|
|
||||||
motr: Motr
|
motr: Motr
|
||||||
|
|
||||||
@JsonField
|
|
||||||
schema: Schema
|
schema: Schema
|
||||||
|
|
||||||
@JsonField
|
|
||||||
proxyUrl: String
|
proxyUrl: String
|
||||||
}
|
}
|
||||||
|
|
||||||
class IPFS {
|
class IPFS {
|
||||||
@JsonField
|
|
||||||
apiUrl: String
|
apiUrl: String
|
||||||
|
|
||||||
@JsonField
|
|
||||||
gatewayUrl: String
|
gatewayUrl: String
|
||||||
}
|
}
|
||||||
|
|
||||||
class Motr {
|
class Motr {
|
||||||
@JsonField
|
|
||||||
keyshare: JSON
|
keyshare: JSON
|
||||||
|
|
||||||
@JsonField
|
|
||||||
address: String
|
address: String
|
||||||
|
|
||||||
@JsonField
|
|
||||||
origin: String
|
origin: String
|
||||||
}
|
}
|
||||||
|
|
||||||
class Schema {
|
class Schema {
|
||||||
version: Int
|
version: Int
|
||||||
|
|
||||||
@JsonField
|
|
||||||
account: String
|
account: String
|
||||||
|
|
||||||
@JsonField
|
|
||||||
asset: String
|
asset: String
|
||||||
|
|
||||||
@JsonField
|
|
||||||
chain: String
|
chain: String
|
||||||
|
|
||||||
@JsonField
|
|
||||||
credential: String
|
credential: String
|
||||||
|
|
||||||
@JsonField
|
|
||||||
jwk: String
|
jwk: String
|
||||||
|
|
||||||
@JsonField
|
|
||||||
grant: String
|
grant: String
|
||||||
|
|
||||||
@JsonField
|
|
||||||
keyshare: String
|
keyshare: String
|
||||||
|
|
||||||
@JsonField
|
|
||||||
profile: String
|
profile: String
|
||||||
}
|
}
|
||||||
|
|
||||||
class Sonr {
|
class Sonr {
|
||||||
@JsonField
|
|
||||||
apiUrl: String
|
apiUrl: String
|
||||||
|
|
||||||
@JsonField
|
|
||||||
grpcUrl: String
|
grpcUrl: String
|
||||||
|
|
||||||
@JsonField
|
|
||||||
rpcUrl: String
|
rpcUrl: String
|
||||||
|
|
||||||
@JsonField
|
|
||||||
webSocketUrl: String
|
webSocketUrl: String
|
||||||
|
|
||||||
@JsonField
|
|
||||||
chainId: String
|
chainId: String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dwn : Config
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user