Coder Social home page Coder Social logo

open-transactions / opentxs Goto Github PK

View Code? Open in Web Editor NEW
132.0 132.0 100.0 137.29 MB

Open Transactions - Libraries and CLI

Home Page: http://opentransactions.org/

License: Other

CMake 0.54% C++ 41.46% C 57.66% Shell 0.01% Roff 0.28% Dockerfile 0.01% POV-Ray SDL 0.01% HCL 0.05% Pawn 0.01%

opentxs's Introduction

Open-Transactions Library Project

Build Status

The Open-Transactions project is a collaborative effort to develop a robust, commercial-grade, fully-featured, free-software toolkit implementing the OTX protocol as well as a full-strength financial cryptography library, API, CLI, and prototype server. The project is managed by a worldwide community of volunteers that use the Internet to communicate, plan, and develop the Open-Transactions toolkit and its related documentation.

Official Wiki

http://opentransactions.org/

About

Open-Transactions democratizes financial and monetary actions. You can use it for issuing currencies/stock, paying dividends, creating asset accounts, sending/receiving digital cash, writing/depositing cheques, cashier's cheques, creating basket currencies, trading on markets, scripting custom agreements, recurring payments, escrow, etc.

Open-Transactions uses strong crypto. The balances are unchangeable (even by a malicious server.) The receipts are destructible and redundant. The transactions are unforgeable. The cash is untraceable. The cheques are non-repudiable. Etc.

This product includes software developed by Ben Laurie for use in the Lucre project.

Contributing

All development goes in develop branch - please don't submit pull requests to master.

Please do NOT use an editor that automatically reformats.

opentxs's People

Contributors

albertocabello avatar bartalke avatar benma avatar bluewall avatar bugfreesoftware avatar da2ce7 avatar digital-michael avatar fellowtraveler avatar grealish avatar haarts avatar justusranvier avatar klzns avatar kmels avatar lclc avatar martinhbramwell avatar matthewholt3 avatar mhamrle avatar michael avatar murrekatt avatar nopdotcom avatar ottoallmendinger avatar pjz avatar polishcode avatar randy-waterhouse avatar rfree2 avatar str0g avatar tomaszaugustyn avatar tomlandrum avatar wallydog66 avatar yamamushi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opentxs's Issues

Bug: OTPaymentPlan::ProcessInitialPayment() Missing Error Handler

OTPaymentPlan::ProcessInitialPayment() line 1258: The call to OTCron::SaveCron() fails to check its return code to determine if the SaveCron() call succeeded. For example, the user could have made an initial payment, but then ProcessInitialPayment() could fail to save it in cron. The cron OTPaymentPlan state would then get out of sync with the payment transaction state.

Ask Barry (IRC b2k) for more information if needed.

Bug: OTPaymentPlan::ProcessCron() code redundancy

The OTPaymentPlan::ProcessCron() code in lines 1377-1378 duplicates that in OTAgreement::ProcessCron(). Either we should delete these lines here, or delete the OTAgreement::ProcessCron() method, unless it there to support future expansion."

Ask Barry (IRC b2k) for more information if needed.

Using boost

Home-brewed code that could be replaced with boost code:

src/opentxs/opentxs.cpp

Replace ltrim, rtrim and trim functions with Boost's string algorithms (boost/algorithm/string.hpp)

src/core/OTPaths.cpp

Replace check if folder, file exists etc etc with boost::filesystem

src/core/OTLog.h/.cpp

Replace home-brew logging with boost.log 2.0 Why? Faster, cleaner, better maintained, used by many projects etc. than our own code http://boost-log.sourceforge.net/libs/log/doc/html/index.html

deps/irrxml XML parsing

Replace XML parsing with Boost.PropertyTree[2]

Add more as comments please.

Removes tech debt from opentxs api

