GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - 858chain/token-shout: shoutout when token balance change

This repository was archived by the owner on Dec 30, 2022. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

44 Commits
44 Commits

Folders and files

NameName
Last commit message
Last commit date
api
api
 
 
cmd
cmd
 
 
contracts
contracts
 
 
docs
docs
 
 
ethclient
ethclient
 
 
notifier
notifier
 
 
scripts
scripts
 
 
utils
utils
 
 
.gitignore
.gitignore
 
 
AUTHORS
AUTHORS
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
TODO
TODO
 
 
VERSION
VERSION
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
receivers_example.json
receivers_example.json
 
 
run.sh
run.sh
 
 

Repository files navigation

Token shout notify balance changes for both ETH/ERC20 tokens, save registered upstream servics from repeatly querying for any event/balance change from ethreum chains.

version

Run

$ ./bin/token-shout --log-level debug \
  --log-dir /tmp \
  start \
  --http-listen-addr 0.0.0.0:8081 \
  --rpc-addr ws://192.168.0.101:9546 \
  --receivers-conf-path /tmp/receivers \
  --watch-list eth,usdt,dusd \
  --eth-wallet-dir /tmp/wallets \
  --eth-watch-interval 20s \
  --erc20-contracts-dir /tmp/contracts

Run In Docker(docker-compose style)

version: "3"

services:
  token-shout:
    image: 858chain/token-shout:latest
    volumes:
      - /data/token-shout-data:/data
      - /data/wallet-keeper-data/eth-wallet:/eth-wallet
    network_mode: host
    environment:
      - LOG_LEVEL=debug
      - HTTP_LISTEN_ADDR=127.0.0.1:8001
      - LOG_DIR=/data/log
      - RPCADDR=ws://localhost:9546
      - RECEIVERS_CONF_PATH=/data/receivers/receivers.json
      - WATCH_LIST=eth
      - ETH_WALLET_DIR=/eth-wallet
      - ETH_WATCH_INTERVAL=20s
      - ERC20_CONTRACTS_DIR=/data/contracts
    restart: always

Notice:

1、RECEIVERS_CONF_PATH, it should be the receivers.json full filepath , not path.

2、ETH_WALLET_DIR, it should be geth wallet keystone folder.

3、ERC20_CONTRACTS_DIR, it shoud be contract setting folder. the config js can generate by run scripts/contract_abi.rb file.

How to config

before start token-shout, you shoud setting a receivers.json config. below is sample config:

[
  {"endpoint": "http://exmaple.com/callback",
    "eventTypes": [
      "eth_balance_change_event",
      "erc20_log_event"
    ],
    "retryCount": 1,
    "newBalanceRemaining": 0.01,
    "from": ["*"],
    "to": ["all-in-wallet"]
  },
  {"endpoint": "http://exmaple2.com/callback",
    "eventTypes": [
      "eth_balance_change_event"
    ],
    "retryCount": 2,
    "newBalanceRemaining": 0.01,
    "from": ["*"],
    "to": ["all-in-wallet", "0x9d8ec6a2cfe2a6abdf5a6041e752ba851abb4dbb"]
  }
]

Notice:

1、newBalanceRemaining: filter event by > 0.01 can trigger event notification.

2、retryCount: send notification msg retry count, when the consumer return http status 200 code, the token shout service will confirm the msg is successful sending.

About

shoutout when token balance change

Topics

erc20erc20-tokensethnotification

Resources

Readme
Apache-2.0 license
Activity
Custom properties

Stars

4 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.