Skip to content

Commit

Permalink
example: gnode (#324)
Browse files Browse the repository at this point in the history
* gnode initial commit

* chore: updates for CI

Signed-off-by: Manfred Touron <[email protected]>

* chore: move p/gnode -> p/demo/gnode

Signed-off-by: Manfred Touron <[email protected]>

Signed-off-by: Manfred Touron <[email protected]>
Co-authored-by: Manfred Touron <[email protected]>
  • Loading branch information
jaekwon and moul authored Oct 28, 2022
1 parent ac0d139 commit c36a2e5
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions examples/gno.land/p/demo/gnode/gnode.gno
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package gnode

// XXX what about Gnodes signing on behalf of others?
// XXX like a multi-sig of Gnodes?

type Name string

type Gnode interface {

//----------------------------------------
// Basic properties
GetName() Name

//----------------------------------------
// Affiliate Gnodes
NumAffiliates() int
GetAffiliates(Name) Affiliate
AddAffiliate(Affiliate) error // must be affiliated
RemAffiliate(Name) error // must have become unaffiliated

//----------------------------------------
// Signing
NumSignedDocuments() int
GetSignedDocument(idx int) Document
SignDocument(doc Document) (int, error) // index relative to signer

//----------------------------------------
// Rendering
RenderLines() []string
}

type Affiliate struct {
Type string
Gnode Gnode
Tags []string
}

type MyGnode struct {
Name
// Owners // voting set, something that gives authority of action.
// Treasury //
// Affiliates //
// Board // discussions
// Data // XXX ?
}

type Affiliates []*Affiliate

// Documents are equal if they compare equal.
// NOTE: requires all fields to be comparable.
type Document struct {
Authors string
// Timestamp
// Body
// Attachments
}

// ACTIONS

// * Lend tokens
// * Pay tokens
// * Administrate transferrable and non-transferrable tokens
// * Sum tokens
// * Passthrough dependencies
// * Code
// * ...

0 comments on commit c36a2e5

Please sign in to comment.