1 The sample trubanc client handles multiple users of multiple banks.
2 More details in db.txt, the description of the server database and protocol.
4 $dbdir is the base of the database in the file system. Here's how the
5 client directory is structured.
7 Items in angle brackets are variables
8 Items not in angle brackets are literals
9 "--" comment to the end of the line
11 <key>=<value> is a file named <key> with contents <value>
12 Items whose names end with "#" are sequence numbers.
13 name:<item> denotes an optional item, passed by position or name
14 Items in parens are signed. Signature omitted here.
17 privkey/ -- private keys indexed by the hash of their passphrases
19 pubkey/ -- for fast lookup. Must verify that <id> = hash(<pubkey>)
25 url=<url> -- web address of the server
26 name=<name> -- Bank's name
27 tokenid=(<bankid>,tokenid,<tokenid>)
28 regfee=(<bankid>,regfee,<time#>,<tokenid>,<amount>)
29 tranfee=(<bankid>,tranfee,<bankid>,<time#>,<tokenid>,<amount>)
31 spend=(<bankid>,fee|spend,<fee#>,<assetid>,<amount>)[...]
32 selfspend=(<bankid>,fee|spend,<fee#>,<assetid>,<amount>)[...]
33 createasset=(<bankid>,fee|createasset,<fee#>,<assetid>,<amount>)[...]
35 <assetid>=(<bankid>,@asset,(<id>,asset,<bankid>,<assetid>,<scale>,<precision>,<assetname>))
37 <sessionhash>=<encrypted_passphrase>
45 time=<time#>[,<time#>]
48 <id>=(<bankid>,@register,(<id>,register,<bankid>,<pubkey>,name=<name>))
55 fraction/ -- fractional amounts due to storage fees
56 <assetid>=(<bankid>,@fraction,(<id>,fraction,<bankid>,<time#>,<assetid>,<amount>))
57 balancehash=(<bankid>,@balancehash,(<id>,balancehash,<bankid>,<time#>,<count>,<hash>))
59 <acct>/ -- "main" is the default acct name
60 <assetid>=(<bankid>,@balance,(<id>,balance,<bankid>,<time#>,<assetid>,<amount>,acct:<acct>))
61 outboxhash=(<bankid>,@outboxhash,(<id>,outboxhash,<bankid>,<time#>,<count>,<hash>))
63 <time2#>=(<bankid>,@spend,(<id>,spend,<bankid>,<time2#>,<id2>,<assetid2>,<amount2>,note:<note2>,acct:<acct2>)).
64 (<bankid>,@tranfee,(<id>,tranfee,<bankid>,<time2#>,<tokenid>,<amount2fee>))
65 <time3#>=(<bankid>,@spend,(<id>,spend,<bankid>,<time3#>,<id3>,<assetid3>,<amount3>,note:<note3>,acct:<acct3>)).
66 (<bankid>,@tranfee,(<id>,tranfee,<bankid>,<time3#>,<tokenid>,<amount3fee>))
68 <time5#>=(<bankid>,inbox,<time5#>,(<id2>,spend|accept,<bankid>,<time2#>,<id>,note:<note22>))
69 <time6#>=(<bankid>,inbox,<time6#>,(<id3>,spend|reject,<bankid>,<time3#>,<id>,note:<note32>))
70 <time7#>=(<bankid>,inbox,<time7#>,(<id4>,spend,<bankid>,<time4#>,<id>,<assetid4>,<amount4>,note:<note4>)).
71 (<bankid>,@tranfee,(<id>,tranfee,<bankid>,<time4#>,<tokenid>,<amount4fee>))
73 (<bankid>,@spend,(<id>,spend,<time#>,<id2>,<bankid>,<assetid>,<amount>,note:<note>,acct:<acct>))...
75 (<bankid,@processinbox,(<id>,processinbox,<bankid>,<time11#>,<time7#>|<time8#>|<time9#>)...
77 -- Needs more work. Likely wants to be indexed multiple ways
78 -- and probably organized in directories to keep any one listing
79 -- from getting too long to handle
82 // Copyright 2008-2009 Bill St. Clair
84 // Licensed under the Apache License, Version 2.0 (the "License");
85 // you may not use this file except in compliance with the License.
86 // You may obtain a copy of the License at
88 // http://www.apache.org/licenses/LICENSE-2.0
90 // Unless required by applicable law or agreed to in writing, software
91 // distributed under the License is distributed on an "AS IS" BASIS,
92 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
93 // See the License for the specific language governing permissions
94 // and limitations under the License.