{"id":27429482,"url":"https://github.com/byteball/ico-bot","last_synced_at":"2025-09-19T11:15:11.382Z","repository":{"id":72989801,"uuid":"109411199","full_name":"byteball/ico-bot","owner":"byteball","description":"A bot for running an ICO","archived":false,"fork":false,"pushed_at":"2020-07-12T22:49:20.000Z","size":266,"stargazers_count":18,"open_issues_count":0,"forks_count":20,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-14T14:18:04.782Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/byteball.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-11-03T15:22:41.000Z","updated_at":"2021-04-21T05:19:38.000Z","dependencies_parsed_at":"2023-05-15T03:45:39.640Z","dependency_job_id":null,"html_url":"https://github.com/byteball/ico-bot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/byteball/ico-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteball%2Fico-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteball%2Fico-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteball%2Fico-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteball%2Fico-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/byteball","download_url":"https://codeload.github.com/byteball/ico-bot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteball%2Fico-bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271314721,"owners_count":24738227,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-04-14T14:17:57.301Z","updated_at":"2025-09-19T11:15:06.313Z","avatar_url":"https://github.com/byteball.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![ICO Bot with Web server](ico-stats.png)\n\n# ICO Bot with Web server\n\nThis bot allows to run an ICO on Byteball network.  It accepts Bytes, BTC, and Ether from users and sends back the new tokens in exchange.  You set the prices relative to USD or other fiat or crypto currencies. \n\n## Install\n\nInstall node.js, clone the repository, then say\n```sh\nnpm install\n```\n\n## Run\n\n### Before the ICO\n\nFirst, you need to sync your node\n```sh\nnode sync.js 2\u003eerrlog\n```\nIt will take about 3 days on SSD.\n\nThe bot is based on [headless wallet](../../../headless-obyte), see its documentation too to understand what options you have.  Also see the documentation of [the core library](../../../ocore).  Note that the default config enables TOR for security reasons, you need to have a TOR service running on your machine or disable TOR in conf.\n\nEdit `conf.js` or `conf.json` to describe the properties of your token and token sale.  See the comments in `conf.js` which describe the options.  Some of the most important options:\n\n* `bRequireRealName`: to require KYC.\n* `bRequireNonUs`: to allow only non-US investors.\n* `bRequireAccredited`: to allow only accredited investors.\n* `rulesOfDistributionOfTokens`: `real-time` for sending tokens immediately after the payment is confirmed, `one-time` for collecting investments during the ICO, and then sending tokens to all investors in one go when the ICO is over.\n* `totalTokens`: total number of smallest indivisible units (pennies) of the newly issued token.\n* `tokenDisplayDecimals`: number of decimals in user-displayed amounts of the token.  Total supply in user-displayed units is `totalTokens / 10^tokenDisplayDecimals`.\n* `assocPrices`: prices of your token depending on the payment currency.  The prices can be pegged to another currency, such as USD, in this case the prices in payment currency are periodically updated using exchange feeds.  Note that the prices are per smallest indivisible unit of your token, they are different from prices per user-displayed token by `tokenDisplayDecimals` decimal places.\n* `startDate` and `endDate`: start and end dates of the crowdsale.\n* `accumulationAddresses`: all collected funds are periodically swept to these addresses (one address per currency), it is recommended that these addresses are better secured by being multisig or offline.\n* `arrAdminAddresses`: array of device addresses of admins.  Only admins can change the price of your token by giving commands to the bot in chat interface (see below).  If you don't want to change the price via chat, leave this field empty.\n* `socksHost` and `socksPort`: for better security, it is recommended to configure your bot to use TOR, so the rest of the network won't know your real IP.  If you enable the [web server](#web-server), it is recommended to run it through a reverse proxy such as Cloudflare in order not to expose your IP address.\n\nChat with the bot, learn its address and pay a small amount (at least 10000 bytes) to fund asset issuance.  You’ll see the balance only when it is fully synced.\n\nWhen it is synced, cd to `scripts` and run\n```sh\nnode issue_tokens.js\n```\nDon't kill the script too early and follow its output.  It first creates a definition of the new token, waits for confirmation, then actually issues it.\n\n### Start the ICO\n\nWhen issuance is done, run\n```sh\nnode ico.js 2\u003eerrlog\n```\nThereafter, you start the daemon only with ico.js.  Now, the bot is ready to accept payments.\n\nIf you want to change the price of your token, you have two options:\n* ssh to your server and edit conf.json.  Note that the price stored in conf.json is the price per smallest indivisible unit of your token, which is `tokenDisplayDecimals` decimal places different from the price displayed to the users.  After editing the conf, restart your bot for the changes to take effect.\n* if you enabled `arrAdminAddresses` in your conf (see above), any of the admins can chat with the bot and change the price by sending `set price \u003cnew price\u003e` command to the bot (type `admin` to be reminded about the format of the command).  The price is per user-displayed token.  Any changes are effective immediately without restart.  This command edits your conf.json, so the new price is remembered even if the bot is restarted.\n\n### After the ICO\n\nCd to `scripts`.  Burn the remaining tokens:\n```sh\nnode burn_remaining_tokens.js\n```\nIf you failed to reach your target, refund:\n```sh\nnode refund.js\n```\nIf you chose one-time distribution (rather than sending tokens back to users immediately after receiving the payment), run the distribution script:\n```sh\nnode run_one_time_distribution.js\n```\n\n## Bitcoin\n\n### Install\n\nInstall Bitcoin Core https://bitcoin.org/en/full-node#linux-instructions\n\nTo save space, it is recommended to run it in pruning mode.  Edit your `~/.bitcoin/bitcoin.conf` and add the line `prune=550`.  The Bitcoin node will take only 5Gb disk space.\n\nSet `rpcuser` and `rpcpassword` in your `bitcoin.conf` the same as in the conf (`conf.js` or `conf.json`) of this bot.\n\n### Start\n```\nbitcoind -daemon\n```\n\n## Ethereum\n\n### Install\nInstall [geth](https://github.com/ethereum/go-ethereum/wiki/Installing-Geth#install-on-ubuntu-via-ppas)\n\n### Start\nStart dev node\n```bash\n$ geth --dev --mine --minerthreads 1 --ws --wsorigins \"*\" --wsapi \"db,eth,net,web3,personal,miner\"\n```\n\nStart Ropsten test network node\n```bash\n$ geth --testnet --ws --wsorigins \"*\" --wsapi \"admin,db,eth,net,web3,personal\" --cache=1024 --syncmode light\n```\n\nStart Main network node\n```bash\n$ geth --ws --wsorigins \"*\" --wsapi \"admin,db,eth,net,web3,personal\" --cache=1024 --syncmode light\n```\n\n# Web server\n\nA web server that shows stats of the ongoing ICO is started automatically when you start `ico.js`.  The server listens on port 8080 by default.  You usually want to proxy the web traffic to the server via nginx.\n\nYou can also start the server separately of `ico.js`:\n```\nnode server/bin/www.js\n```\n\n## Environment\n\n### Back End\n* [node.js](https://nodejs.org/en/) (v8.x.x)\n* [sqlite](https://www.postgresql.org/) (v3.x.x)\n* [pm2](http://pm2.keymetrics.io/)\n\n### Front End\n* [bower](https://bower.io/)\n* [jquery](http://api.jquery.com/) (v3.x.x)\n* [bootstrap](https://getbootstrap.com/docs/4.0/) (v4.x.x)\n* [pug](https://pugjs.org)\n* [stylus](http://stylus-lang.com/)\n\n## Client Build\n\nPlease run one of these commands before starting the web server and after each update.\n\n* build (production)\n```sh\nnpm run build\n```\n* build and start listening changes (production)\n```sh\nnpm run builder\n```\n* build (development)\n```sh\nnpm run build-dev\n```\n* build and start listening changes (development)\n```sh\nnpm run builder-dev\n```\n\n## Server Start\n\n`NODE_ENV` - `production` or `development` (`development`)\n\n# Server API\n\nUse these endpoints if you want to display ICO data on another website or want to fetch the data from another server.\n\n## List of transactions\n\n**URL** : `/api/transactions`\n\n**Method** : `GET`\n\n**Query parameters** :\n\n * `page=[integer]`  \n min=1  \n default=1\n * `limit=[integer]`  \n min=1, max=100  \n default=10\n * `sort=[string]`  \n one of ['currency_amount', 'creation_date']  \n default='creation_date'\n * `filter_stable=[string]`  \n one of ['all', 'true', 'false']  \n default='all'\n * `filter_currency=[string]`  \n one of ['all', 'GBYTE', 'BTC', 'ETH', 'USDT']  \n default='all'  \n * `filter_bb_address=[string]`  \n * `filter_receiving_address=[string]`  \n * `filter_txid=[string]`  \n\n**Response** :\n\n```\n{ \n  \"rows\": [{\n    \"txid\": [string],\n    \"receiving_address\": [string],\n    \"byteball_address\": [string],\n    \"currency\": [string],\n    \"currency_amount\": [decimal],\n    \"usd_amount\": [decimal],\n    \"tokens\": [integer],\n    \"stable\": [integer],\n    \"creation_date\": [string]\n  }, ...],\n  \"total\": [integer]\n}\n```\n\n## Statistic\n\n**URL** : `/api/statistic`\n\n**Method** : `GET`\n\n**Query parameters** :\n\n * `filter_currency=[string]`  \n one of ['all', 'GBYTE', 'BTC', 'ETH', 'USDT']  \n default='all'  \n * `filter_date_from=[string]`\n * `filter_date_to=[string]`\n\n**Response** :\n\n```\n{\n  \"rows\": [{\n    \"date\": [string], \n    \"count\": [integer],\n    \"sum\": [decimal],\n    \"usd_sum\": [decimal]\n  }, ...]\n}\n```\n\n## Common data\n\n**URL** : `/api/common`\n\n**Method** : `GET`\n\n**Query parameters** : -\n\n**Response** :\n\n```\n{\n  \"count_transactions\": [integer],\n  \"users_all\": [integer],\n  \"users_paid\": [integer],\n  \"total_sum\": [decimal]\n}\n```\n\n## Init data\n\n**URL** : `/api/init`\n\n**Method** : `GET`\n\n**Query parameters** : -\n\n**Response** :\n\n```\n{\n  \"tokenName\": [string]\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyteball%2Fico-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyteball%2Fico-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyteball%2Fico-bot/lists"}