Skip to content

Commit

Permalink
Merge pull request #135 from fioprotocol/main
Browse files Browse the repository at this point in the history
Main > Release 1.4.x
  • Loading branch information
trukhilio authored Dec 18, 2024
2 parents 1fa38b9 + b38fed1 commit 110f110
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ FIO_SERVER_URL_ACTION=
FIO_GET_TABLE_ROWS_OFFSET=
FIO_HISTORY_HYPERION_OFFSET=
FIO_TRANSACTION_MAX_RETRIES=
LOWEST_ORACLE_ID=

FIO_ORACLE_PRIVATE_KEY=
FIO_ORACLE_ACCOUNT=
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ FIO_SERVER_URL_ACTION= # URL of FIO API node
FIO_HISTORY_HYPERION_OFFSET= # The number of actions to get from history when using hyperion version
FIO_TRANSACTION_MAX_RETRIES= # The number of retries when FIO action call fails
FIO_GET_TABLE_ROWS_OFFSET= # Offset for FIO get tables rows action
LOWEST_ORACLE_ID= # WARNING! This is REQUIRED! If not set, incorrect wraps could be created, and tokens may be lost! The value of the wrapped oracle ID from the FIO chain table. Oracle items lower than this value should not be used to avoid wrapping already processed items.
FIO_ORACLE_PRIVATE_KEY= # The FIO private key used for approving unwrap transactions
FIO_ORACLE_ACCOUNT= # The FIO account used for approving unwrap transactions
Expand Down
1 change: 1 addition & 0 deletions config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default {
FIO_TRANSACTION_MAX_RETRIES: parseInt(process.env.FIO_TRANSACTION_MAX_RETRIES),
FIO_GET_TABLE_ROWS_OFFSET: parseInt(process.env.FIO_GET_TABLE_ROWS_OFFSET),
FIO_HISTORY_HYPERION_OFFSET: process.env.FIO_HISTORY_HYPERION_OFFSET,
LOWEST_ORACLE_ID: parseInt(process.env.LOWEST_ORACLE_ID),
},
gas: {
GAS_PRICE_LEVEL: process.env.GAS_PRICE_LEVEL,
Expand Down
7 changes: 5 additions & 2 deletions controller/api/fio.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import MathOp from '../utils/math.js';

const {
eth: { BLOCKS_RANGE_LIMIT_ETH, BLOCKS_OFFSET_ETH, ETH_CONTRACT, ETH_NFT_CONTRACT },
fio: { FIO_TRANSACTION_MAX_RETRIES, FIO_HISTORY_HYPERION_OFFSET },
fio: { FIO_TRANSACTION_MAX_RETRIES, FIO_HISTORY_HYPERION_OFFSET, LOWEST_ORACLE_ID },
infura: { eth, polygon },
nfts: { NFT_CHAIN_NAME },
oracleCache,
Expand Down Expand Up @@ -255,7 +255,8 @@ class FIOCtrl {
}

const handleWrapAction = async () => {
const lastProcessedFioOracleItemId = getLastProcessedFioOracleItemId();
const lastProcessedFioOracleItemId =
getLastProcessedFioOracleItemId() || LOWEST_ORACLE_ID;

console.log(`${logPrefix} start oracle from id = ${lastProcessedFioOracleItemId}`);

Expand Down Expand Up @@ -719,6 +720,8 @@ class FIOCtrl {
? lastDeltasItem.block_num - 1
: lastDeltasItem.block_num;
}
// add 1 sec to decrease 429 Too Many requests
await sleep(SECOND_IN_MILLISECONDS);

await getFioBurnedDomainsLogsAll(params);
}
Expand Down

0 comments on commit 110f110

Please sign in to comment.