{"id":22609165,"url":"https://github.com/bitfinexcom/bfx-ext-eos-multisig","last_synced_at":"2025-04-11T06:26:37.385Z","repository":{"id":141633932,"uuid":"190373698","full_name":"bitfinexcom/bfx-ext-eos-multisig","owner":"bitfinexcom","description":null,"archived":false,"fork":false,"pushed_at":"2020-09-11T16:55:33.000Z","size":175,"stargazers_count":3,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T04:19:52.789Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitfinexcom.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}},"created_at":"2019-06-05T10:18:55.000Z","updated_at":"2021-05-19T04:49:42.000Z","dependencies_parsed_at":"2023-03-13T10:30:28.835Z","dependency_job_id":null,"html_url":"https://github.com/bitfinexcom/bfx-ext-eos-multisig","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/bitfinexcom%2Fbfx-ext-eos-multisig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-ext-eos-multisig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-ext-eos-multisig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-ext-eos-multisig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitfinexcom","download_url":"https://codeload.github.com/bitfinexcom/bfx-ext-eos-multisig/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248353507,"owners_count":21089651,"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-12-08T15:11:11.424Z","updated_at":"2025-04-11T06:26:37.376Z","avatar_url":"https://github.com/bitfinexcom.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bfx-ext-eos-multisig\n\nOpen source C++ to JS port.\n\nOne worker will pull open transactions from the contract gateways via the HTTP API of the main and sidechain.\n\nIt creates a signed transaction and sends it to the network for signing.\n\nOnce the amount of required signatures is reached, the transaction is sent to the chain.\n\n## Setup\n\nRun two Grape rings:\n\n```\ngrape --dp 20001 --aph 30001 --bn '127.0.0.1:20002'\ngrape --dp 20002 --aph 40001 --bn '127.0.0.1:20001'\n\ngrape --dp 21001 --aph 50001 --bn '127.0.0.1:21002'\ngrape --dp 21002 --aph 60001 --bn '127.0.0.1:21001'\n```\n\n```\n# Add base as upstream:\ngit remote add upstream https://github.com/bitfinexcom/bfx-ext-js\n\n# Configure service:\nmkdir db\nbash setup-config.sh\n\n\n# setup dev ssl certs (use just in dev!):\ncp -R sec-test sec\n\n# add a dev key to run integration tests:\n# in eosmultisig.ext.json set for main/side:\n\n\"privateKey\": \"5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3\"\n```\n\nSetup a useraccount with multiple keys, example for an existing account\n(`testuser1511`):\n\n```\nPRIVATE_KEY='SECRET'\n\n# create dev wallet\n./cleos wallet create --name devwallet --file devwallet\ncat devwallet # your secret wallet key\n\n# unlock wallet\n./cleos wallet unlock -n devwallet\n\n# import key for user\n./cleos wallet import -n devwallet --private-key $PRIVATE_KEY\n\n# change permissions to use 2 keys for testuser1511@active\n# references two public keys:\ncleos set account permission testuser1511 active '{\"threshold\" : 100, \"keys\" : [{\"key\": \"EOS6jLRVDbXkjsRELh4g4mdrGwSSzwCvWhPBjU7vynsTvvzwsHEfM\",\"weight\": 50}, {\"key\": \"EOS8avaS8TiqEhzoZ8kMKnhSXuRpJ1NyLeSkJcX2eWYW5vtEzGESM\",\"weight\": 50}]}' -p testuser1511@owner\n\n# verify changed keys\n./cleos get account testuser1511\n\n\n# set public keys as `requiredKeys` in eosmultisig.ext.json\n\n```\n\n### Boot workers\n\n```\nnode worker.js --env=development --wtype=wrk-ext-eos-sign-api  --apiPort 8338\nnode worker.js --env=development --wtype=wrk-ext-eos-sign-api  --apiPort 7338\n\n\n# to speed up developments and review, in development mode, passing of keys is possible via commandline:\n\nnode worker.js --env=development --wtype=wrk-ext-eos-sign-api  --apiPort 8338 --chain=main --key=secret\n```\n\n### Debugging\n\nTo see if the workers are reachable from another machine, run:\n\n```\nnode test-grapes.js\n```\n\nIt should print the IPs it will send the requests to and the request should fail with \"outdated tx\".\n\nUse `test.js` for running tests where users transfer tokens between main and sidechain.\n\n### Contract details / implementation details\n\nIds in contract tables are increasing over time. To release **all** valid pending transactions, just the\nid of the oldest valid one is required, the contract will care of the other ids.\n\nValidation is done by comparing the time of the last irreversible block with the time stored in the table entry.\n\n`nexttrsid` is currently not used.\n\n\n## Grenache API\n\n### action: 'sign'\n\n  - `args \u003cArray\u003e`\n    - `0 \u003cObject\u003e`\n      - `tx \u003cString\u003e` Tx Uint8 Array encoded as hex\n      - `exp \u003cString\u003e` Expiry time of tx\n\n\n**Response:**\n\n  - `\u003cObject\u003e` tx status\n\n**Example Payload:**\n\n```js\n{ tx:\n   'EFD7145D65066DE414CA0000000001C0339BCEC8AEA65B00D4A44961A3A2BA01C0339BCEC8AEA65B00000000A8ED3232080C0000000000000000',\n  exp: '2019-06-27T14:51:27.000' }\n```\n\n**Example Response:**\n\n```js\n{ sentToChain: true }\n```\n\nExample: [example.js](example.js)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfinexcom%2Fbfx-ext-eos-multisig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitfinexcom%2Fbfx-ext-eos-multisig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfinexcom%2Fbfx-ext-eos-multisig/lists"}