Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v1 source realm

Boards2 is a social discussion forum for open communication and community-driven conversations.

Readme View source

Boards2

Boards2 is a social discussion forum for open communication and community-driven conversations.

Users can start discussions by creating or reposting threads and then submitting comments or replies to other user comments.

Discussions happen within different boards, where each board is an independent self managed community.

Boards2 allows users to create two types of boards, one is the invite only board where only invited users can create threads and comment, and where non invited users can only read the content and discussions; The other type of board is the open board where any user with a specific amount of GNOT in their account can create threads, repost and comment.

Open Boards Quick Start

If you are new to Gno.land in general, the quick start guide below can help you get started.

What you need to create threads and start commenting within open boards is having a specific amount of GNOT in your Gno.land user account, which by default initially is 3000 GNOT. This initial GNOT amount could be changed over time to a different amount, so this requirement can change.

How To Get a Gno.land Address

To use Boards2 you'll need a Gno.land address. You can quickly setup your account using Adena or any Gno.land compatible wallet by following these steps:

  • Download Adena, or a Gno.land compatible wallet
  • Once installed, you have to create a new account or add an existing one following wallet's instructions
  • If you don't have GNOT you will need to use a faucet to get some, if the network allows it

For testing networks you can use the official Faucet Hub to receive GNOT in your account.

How to Start Using Open Boards

Once you have the required GNOT amount in your account you can start commenting, creating and reposting threads within any open board.

To comment and engage on an open board discussion visit a thread and click on the "Comment" link. You can also reply to any of the thread's comments by clicking on the "Reply" link.

To create threads, visit an open board and then click on the "Create Thread" link, there you will have to enter a title and some content for the thread body.

Thread and comments content can be written as plaintext, or Markdown if you want to format the content so it's rendered as rich text.

You can also repost any thread, even the ones from invite only boards, into any open board. To do so visit the thread you want to repost and click on the "Repost" link at the bottom of the thread, there you will have to enter the open board where you want the repost to be created, a title for the thread repost and optionally also some content to render at the top of the repost. The optional content can also be written as plaintext or Markdown, like threads.

After your thread, repost or comment is created, you can easily share the link with others so they can join the discussion!

Boards

Boards2 realm enables the creation of different communities though independent boards.

When a board is created, and independetly of the board type, it initially has a single "owner" member assigned by default, which is the user that creates it. The member is called "owner" because by default it has the owner role, which grants all permissions within that board.

Members of a board with the owner or admin role, independently of the board type, can invite other members, or otherwise users can request being invited to be a member by visiting the board and clicking the "Request Invite" link. Requested invites can be accepted or revoked though the board's "Invite Requests" view or using these public realm functions:

1// AcceptInvite accepts a board invite request.
2func AcceptInvite(_ realm, boardID boards.ID, user address)
3
4// RevokeInvite revokes a board invite request
5func RevokeInvite(_ realm, boardID boards.ID, user address)

There are four possible roles that invited users can have when they are members of a board:

  • owner: Grants all available permissions
  • admin: Grants basic, moderator and advanced permissions, like being able to rename boards, add or remove members, or change their role.
  • moderator: Grants basic and moderation related permissions, like being able to ban or unban users, or flag content.
  • guest: Grants basic permissions that allow creating threads, reposting and commenting.

Default board configuration, permissions and roles are defined in the permissions file.

No roles or number of members is enforced for boards, so technically a board can be updated to have no members, or for example, boards could exists without any "owner" if all members with owner role are removed from it.

Other custom user defined roles can exists on top of the default ones though custom board implementations.

Custom Boards

Boards2 realm allows users to customize the mechanics of their boards when the default ones doesn't make sense to that community, or when users want to integrate a board with their realms.

An example of this would be a case where thread creation should be allowed only though a new publisher role, or a case where a community have their own DAO realm and governance implementation and are looking to integrate it into their board mechanics by creating threads though proposals that must be approved for the thread to be published.

