{"id":13632036,"url":"https://github.com/trinity-project/trinity","last_synced_at":"2025-04-18T01:32:22.335Z","repository":{"id":115748151,"uuid":"112187697","full_name":"trinity-project/trinity","owner":"trinity-project","description":"Trinity state channel protocol","archived":false,"fork":false,"pushed_at":"2019-04-25T10:50:18.000Z","size":3263,"stargazers_count":45,"open_issues_count":7,"forks_count":9,"subscribers_count":27,"default_branch":"trunk","last_synced_at":"2024-08-01T22:51:31.708Z","etag":null,"topics":["neo","protocol","trinity"],"latest_commit_sha":null,"homepage":"","language":"Python","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/trinity-project.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":"2017-11-27T11:26:38.000Z","updated_at":"2023-03-03T09:47:15.000Z","dependencies_parsed_at":"2023-07-02T20:31:10.650Z","dependency_job_id":null,"html_url":"https://github.com/trinity-project/trinity","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinity-project%2Ftrinity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinity-project%2Ftrinity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinity-project%2Ftrinity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinity-project%2Ftrinity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trinity-project","download_url":"https://codeload.github.com/trinity-project/trinity/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223772123,"owners_count":17199968,"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":["neo","protocol","trinity"],"created_at":"2024-08-01T22:02:48.989Z","updated_at":"2024-11-09T00:30:33.768Z","avatar_url":"https://github.com/trinity-project.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Trinity\nTrinity is a universal off-chain scaling solution, which aims to achieve real-time payments with low transaction fees, scalability and privacy protection for mainchain assets. Using state channel technology, Trinity will significantly increase the transaction throughput of underlying chains as well as the assets on smart contracts. TNC cross-chain converter facilitates the data and value flow between multiple chains. Trinity will be a fully autonomous and decentralized performance-enhancing network for the entire ecosystem and provides all-round support to Dapps on bottom layer chains in the future. https://trinity.tech\n\n# Trinity-neo\ntrinity-neo is the implementation of trinity protocol based on NEO.\n\n# Trinity-neo Network Configuration Guide\n\n\nnote：Trinity routing nodes require the configuration environment be no less than python3.6.    \nAs Trinity develops, this file may not apply to the new version. This file was tested on Ubuntu16.04 desktop.\n\n## Trinity-neo Runtime Environment Preparation\n\nInstall system library and system tools\n\n``` shell\nsudo apt-get install screen git libleveldb-dev libssl-dev g++\n```\nInstall mongodb and launch the service\n\n\n``` shell\nsudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5\n\necho \"deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse\" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list\n\nsudo apt-get update\n\nsudo apt-get install mongodb-org\n\nsudo service mongod start\n\n```\n\n*Ref：mongodb configuration details, please visit:  https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/*\n\nConfigure python3.6\n\n``` shell\nsudo apt-get install software-properties-common\n\nsudo add-apt-repository ppa:jonathonf/python-3.6\n\nsudo apt-get update\n\nsudo apt-get install python3.6 python3.6-dev\n```\n\nInstall pip3.6\n\n``` shell\nsudo wget https://bootstrap.pypa.io/get-pip.py\n\nsudo python3.6 get-pip.py\n```\n\nInstall virtualenv\n\n``` shell\nsudo pip3.6 install virtualenv\n```\n\n## Get Trinity-neo Source Code\n\n``` shell\ngit clone https://github.com/trinity-project/trinity.git /home\n```\n\nOpen trinity source code catalo\n\n``` shell\ncd /home/trinity\n```\n\nCreate and activate virtual environment\n\n``` shell\nvirtualenv -p /usr/bin/python3.6 venv\n\nsource venv/bin/activate\n```\n\nInstall trinity node requirement package\n\n``` shell\npip install -r requirements\n```\n\n## Install Trinity Routing Node Gateway\n\nOpen gateway configuration file\n\n``` shell\nvi gateway/config.py\n```\n\nFind'cg_public_ip_port = \"localhost:8089\"'\nand Put user’s public ip address at the localhost\n\neg：cg_public_ip_port = \"8.8.8.8:8089\"\n\nCreate a new session window\n\n``` shell\nscreen -S TrinityGateway #TrinityGateway: 用户可替换该名称\n```\n\nEnter virtual environment\n\n``` shell\nsource venv/bin/activate\n```\n\nRun the Gateway service\n\n``` shell\npython start.py\n```\n\nThe code below indicates the Gateway successfully started\n\n```shell\n###### Trinity Gateway Start Successfully! ######\n\n```\n\nUse ctrl+a+d to close current TrinityGateway session window\n\nNote: call the function below to re-open the existing TrinityGateway session window\n\n```shell\nscreen -r TrinityGateway\n```\n\n## Install Trinity Routing Node Wallet \n\nRevise configuration file\n\n``` shell\nvi wallet/configure.py \n```\nThe default configure file applies to the testnet, for which configure_testnet.py and configure_mainnet.py co-exist in the wallet catalog. For the mainnet, simply copy configure_mainnet.py and paste it to configure.py. \n\nPlease refer to notes for configuration details.\n\nCreate a new session window\n\n``` shell\n    screen -S TrinityWallet\n```\n\nActivate python3.6 virtualenv\n\n``` shell\n   source venv/bin/activate\n```\n\nRun the Gateway service（Enter trinity/ wallet source code catelog)\n\n - Mainnet Wallet\n\n``` shell\n    python3.6 prompt.py -m\n```\n\n- Testnet Wallet\n\n```shell\n   python3.6 prompt.py\n```\n\nclose or reopen the gateway session please refer to the details of 'run the gateway service'\n\n\n## Channel Nodes Interworking\n\nAfter trinity CLI wallet running, the subsequent channel and wallet operations can be performed on the wallet console.\n\nInput help to the wallet console to view all trinity CLI wallet commands.\n\nHere are a few channel-related commands:\n\n1.Use create wallet command to create an address before using state channels.\n\n```shell\ntrinity\u003e create wallet /root/test/test.json # /root/test/test.json is the path of wallet\n```\n\n2.Use open wallet command to open existing wallet. Note: open a wallet with channel function, or the function will be restricted.\n\n```shell\ntrinity\u003e open wallet /root/test/test.json\n```\nNote:After creating or re-opening a wallet, the wallet will automatically connect to the gateway and enable channel function. If channel function was not enabled within 30s, please call channel function to open it manually\n\n3.Use channel enable command to activate channel function before operating on state channels.\n\n```shell\ntrinity\u003e channel enable \n```\n\n4.channel show uri\n\ntrinity\u003e channel show uri\n\n5.Use channel create\n\n```shell\ntrinity\u003e channel create xxxxxxxxxxxxx@xx.xx.xx.xx:xxxx TNC \u003ctnc_count\u003e\n```\n\n6.Call channel tx to execute off-chain transactions. tx parameters supports pymentlink code, or use uri + asset + value\n\n```shell\ntrinity\u003e channel tx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # payment link code\n```\nor\n\n``` shell\ntrinity\u003e channel tx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@xx.xx.xx.xx:xxxx TNC \u003ccount\u003e\n```\n\n7.Call channel payment to generate payment code\n\n```shell\ntrinity\u003e channel payment TNC 10 \"mytest\"\n```\n\n8.Call channel close to complete settlement and close the channel\n\n```shell\ntrinity\u003e channel close xxxxxxxxxxxxxxx\n```\n\n9.channel peer is for peer node review\n\n```shell\ntrinity\u003e channel peer\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinity-project%2Ftrinity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrinity-project%2Ftrinity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinity-project%2Ftrinity/lists"}