{"id":18901181,"url":"https://github.com/regular/tre-init","last_synced_at":"2025-06-29T18:03:03.860Z","repository":{"id":57379415,"uuid":"156106412","full_name":"regular/tre-init","owner":"regular","description":null,"archived":false,"fork":false,"pushed_at":"2020-05-04T13:53:15.000Z","size":194,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-24T11:08:23.691Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/regular.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-04T17:20:13.000Z","updated_at":"2020-05-04T13:53:08.000Z","dependencies_parsed_at":"2022-09-02T21:21:52.032Z","dependency_job_id":null,"html_url":"https://github.com/regular/tre-init","commit_stats":null,"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regular%2Ftre-init","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regular%2Ftre-init/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regular%2Ftre-init/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regular%2Ftre-init/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/regular","download_url":"https://codeload.github.com/regular/tre-init/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regular%2Ftre-init/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258655430,"owners_count":22736642,"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-08T08:55:24.612Z","updated_at":"2025-06-29T18:03:03.808Z","avatar_url":"https://github.com/regular.png","language":"JavaScript","readme":"# tre-init\n\ntre-init and other command line utilities for Tre. \n\n## Install\n\n```\nnpm i -g tre-init\n```\n\n## tre-init - Create a new ssb network and an initial message tree\n\n```\ncd myproject\ntre-init\n```\n\nThis creates the file `.trerc` and the directory `.tre` in the current working directory. `.trerc` serves the same purpose as `~/.ssb/config` in traditional ssb setups. Additionally, it contains ssb message keys of some of the branches that were created by tre-init. A new, random network-id was created, port numbers also are random (above 50000 and below 65000)\n\nData is stored in `.tre`, it replaces `~/.ssb` in traditional ssb setups. \n\nIn case they did not exist before, new keypairs were created in `.tre/secret` and `.tre/browser-keys`\n\n## Run sbot with the local config\n\n`tre-bot` is a simple wrapper around `sbot` (scuttlebot). It instructs sbot to use the local config. You can run it from anywhere inside your project tree, it will pick up the closest `.trerc` file.\n\n```\ntre-bot server\n```\n\n## Create a pub\n\n```\ntre-pub-config | ssh myserver.com 'mkdir -p .myappname \u0026\u0026 cat - \u003e .myappname/config'\n# run `ssb_appname=myappname sbot server` on your server\nssh korn 'ssb_appname=myappname sbot getAddress' \u003e .tre/remotes\n# edit .tre/remotes so that it looks something like\n{\n  \"myserver\": \"net:138.231.111.84:42632~shs:6odsaDg5OpsFlfa7LLSLxikxF5ze4DN03bAz6vrz7uMQ=\"\n}\n\n## Crete an invite code\n\n```\ntre-invite \u003e invite.json\n```\n\nThis invite code can be pasted into bay-of-plenty. It will instruct the pub to follow the user, the user to follow the pub and you, and give the user a name you can specify in invite.json.\n\n## deploy an application\n\n```\ntre-apps-deploy \u003csource.js\u003e\n```\n\nbrowserifies source.js, uploads the result as a blob and publishes a message of type `webapp`. If a previous webapp exists and was deployed from a repo with the same `origin  remote and from the same git branch, and by the same author, that pre-existing webapp is updated. (a new revision of that webapp is posted).\n\nHere's an example message piblished by `tre-apps-deploy`\n\n```\n{\n  \"previous\": \"%GkSmUhYX7jM5rzHobHlUHTzgqc9LKxM8T5eRwuJW624=.sha256\",\n  \"sequence\": 28,\n  \"author\": \"@h8sMNhOo43PP8HX+9B3PCJPchqxhpPXgzwFG7HIaNbc=.ed25519\",\n  \"timestamp\": 1547036143789,\n  \"hash\": \"sha256\",\n  \"content\": {\n    \"type\": \"webapp\",\n    \"name\": \"tre-init\",\n    \"description\": \"Initialize and test a new ssb network\",\n    \"keywords\": [\n      \"ssb\",\n      \"tre\"\n    ],\n    \"config\": {\n      \"tre\": {\n        \"branches\": {\n          \"root\": \"%eMe2hfQ+gI4NKQJzoycSQmefvSLKkwmdXBGj6JRQHwM=.sha256\",\n          \"about\": \"%LQu4ZrTcuS2JhiYGAwk1Lg+Wee5M7OH74XnoSVZ1TdQ=.sha256\",\n          \"machines\": \"%IPYCOlf24z5BeN9BSGPZfWpDIKptDbeYDnEryKldxew=.sha256\",\n          \"prototypes\": \"%38ZbMKMoC4oVXeTZ+bx3objqO8SL3ZYXz6wLBprnmd8=.sha256\",\n          \"webapps\": \"%lkexgs1dnCCvkOjbRyJAUnWwbk1igt4DqOhBe9U3klY=.sha256\",\n          \"trash\": \"%152k3CQRaeK7K+hZy41QCo8aRZjaUg6SyfgG8FeGeLo=.sha256\"\n        }\n      }\n    },\n    \"codeBlob\": \"\u0026IBbpG0szrPmtzbPwXKN0ZijQ9KeIJpzh0JYnIrZx6SE=.sha256\",\n    \"lockBlob\": \"\u0026iwEhkt7JCD9tRnFzkAgRvgdeARj450Db8whC2QMbhqU=.sha256\",\n    \"commit\": \"v1.6.0-6-g01484fd\",\n    \"repository\": \"git@github.com:regular/tre-init.git\",\n    \"repositoryBranch\": \"master\",\n    \"revisionBranch\": \"%GkSmUhYX7jM5rzHobHlUHTzgqc9LKxM8T5eRwuJW624=.sha256\",\n    \"revisionRoot\": \"%39L6vcMxCbcDrRUJyUWSJd2oJ5mA55aG0ecNNijlSaw=.sha256\",\n    \"change-log\": [\n      \"01484fd5aa5c0376e02df540dbee7d63a7239992 Add tre-apps-deploy to Readme\"\n    ]\n  },\n  \"signature\": \"rtkZoJkNRDoWUi39gU+LMmVfkOODLdLM/B7sSnbpXNG02/H21DhNazmEmK5ZbUJrEw5R6HgBJLaSY0G+shbUCw==.sig.ed25519\"\n}\n```\n---\n\nLicsense: AGPLv3 - Copyright 2019 Jan Boelsche\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fregular%2Ftre-init","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fregular%2Ftre-init","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fregular%2Ftre-init/lists"}