Bitseal

From Bitmessage Wiki
Revision as of 10:38, 16 October 2014 by JonathanCoe (talk | contribs) (Removed duplicate text)
Jump to navigation Jump to search

Bitseal is a Bitmessage client for Android, currently in Beta.


Bitseal Server

The Bitseal server code can be found at: (https://github.com/JonathanCoe/bitseal-server)

The Bitseal server application is a slightly modified version of PyBitmessage: (https://github.com/bitmessage/pybitmessage)

See also Bitseal's main respository: (https://github.com/JonathanCoe/bitseal)


Instructions for setting up bitseal-server

1) Download the zip file of the source code from Github

2) Extract the source code files to the desired location on your server

3) Run bitmessagemain.py

4) After a few seconds, stop PyBitmessage. PyBitmessage will have created a keys.dat file, which you can now use to specify your API settings

5) Open the keys.dat file. You can find its location using this reference: https://bitmessage.org/wiki/Keys.dat

6) Add the following lines to the "bitmessagesettings" section of the keys.dat file, replacing the port number, username, and password values as appropriate:

daemon = true
apienabled = true
apiport = YOUR_API_PORT_NUMBER
apiinterface = 0.0.0.0
apiusername = YOUR_API_USERNAME
apipassword = YOUR_API_PASSWORD

7) Save and close the keys.dat file

8) Ensure that your server's firewall is set up allowing incoming + outgoing TCP connections on port 8444 (PyBitmessage default) and the API port you specified in the keys.dat file

9) Run bitmessagemain.py

10) Open Bitseal and add your server's URL, API username, and API password via the 'Server Settings' page

11) Done!


Bitseal Server API

Required arguments are denoted inside < and > Optional arguments are inside [ and ].

Command Parameters On Success Returns On Failure Returns Description
add <integer> <integer> An integer which is the sum of the two parameters An API error Returns the sum of the integers. Used as a simple test of the API.
disseminateMsg <messageHex> 'Message disseminated successfully' 'Message dissemination failed', or an API error Takes a hex-encoded msg object and disseminates it to the rest of the Bitmessage network. The POW for the msg must have already been done.
disseminatePubkey <pubkeyHex> 'Pubkey disseminated successfully' 'Pubkey dissemination failed', or an API error Takes a hex-encoded pubkey object and disseminates it to the rest of the Bitmessage network. The POW for the pubkey must have already been done.
disseminateGetpubkey <getpubkeyHex> 'Getpubkey disseminated successfully' 'Getpubkey dissemination failed', or an API error Takes a hex-encoded getpubkey object and disseminates it to the rest of the Bitmessage network. The POW for the getpubkey must have already been done.
requestPubkey <identifierHex> <addressVersion> The hex-encoded pubkey object, formatted as a single object in a JSON array 'No pubkeys found', or an API error Takes an 'identifer' value and address version number and attempts to find a matching pubkey in the server's storage. The identifier value is ripe hash or the 'tag' of the pubkey which is being requested, depending on the address version of the pubkey. If a matching pubkey is found, it is returned to the client.
checkForNewMsgs <streamNumber> <receivedSinceTime> <receivedBeforeTime> A JSON array containing the hex-encoded msg objects 'No msgs found', or an API error Takes a stream number, a 'received since' time value, and a 'received before' time value and returns any msg objects which were received in that stream number at a time between the two provided values.


API errors

Here are the various error codes and messages you might see. Parts of the error messages in BLOCK_CAPITALS are variable fields that will change based on the data involved in the error.

Error Number Message
000 API Error 000: 'I need NUMBER_OF_PARAMETERS parameters!'
001 API Error 001: 'Decode error - DECODE_EXCEPTION_MESSAGE. Had trouble while decoding string: YOUR_STRING'
002 API Error 002: 'The address version cannot be less than ADDRESS_VERSION_NUMBER'
003 API Error 003: 'Address versions above ADDRESS_VERSION_NUMBER are currently not supported'
004 API Error 004: 'The length of hash should be 20 bytes (encoded in hex and thus 40 characters).'
005 API Error 005: 'The length of tag should be 32 bytes (encoded in hex and thus 64 characters).'
006 API Error 006: 'The requested object was found, but its payload is above the maximum size limit. The size of the object payload is PAYLOAD_SIZE_IN_BYTES'