Each board can customize the way it works by implementing the Permissions interface that is defined in the gno.land/p/gnoland/boards package. It is though the implementation of that interface within a new realm that the default board mechanics can be customized. The new realm can then be used to create an instance of a custom Permissions implementation to replace the one assigned by default to a board.

Right now only Boards2 realm owner members are allowed to change default board permissions using a public realm function:

1// SetPermissions sets a permissions implementation for boards2 realm or a board
2func SetPermissions(_ realm, boardID boards.ID, p boards.Permissions)

This function will be replaced by a proposal that would need to pass for the custom permissions to be applied to a board once Boards2 governance is implemented.

Permissions implementation allow communities to customize the way they want to manage users and roles, where or how they should be stored, and the requirements or effects different board actions have.

Boards2 provides a custom Permissions implementation in gno.land/r/gnoland/boards2/v1/permissions that can be imported by realms and used to implement custom boards.

Boards Governance

By default boards are created with an undelying DAO, so each new board is linked to an independent DAO which is used to organize members by role, and can also be used to update boards in a permissionless manner.

Right now is possible to integrate with the underlying DAO and change the default board mechanics to rely on proposals using a custom board implementation, by creating a new realm that imports and uses the gno.land/r/gnoland/boards2/v1/permissions realm, which exposes the underlying DAO.

Current Boards2 realm implementation doesn't run proposals, but some of the current mechanics will rely on DAO proposals to actually execute changes.

Moderation

Flagging

Threads and comments are moderated by flagging, which requires the moderator, admin or owner roles.

A reason is required each time content is flagged by a member. Content is replaced by a feedback message and a link to the list of flagging reasons given by moderators when a moderation flagging threshold is reached. By default the threshold is of a single flag.

Right now is not possible to show the content of a thread or comment that has been hidden because of moderation, but future Boards2 versions might implement a way to handle moderation disputes and allow restoring the thread or comment content.

Boards2 realm owners are allowed to moderate content with a single flag within any board at this point, but this might be changed to work though a DAO proposal.

Each board's owner or admin members are free to change the flagging threshold within a single board to a greater value using a public realm function:

1// SetFlaggingThreshold sets the number of flags required to hide a thread or comment
2func SetFlaggingThreshold(_ realm, boardID boards.ID, threshold int)

Banning

Members with the moderator, admin or owner roles are the only ones that are allowed to ban or unban a user within a board.

Users can be banned with a reason for any number of hours. Within this period banned users are not allowed to interact or make any changes.

Only invited guest members and open board users can be banned, banning board owners, admins and moderators is not allowed.

Banning and unbanning can be done by calling these public realm functions:

1// Ban bans a user from a board for a period of time
2func Ban(_ realm, boardID boards.ID, user address, hours uint, reason string)
3
4// Unban unbans a user from a board
5func Unban(_ realm, boardID boards.ID, user address, reason string)

Freezing

Boards2 realm allows owner or admin members of a board to freeze the board or any of its threads. Freezing makes the board or thread readonly, disallowing any changes or additions until unfrozen.

The following public realm function can be called for freezing:

 1// FreezeBoard freezes a board so no more threads and comments can be created or modified
 2func FreezeBoard(_ realm, boardID boards.ID)
 3
 4// UnfreezeBoard removes frozen status from a board
 5func UnfreezeBoard(_ realm, boardID boards.ID)
 6
 7// FreezeThread freezes a thread so thread cannot be replied, modified or deleted
 8func FreezeThread(_ realm, boardID, threadID boards.ID)
 9
10// UnfreezeThread removes frozen status from a thread
11func UnfreezeThread(_ realm, boardID, threadID boards.ID)

Overview

Boards2 is a social discussion forum for open communication and community-driven conversations.

Users can start discussions by creating or reposting threads and then submitting comments or replies to other user comments.

Discussions happen within different boards, where each board is an independent self managed community.

Boards2 allows users to create two types of boards: - Invite Only: Only invited users (members) can create threads, reposts and comments. - Open: Anyone with a specific amount of GNOT in their account can create threads, reposts and comments.

Constants 6

