-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
// * ... |