Git Product home page Git Product logo

Comments (6)

FellowTraveler avatar FellowTraveler commented on July 3, 2024

fellowtraveler
11:54 dansmith_btc: I've figured out the problem you were having
11:55 basically we have recently ported the Chaiscript OT API to C++
11:55 the section of the script that crashes for you is complaining about a missing function
11:55 The function is actually still there in the chai, but it's missing because OT is now using the C++ version
11:56 the C++ version is actually also here in the code, but it's not exposed to the scripts
fellowtraveler
11:56 Here's an example: https://github.com/Open-Transactions/Open-Transactions/blob/master/src/otapi/OT_ME.cpp#L1718
fellowtraveler
11:57 Notice how a shit-ton of OT API functions, at the URL I just pasted, are exposed to the scripts?
11:57 Basically the smart contract functions you need, whichever ones are missing, need to be added there at that URL
11:57 Cory left the room (quit: Ping timeout: 240 seconds).
fellowtraveler
11:57 one line for each function, just like you see there.
11:57 The functions that are missing for you, never needed to be there before because they were implemented directly in script form
11:58 but now that they are in C++, the scripts can't see those functions unless they are explicitly exposed
11:58 So FYI I'm going to get them all added there, which will fix your problem dansmith_btc.
11:58 ucerr left the room (quit: Ping timeout: 246 seconds).
fellowtraveler
11:58 In the meantime you can also just add them there yourself and rebuild, and it will fix your problem immeidately
11:58 otherwise I'll have the fix in quite soon.
11:59 Also dansmith_btc here is where in the smartcontract.ot script it is going down:
11:59 .
11:59 var bStatAgents = stat_partyagents(strSmartContract, strPartyName, int32_t(nDepth-1))
var bStatAccounts = stat_partyaccounts(strSmartContract, strPartyName, int32_t(nDepth-1))
11:59 .
12:00 Friday, June 20, 2014
fellowtraveler
12:00 Basically it's complaining that the stat_partyagents function doesn't exist
fellowtraveler
12:00 So I know if I go here: https://github.com/Open-Transactions/Open-Transactions/blob/master/src/otapi/OT_ME.cpp#L1718
fellowtraveler
12:00 and add a line there for stat_partyagents, the problem will go away
12:00 But then it will hit a similar problem on the very next line, with stat_partyaccounts
12:01 So then I can add that function too, and then it will hit the problem again on some other related function
12:01 and basically go through that process until they're all added to OT_ME.cpp
12:01 Might be quicker for you to just do that and send a pull request, but otherwise like I said, I will get those calls added.
12:01

from open-transactions.

themighty1 avatar themighty1 commented on July 3, 2024

What I did is I took the whole public block from
https://github.com/Open-Transactions/Open-Transactions/blob/master/include/otapi/ot_commands_ot.hpp#L24
EXPORT OT_COMMANDS_OT static int32_t accept_from_paymentbox(const string & strMyAcctID, const string & strIndices, const string & strPaymentType);
....
and stuck it to the bottom of OTAPI.hpp as part of the OTAPI_Wrap class
EXPORT static int32_t accept_from_paymentbox(const std::string & strMyAcctID, const std::string & strIndices, const std::string & strPaymentType);
....
then added all these commands to OT_ME.cpp
theScript.chai->add(fun(&OTAPI_Wrap::accept_from_paymentbox), "OT_API_accept_from_paymentbox");
...
make gives me this for each command
otapi/.libs/libotapi.so: undefined reference to `OTAPI_Wrap::accept_from_paymentbox(std::string const&, std::string const&, std::string const&)'
....
advise on how to proceed is appreciated.

from open-transactions.

FellowTraveler avatar FellowTraveler commented on July 3, 2024

What I did is I took the whole public block from (URL)
and stuck it to the bottom of OTAPI.hpp as part of the OTAPI_Wrap class

This part is unnecessary because that URL proves that all those functions are ALREADY part of the OT_Command class. See for yourself:

https://github.com/Open-Transactions/Open-Transactions/blob/master/include/otapi/ot_commands_ot.hpp#L18

Therefore there's no need adding those functions to OTAPI_Wrap because they already exist in OT_Command.

then added all these commands to OT_ME.cpp
theScript.chai->add(fun(&OTAPI_Wrap::accept_from_paymentbox), "OT_API_accept_from_paymentbox");

This part is mostly correct, except probably should be more like this:

theScript.chai->add(fun(&OT_Command::accept_from_paymentbox),
"OT_COM_accept_from_paymentbox");

Also you probably don't need to do it for the "whole block" of functions, but just for a few functions like stat_partyaccounts and stat_partyagents (the functions specifically used by smartcontract.ot.)

I would do it one function at a time, since it will probably only be a few functions. When it complains about the next function, just add it.

If OT_ME.cpp is unable to see the functions, BTW, see if "ot_commands_ot.hpp" is #included at the top of OT_ME.cpp. If not, adding the include there will fix that.

from open-transactions.

themighty1 avatar themighty1 commented on July 3, 2024

ALas, the same issue as in OP triggered again
after making changes as suggested and doing
sudo make uninstall
make
sudo make install
sudo ldconfig

from open-transactions.

FellowTraveler avatar FellowTraveler commented on July 3, 2024

I just realized the function shouldn't be exposed as OT_COM_accept_from_paymentbox, but rather, as accept_from_paymentbox, since that is the function name that would be expected. (There are places that would already be calling that function and would expect a certain name already.)

from open-transactions.

themighty1 avatar themighty1 commented on July 3, 2024

Yes, that fixed it. thanks

from open-transactions.

Related Issues (20)

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.