@boardroom/proposal-comments
v0.1.7
Published
Ceramic Comments Thread on Governance Proposals
Downloads
17
Keywords
Readme
RFC 001 - Signal Weighted Proposal Comments
Summary
Much of the conversation around how to vote on a proposal is happening on Discourse, Twitter, and Discord chats. This is clearly unsustainable as key points get lost in the noise, and everyone's opinion is equally weighted regardless of their skin in the game for that particular protocol. This RFC lays out an additional layer to surfacing signal from noise, building on top of the concept of signal weighted polling strategies introduced by Snapshot. The purpose of this feature is to surface the signal of comments that are currently getting lost in the various media of discussion in a single place.
KPIs
After the feature hits production, these are the metrics we'd need to collect and analyze to determine the next steps.
Number of comments made between proposal creation and vote ending/quorum reached.
Correlation between signals from comments and the actual eventual vote
Number of unique addresses participating
Number of recurring addresses participating
Number of Social Shares
Ceramic Definitions (https://idx.xyz/docs/guide-definitions) (https://idx.xyz/docs/concepts/definition)
Comment
{
schema: CommentDefinitionId,
name: "BoardroomProposalComment",
description: "a signed comment on boardroom",
url: ?
config: ?
Like
{
schema: LikeDefinitionId,
name: "BoardroomCommentOrProposalLike",
description: "a signed like on a boardroom proposal or comment",
url: ?
config: ?
Reply
{
schema: ReplyDefinitionId,
name: "BoardroomCommentReply",
description: "a signed reply on a boardroom comment",
url: ?
config: ?
Ceramic Schemas (https://idx.xyz/docs/concepts/schema/)
### interface Comment
{
id: string, // CeramicDocId
proposalId: number,
protocol: string,
author: address,
signature: string,
blockHeight: number, // block at which comment was submitted.
strategy: string, // strategy for signal weighted ranking
comment: string,
likes: Like[],
replies: Reply[]
}
### interface Like
{
id: string, // CeramicDocId
liker: address,
signature: string
}
### interface Reply
{
id: string, // CeramicDocId
replier: address,
signature: string
}
Steps to Run Locally
Machine Setup
- Node LTS
- You need a local ceramic node.
npm install -g @ceramicstudio/idx-cli
Run: After installing dependencies
- In one terminal:
ceramic daemon
will run your local ceramic node - In another: running the following script will publish the schema and definitions to the ceramic node, and write a
config.json
file insrc
.
import Ceramic from '@ceramicnetwork/http-client'
import { createDefinition, publishSchema } from '@ceramicstudio/idx-tools'
import crypto from 'crypto';
import fs from 'fs'
import { Ed25519Provider } from 'key-did-provider-ed25519'
import fromString from 'uint8arrays/from-string'
import { CommentSchema, CommentsListSchema } from './schemas'
const CERAMIC_URL = 'http://localhost:7007'
const SEED = "boardroomweightedproposalcomment";
const writeFile = fs.promises.writeFile;
export async function run() {
const hash = crypto.createHash('sha256');
hash.update(SEED)
const seed = fromString(hash.digest('hex'), 'base16')
// Connect to the local Ceramic node
const ceramic = new Ceramic(CERAMIC_URL)
// Authenticate the Ceramic instance with the provider
await ceramic.setDIDProvider(new Ed25519Provider(seed))
// Publish the two schemas
const [commentSchema, commentsListSchema] = await Promise.all([
publishSchema(ceramic, { content: CommentSchema, name: 'CommentSchema' }),
publishSchema(ceramic, { content: CommentsListSchema, name: 'CommentsListSchema' }),
])
// Create the definition using the created schema ID
const commentsDefinition = await createDefinition(ceramic, {
name: 'comments',
description: 'Simple text comments',
schema: commentsListSchema.commitId.toUrl(),
})
// Write config to JSON file
const config = {
definitions: {
notes: commentsDefinition.id.toString(),
},
schemas: {
Note: commentSchema.commitId.toUrl(),
NotesList: commentsListSchema.commitId.toUrl(),
},
}
await writeFile('./config.json', JSON.stringify(config))
console.log('Config written to src/config.json file:', config)
process.exit(0)
}
run().catch(console.error)