{"id":21538306,"url":"https://github.com/rarimo/voting-relayer","last_synced_at":"2025-03-17T20:47:44.858Z","repository":{"id":250858979,"uuid":"835684804","full_name":"rarimo/voting-relayer","owner":"rarimo","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-12T14:11:51.000Z","size":464,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-24T07:45:32.080Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://rarimo.github.io/voting-relayer/","language":"Go","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/rarimo.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":"2024-07-30T10:29:24.000Z","updated_at":"2024-09-12T14:11:23.000Z","dependencies_parsed_at":"2024-09-11T23:32:12.383Z","dependency_job_id":"e9c15cd7-3474-417a-aff7-36757f5a3d87","html_url":"https://github.com/rarimo/voting-relayer","commit_stats":null,"previous_names":["rarimo/voting-relayer"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rarimo%2Fvoting-relayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rarimo%2Fvoting-relayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rarimo%2Fvoting-relayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rarimo%2Fvoting-relayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rarimo","download_url":"https://codeload.github.com/rarimo/voting-relayer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244110086,"owners_count":20399561,"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-11-24T04:11:37.384Z","updated_at":"2025-03-17T20:47:44.834Z","avatar_url":"https://github.com/rarimo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# voting-relayer\n\n## Description\n\nRelayer service that makes calls to the smart contracts. Now it is used to work with such endpoints:\n  - POST `/integrations/voting-relayer/v1/register` - it takes calldata in hex encoided format from Rarime mobile applications and makes call to the smart contract.\n\n    Request body example:\n    ```json\n    {\n      \"data\": {\n        \"tx_data\": \"hex_encoded_call_data\",\n        \"destination\": \"contract_address,optional\"\n      }\n    }\n    ```\n\n  - GET `/integrations/voting-relayer/v1/operations/latest`  - it returnes info about latest transited root\n    Response body example \n\n    ```json\n    {\n       \"data\": {\n       \"id\": \"\",\n       \"type\": \"\",\n       \"attributes\": {\n          \"block_height\": 0,\n          \"destination_chain\": \"\",\n          \"operation_id\": \"\",\n          \"proof\": \"\",\n          \"tx_hash\": \"\"\n       }\n    },\n    \"included\": []\n    }\n    ```\n\n  - GET `/integrations/voting-relayer/v1/operations/{root}`  - it returnes info about transited root, where root is lower case hex string with 0x prefix\n    Response body example\n\n     ```json\n     {\n        \"data\": {\n        \"id\": \"\",\n        \"type\": \"\",\n        \"attributes\": {\n           \"block_height\": 0,\n           \"destination_chain\": \"\",\n           \"operation_id\": \"\",\n           \"proof\": \"\",\n           \"tx_hash\": \"\"\n        }\n     },\n     \"included\": []\n     }\n     ```\n\n## Install\n\n  ```\n  git clone github.com/rarimo/voting-relayer\n  cd voting-relayer\n  go build main.go\n  export KV_VIPER_FILE=./config.yaml\n  ./main run service\n  ```\n\n## Documentation\n\nWe do use openapi:json standard for API. We use swagger for documenting our API.\n\nTo open online documentation, go to [swagger editor](http://localhost:8080/swagger-editor/) here is how you can start it\n```\n  cd docs\n  npm install\n  npm start\n```\nTo build documentation use `npm run build` command,\nthat will create open-api documentation in `web_deploy` folder.\n\nTo generate resources for Go models run `./generate.sh` script in root folder.\nuse `./generate.sh --help` to see all available options.\n\nNote: if you are using Gitlab for building project `docs/spec/paths` folder must not be\nempty, otherwise only `Build and Publish` job will be passed.  \n\n## Config\n```yaml\n  network:\n    rpc: \"\" # (url) RPC API endpoint | required\n    registration: \"\" # (hex) target contract address | required\n    private_key: \"\" # (hex without 0x) ECDSA secp256k1 private key for sign transactions\n    vault_address: \"http://127.0.0.1:8200\" # (url) vault address\n    vault_mount_path: \"secret_data\" # (string)\n    whitelist: # (list of hex addresses) specify which contracts can be passed in `destination` field in request\n      - \"0x123...123\"\n      - \"0x123...123\"\n```\nENV\n```\n  VAULT_TOKEN (will be cleared after start service)\n```\nThere must be specified or private key, or vault address and path. If specified both, then will be used private_key from config.\n\n## Running from docker \n  \nMake sure that docker installed.\n\nuse `docker run ` with `-p 8080:80` to expose port 80 to 8080\n\n  ```\n  docker build -t github.com/rarimo/voting-relayer .\n  docker run -e KV_VIPER_FILE=/config.yaml github.com/rarimo/voting-relayer\n  ```\n\n## Running from Source\n\n* Set up environment value with config file path `KV_VIPER_FILE=./config.yaml`\n* Provide valid config file\n* Launch the service with `run service` command to run full mode (voting and relayer)\n\n### Voting mode \nTo run service only in voting mode should use `run voting`\n\n### Relayer mode \nTo run service only in relayer mode should use `run relayer`\n\n\n### Third-party services\n\n\n## Contact\n\nResponsible \nThe primary contact for this project is  [//]: # (TODO: place link to your telegram and email)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frarimo%2Fvoting-relayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frarimo%2Fvoting-relayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frarimo%2Fvoting-relayer/lists"}