Publishing Universal-Router decoded data by GraphQL mutation from the latest txpool and transaction in Ethereum
- GraphQL: Need to properly set up for the use of mutation
- Mongo DB: The data will regist to Mongo DB via GraphQL mutation
$ sudo apt install nodejs
$ cd ./[application execute path]
$ git clone https://github.com/HiroyukiNaito/uniswap-universal-decoder.git
$ cd uniswap-universal-decoder
$ yarn install
$ cd ./[application execute path]
$ git clone https://github.com/HiroyukiNaito/uniswap-universal-publisher.git
$ cd uniswap-universal-publisher
$ yarn install
$ vi .env
# Designate proper GraphQL endpoint
GRAPHQL_URL=http://localhost:4000/graphql
# Node.js heap size
NODE_OPTIONS="--max-old-space-size=4046"
# L1 Uniswap Universal Router Address
UNIVERSAL_ROUTER_ADDRESS=0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD
# Your L1 Websocket RPC endpoint url
RPC_WEBSOCKET_URL=ws://localhost:8546
# L2 Uniswap Universal Router Address
L2_UNIVERSAL_ROUTER_ADDRESS=0x198EF79F1F515F02dFE9e3115eD9fC07183f02fC
# Your L2 Websocket RPC endpoint url
# Currently supports only Optimism and Base
L2_RPC_WEBSOCKET_URL=ws://localhost:9546
# Authentication for Mutation
APP_SECRET=AccessToken
# CAUTION: If you don't have L2 RPC endpoint, please assign empty value (ex. L2_RPC_WEBSOCKET_URL="")
# Will skip obtaining L2 endpoint data
$ export $(cat .env | xargs)
$ node runPublish.js