Coder Social home page Coder Social logo

octopus's People

Contributors

aamirl avatar jhernandezb avatar mohitmamoria avatar notduncansmith avatar shanev avatar truted avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

octopus's Issues

[OCT-76] Claims resolver

  • claim(id: ID)
  • claims(first: Number, after: Number, filter: String, feedFilter: Number, communityId: Number)

Struct:

https://github.com/TruStory/truchain/tree/develop/docs/spec/claim

Note: ID int64 should be cast to a string to prevent overflows on client.

Typescript types:

export interface BaseClaim {
  id: ID;
  community: Community;
  body: string;
  creator: Creator;
  source: string;
  totalBacked: Coin;
  totalChallenged: Coin;
  createdTime: Time;
}

export interface FeedClaim extends BaseClaim {
  topArgument: Argument;
  argumentCount: number;
}

export interface Claim extends FeedClaim {
  arguments: Argument[];
  stakerCount: number;
  stakers: Creator[];
  // comments: Comment[]
}

[OCT-76] Community resolver

  • communities() resolver
  • community(id: string) resolver
  • Community object field resolver

Truchain struct:

type Community struct {
    ID                  int64         
    Name                string        
    Slug                string        
    Description         string        
    TotalEarnedStake    sdk.Coin      
}

Note: ID int64 should be cast to a string to prevent overflows on client.

[TRU-599] TruAPI: resolver + endpoint changes

Update API for data the client needs for staking and slashing, and anything else needed to conform to spec.

  • minimize GraphQL schema changes
    • keep story queries
    • rename category to community?
  • update resolvers
    • add endTime to staking
    • remove from story
    • add slashing
  • update endpoints

[OCT-76] Arguments resolver

https://github.com/TruStory/truchain/tree/develop/docs/spec/staking#main-types

Typescript types

export interface Argument {
  id: ID;
  claimId: ID;
  summary: string;
  body: string;
  vote: boolean;
  createdTime: Time;
  creator: Creator;
  upvotedStake: Coin;
  upvotedCount: number;
  isUnhelpful: boolean;
  hasSlashed: boolean;
  appAccountStake?: Stake;
  stakers: Creator[]; // will only return 3 max per UI
}
  • claimArguments(first: Number, after: Number, claimId: ID)
  • claimArgument(id: ID)

Push notifications for comments/replies

From Preethi:

Part 1 feature to be "complete", it should include a notification anytime a person is @mentioned as well
  • API imports push service
  • directly send (and save in DB) message (not going through tendermint)

API Split [2/3]: Add api service with chttp, truapi, graphql, and db modules from truchain

  • upgrade Cosmos in a branch
  • point octopus to upgraded Cosmos branch
  • add Cobra command-line service
  • take in chain-id as a parameter
  • build all newly added packages (chttp, truapi, graphql, db)
  • modify RunQuery and DeliverPresigned to use CLIContext instead of TruChain app directly
  • query Tendermint with QueryWithData and send messages with BroadcastTx
  • revamp account registration to use Tendermint, not chain
  • remove setting initial coins
  • modify resolvers to work with new RunQuery signature
  • modify POST requests to use new BroadcastTx signature
  • modify API to take cli params for chain-id, chain-url, etc.
  • test that all routes work with Insomnia
  • add registrar account as a parameter for now and sign registration message
  • configure print output
  • clear up home, chain-id, and trust-node params
  • move whitelist to $HOME/.octopus
  • test with web client
  • deployment with CI
  • update the other services per these changes
  • fix seeder action
  • create systemctl service to run it
  • cherry-pick new code in chain

[OCT-76] Add claim level comments

DB:

  • migration for claim_comments (same as current comments but with argument_id replaced with claim_id)

Rest/Mutation:

  • /claim_comments end point and HandleClaimComment handler based off current /comments endpoint

Resolvers:

  • claimComments(first: Number, after: Number, claimId: ID)
  • claimComment(id: ID)
  • ClaimComment object resolver

API upgrade spec: staking on arguments

  • define what API endpoints are needed
  • define what mutations are needed
  • define what queries are needed
  • create issues for each

API endpoints:

  • /claim_comments - add claim level discussion entry

Mutations:

  • We haven't really been able to get these working. We could try again by trying to add /claim_comments via a mutation

Queries:

  • appAccount(id: ID)
  • communities()
  • community(id: ID)
  • claim(id: ID)
  • claims(first: Number, after: Number, filter: String, feedFilter: Number, communityId: Number)
  • claimComments(first: Number, after: Number, claimId: ID)
  • claimComment(id: ID)
  • claimArguments(first: Number, after: Number, claimId: ID
  • claimArgument(id: ID)
  • stakes(argumentId: ID)
  • stake(id: ID)

Reuse:

  • invites()
  • notifications()
  • params()

Notifications Improvements

  • handle case were reward is 0 (only one staker)
  • include storyId in meta field when backing/challenge
  • create migration to update older story notifications to include meta.

[OCT-76] Account resolver

  • appAccount(id: string)
type AppAccount struct {
    auth.BaseAccount

    EarnedStake     type.EarnedCoins
    SlashCount      int
    IsJailed        bool
    JailEndTime     time.Time
    CreatedTime     time.Time
}
type EarnedCoin struct {
    sdk.Coin

    CommunityID int64
}
type BaseAccount struct {
	Address       sdk.AccAddress
	Coins         sdk.Coins
	PubKey        crypto.PubKey
	AccountNumber uint64       
	Sequence      uint64       
}

Twitter profiles should be returned as part of this as well

Notification updates.

  • Include cred earned
  • Hide who endorsed.
  • Include story result (win/lose)
  • Include interest earned

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.