|
From: Pelle B. <pe...@ne...> - 2004-05-14 14:57:14
|
The version of neuclear-ledger currently in CVS (release 0.5) contains a few
minor but important changes to its functionality.
The LedgerController now can support multiple "ledgers". This was added to
support asset controllers and audit controllers with multiple assets.
So our definition of a ledger is basically a separate set of books with
separate balances etc.
For usage with old code, you just use it the same as before. You can
instantiate the LedgerController with a default ledger, which is used in
cases where a ledger isnt specified.
Otherwise you would do something like this:
lc.transfer("bux", reqid, "bob","alice", 20.0, "I want to buy shoes");
Where the first parameter "bux" is the ledger. On the same ledger controller
you could do:
lc.transfer("shoes", reqid, "alice","bob", 5.0, "Here are your shoes");
How does this work within the AssetController and Auditor's in NeuClear Pay?
ledger.transfer(req.getAsset().getDigest(), req.getDigest(),
req.getSignatory().getName(), req.getRecipient(),
req.getAmount().getAmount(), req.getComment());
It uses the unique asset digest as the ledger identifier. So we dont need to
maintain anykinds of mapping between an asset and it's ledger.
-P
--
http://talk.org + Live and direct from Panama
http://neuclear.org + The World Wide Web of Assets
|