EOSIO / eosjs-json

Information about the EOS blockchain in the JSON file format.
27 stars 17 forks source link

Automatic generation? #4

Closed tbfleming closed 6 years ago

tbfleming commented 6 years ago

By its name, I assume generated.json is automatically generated. How is this done?

jcalfee commented 6 years ago

It was automatically generated .. that tool was not maintained in eosio.. Next week I can consolidate the files in that directory and drop the name generated.

tbfleming commented 6 years ago

I noticed the bios abi has most of what's in generated.json, so I wrote a generation script today to see what happens. It's runs on node v8.11.1: extract-abi.js.txt

The definition order moved around, so I made it sort the definitions by name. I also sorted my local copy of the repo's generated.js to make it easier to compare. There's a bunch of new definitions (e.g. set_account_limits) and some new fields in updateauth. The bios abi doesn't have the following definitions; some are already in base.json:

jcalfee commented 6 years ago

@tbfleming, I used your script in 42aa827 ..

Keep in mind, this may be temporary. I'm wondering if we could remove the "schema" folder from eosjs-json and just include eosio.abi in the main eosjs repository. I'm already parsing abis in eosjs when a contract is loaded. I can just call that code statically when the eos instance is created.

tbfleming commented 6 years ago

Another option is to get_code the esoio abi at startup. That's the approach I took with https://github.com/tbfleming/eos-altjs .

jcalfee commented 6 years ago

I do lookup the ABI if you go into eos.contract('eosio', eosio => {..}) .. However, I update eosio.abi manually and package it allowing those more common actions to be used without looking them up (ex: eos[actionName](..)) ..