Publishing a Betting Feed


#1

Below is an example feed format which must be a JSON file. When publishing a broadcast you have to add the URL that points to this JSON file. Also, all files/images URLs have to exist.

{
    "version": "1.0",
    "address": "muYJYjRZDPmTEMfyEGe34BGN8tZ6rmRZCu",
    "type": "binary",
    "category": "sports",
    "title": "Superbowl 2014",
    "image": "https://www.jahpowerbit.org/feeds/image-1.png",
    "description": "The feed for the Super Bowl final",
    "url": "http://www.jahpowerbit.org/superbowl2014",
    "broadcast_date": "2014-11-01T05:06:07+00:00",,
    "operator": {
        "name": "JahPowerBit",
        "image": "https://www.jahpowerbit.org/feeds/image-1.png",
        "description": "Development site",
        "url": "http://www.jahpowerbit.org"
    },
    "targets": [{
        "text": "The Bronco wins",
        "image": "https://www.jahpowerbit.org/feeds/image-1.png",
        "value": 1,
        "labels": {
            "equal": "yes",
            "not_equal": "no"
        },
        "odds": {
            "initial": 2,
            "suggested": 3
        },
        "deadline": "2014-07-01T05:06:07+00:00"
    }, {
        "text": "The Seahawks wins",
        "image": "https://www.jahpowerbit.org/feeds/image-1.png",
        "value": 2,
        "labels": {
            "equal": "yes",
            "not_equal": "no"
        },
        "deadline": "2014-07-01T05:06:07+00:00"
    }, {
        "text": "They draw",
        "image": "https://www.jahpowerbit.org/feeds/image-1.png",
        "value": 3,
        "labels": {
           "equal": "yes",
            "not_equal": "no"
        },
        "odds": {
            "initial": 3,
            "suggested": 4
        },
        "deadline": "2014-09-01T05:06:07+00:00"
    }],
    "customs": {
        "key1": "value1",
        "key2": 2
    }
}

#2

That’s very useful. Now how do I add the url to a broadcast - what would an example of a complete broadcast look like?


#3

@DeanScottWalsh I’ve made a doc on feed/broadcast features that should answer all your questions https://github.com/CounterpartyXCP/Documentation/blob/master/Counterwallet/enhanced_feed_info.md. It will be available on the Counterparty site (http://counterparty.io/docs) soon as well.

Let me know if you have any further questions.


#4

By the way, something that is often missed:

in counterparty-lib and counterparty-cli it’s possible to make broadcasts of arbitrary length (as opposed to the character limit in Counterwallet). Of course it will cost more, but this is useful if you are trying to embed larger data.


#5

Here’s a nice post I just stumbled upon that you might find useful : http://cryptorials.io/becoming-a-bitcoin-oracle-how-to-publish-a-counterparty-feed/