const PermissionBoardCreate, PermissionBoardFlaggingUpdate, PermissionBoardFreeze, PermissionBoardRename, PermissionMemberInvite, PermissionMemberInviteRevoke, PermissionMemberRemove, PermissionPermissionsUpdate, PermissionRealmHelpChange, PermissionRealmLock, PermissionRealmNotice, PermissionAccountRequiredAmountChange, PermissionReplyCreate, PermissionReplyDelete, PermissionReplyFlag, PermissionRoleChange, PermissionThreadCreate, PermissionThreadDelete, PermissionThreadEdit, PermissionThreadFlag, PermissionThreadFreeze, PermissionThreadRepost, PermissionUserBan, PermissionUserUnban

 1const (
 2	PermissionBoardCreate boards.Permission = iota
 3	PermissionBoardFlaggingUpdate
 4	PermissionBoardFreeze
 5	PermissionBoardRename
 6	PermissionMemberInvite
 7	PermissionMemberInviteRevoke
 8	PermissionMemberRemove
 9	PermissionPermissionsUpdate
10	PermissionRealmHelpChange
11	PermissionRealmLock
12	PermissionRealmNotice
13	PermissionAccountRequiredAmountChange
14	PermissionReplyCreate
15	PermissionReplyDelete
16	PermissionReplyFlag
17	PermissionRoleChange
18	PermissionThreadCreate
19	PermissionThreadDelete
20	PermissionThreadEdit
21	PermissionThreadFlag
22	PermissionThreadFreeze
23	PermissionThreadRepost
24	PermissionUserBan
25	PermissionUserUnban
26)
source

List of Boards2 permissions.

const MaxBoardNameLength, MaxThreadTitleLength, MaxThreadBodyLength, MaxReplyLength

 1const (
 2	// MaxBoardNameLength defines the maximum length allowed for board names.
 3	MaxBoardNameLength = 50
 4
 5	// MaxThreadTitleLength defines the maximum length allowed for thread titles.
 6	MaxThreadTitleLength = 100
 7
 8	// MaxThreadBodyLength defines the maximum length allowed for thread bodies.
 9	// 40,000 mirrors Reddit's self-post body cap.
10	MaxThreadBodyLength = 40000
11
12	// MaxReplyLength defines the maximum length allowed for replies.
13	// 10,000 mirrors Reddit's comment cap.
14	MaxReplyLength = 10000
15)
source

const DefaultFlaggingThreshold

1const DefaultFlaggingThreshold = 1
source

DefaultFlaggingThreshold defines the default number of flags that hides flaggable items.

const PermissionCustom

1const PermissionCustom boards.Permission = 200
source

PermissionCustom defines an initial value for custom board permissions. When a board defines custom permissions it must starts from a value greater or equal than PermissionCustom.

Custom permissions definition example:

Example
1const (
2  PermissionCustom1 boards.Permission = iota + boards2.PermissionCustom
3  PermissionCustom2
4  PermissionCustom3
5)

Variables 1

Functions 45

func AcceptInvite

crossing Action
1func AcceptInvite(cur realm, boardID boards.ID, user address)
source

AcceptInvite accepts a board invite request.

func Ban

crossing Action
1func Ban(cur realm, boardID boards.ID, user address, hours uint, reason string)
source

Ban bans a user from a board for a period of time. Only invited guest members and external users can be banned. Banning board owners, admins and moderators is not allowed.

func ChangeMemberRole

crossing Action
1func ChangeMemberRole(cur realm, boardID boards.ID, member address, role boards.Role)
source

ChangeMemberRole changes the role of a realm or board member.

Board ID is only required when changing the role for a member of a board.

func CreateBoard

crossing Action
1func CreateBoard(cur realm, name string, listed, open bool) boards.ID
source

CreateBoard creates a new board.

Listed boards are included in the realm's list of boards. Open boards allow anyone to create threads and comment.

func CreateReply

crossing Action
1func CreateReply(cur realm, boardID, threadID, replyID boards.ID, body string) boards.ID
source

CreateReply creates a new comment or reply within a thread.

The value of `replyID` is only required when creating a reply of another reply.

func CreateRepost

