{"id":18245047,"url":"https://github.com/edgeapp/edge-eospay-server","last_synced_at":"2025-09-12T00:38:55.529Z","repository":{"id":40523992,"uuid":"240625321","full_name":"EdgeApp/edge-eospay-server","owner":"EdgeApp","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-10T22:28:16.000Z","size":594,"stargazers_count":1,"open_issues_count":14,"forks_count":1,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-27T02:43:28.991Z","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/EdgeApp.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","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}},"created_at":"2020-02-15T01:08:23.000Z","updated_at":"2021-11-17T15:21:57.000Z","dependencies_parsed_at":"2023-10-11T00:59:18.863Z","dependency_job_id":null,"html_url":"https://github.com/EdgeApp/edge-eospay-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EdgeApp/edge-eospay-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdgeApp%2Fedge-eospay-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdgeApp%2Fedge-eospay-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdgeApp%2Fedge-eospay-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdgeApp%2Fedge-eospay-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EdgeApp","download_url":"https://codeload.github.com/EdgeApp/edge-eospay-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdgeApp%2Fedge-eospay-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274732455,"owners_count":25339345,"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-09-11T02:00:13.660Z","response_time":74,"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":"2024-11-05T09:18:44.204Z","updated_at":"2025-09-12T00:38:55.512Z","avatar_url":"https://github.com/EdgeApp.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Edge \u003c\u003e EOS Name Registration and Activation Server API\n\n### Leverages BTCPay Server, CouchDb, and the EOS Network to register named accounts using any cryptocurrency configured on your BTCPayServer\n\n### Prerequisites\n\n* [NodeJS](https://nodejs.org)\n  * The API uses the NodeJS / [ExpressJS](http://expressjs.com/) Frameworks inherently\n* A functioning [BTCPay Server](https://github.com/btcpayserver/btcpayserver) with configured Cryptos \u0026amp; Tokens that are synched to their networks\n  * [Luna Node Cloud Hosts](https://www.lunanode.com/) offer a [GREAT quick-start BTCPay Server VPS](https://medium.com/@BtcpayServer/launch-btcpay-server-via-web-interface-and-deploy-full-bitcoin-node-lnd-in-less-than-a-minute-dc8bc6f06a3).\n  * Manually installing a BTCPay Server seems possible, but many hours have been burned by @chuckwilliams37 with no success\n  * There's also a [docker option](https://github.com/btcpayserver/btcpayserver-docker) if you're into that.\n* A [CouchDB](http://couchdb.apache.org/) Installation with a DB named \"invoice_tx\"\n  * Install and run [CouchDB v1.6](http://docs.couchdb.org/en/1.6.1/install/index.html) (not yet compatible with 2.x) \n  * This is used to store the requested names, and track payments until at least 1 confirmation\n  * It seems to run fine alongside this API on the same machine\n  * [Here's an easy setup](https://websiteforstudents.com/install-apache-couchdb-on-ubuntu-16-04-17-10-18-04/) for Ubuntu machines I used (w/ LunaNode)\n  * Here's a neat trick to tunnel a remote CouchDB as though it were local (for local setup/testing of API while using remote CouchDB):\n\n        ssh -f -L localhost:15984:127.0.0.1:5984 user@remote_host -N \n\n\n#### Installation\n\n    npm install\n    mkdir config \u0026\u0026 cp serverConfig.json.sample ./config/serverConfig.json\n\nGo thorough and edit the `serverConfig.json` file:\n\n```\n    {\n        \"btcpayServerHostName\": \"mybtcpayserver.mydomain.com\", \n```\n:boom: Host Name will need to setup SSL Certificates and be available on the interwebs so that the BTCPay Server can safely communicate with it.\n```\n        \"apiPublicDisplayName\": \"Edge EOS Name Registration and Payment restful API\",\n        \"apiVersionPrefix\": \"/api/v1\",\n        \"clientPrivateKeyFullPath\": \"./config/btcpay_client_private.key\",\n        \"merchantPairingDataFullPath\": \"./config/btcpay_client_merchant_paring.data\",\n```\n:boom: These above full paths are used by the server as read/write destinations with some API key-pairing/generation calls, so be sure that no write issues exist for the API server in order to generate keys \u0026 pair appropriately\n```\n        \"btcpayStoreId\": \"StoreIDFromBTCPayServerAdminConfig\",\n        \"oneTimePairingCode\": \"pairingCodeFRomBTCPayServerUsedOnceWithPairingCall\", \n        \"supportedCurrencies\":\n            {\n            \"BTC\": true,\n            \"LTC\": true,\n            \"FTC\": true,\n            \"DOGE\": false,\n            \"DASH\": false,\n            \"ETH\": false\n            },\n        \"invoiceNotificationURL\": \"https://this.server.url/api/v1/invoiceNotificationEvent/\",\n```\n:boom: These values above are all used by the BTCPay Server for connecting clients (e.g. your instance of this API server) that are authorized to generate invoices, receive updates on confirmations, expirations, etc. Make sure that this list of currencies is in alignment with the currencies configured on your BTCPay Server!\n``` \n        \"dbFullpath\": \"http://admin:couchDBPassword@localhost:5984\",\n        \"btcPayInvoicePropsToSave\": [\n            \"url\", \"status\", \"btcPrice\", \"btcDue\", \"cryptoInfo\", \"price\", \"currency\", \"invoiceTime\", \"expirationTime\",\n            \"currentTime\", \"lowFeeDetected\", \"rate\", \"exceptionStatus\", \"refundAddressRequestPending\", \n            \"token\", \"paymentSubtotals\", \"paymentTotals\", \"amountPaid\", \"minerFees\", \"addresses\"\n        ],\n        \"eosCreatorAccountPrivateKey\" : \"EOSPrivateKeyAssociatedWithPaying/CreatingAccount\",\n```\n:warning::moneybag: You'll need to create an account on the EOS network that is WELL funded with CPU/NET/RAM to pay for \u0026 allocate the creation of other accounts. This (`eosCreatorAccountPrivateKey`) is the private key for that creator account. KEEP IT SAFE!\n```\n        \"eosjs\" : {\n            \"chainId\": \"aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906\", \n            \"httpEndpoint\": \"https://proxy.eosnode.tools\", \n            \"expireInSeconds\": 60,\n            \"broadcast\": true,\n            \"debug\": false,\n            \"sign\": true\n        },\n```\n:point_up: [EOSJS](https://github.com/EOSIO/eosjs) configs. [Docs here](https://eosio.github.io/eosjs/)\n```\n        \"eosPricingRatesURL\" : \"https://info1.edgesecure.co:8444/v1/eosPrices\",\n        \"eosAccountActivationStartingBalances\" :{\n            \"ram\": \"8192\",\n            \"net\": \"2\", \n            \"cpu\": \"10\" \n        },\n```\n:point_up: This is how much ram/net/cpu EACH account will be PRICED and \"seeded\" with. Actual results will vary depending on fluctuations during transactions.\n```\n        \"cryptoPricing\" : {\n            \"updateFrequencyMs\" : 300000,\n            \"apiKey\" : \"my-coinmarketcap-pro-api-key\",\n            \"rootPath\":  \"https://pro-api.coinmarketcap.com/v1\",\n        \"listings\": \"/cryptocurrency/listings/latest\",\n        \"tickerQuotes\": \"/ticker/\"\n        },\n```\n:point_up: This is your configuration for the [CoinMarketCap Pro API](https://coinmarketcap.com/api/documentation/v1/) for crypto pricing. BTCPay has it's own inbuilt mechanism for pricing tokens, so It's possible that this is not necessary, and is overkill. \n:recycle::point_up: A refactor may be in order here.\n:hankey: In any case, the code can be improved.\n\n```\n        \"serverSSLKeyFilePath\": \"/path/to/keyfile.key\",\n        \"serverSSLCertFilePath\": \"/path/to/certfile.crt\",\n        \"serverSSLCaCertFilePath\": \"/path/to/certauthorityfile.ca\"\n    }\n```\n\n#### Launch API server\n\n    node src/eos-name-server.js\n\n### BTCPay Client Pairing (Pair This API server w/ BTCPay Server)\n\nNote:\n\n* The pairing step is only needed once per client (e.g. your instance of this eos-name-api).\n* The token needs to be stored for usage in the future (handled by server in process below - stored in `\u003cCONFIG.merchantPairingDataFullPath\u003e` relative to project root).\n* Pairing codes will expire after 24 hours. However, once a token is approved or claimed, the expiration is cleared.\n\n:warning: This process has a time-out, so make sure you have opened up your `serverConfig.js` so that you can navigate to the appropriate URLs within the timeframe alloted, AND that your API Server is up \u0026 running, with SSL certs appropriately applied to both API server and BTCPay Server (otherwise BTCPay server will reject it).\n\n1. Login to your BTCPay Server Admin UI\n1. Navigate to STORES :arrow_right: (Selected Store (Create if Necessary))\n1. Under the \"General Settings\":\"Profile\" View, COPY the value listed in the non-editable \"Id\" Field. This is your \"Store ID\"\n1. Paste the Store ID in the `serverConfig.json` file in the `btcpayStoreId` field.\n1. Navigate to STORES :arrow_right: (Selected Store) :arrow_right: Settings :arrow_right: Access Tokens :arrow_right: Create New Token\n1. Give your API server a meaningful label: e.g. \"my-eos-name-server-api\"\n1. LEAVE PUBLIC KEY BLANK, Make sure the \"Facade\" option is set to \"merchant\"\n1. Click \"Request Pairing\"\n1. Review Settings (Label, Facade, SIN), confirm \"Pair to\" STORE and click \"Approve\" - \n    * :warning::boom: YOU NOW HAVE ~24 HOURS TO COMPLETE THE NEXT STEPS, or you must recreate a pairing key, and try again.\n1. Copy the \"Server initiated pairing code:\" at top (e.g. `gvdiRnK`)\n1. Using [PostMan](https://www.getpostman.com/tools), (or some such other tool), send a GET request to : `https://my-eos-name-api-server.com/api/v1/generateAndSavePrivateKey` - this will generate and save a private key indentity for your API server. (Highly recommend you run the `dev-watch-eos` command below so you can see output). You should get a response like:\n    ```\n    {\n        \"message\": \"Private key saved to server.\",\n        \"PK\": \"5d8114bd710163f3703561df34274a29c15cd5ee4301bba8907cdfe2a75c2a60\"\n    }\n    ```\n1. EDIT your `serverConfig.js` and paste your pairing code (from above step) into \"`oneTimePairingCode`\" property - make sure your API server is restarted after this action (again - `dev-watch-eos` command helps here)\n1. Again, using [PostMan](https://www.getpostman.com/tools), (or some such other tool), send a GET request to : `https://my-eos-name-api-server.com/api/v1/pairClientWithServer`.  You should get a response like:\n    ```\n       {\n            \"message\": \"Merchant code saved to server.\",\n            \"merchantCode\": \"CoycgtnCVqjLWvSiZT7EfBmnbjY3yu9fDAPPyJ5zsWsm\"\n        }\n    ```\n    * If you receive a 404 message, or `404 - {\"error\":\"The specified pairingCode is not found\"}` error, go back to the \"Create New Token\" step and try again.\n1. You should now be able to navigate to your BTCPay Server Admin UI :arrow_right: STORES :arrow_right: (Selected Store)\n\n#### Launch dev-server with live outputs \u0026 restarts using node-mon\n:warning: Requires [npx](https://www.npmjs.com/package/npx) \u0026 [nodemon](https://www.npmjs.com/package/nodemon) global installs (with nvm on Linux machines)\n\nThis mode is helpful because there are outputs in the startup scripts that will clue you in to the next steps if you're missing anything (like configs or key files).\n\n    sudo npm run dev-watch-eos\n\n#### Launch server using `forever-service`\n:warning: It is highly recommended that you install npm \u0026 node using [nvm](https://github.com/creationix/nvm) so that you don't run into EACCESS or permission/sudo issues when using [forever](https://www.npmjs.com/package/forever) \u0026 [forever-service](https://www.npmjs.com/package/forever-service)\n:warning: :boom: If you have not installed node using nvm, and you have installed global services on Ubuntu machines, you're honestly better off starting from scratch and going back to installing everything with nvm \u0026 reinstalling all of your global npm packages after you've got nvm up \u0026 running with your preferred version of node.\n\n    sudo forever-service install eos-name-api -r [username] --script ./src/eos-name-server.js --start\n\n#### Restart, stop, delete service (once installed w/ forever-service)\n\n    sudo service eos-name-api restart\n    sudo service eos-name-api stop\n    sudo forever-service delete eos-name-api\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgeapp%2Fedge-eospay-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedgeapp%2Fedge-eospay-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgeapp%2Fedge-eospay-server/lists"}