Perform the same kind of transformations that we have done on otlib code

  • 1 header per class
  • 1 source per class
  • minimize header dependencies
  • minimize source includes
  • convert printf style logging to stream style logging
  • const correctness
  • correct private/protected
  • naming conventions
  • etc.

Eric is working on this.

opentxs decode

If you call opentxs decode, and enter "~", (an empty string), then opentxs decode asserts:

Please enter multiple lines of OT-armored text to be decoded, followed by an EOF or a ~ by itself on a blank line:
~


You entered:

Decode: Null: strEncoded passed in!
OT_ASSERT in /home/barry/dev/Monetas/opentxs/src/api/OTAPI_Exec.cpp at line 4183
stack trace:
/home/barry/dev/Monetas/opentxs/build/lib/libopentxs-api.so : opentxs::OTAPI_Exec::Decode(std::string const&, bool const&)+0xfd
/home/barry/dev/Monetas/opentxs/build/lib/libopentxs-api.so : opentxs::OTAPI_Wrap::Decode(std::string const&, bool const&)+0x28
/home/barry/dev/Monetas/opentxs/build/lib/libopentxs-api.so : opentxs::OT_Command::main_decode()+0xf1
/home/barry/dev/Monetas/opentxs/build/lib/libopentxs-api.so : opentxs::interpret_command(std::string const&)+0x1e4
/home/barry/dev/Monetas/opentxs/build/lib/libopentxs-api.so : opentxs::OT_ME::opentxs_main_loop()+0x130
opentxs() [0x406147]
opentxs : main()+0x14e
/lib/x86_64-linux-gnu/libc.so.6 : __libc_start_main()+0xf5
opentxs() [0x405442]

We probably shouldn't terminate the client with an assert due to unexpected command line input. We should just print an error message and exit gracefully.

Ask Barry (IRC b2k) for more information if needed.

Python api broken

Some issues with swig and the python api.

I install in ~/.local and place the python things in ~./local/lib64/python2.7/site-packages.

otapi.py is looking for _otapi.so, which the new name for the library is otapi-python.so ("-" in python module names are usually avoided) ...

import otapi
Traceback (most recent call last):
File "", line 1, in
File "/home/bluewall/.local/lib64/python2.7/site-packages/otapi.py", line 28, in
_otapi = swig_import_helper()
File "/home/bluewall/.local/lib64/python2.7/site-packages/otapi.py", line 20, in swig_import_helper
import _otapi
ImportError: No module named _otapi

So, make a link to the library ...

ln -s ~/.local/lib64/otapi-python.so _otapi.so

Then try again ...

import otapi
Traceback (most recent call last):
File "", line 1, in
File "/home/bluewall/.local/lib64/python2.7/site-packages/otapi.py", line 28, in
_otapi = swig_import_helper()
File "/home/bluewall/.local/lib64/python2.7/site-packages/otapi.py", line 24, in swig_import_helper
_mod = imp.load_module('_otapi', fp, pathname, description)
ImportError: /home/bluewall/.local/lib64/python2.7/site-packages/_otapi.so: undefined symbol: _ZTIN7opentxs12OTNameLookupE

I also tried renaming all the references to _otapi in otapi.py to otapi-python and ran into issues with the "-" in the library name.

Bug: OTCron::ProcessCronItems: Cron items may not process in FIFO order

OTCron::ProcessCronItems(), lines 709-718: If the transaction number count falls below 100 (20% of the refill amount) while processing cron items in a Cron processing round, then the remaining cron items in the Cron processing round are skipped. If this happens on a market order, it means market orders may not be processed in FIFO order. Some orders may get skipped, and not be processed until the next processing cycle. If the same condition repeats, orders at the bottom of the order book may never execute.

The fundamental problem here is that it needs to be possible to allocate transaction numbers on demand, not be forced to rely on a pre-allocated pool of transaction numbers not running out, or running too low, because the number of transaction numbers used by Cron during a processing round is not constant, and not deterministic.

Ask Barry (IRC b2k) for more information if needed.

