web3-proxy/config/example.toml

159 lines
5.3 KiB
TOML
Raw Permalink Normal View History

2022-10-19 02:31:40 +03:00
[app]
2022-05-12 21:49:57 +03:00
chain_id = 1
2022-11-13 21:39:49 +03:00
# a database is optional. it is used for user authentication and accounting
2022-09-03 05:59:30 +03:00
# TODO: how do we find the optimal db_max_connections? too high actually ends up being slower
2022-09-02 23:16:20 +03:00
db_max_connections = 99
2022-11-16 11:30:32 +03:00
# development runs cargo commands on the host and so uses "mysql://root:dev_web3_proxy@127.0.0.1:13306/dev_web3_proxy" for db_url
# production runs inside docker and so uses "mysql://root:web3_proxy@db:3306/web3_proxy" for db_url
2022-11-13 21:39:49 +03:00
db_url = "mysql://root:dev_web3_proxy@127.0.0.1:13306/dev_web3_proxy"
# read-only replica useful when running the proxy in multiple regions
db_replica_url = "mysql://root:dev_web3_proxy@127.0.0.1:13306/dev_web3_proxy"
2023-06-10 01:39:14 +03:00
deposit_factory_contract = "0x4e3BC2054788De923A04936C6ADdB99A05B0Ea36"
User Balance + Referral Logic (#44) * will implement balance topup endpoint * will quickly fix other PR reviews * merging from master * will finish up godmoe * will finish up login * added logic to top up balance (first iteration) * should implement additional columns soon (currency, amount, tx-hash), as well as a new table for spend * updated migrations, will account for spend next * get back to this later * will merge PR from stats-v2 * stats v2 rebased all my commits and squashed them down to one * cargo upgrade * added migrtation for spend in accounting table. will run test-deposit next * trying to get request from polygon * first iteration /user/balance/:tx_hash works, needs to add accepted tokens next * creating the referral code seems to work * will now check if spending enough credits will lead to both parties receiving credits * rpcstats takes care of accounting for spend data * removed track spend from table * Revert "removed track spend from table" This reverts commit a50802d6ae75f786864c5ec42d0ceb2cb27124ed. * Revert "rpcstats takes care of accounting for spend data" This reverts commit 1cec728bf241e4cfd24351134637ed81c1a5a10b. * removed rpc request table entity * updated referral code to use ulid s * credits used are aggregated * added a bunch of fields to referrer * added database logic whenever an aggregate stats is added. will have to iterate over this a couple times i think. go to (1) detecting accepted stables next, (2) fix influxdb bug and (3) start to write test * removed track spend as this will occur in the database * will first work on "balance", then referral. these should really be treated as two separate PRs (although already convoluted) * balance logic initial commit * breaking WIP, changing the RPC call logic functions * will start testing next * got rid of warnings & lint * will proceed with subtracting / adding to balance * added decimal points, balance tracking seems to work * will beautify code a bit * removed deprecated dependency, and added topic + deposit contract to app.yaml * brownie test suite does not rely on local contract files it pulls all from polygonscan * will continue with referral * should perhaps (in a future revision) recordhow much the referees got for free. marking referrals seems to work rn * user is upgraded to premium if they deposit more than 10$. we dont accept more than $10M in a single tx * will start PR, referral seems to be fine so far, perhaps up to some numbers that still may need tweaking * will start PR * removed rogue comments, cleaned up payments a bit * changes before PR * apply stats * added unique constraint * some refactoring such that the user file is not too bloated * compiling * progress with subusers, creating a table entry seems to work * good response type is there as well now, will work on getters from primary user and secondary user next * subuser logic also seems fine now * downgrade logic * fixed bug influxdb does not support different types in same query (which makes sense) * WIP temporary commit * merging with PR * Delete daemon.rs there are multiple daemons now, so this was moved to `proxyd` * will remove request clone to &mut * multiple request handles for payment * making requests still seem fine * removed redundant commented out bits * added deposit endpoint, added deposit amount and deposit user, untested yet * small bug with downgrade tier id * will add authorization so balance can be received for users * balance history should be set now too * will check balance over time again * subususer can see rpc key balance if admin or owner * stats also seems to work fine now with historical balance * things seem to be building and working * removed clone from OpenRequestHandle * removed influxdb from workspace members * changed config files * reran sea-orm generate entities, added a foreign key, should be proper now * removed contract from commit * made deposit contract optional * added topic in polygon dev * changed deposit contract to deposit factory contract * added selfrelation on user_tier * added payment required * changed chain id to u64 * add wss in polygon llamarpc * removed origin and method from the table * added onchain transactions naming (and forgot to add a migration before) * changed foreign key to be the referrer (id), not the code itself * forgot to add id as the target foreign key * WIP adding cache to update role * fixed merge conflicts --------- Co-authored-by: Bryan Stitt <bryan@llamanodes.com> Co-authored-by: Bryan Stitt <bryan@stitthappens.com>
2023-05-12 19:45:15 +03:00
free_subscriptions = true
2023-03-03 17:58:45 +03:00
kafka_urls = "127.0.0.1:19092"
2023-04-20 01:22:27 +03:00
kafka_protocol = "plaintext"
2023-03-03 17:58:45 +03:00
# a timeseries database is optional. it is used for making pretty graphs
influxdb_host = "http://127.0.0.1:18086"
influxdb_org = "dev_org"
influxdb_token = "dev_web3_proxy_auth_token"
influxdb_bucket = "dev_web3_proxy"
# thundering herd protection
# only mark a block as the head block if the sum of their soft limits is greater than or equal to min_sum_soft_limit
2022-10-21 23:59:05 +03:00
min_sum_soft_limit = 2_000
# only mark a block as the head block if the number of servers with it is great than or equal to min_synced_rpcs
2022-08-27 05:13:36 +03:00
min_synced_rpcs = 2
2023-06-17 19:19:05 +03:00
# don't serve requests if the best known block is >60 seconds old
max_head_block_age = 60
2022-11-13 21:39:49 +03:00
# redis is optional. it is used for rate limits set by `hard_limit`
2022-09-03 05:59:30 +03:00
# TODO: how do we find the optimal redis_max_connections? too high actually ends up being slower
volatile_redis_max_connections = 300
2022-11-16 11:30:32 +03:00
# development runs cargo commands on the host and so uses "redis://127.0.0.1:16379/" for volatile_redis_url
# production runs inside docker and so uses "redis://redis:6379/" for volatile_redis_url
2022-11-13 23:29:33 +03:00
volatile_redis_url = "redis://127.0.0.1:16379/"
2022-11-16 11:30:32 +03:00
# redirect_public_url is optional
redirect_public_url = "https://llamanodes.com/public-rpc"
2022-11-16 11:30:32 +03:00
# redirect_rpc_key_url is optional
# it only does something if db_url is set
2022-11-30 00:32:40 +03:00
redirect_rpc_key_url = "https://llamanodes.com/dashboard/keys?key={{rpc_key_id}}"
2022-11-13 21:39:49 +03:00
# sentry is optional. it is used for browsing error logs
# sentry_url = "https://SENTRY_KEY_A.ingest.sentry.io/SENTRY_KEY_B"
2022-11-04 01:16:27 +03:00
stripe_api_key = ""
# public limits are when no key is used. these are instead grouped by ip
2022-10-25 07:34:24 +03:00
# 0 = block all public requests
public_max_concurrent_requests = 3
2022-10-19 02:31:40 +03:00
# 0 = block all public requests
public_requests_per_period = 200
2022-11-28 22:59:42 +03:00
login_domain = "llamanodes.com"
# 10GB of cache
2022-10-21 23:59:05 +03:00
response_cache_max_bytes = 10_000_000_000
2022-11-13 21:39:49 +03:00
# allowed_origin_requests_per_period changes the min_sum_soft_limit for requests with the specified (AND SPOOFABLE) Origin header
# origins not in the list for requests without an rpc_key will use public_requests_per_period instead
[app.allowed_origin_requests_per_period]
2022-10-22 00:12:05 +03:00
"https://chainlist.org" = 1_000
2022-05-12 21:49:57 +03:00
2022-05-13 23:50:11 +03:00
[balanced_rpcs]
2022-05-06 04:40:43 +03:00
[balanced_rpcs.llamanodes]
display_name = "LlamaNodes"
2023-09-13 00:59:13 +03:00
block_data_limit = "archive"
http_url = "https://ethereum.llamarpc.com"
ws_url = "wss://ethereum.llamarpc.com"
2022-06-25 05:24:31 +03:00
[balanced_rpcs.ankr]
2022-11-14 00:05:37 +03:00
display_name = "Ankr"
2023-09-13 00:59:13 +03:00
block_data_limit = 64
http_url = "https://rpc.ankr.com/eth"
2022-06-25 05:24:31 +03:00
soft_limit = 1_000
2022-05-18 19:35:06 +03:00
2022-06-25 05:24:31 +03:00
[balanced_rpcs.cloudflare]
2022-11-14 00:05:37 +03:00
display_name = "Cloudflare"
http_url = "https://cloudflare-eth.com"
2022-06-25 05:24:31 +03:00
soft_limit = 1_000
2022-05-12 22:58:26 +03:00
2022-06-25 05:24:31 +03:00
[balanced_rpcs.blastapi]
2022-11-14 00:05:37 +03:00
display_name = "Blast"
http_url = "https://eth-mainnet.public.blastapi.io"
2022-06-25 05:24:31 +03:00
soft_limit = 1_000
2022-11-04 07:40:39 +03:00
[balanced_rpcs.mycryptoapi]
2022-11-14 00:05:37 +03:00
display_name = "MyCrypto"
2022-11-04 07:40:39 +03:00
disabled = true
http_url = "https://api.mycryptoapi.com/eth"
2022-11-04 07:40:39 +03:00
soft_limit = 1_000
2022-06-25 05:24:31 +03:00
[balanced_rpcs.pokt-v1]
2022-11-14 00:05:37 +03:00
display_name = "Pokt #1"
http_url = "https://eth-mainnet.gateway.pokt.network/v1/5f3453978e354ab992c4da79"
2022-08-27 05:13:36 +03:00
soft_limit = 500
2022-06-25 05:24:31 +03:00
[balanced_rpcs.pokt]
2022-11-14 00:05:37 +03:00
display_name = "Pokt #2"
http_url = "https://eth-rpc.gateway.pokt.network"
2022-08-27 05:13:36 +03:00
soft_limit = 500
2022-06-25 05:24:31 +03:00
[balanced_rpcs.linkpool]
2022-11-14 00:05:37 +03:00
display_name = "Linkpool"
http_url = "https://main-rpc.linkpool.io"
2022-08-27 05:13:36 +03:00
soft_limit = 500
2023-01-04 23:07:53 +03:00
[balanced_rpcs.runonflux]
display_name = "Run on Flux (light)"
http_url = "https://ethereumnodelight.app.runonflux.io"
2023-01-04 23:07:53 +03:00
soft_limit = 1_000
2022-05-12 04:38:27 +03:00
2022-08-27 05:13:36 +03:00
# load balanced light nodes are not very reliable
2022-11-04 07:40:39 +03:00
[balanced_rpcs.linkpool-light]
2022-11-14 00:05:37 +03:00
display_name = "Linkpool (light)"
2022-11-04 07:40:39 +03:00
disabled = true
http_url = "https://main-light.eth.linkpool.io"
2022-11-04 07:40:39 +03:00
soft_limit = 100
2022-08-27 05:13:36 +03:00
[private_rpcs]
2022-06-25 05:24:31 +03:00
2022-10-06 23:21:16 +03:00
# these worked well on ETH 1.0, but 2.0 ends up not working as well. we will re-assess as more validators turn on private transactions
2022-10-19 02:27:33 +03:00
[private_rpcs.eden]
disabled = true
2022-11-14 00:05:37 +03:00
display_name = "Eden network"
http_url = "https://api.edennetwork.io/v1/"
2022-06-25 05:24:31 +03:00
soft_limit = 1_805
2022-10-19 02:27:33 +03:00
[private_rpcs.eden_beta]
disabled = true
2022-11-14 00:05:37 +03:00
display_name = "Eden network beta"
http_url = "https://api.edennetwork.io/v1/beta"
2022-06-25 05:24:31 +03:00
soft_limit = 5_861
2022-10-19 02:27:33 +03:00
[private_rpcs.ethermine]
disabled = true
2022-11-14 00:05:37 +03:00
display_name = "Ethermine"
http_url = "https://rpc.ethermine.org"
2022-06-25 05:24:31 +03:00
soft_limit = 5_861
2022-10-19 02:27:33 +03:00
[private_rpcs.flashbots]
disabled = true
2022-11-14 00:05:37 +03:00
display_name = "Flashbots Fast"
http_url = "https://rpc.flashbots.net/fast"
2022-10-21 23:59:05 +03:00
soft_limit = 7_074
2022-06-25 05:24:31 +03:00
2022-10-19 02:27:33 +03:00
[private_rpcs.securerpc]
disabled = true
2022-11-14 00:05:37 +03:00
display_name = "SecureRPC"
http_url = "https://gibson.securerpc.com/v1"
2022-10-21 23:59:05 +03:00
soft_limit = 4_560