Code Monkey home page Code Monkey logo

poa-faucet's Introduction

Sokol POA Network faucet

Building from source

  1. Clone repository
git clone https://github.com/poanetwork/poa-faucet
  1. Copy config.json.example to config.json
cp config.json.example config.json
  1. Update config.json ./config.json (see config.json with placeholders below)
  2. Update ./public/index.html: Find <div class="g-recaptcha" data-sitekey="type your reCaptcha plugin secret here"></div> line and type your reCaptcha plugin secret in data-sitekey attribute. For more info, see
  3. Install dependencies npm install from the project's root
  4. Run faucet with npm start. Sokol POA Network faucet will be launched at http://localhost:5000

Server config.json (./config.json) with placeholders

{
  "environment": "switcher between configurations: 'prod' or 'dev'",
  "debug": "switch on/off server logs: true or false",
  "Captcha": {
    "secret": "reCaptcha plugin secret"
  },
  "Ethereum": {
    "etherToTransfer": "The number of milliEther to be sent from the faucet. For example, 500",
    "gasLimit": "Transaction gas limit, for example, 21000",
    "prod": {
      "rpc": "JSON RPC endpoint. For example, https://core.poa.network",
      "account": "The address from which the funds will be drained",
      "privateKey": "Private key of the account"
    },
    "dev": {
      ...
    }
  }
}

poa-faucet's People

Contributors

achempion avatar eswarasai avatar igorbarinov avatar ligi avatar vbaranov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

poa-faucet's Issues

Docker Compose

Just a question โ€” any plan for put this in Docker Compose? That will help others spin this faucet faster for their own usage i.e. development.

shutdown request

owner of the faucet and power of attorny is not granted to the individual dylan pelten.

(Fix) rename ETH to POA in alerts

Problem:
now we use ETH in POA messages in Sokol faucet

Success 0.5 ETH is successfully transfered to 0x92718b08585c19f9a4e3368d072a8aee9e9f2a2c

Solution:
replace ETH to POA

add callback URL

it would be great if one could pass a callback url to which one get's redirected once the transaction is triggered.

Error NPM Start

Hi All,

I need help for Fix to NPM Start. Error This Code
root@ubuntu-c-4-8gib-sfo3-01:~/poa-faucet# npm start

[email protected] start
npm run sass && npm run coffee && node index.js

[email protected] sass
gulp sass

fs.js:47
} = primordials;
^

ReferenceError: primordials is not defined
at fs.js:47:5
at req_ (/root/poa-faucet/node_modules/natives/index.js:143:24)
at Object.req [as require] (/root/poa-faucet/node_modules/natives/index.js:55:10)
at Object. (/root/poa-faucet/node_modules/vinyl-fs/node_modules/graceful-fs/fs.js:1:37)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)

(Fix) Change POA to SPOA

A faucet is for Sokol POA coins. So, POA should be changed to SPOA in alerts and button title.

Error internal server error

When you press the button "Request 0.5 SPOA" (without entering an addressor without putting a checkbox in the captha), you directly get the error: Error internal server error.
See screenshot:

image

Goerli Testnet Faucet - error: insufficient funds for gas * price + value

Everything is working great, but when I try to request goerli from my faucet I receive the following error:

{ Error: Returned error: insufficient funds for gas * price + value
at Object.ErrorResponse (/home/vulture/goerli-faucet/node_modules/web3-core-helpers/lib/errors.js:28:19)
at /home/vulture/goerli-faucet/node_modules/web3-core-requestmanager/lib/index.js:302:36
at XMLHttpRequest.request.onreadystatechange (/home/vulture/goerli-faucet/node_modules/web3-providers-http/lib/index.js:98:13)
at XMLHttpRequestEventTarget.dispatchEvent (/home/vulture/goerli-faucet/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22)
at XMLHttpRequest._setReadyState (/home/vulture/goerli-faucet/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14)
at XMLHttpRequest._onHttpResponseEnd (/home/vulture/goerli-faucet/node_modules/xhr2-cookies/dist/xml-http-request.js:318:14)
at IncomingMessage. (/home/vulture/goerli-faucet/node_modules/xhr2-cookies/dist/xml-http-request.js:289:61)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19) data: null }

I've tried adjusting the config file gaslimit and milliethertotransfer as well as using hex, but the same error occurs. Here is the config file:

{
"environment": "live",
"debug": false,
"Captcha": {
"secret": "MySecretHere"
},
"Ethereum": {
"milliEtherToTransfer": "1",
"gasLimit": "30000",
"live": {
"rpc": "https://goerli-light.eth.linkpool.io/",
"account": "MyEthAddress",
"privateKey": "MyPrivKey"
}
}
}

My tx index.js has the following:

const gasPrice = web3.utils.toWei('0.00000002', 'ether')
const gasPriceHex = web3.utils.toHex(gasPrice)
const gasLimitHex = web3.utils.toHex(config.Ethereum.gasLimit)
const nonce = await web3.eth.getTransactionCount(config.Ethereum[config.environment].account, "pending")
const nonceHex = web3.utils.toHex(nonce)
const BN = web3.utils.BN
const ethToSend = web3.utils.toWei(new BN(config.Ethereum.milliEtherToTransfer), "milliether")
const rawTx = {
nonce: nonceHex,
gasPrice: gasPriceHex,
gasLimit: gasLimitHex,
to: receiver,
value: ethToSend,
data: '0x00',
chainId: '5'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.