Advanced Features
Advanced vRAM features
To use advanced multi index features include #define USE_ADVANCED_IPFS
at the top of the contract file while following the steps below. If you have already deployed a contract that does not use advanced features, do not add this line, as it is not backwards compatible. With this addition, the primary key may be uint32
, uint64
, uint128
, and checksum256
.
Example implementation:
Another feature of the advanced multi index is warmuprow
and cleanuprow
actions. The warmuprow
action allows for faster warmups for IPFS actions. The warmup process is where data is fetched and loaded into RAM to be used. Previously each RAM entry touched would require 3 separate warmup actions, now this can be done within 1 action. The cleanuprow
action removes all the data entries created by the warmuprow
in the case that a rollback is required.
Additionally, vram tables from other contracts can now be read with the addition of the warmupcode
action. This is done the same way as a regular multi_index table by specifying a code
other than _self
. For example, by replacing:
with
This does require that the table struct and table name of the remote contract to be known, just as in regular multi_index. Remote tables can only be read, they cannot be modified. Remote table owners do not have to be staked to the same DSP as your contract.
These same conditions apply for reading vram tables from contracts on other chains. This is achieved with the warmupchain
and cleanchain
actions. Similar to reading from other contracts, this may be done using some additional parameters:
Where chain
is the name of the side chain as specified in the LiquidX chain model file. In the case of reading from the EOSIO mainnet, specify chain
as βmainnetβ.
Last updated