{"id":13638699,"url":"https://github.com/stephenlacy/go-urbit","last_synced_at":"2025-03-21T13:31:53.755Z","repository":{"id":37967926,"uuid":"369731312","full_name":"stephenlacy/go-urbit","owner":"stephenlacy","description":"Golang interface for Urbit. Connect natively with urbit's ames wire protocol","archived":false,"fork":false,"pushed_at":"2025-02-17T17:23:37.000Z","size":2347,"stargazers_count":39,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-18T01:51:21.414Z","etag":null,"topics":["cryptography","golang","urbit"],"latest_commit_sha":null,"homepage":"","language":"C","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/stephenlacy.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}},"created_at":"2021-05-22T06:16:00.000Z","updated_at":"2025-02-17T17:23:43.000Z","dependencies_parsed_at":"2022-07-10T00:46:25.150Z","dependency_job_id":null,"html_url":"https://github.com/stephenlacy/go-urbit","commit_stats":null,"previous_names":["stephenlacy/go-urbit","stevelacy/go-urbit"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenlacy%2Fgo-urbit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenlacy%2Fgo-urbit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenlacy%2Fgo-urbit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenlacy%2Fgo-urbit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stephenlacy","download_url":"https://codeload.github.com/stephenlacy/go-urbit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244806120,"owners_count":20513383,"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":["cryptography","golang","urbit"],"created_at":"2024-08-02T01:00:51.902Z","updated_at":"2025-03-21T13:31:53.283Z","avatar_url":"https://github.com/stephenlacy.png","language":"C","funding_links":[],"categories":["C","Developer Tools"],"sub_categories":[],"readme":"# go-urbit\n\u003e golang interface for Urbit\n\n[![GoDoc](https://godoc.org/github.com/stevelacy/go-urbit?status.svg)](https://godoc.org/github.com/stevelacy/go-urbit)\n\n![urbit example](./urbit.go.png)\n\nAllows golang applications running as moons to connect to urbit ships over ames.\n\nThis can be used by any unix host, including deployed services and IoT projects.\n\n\n## Ames\n\n### Usage\n\n\u003e Note: each running app _must_ have it's own moon identity. Running on kubernetes or other systems with more than 1 replica per identity will result in odd behavior.\n\nIn your Urbit dojo generate a new moon for each connection. The output is the secret key in `@ux` encoding.\n```\ndojo\u003e |moon\n~tabber-finlur-litryl-tadmev\n0wnXJXi.~OJWk.4aDRR.....1NEMq.p-00s.2w7U1\n```\nConvert the key to hex with `` `@ux` `` as follows:\n```\ndojo\u003e `@ux`0wnXJXi.~OJWk.4aDRR.....1NEMq.p-00s.2w7U1\n0x17.eede.d2ff.2b7a.........1022.001c.68c1.a67e.0007.0280.7e01\n```\n\nThe output value is the seed, or secret key, for your newly created moon.\n\n#### New connection\n\n```go\nfunc main() {\n\tseed := \"the hex seed\"\n\n\tonPacket := func(c *Connection, pkt Packet) {\n\t\tfmt.Println(\"ames OnPacket\", pkt.Data)\n\t}\n\n\tames, err := NewAmes(seed, onPacket)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tto := \"~your-planet\"\n\tconnection, err := ames.Connect(to)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err := connection.Request([]string{\"ge\", \"hood\"}, \"helm-hi\", noun.MakeNoun(\"it works!\"))\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n```\n\n\n## Noun\n\nMost of the common urbit noun functions are available in the `go-urbit/noun` package\n\n```go\nimport (\n\t\"github.com/stevelacy/go-urbit/noun\"\n)\n\nfunc main() {\n  n := noun.MakeNoun(\"string\", 1234)\n  fmt.Println(n)\n}\n\n```\n\n\n### Installation\n\u003e Tested on macos M1\n\n\n```\nbrew install openssl pkg-config\n```\n\n```\ngit clone git@github.com:bitcoin-core/secp256k1.git\ncd secp256k1\n./autogen.sh\n./configure --enable-module-recovery --enable-module-extrakeys --enable-module-schnorrsig\n\nmake\nsudo make install\n\n```\n\nIf on macos M1\n```\nexport PATH=\"/opt/homebrew/opt/openssl@3/bin:$PATH\"\nexport CPPFLAGS=\"-I/opt/homebrew/opt/openssl@3/include -I/usr/local/include\"\nexport LDFLAGS=\"-L/opt/homebrew/opt/openssl@3/lib -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -L/usr/local/lib/\"\nexport SDKROOT=\"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk\"\nexport PKG_CONFIG_PATH=\"/opt/homebrew/opt/openssl@3/lib/pkgconfig\"\n\n\ngit clone git@github.com:dfoxfranke/libaes_siv.git\ncd libaes_siv\ncmake -DCMAKE_PREFIX_PATH=/opt/homebrew/opt/openssl@3 .\nmake\nsudo make install\n\n```\n\n\n\n```\nexport PKG_CONFIG_PATH=\"/opt/homebrew/opt/openssl@3/lib/pkgconfig\"\ncd urcrypt/\n./autogen.sh\n./configure --disable-shared\nmake\nsudo make install\n```\n\n\n#### Testing\n\n```\nexport MOON_SEED=\"your seed\"\n\ngo test ./...\n```\n\n\n\n\n~litryl-tadmev\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephenlacy%2Fgo-urbit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephenlacy%2Fgo-urbit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephenlacy%2Fgo-urbit/lists"}