From fc8170dd2f135dfa369d00ea30c2164d3cace3bb Mon Sep 17 00:00:00 2001 From: pk910 Date: Thu, 19 Oct 2023 14:24:59 +0200 Subject: [PATCH 1/5] replace fauceth with powfaucet --- .../defaults/main.yaml | 6 +- .../templates/fauceth.yaml.j2 | 67 ------------------- .../templates/powfaucet.yaml.j2 | 36 ++++++++++ 3 files changed, 39 insertions(+), 70 deletions(-) delete mode 100644 roles/generate_kubernetes_config/templates/fauceth.yaml.j2 create mode 100644 roles/generate_kubernetes_config/templates/powfaucet.yaml.j2 diff --git a/roles/generate_kubernetes_config/defaults/main.yaml b/roles/generate_kubernetes_config/defaults/main.yaml index 7ced7888..29ee1576 100644 --- a/roles/generate_kubernetes_config/defaults/main.yaml +++ b/roles/generate_kubernetes_config/defaults/main.yaml @@ -66,11 +66,11 @@ gen_kubernetes_config_helm_charts: repository: https://ethpandaops.github.io/ethereum-helm-charts version: 0.1.4 faucet: - valuesTemplatePath: templates/fauceth.yaml.j2 + valuesTemplatePath: templates/powfaucet.yaml.j2 dependencies: - - name: fauceth + - name: powfaucet repository: https://ethpandaops.github.io/ethereum-helm-charts - version: 0.2.3 + version: 0.0.1 faucet-2: valuesTemplatePath: templates/eth-faucet.yaml.j2 dependencies: diff --git a/roles/generate_kubernetes_config/templates/fauceth.yaml.j2 b/roles/generate_kubernetes_config/templates/fauceth.yaml.j2 deleted file mode 100644 index 1257114e..00000000 --- a/roles/generate_kubernetes_config/templates/fauceth.yaml.j2 +++ /dev/null @@ -1,67 +0,0 @@ -# {{ ansible_managed }} - -fauceth: - fullnameOverride: fauceth - image: - repository: {{ default_tooling_images.fauceth.split(':') | first }} - tag: {{ default_tooling_images.fauceth.split(':') | last}} - ingress: - enabled: true - - className: ingress-nginx-public - - hosts: - - host: faucet.{{ network_subdomain }} - paths: - - path: / - pathType: Prefix - - secretEnv: - APP_AMOUNT: "100080000000000000000" # 100.08 ETH - APP_IMAGEURL: "https://i.imgur.com/M0gEdpw.png" - APP_TITLE: "{{ ethereum_network_name }} Faucet" - APP_CHAINS: "{{ ethereum_genesis_chain_id }}" - APP_LOGGING: "VERBOSE" - APP_ETHKEY: "" - HCAPTCHA_SECRET: "" - HCAPTCHA_SITEKEY: "" - - initContainers: - - name: init-config - image: bash:latest - imagePullPolicy: IfNotPresent - securityContext: - runAsNonRoot: false - runAsUser: 0 - volumeMounts: - - name: config - mountPath: /config - command: - - bash - - -ace - - > - echo ' - [{ - "name": "{{ ethereum_network_name }}", - "chain": "dencunEth", - "icon": "ethereum", - "rpc": [ - "{{ default_el_endpoint }}" - ], - "faucets": [], - "nativeCurrency": { - "name": "Ether", - "symbol": "ETH", - "decimals": 18 - }, - "infoURL": "https://ethereum.org", - "shortName": "eth", - "chainId": {{ ethereum_genesis_chain_id }}, - "networkId": {{ ethereum_genesis_chain_id }}, - "slip44": 60, - "ens": { - "registry":"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" - } - }] - ' > /config/chains.json; - cat /config/chains.json; diff --git a/roles/generate_kubernetes_config/templates/powfaucet.yaml.j2 b/roles/generate_kubernetes_config/templates/powfaucet.yaml.j2 new file mode 100644 index 00000000..a4a11fe7 --- /dev/null +++ b/roles/generate_kubernetes_config/templates/powfaucet.yaml.j2 @@ -0,0 +1,36 @@ +# {{ ansible_managed }} + +powfaucet: + fullnameOverride: powfaucet + + image: + repository: {{ default_tooling_images.powfaucet.split(':') | first }} + tag: {{ default_tooling_images.powfaucet.split(':') | last}} + ingress: + enabled: true + + className: ingress-nginx-public + + hosts: + - host: faucet.{{ network_subdomain }} + paths: + - path: / + pathType: Prefix + + faucetTitle: "{{ ethereum_network_name }} PoW Faucet" + faucetPrivkey: "" + faucetRpcUrl: "{{ default_el_endpoint }}" + faucetExplorerLink: "https://explorer.{{ network_subdomain }}/tx/{txid}" + + faucetMaxDropWei: 100000000000000000000 # 100 ETH + + faucetCaptchaEnabled: true + faucetCaptchaSitekey: "" + faucetCaptchaSecret: "" + + faucetRecurringLimitsEnabled: true + faucetRecurringLimitsAmountWei: 500000000000000000000 # 500 ETH + faucetRecurringLimitsDuration: 86400 # 1 day + + faucetPowEnabled: true + faucetPowRewardPerHash: 1000000000000000000 # 1 ETH From df236190716f88cd0f3cc63e50c4d0c5d9d7d408 Mon Sep 17 00:00:00 2001 From: pk910 Date: Thu, 19 Oct 2023 14:42:07 +0200 Subject: [PATCH 2/5] add basic settings to template --- .../templates/powfaucet.yaml.j2 | 47 +++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/roles/generate_kubernetes_config/templates/powfaucet.yaml.j2 b/roles/generate_kubernetes_config/templates/powfaucet.yaml.j2 index a4a11fe7..80185031 100644 --- a/roles/generate_kubernetes_config/templates/powfaucet.yaml.j2 +++ b/roles/generate_kubernetes_config/templates/powfaucet.yaml.j2 @@ -22,15 +22,56 @@ powfaucet: faucetRpcUrl: "{{ default_el_endpoint }}" faucetExplorerLink: "https://explorer.{{ network_subdomain }}/tx/{txid}" - faucetMaxDropWei: 100000000000000000000 # 100 ETH - + # captcha module (require captcha check) faucetCaptchaEnabled: true + faucetCaptchaProvider: "hcaptcha" faucetCaptchaSitekey: "" faucetCaptchaSecret: "" - + + # ens module (allow/require ENS names) + faucetEnsEnabled: true + faucetEnsRpcUrl: "https://rpc.flashbots.net/" + faucetEnsRequired: false + + # ipinfo module (check ip-api.com) + faucetIpinfoEnabled: true + faucetIpinfoHostingRewards: 10 # 10% + faucetIpinfoProxyRewards: 10 # 10% + + # ethinfo module (check target wallet balance / type) + faucetEthinfoEnabled: true + faucetEthinfoMaxbalanceWei: 100000000000000000000 # 100 ETH + faucetEthinfoDenyContract: true + + # outflow module (limit global faucet outflow) + faucetOutflowEnabled: false + faucetOutflowAmountWei: 1000000000000000000000 # 1000 ETH + faucetOutflowDuration: 86400 # 1 day + faucetOutflowBufferWei: 500000000000000000000 # 500 ETH + + # github module (require login to github) + faucetGithubEnabled: false + faucetGithubClientid: "" # github app + faucetGithubSecret: "" # github app + faucetGithubMinAge: 604800 # 7 days + faucetGithubMinRepos: 5 + faucetGithubMinFollowers: 5 + faucetGithubLimitAmountWei: 100000000000000000000 # 100 ETH + faucetGithubLimitDuration: 86400 # 1 day + + # mainnet module (check mainnet wallet balance / nonce) + faucetMainnetEnabled: false + faucetMainnetRpcUrl: "https://rpc.flashbots.net/" + faucetMainnetMinBalanceWei: 10000000000000000 # 0.01 ETH + faucetMainnetMinTxCount: 5 + + # recurring limits module (enforce limits for recurring users) faucetRecurringLimitsEnabled: true faucetRecurringLimitsAmountWei: 500000000000000000000 # 500 ETH faucetRecurringLimitsDuration: 86400 # 1 day + # pow module (require mining) faucetPowEnabled: true faucetPowRewardPerHash: 1000000000000000000 # 1 ETH + faucetPowMaxDuration: 18000 # 5h + faucetPowDifficulty: 12 From 2855f06f99c90628f7c7612db147e6004f61a122 Mon Sep 17 00:00:00 2001 From: pk910 Date: Thu, 19 Oct 2023 16:14:37 +0200 Subject: [PATCH 3/5] remove default values from template --- .../templates/powfaucet.yaml.j2 | 48 +------------------ 1 file changed, 1 insertion(+), 47 deletions(-) diff --git a/roles/generate_kubernetes_config/templates/powfaucet.yaml.j2 b/roles/generate_kubernetes_config/templates/powfaucet.yaml.j2 index 80185031..7e02d83e 100644 --- a/roles/generate_kubernetes_config/templates/powfaucet.yaml.j2 +++ b/roles/generate_kubernetes_config/templates/powfaucet.yaml.j2 @@ -22,56 +22,10 @@ powfaucet: faucetRpcUrl: "{{ default_el_endpoint }}" faucetExplorerLink: "https://explorer.{{ network_subdomain }}/tx/{txid}" - # captcha module (require captcha check) faucetCaptchaEnabled: true - faucetCaptchaProvider: "hcaptcha" faucetCaptchaSitekey: "" faucetCaptchaSecret: "" - - # ens module (allow/require ENS names) - faucetEnsEnabled: true - faucetEnsRpcUrl: "https://rpc.flashbots.net/" - faucetEnsRequired: false - - # ipinfo module (check ip-api.com) - faucetIpinfoEnabled: true - faucetIpinfoHostingRewards: 10 # 10% - faucetIpinfoProxyRewards: 10 # 10% - - # ethinfo module (check target wallet balance / type) - faucetEthinfoEnabled: true - faucetEthinfoMaxbalanceWei: 100000000000000000000 # 100 ETH - faucetEthinfoDenyContract: true - - # outflow module (limit global faucet outflow) - faucetOutflowEnabled: false - faucetOutflowAmountWei: 1000000000000000000000 # 1000 ETH - faucetOutflowDuration: 86400 # 1 day - faucetOutflowBufferWei: 500000000000000000000 # 500 ETH - - # github module (require login to github) - faucetGithubEnabled: false - faucetGithubClientid: "" # github app - faucetGithubSecret: "" # github app - faucetGithubMinAge: 604800 # 7 days - faucetGithubMinRepos: 5 - faucetGithubMinFollowers: 5 - faucetGithubLimitAmountWei: 100000000000000000000 # 100 ETH - faucetGithubLimitDuration: 86400 # 1 day - - # mainnet module (check mainnet wallet balance / nonce) - faucetMainnetEnabled: false - faucetMainnetRpcUrl: "https://rpc.flashbots.net/" - faucetMainnetMinBalanceWei: 10000000000000000 # 0.01 ETH - faucetMainnetMinTxCount: 5 - - # recurring limits module (enforce limits for recurring users) - faucetRecurringLimitsEnabled: true + faucetRecurringLimitsAmountWei: 500000000000000000000 # 500 ETH - faucetRecurringLimitsDuration: 86400 # 1 day - - # pow module (require mining) faucetPowEnabled: true faucetPowRewardPerHash: 1000000000000000000 # 1 ETH - faucetPowMaxDuration: 18000 # 5h - faucetPowDifficulty: 12 From 0be7ae2940cd0ccf14446614816dcc399d2161b9 Mon Sep 17 00:00:00 2001 From: pk910 Date: Thu, 19 Oct 2023 16:25:21 +0200 Subject: [PATCH 4/5] add resource limits for powfaucet --- .../templates/powfaucet.yaml.j2 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/roles/generate_kubernetes_config/templates/powfaucet.yaml.j2 b/roles/generate_kubernetes_config/templates/powfaucet.yaml.j2 index 7e02d83e..8c6f361e 100644 --- a/roles/generate_kubernetes_config/templates/powfaucet.yaml.j2 +++ b/roles/generate_kubernetes_config/templates/powfaucet.yaml.j2 @@ -6,6 +6,15 @@ powfaucet: image: repository: {{ default_tooling_images.powfaucet.split(':') | first }} tag: {{ default_tooling_images.powfaucet.split(':') | last}} + + resources: + requests: + cpu: 1000m + memory: 500Mi + limits: + cpu: 2000m + memory: 1Gi + ingress: enabled: true @@ -25,7 +34,7 @@ powfaucet: faucetCaptchaEnabled: true faucetCaptchaSitekey: "" faucetCaptchaSecret: "" - + faucetRecurringLimitsAmountWei: 500000000000000000000 # 500 ETH faucetPowEnabled: true faucetPowRewardPerHash: 1000000000000000000 # 1 ETH From c904defbf3daa219dfbb7703e8ec63f3ae63268d Mon Sep 17 00:00:00 2001 From: pk910 Date: Thu, 19 Oct 2023 16:35:31 +0200 Subject: [PATCH 5/5] lower cpu limit --- roles/generate_kubernetes_config/templates/powfaucet.yaml.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/generate_kubernetes_config/templates/powfaucet.yaml.j2 b/roles/generate_kubernetes_config/templates/powfaucet.yaml.j2 index 8c6f361e..b4242f4d 100644 --- a/roles/generate_kubernetes_config/templates/powfaucet.yaml.j2 +++ b/roles/generate_kubernetes_config/templates/powfaucet.yaml.j2 @@ -9,10 +9,10 @@ powfaucet: resources: requests: - cpu: 1000m + cpu: 200m memory: 500Mi limits: - cpu: 2000m + cpu: 400m memory: 1Gi ingress: