npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@boardroom/proposal-comments

v0.1.7

Published

Ceramic Comments Thread on Governance Proposals

Downloads

17

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

  1. Node LTS
  2. You need a local ceramic node. npm install -g @ceramicstudio/idx-cli

Run: After installing dependencies

  1. In one terminal: ceramic daemon will run your local ceramic node
  2. In another: running the following script will publish the schema and definitions to the ceramic node, and write a config.json file in src.
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)