crossing Action
1func CreateRepost(cur realm, boardID, threadID, destinationBoardID boards.ID, title, body string) boards.ID
source

CreateRepost reposts a thread into another board.

func CreateThread

crossing Action
1func CreateThread(cur realm, boardID boards.ID, title, body string) boards.ID
source

CreateThread creates a new thread within a board.

func DeleteReply

crossing Action
1func DeleteReply(cur realm, boardID, threadID, replyID boards.ID)
source

DeleteReply deletes a reply from a thread.

Replies can be deleted by the users who created them or otherwise by users with special permissions. Soft deletion is used when the deleted reply contains sub replies, in which case the reply content is replaced by a text informing that reply has been deleted to avoid deleting sub-replies.

func DeleteThread

crossing Action
1func DeleteThread(cur realm, boardID, threadID boards.ID)
source

DeleteThread deletes a thread from a board.

Threads can be deleted by the users who created them or otherwise by users with special permissions.

func EditReply

crossing Action
1func EditReply(cur realm, boardID, threadID, replyID boards.ID, body string)
source

EditReply updates the body of a comment or reply.

Replies can be updated only by the users who created them.

func EditThread

crossing Action
1func EditThread(cur realm, boardID, threadID boards.ID, title, body string)
source

EditThread updates the title and body of a thread.

Threads can be updated by the users who created them or otherwise by users with special permissions.

func FlagReply

crossing Action
1func FlagReply(cur realm, boardID, threadID, replyID boards.ID, reason string)
source

FlagReply adds a new flag to a comment or reply.

Flagging requires special permissions and hides the comment or reply when the number of flags reaches a pre-defined flagging threshold.

func FlagThread

crossing Action
1func FlagThread(cur realm, boardID, threadID boards.ID, reason string)
source

FlagThread adds a new flag to a thread.

Flagging requires special permissions and hides the thread when the number of flags reaches a pre-defined flagging threshold.

func FreezeBoard

crossing Action
1func FreezeBoard(cur realm, boardID boards.ID)
source

FreezeBoard freezes a board so no more threads and comments can be created or modified.

func FreezeThread

crossing Action
1func FreezeThread(cur realm, boardID, threadID boards.ID)
source

FreezeThread freezes a thread so thread cannot be replied, modified or deleted.

Fails if board is frozen.

func GetBoard

crossing Action
1func GetBoard(cur realm, boardID boards.ID) (_ *boards.Board, found bool)
source

GetBoard returns a board. This is a protected function only callable by Boards2 sub realms.

func GetBoardIDFromName

crossing Action
1func GetBoardIDFromName(_ realm, name string) (_ boards.ID, found bool)
source

GetBoardIDFromName searches a board by name and returns its ID.

func GetFlaggingThreshold

Action
1func GetFlaggingThreshold(boardID boards.ID) int
source

GetFlaggingThreshold returns the number of flags required to hide a thread or comment within a board.

func GetRealmPermissions

crossing Action
1func GetRealmPermissions(cur realm) boards.Permissions
source

GetRealmPermissions returns Boards2 realm permissions. This is a protected function only callable by Boards2 sub realms.

func HasMemberRole

Action
1func HasMemberRole(boardID boards.ID, member address, role boards.Role) bool
source

HasMemberRole checks if a realm or board member has a specific role assigned.

Board ID is only required when checking a member of a board.

func InviteMember

crossing Action
1func InviteMember(cur realm, boardID boards.ID, user address, role boards.Role)
source

InviteMember adds a member to the realm or to a board.

A role can optionally be specified to be assigned to the new member.

func InviteMembers

crossing Action
1func InviteMembers(cur realm, boardID boards.ID, invites ...Invite)
source

InviteMembers adds one or more members to the realm or to a board.

Board ID is only required when inviting a member to a specific board.

func IsBanned

Action
1func IsBanned(boardID boards.ID, user address) bool
source

IsBanned checks if a user is banned from a board.

func IsMember

Action
1func IsMember(boardID boards.ID, user address) bool
source

IsMember checks if a user is a member of the realm or a board.

Board ID is only required when checking if a user is a member of a board.

