Getting Ads from the blockchain.All CraigsCoin ads are stored in the blockchain. In order to create new Ad a new transaction has to be created. Ads message is inscribed into the blockchain together with its transaction.
As soon as the transaction that contains the Ad gets at least one confirmation you can get the Ads message by making gettransaction RPC call. Gettransaction has one additional field “msg” that contains Ads message json.
JSON has the following format:
{
"person": {
"name": "John Smith",
"contacts": "my email or phone",
},
"location": {
"country": "USA",
"state": "California",
"city": "Los Angeles",
"street_address": "Avalon Blvd, 10",
"postal_code": "123456",
},
"category": {
"level_1": "services",
"level_2": "farm+garden"
},
"ad": {
"ad_title": "Hello world!!!",
"description": "My first message",
"tags": [
"happiness", "christmas", "hugs"
],
"price": "10$",
"images": [
"http://craigscoin.info/img/logo.png", "http://craigscoin.info/img/about.png"
],
"videos": []
}
}
All json fields are always present. Even if the Ads message was created without these fields, in the json they will be empty.
The following limits are in place:
Ads message maximum size – 10 kB
“ad” – “ad-title” minimum length – 10 characters
“ad” – “description” minimum length – 10 characters