Language

Choose a language

/build/rpc / cosign / discussion

cosign.discussion_post

cosign.discussion_post "scope_type" "scope_id" "content" ( expiry_blocks min_stake "model_identifier" ) Post a discussion message to a model-scoped thread. Creates a BIP-322 proof-of-funds, sends the message to the bridge, which publishes it to Nostr relays as a kind 8322 event. Arguments: 1. scope_type (string, required) Scope type: "model_prealert" or "model_challenge" 2. scope_id (string, required) Scope ID: model_hash or challenge_block_hash (64 hex chars) 3. content (string, required) Message text (max 4096 chars) 4. expiry_blocks (numeric, optional, default=200) Proof expiry in blocks from current height 5. min_stake (numeric, optional, default=10000) Minimum stake in satoshis for proof 6. model_identifier (string, optional, default="") Optional model_name@commit_id alias for model_prealert scopes Result: { (json object) "event_id" : "str", (string) Nostr event ID of published post "scope_type" : "str", (string) Scope type "scope_id" : "hex", (string) Scope ID "content" : "str", (string) Message content "created_at" : n, (numeric) Unix timestamp "model_identifier" : "str" (string, optional) Human-readable model_name@commit_id alias carried with the discussion post } Examples: > bitcoin-cli cosign.discussion_post "model_prealert" "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" "Proposing new model, commits welcome"

Signature

cosign.discussion_post(scope_type: string, scope_id: string, content: string, expiry_blocks?: number, min_stake?: number, model_identifier?: string) → any

Code samples

curl --user "$RPC_USER:$RPC_PASS" \
  --data-binary '{"jsonrpc":"1.0","id":"docs","method":"cosign.discussion_post","params":["\"<scope_type>\"","\"<scope_id>\"","\"<content>\"",200,10000,""]}' \
  -H 'content-type: text/plain;' \
  http://127.0.0.1:8332/

Parameters

NameTypeReq.Description
scope_typestringyesScope type: "model_prealert" or "model_challenge"
scope_idstringyesScope ID: model_hash or challenge_block_hash (64 hex chars)
contentstringyesMessage text (max 4096 chars)
expiry_blocksnumberProof expiry in blocks from current height
min_stakenumberMinimum stake in satoshis for proof
model_identifierstringOptional model_name@commit_id alias for model_prealert scopes

Result

Type:  any

{ (json object) "event_id" : "str", (string) Nostr event ID of published post "scope_type" : "str", (string) Scope type "scope_id" : "hex", (string) Scope ID "content" : "str", (string) Message content "created_at" : n, (numeric) Unix timestamp "model_identifier" : "str" (string, optional) Human-readable model_name@commit_id alias carried with the discussion post }

Source: services/core-node/bcore/src/rpc/cosign.cpp:3711

C++ symbol: cosign_discussion_post