New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

tinyfox

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tinyfox

Data aggregation node for Ethereum

latest
npmnpm
Version
0.16.1
Version published
Maintainers
1
Created
Source

🦊 tinyfox

Simple lightweight data aggregator for Transfer/Approval events of ERC20 and ERC721 tokens

Npm install tinyfox

How to use (In NodeJS)

(Requires a MongoDB to be installed on the local machine)

    this.tinyFox = new TinyFox()
    await this.tinyFox.init({suffix: 'development'})



    let tinyfoxConfig = {
        contractType: 'ERC20',
        contractAddress: '0xab89a7742cb10e7bce98540fd05c7d731839cf9f' ,
        startBlock: 1316824,
        
        courseBlockGap: 1000, 
        fineBlockGap: 50,
        indexRate: 10000,
        updateBlockNumberRate:60000
    } 

    this.tinyFox.startIndexing( this.web3, tinyfoxConfig )  
    
    this.tinyFox.stopIndexing()   
    
    this.tinyFox.resetState()  
    
    
    

As tinyfox indexes, it starts at 'startBlock' and is collecting events at a pace of 'courseBlockGap' blocks read per 'indexRate' of time.
It stores these events inside of a mongo database named 'tinyfox_{{suffix}}' and inside of a collection named 'event_data'

Once tinyfox synchronizes to the front of the blockchain data (current state) then it will use the 'fineBlockGap' to remain synchronized.

As tinyfox is scraping chaindata for the ERC20/ERC721 token, it is also building a cache of user balances in the tables named 'erc20_balances' and 'erc721_balances'.

Events Supported

    ERC20 Events:  Transfer, Approval, Deposit (weth), Withdrawal (weth), Mint (0xBTC)

    ERC721 Events: Transfer

Keywords

ethereum

FAQs

Package last updated on 29 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts