{"id":13790394,"url":"https://github.com/f-o-a-m/cliquebait","last_synced_at":"2025-12-30T00:33:46.761Z","repository":{"id":39633988,"uuid":"115741769","full_name":"f-o-a-m/cliquebait","owner":"f-o-a-m","description":"Scientists are SHOCKED by how easy it is to disrupt a $550B industry with this one weird trick!","archived":false,"fork":false,"pushed_at":"2023-11-01T17:00:01.000Z","size":48,"stargazers_count":107,"open_issues_count":0,"forks_count":23,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-08T04:13:06.672Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/f-o-a-m.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-12-29T17:34:12.000Z","updated_at":"2024-09-23T16:19:38.000Z","dependencies_parsed_at":"2022-08-10T10:30:58.876Z","dependency_job_id":"b64e09b6-cc59-42f7-b1c9-da0aec0f5a7e","html_url":"https://github.com/f-o-a-m/cliquebait","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f-o-a-m%2Fcliquebait","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f-o-a-m%2Fcliquebait/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f-o-a-m%2Fcliquebait/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f-o-a-m%2Fcliquebait/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f-o-a-m","download_url":"https://codeload.github.com/f-o-a-m/cliquebait/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253709216,"owners_count":21951123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T22:00:43.012Z","updated_at":"2025-12-30T00:33:46.728Z","avatar_url":"https://github.com/f-o-a-m.png","language":"Shell","funding_links":[],"categories":["Roadmap"],"sub_categories":[],"readme":"# cliquebait\nTest your DApps easily with this one weird trick!\n\n## Overview\nCliquebait is a compact, fun, and easy to use Docker image that spins up a single-node Proof of Authority blockchain with Geth. It also generates some accounts and gives them ether, as well as unlocks them for use via Web3.\n\n#### Why?\nCliquebait simplifies integration and accepting testing of smart contract applications by offering a clean ephemeral testing environment that closely resembles a real blockchain network. The key differences are a shorter block time (3 seconds by default) and a VERY high gas limit from the start.\n\n#### But geth and parity have `--dev` now!\nVery true! However, `geth` only has `--dev` mode as of v1.7.3, which also introduced slight changes to the JSON-RPC interface. Additionally, without careful configuration to avoid lazy block mining, you lose the ability to test things like waiting for block intervals and such.\n\n## Quickstart\nSimply run `docker run --rm -it -p 8545:8545 foamspace/cliquebait:latest` and connect to `http://localhost:8545/` using your Web3 interface of choice!\n\n## Advanced Usage\n\n### Give some ether to an account you control\nIf you're testing with MetaMask, for example, it's often helpful to have some ether allocated to the account that MetaMask has generated for you instead of having to import an ephemeral account.\nYou can pass a comma-separated of addresses in the `EXTERNAL_ALLOCS` environment variable to facilitate this. For example:\n\n``docker run --rm -it -p 8545:8545 -e EXTERNAL_ALLOCS=0xAb0B142C3231e58cD7dAc89e91e6a5030E6Bd888` foamspace/cliquebait:latest``\n\nor\n\n``docker run --rm -it -p 8545:8545 -e EXTERNAL_ALLOCS=0x6Af35ddaA6555d357845Fcd5c2C6A322a784c85d,0xAb0B142C3231e58cD7dAc89e91e6a5030E6Bd888,0x7e2A25C20e536B5e8b834Bb84A53bC2F6E2Fc4bB` foamspace/cliquebait:latest``\n\nThe mechanism is fairly forgiving, it's case-insensitive and it's OK to omit the `0x` prefix as long as the rest of the address is valid.\n\n### Create more (or less) accounts on startup\nSimply supply the `ACCOUNTS_TO_CREATE` environment variable to `docker run`. The value must be numeric, in base 10, and at least 1\n\nFor example (creates 10 accounts on startup): `docker run --rm -it -p 8545:8545 -e ACCOUNTS_TO_CREATE=10 foamspace/cliquebait:latest`\n\n### Define value of Wei to allocate to accounts on startup (default value is 1000 Ether)\nAdd a value of Wei to `ALLOC_WEI` environment variable to `docker run`. It have to be a hexadecimal value.\n\nFor example (adds 222 Ether to each account on startup): `docker run --rm -it -p 8545:8545 -e ALLOC_WEI=0xC08DE6FCB28B80000 foamspace/cliquebait:latest`\n\n### Tweak the genesis block\nOne may mount a custom genesis block to `/cliquebait/cliquebait.json` to really fine tune their network's behavior. The only key thing to keep in mind is that the `extraData` field MUST remain the same. Cliquebait supplies the address of an ephemeral \"authority\" for the network on startup, and for the image to behave properly this must remain as-is.\n\nAlternatively, you may pass in a genesis JSON directly via the `GENESIS_JSON` environment variable. The same rules regarding `extraData` apply!\n\n### Use specific accounts\nIf you have an account JSON file compatible with geth's keystore, you may embed it into a specially crafted JSON file (see `sample-extra-accounts.json`) and supply it to cliquebait. You may then mount this file as `/extra-accounts.json`, and cliquebait will allocate ether and unlock the account for use in Web3. Note that this involves supplying the password to the account in plaintext, so be careful! If you prefer not to have the account unlocked, you may simply add an `alloc` in the genesis block.\n\n### Persist the blockchain\nIf you want to keep your chain around for whatever reason, you may mount a volume or local folder to `/cbdata` inside the container. This implies that you won't be able to change the genesis block or change the number of created accounts without clearing the mount target and losing your chain (as these are all done when the blockchain is first fired up). However, this does mean that the accounts that get generated are much more easily accessible, as you can find the keystore directly on your local machine.\n\nFor example:\n\n```shell\nmkdir ~/my-persisted-cb\ndocker run --rm -it -p 8545:8545 -v ~/my-persisted-cb:/cbdata foamspace/cliquebait:latest\n```\n\nYou will then be able to find the keystore Geth is using at `~/my-persisted-cb/ethereum/keystore`. To find the password for a given account,\nyou may look at `~/my-persisted-cb/_cliquebait/accounts` and `~/my-persisted-cb/_cliquebait/account-passwords`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff-o-a-m%2Fcliquebait","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff-o-a-m%2Fcliquebait","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff-o-a-m%2Fcliquebait/lists"}