The Barter Command Set


help

Prints out a list of all command names.


exit

Says goodbye to the server. The connection will be terminated with a CODE_GOODBYE.

shutdown

Tells the server to shutdown. (User must have USER_FLAG_SUPER.) All connections will be terminated with CODE_GOODBYE.


login user

Initiates authentication as user. Response will be a challenge to the user's RSA key.


respond response

Completes authentication. response is computed by signing the challenge generated by the login command.


txn_create

Begins a transaction. All commands after txn_create and before txn_commit or txn_abort will be treated as a transaction. While in a transaction, CODE_ERR_ABORTED can be returned as an error by any command due to a lock conflict. If this happens, you will need to begin a new transaction and start over. (Requires USER_FLAG_TXN.)


txn_commit

Commits a transaction. (Requires USER_FLAG_TXN.)


txn_abort

Aborts a transaction. (Requires USER_FLAG_TXN.)


event_read event

Prints out attributes of the event event. User must have permission to read this event.


event_list [lower-bound [upper-bound]]

Prints out a list of all events in between lower-bound and upper-bound which the user has permission to read. lower-bound defaults to 1 and upper-bound defaults to the the maximum event in the system.


event_last

Prints out the identity of the last event in the system.


event_send recipient message

Creates a pair of events, one with type "event_sent" (which you have access to) and the other with type "event_received" (which recipient has access to). The extra attributes of the event will be from (which is set to your user), to (which is set to recipient), and message (which is set to message, any string, conventionally CGI-escaped).


user_create user public modulus

Creates a new user with the given public key and modulus. (Requires USER_FLAG_SUPER.)


user_set user attribute value

Sets an attribute of user to the given value.


user_read user

Prints out attributes of user which you have permission to read.


user_destroy user

Removes a user from the system. (Requires USER_FLAG_SUPER.)


denom_create denom

Creates a new denomination. (Requires USER_FLAG_ISSUER.)


denom_set denom attribute value

Sets an attribute of denom to the given value.


denom_read denom

Prints out attributes of denom which you have permission to read.


denom_destroy denom

Removes a denomination from the system. (Requires USER_FLAG_ISSUER.)


denom_list

Lists all denominations for which you are the issuer.


denom_list_all

Lists all denominations that exist on the system.


note_read note [signature]

Prints out attributes of note which you have permission to read. signature is required if you are not the issuer of note.


note_list

Lists all notes for which you are the issuer.


note_withdraw value ...

Debits all values from your account and creates a new note containing the values as its portfolio. The identity of the note is returned.


note_deposit note signature

Deposits note into your account and destroys it. The list of deposited values is returned.


balance

Prints out a list of all values in your account (your portfolio).


credit recipient value

Adds value to recipient's portfolio. (Requires USER_FLAG_SUPER, or USER_FLAG_ISSUER if user is issuer of value's denomination.)


credit recipient value

Subtracts value from recipient's portfolio. (Requires USER_FLAG_SUPER, or USER_FLAG_ISSUER if user is issuer of value's denomination.)