func IsThreadFrozen

Action
1func IsThreadFrozen(boardID, threadID boards.ID) bool
source

IsThreadFrozen checks if a thread has been frozen.

Returns true if board is frozen.

func Iterate

crossing Action
1func Iterate(cur realm, start, count int, fn boards.BoardIterFn) bool
source

Iterate iterates boards. Iteration is done for all boards, including the ones that are not listed. To reverse iterate boards use a negative count. If the callback returns true, iteration is stopped.

func LockRealm

crossing Action
1func LockRealm(cur realm, lockRealmMembers bool)
source

LockRealm locks the realm making it readonly.

WARNING: Realm can't be unlocked once locked.

Realm can also be locked without locking realm members. Realm members can be locked when locking the realm or afterwards. This is relevant for two reasons, one so that members can be modified after the lock. The other is for realm owners, who can delete threads and comments after the lock.

func MustGetBoard

crossing Action
1func MustGetBoard(cur realm, boardID boards.ID) *boards.Board
source

MustGetBoard returns a board or panics on error. This is a protected function only callable by Boards2 sub realms.

func RemoveMember

crossing Action
1func RemoveMember(cur realm, boardID boards.ID, member address)
source

RemoveMember removes a member from the realm or a board.

Board ID is only required when removing a member from board.

func RenameBoard

crossing Action
1func RenameBoard(cur realm, name, newName string)
source

RenameBoard changes the name of an existing board.

A history of previous board names is kept when boards are renamed. Because of that boards are also accessible using previous name(s).

func RequestInvite

crossing Action
1func RequestInvite(cur realm, boardID boards.ID)
source

RequestInvite request to be invited to a board.

func RevokeInvite

crossing Action
1func RevokeInvite(cur realm, boardID boards.ID, user address)
source

RevokeInvite revokes a board invite request.

func SetFlaggingThreshold

crossing Action
1func SetFlaggingThreshold(cur realm, boardID boards.ID, threshold int)
source

SetFlaggingThreshold sets the number of flags required to hide a thread or comment.

Threshold is only applicable within the board where it's setted.

func SetHelp

crossing Action
1func SetHelp(cur realm, content string)
source

SetHelp sets or updates boards realm help content.

func SetPermissions

crossing Action
1func SetPermissions(cur realm, boardID boards.ID, p boards.Permissions)
source

SetPermissions sets a permissions implementation for boards2 realm or a board.

func SetRealmNotice

crossing Action
1func SetRealmNotice(cur realm, message string)
source

SetRealmNotice sets a notice to be displayed globally within the realm. An empty message removes the realm notice.

func SetRequiredAccountAmount

crossing Action
1func SetRequiredAccountAmount(cur realm, amount int64)
source

SetRequiredAccountAmount sets the required account amount to interact as a non member with open boards. Amount must be given as ugnot. The amount requirement is not applied to members that were invited to an open board.

func Unban

crossing Action
1func Unban(cur realm, boardID boards.ID, user address, reason string)
source

Unban unbans a user from a board.

func UnfreezeBoard

crossing Action
1func UnfreezeBoard(cur realm, boardID boards.ID)
source

UnfreezeBoard removes frozen status from a board.

func UnfreezeThread

crossing Action
1func UnfreezeThread(cur realm, boardID, threadID boards.ID)
source

UnfreezeThread removes frozen status from a thread.

Fails if board is frozen.

Types 3

type BoardMeta

struct
1type BoardMeta struct {
2	// HiddenThreads contains hidden board threads.
3	HiddenThreads boards.PostStorage
4}
source

BoardMeta defines a type for board metadata.

type Invite

struct
1type Invite struct {
2	// User is the user to invite.
3	User address
4
5	// Role is the optional role to assign to the user.
6	Role boards.Role
7}
source

Invite contains a user invitation.

type ThreadMeta

struct
1type ThreadMeta struct {
2	// AllReplies contains all existing thread comments and replies.
3	AllReplies boards.PostStorage
4}
source

ThreadMeta defines a type for thread metadata.

Imports 24

Source Files 230

Directories 1