Faucet application for nem2 (catapult)
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
config
public
routes
views
.gitignore
Dockerfile
Procfile
README.md
app.js
app.json
package-lock.json
package.json

README.md

🚰 NEM Faucet

💓 Demo

🤝 Using with catapult-service-bootstrap

Build or Pull image

# build image
$ docker build -t my-nem2-faucet .

# or pull from dockerhub
$ docker pull 44uk/nem2-faucet

Add as service

Using nemesis Private Key automatically example.

faucet:
  # image: my-nem2-faucet # in case of built image
  image: 44uk/nem2-faucet
  stop_signal: SIGINT
  command: sh -c "/bin/sh /app/bin/create-env-from-generated-address.sh && /usr/local/bin/npm start"
  environment:
    - NETWORK=MIJIN_TEST
    - API_URL=http://rest-gateway:3000
    - PUBLIC_URL=http://localhost:3000
  volumes:
    - ./build/generated-addresses:/addresses:rw
  ports:
    - '4000:4000'
  depends_on:
    - rest-gateway

Using specific PrivateKey example.

faucet:
  image: 44uk/nem2-faucet
  stop_signal: SIGINT
  environment:
    - NETWORK=MIJIN_TEST
    - API_URL=http://rest-gateway:3000
    - PUBLIC_URL=http://localhost:3000
    - PRIVATE_KEY=__USING_SPECIFIED_PRIVATE_KEY__
  ports:
    - '4000:4000'
  depends_on:
    - rest-gateway

Specific Mosaic faucet example.

faucet:
  image: 44uk/nem2-faucet
  stop_signal: SIGINT
  environment:
    - NETWORK=MIJIN_TEST
    - API_URL=http://rest-gateway:3000
    - PUBLIC_URL=http://localhost:3000
    - MOSAIC_FQN=jpn:jpy
    - PRIVATE_KEY=__USING_SPECIFIED_PRIVATE_KEY__
  ports:
    - '4000:4000'
  depends_on:
    - rest-gateway

Deploy to Heroku

Deploy

Need to set PRIVATE_KEY(PrivateKey of your faucet account) while deployment.

If you want to use ReCaptcha, set both variables RECAPTCHA_CLIENT_SECRET and RECAPTCHA_SERVER_SECRET.

🐳 Dockerimage

🔥 Customize

# set enviroment variables
# * COOKIE_SECRET (it is just used for flash message)
# * PORT (default: 4000)
# * NETWORK (default: MIJIN_TEST)
# * PRIVATE_KEY
# * API_URL
# * PUBLIC_URL
# * MOSAIC_FQN (default: nem:xem)
# * OUT_MAX
# * OUT_MIN
# * OUT_OPT
# * ENOUGH_BALANCE
# * MAX_UNCONFIRMED
# * WAIT_HEIGHT
# * RECAPTCHA_CLIENT_SECRET
# * RECAPTCHA_SERVER_SECRET
# see .env.sample

# install packages
$ npm install

# start app
$ npm start

# or for development
$ npm run dev

💪 Powered by