Bug: OTPaymentPlan::ProcessCron() lines 1384-1389 Dead Code

OTPaymentPlan::ProcessCron() lines 1384-1389 are dead code because OTCron::ProcessCronItems() won't call OTPaymentPlan::ProcessCron() if there are < 100 transaction numbers remaining.

Ask Barry (IRC b2k) for more information if needed.

Bug: OTCron::ProcessCronItems() lines 752-781: Possible CronItem execution after deletion.

The current design of OTCron::ProcessCronItems() is unsafe in the event of a server failure that occurs inside a Cron processing cycle. If the server fails between the time cron items are deleted from memory and the time SaveCron is called, then the updated state of Cron is never recorded, which means the next time the server starts up and Cron restarts, the deleted cron items will still be present, so they will be executed again.

OTCron::ProcessCronItems() line 760 and 766

The function signatures of std::multimap<key, value>.erase() and std::map<key, value>.erase() have changed from void erase(iterator position) to iterator erase(const_iterator position). We should use the new C++11 syntax because it is safer, and it would allow us to test to make sure the erase() function succeeded.

Ask Barry (IRC b2k) for more information if needed.

Bug: OTCron::ProcessCronItems() line 781: Missing Error Handler

OTCron::ProcessCronItems() line 781: We fail to check the return value from the call to SaveCron(). This could result in file corruption in the persisted Cron state, and create the potential for future Cron task failure, misbehavior, and/or server crashes.

Ask Barry (IRC b2k) for more information if needed.

Bug: OTAgreement::ProcessCron() line 969:

The OTAgreement::ProcessCron() call to VerifyCurrentDate() on line 969 effectively does nothing, because ProcessCron() just returns true regardless of the result returned from VerifyCurrentDate().

As it currently stands, the implementation of OTAgreement::ProcessCron() is incomplete because OTAgreement doesn't currently do any cron processing of its own (the processing it does is ignored). We should consider removing OTAgreement::ProcessCron() if we can't find anything for it to do.

Ask Barry (IRC b2k) for more information if needed.

Building with python support triggers errors

I added ; to many lines of DEFINE_OT_DYNAMIC_CAST in include/opentxs/core/OTStorage.hpp and was able to build further. But, build still stops with a similar message and I have not been able to find the source of the issue ...

[ 98%] Swig source
cd /home/bluewall/src/opentxs/BUILD/swig && /usr/bin/cmake -E make_directory /home/bluewall/src/opentxs/BUILD/swig
cd /home/bluewall/src/opentxs/BUILD/swig && /usr/bin/swig -python -outdir /home/bluewall/src/opentxs/BUILD/swig -c++ -I/home/bluewall/src/opentxs/swig/../deps -I/home/bluewall/src/opentxs/swig -I/home/bluewall/src/opentxs/swig/../include -I/home/bluewall/src/opentxs/swig/../include/opentxs -I/home/bluewall/src/opentxs/swig/../include/opentxs/core -I/home/bluewall/src/opentxs/swig/../include/opentxs/ext -I/home/bluewall/src/opentxs/swig/../include/opentxs/api -I/usr/include/python2.7 -o /home/bluewall/src/opentxs/BUILD/swig/OTAPIPYTHON_wrap.cxx /home/bluewall/src/opentxs/swig/OTAPI.i
/home/bluewall/src/opentxs/swig/../include/opentxs/core/OTPassword.hpp:223: Warning 362: operator= ignored
/home/bluewall/src/opentxs/swig/../include/opentxs/core/OTStorage.hpp:1100: Error: Syntax error in input(3).
make[2]: *** [swig/OTAPIPYTHON_wrap.cxx] Error 1
make[2]: Leaving directory /home/bluewall/src/opentxs/BUILD' make[1]: *** [swig/CMakeFiles/_otapi-python.dir/all] Error 2 make[1]: Leaving directory/home/bluewall/src/opentxs/BUILD'
make: *** [all] Error 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.