Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
use flake
dotenv
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ tonutils-bridge
.env
config.json
wsbridge/testdata/.wallet.json
result
.kilo
.direnv
82 changes: 82 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
description = "TON Utils Bridge — WebSocket bridge for TON blockchain";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
gomod2nix.url = "github:nix-community/gomod2nix";
gomod2nix.inputs.nixpkgs.follows = "nixpkgs";
};

outputs = { self, nixpkgs, gomod2nix }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
forEachSystem = nixpkgs.lib.genAttrs supportedSystems;
in
{
packages = forEachSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
inherit (gomod2nix.legacyPackages.${system}) buildGoApplication;
in
{
default = buildGoApplication rec {
pname = "tonutils-bridge";
version = "0.1.0";

src = builtins.path { path = ./.; name = "source"; };

modules = ./gomod2nix.toml;

pwd = src;

subPackages = [ "." ];

ldflags = [ "-s" "-w" ];

meta = with pkgs.lib; {
description = "WebSocket bridge for TON blockchain (tonutils-go)";
homepage = "https://github.com/TONresistor/tonutils-bridge";
license = licenses.mit; # adjust if LICENSE says otherwise
mainProgram = "tonutils-bridge";
platforms = supportedSystems;
};
};
}
);

devShells = forEachSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
bridge = self.packages.${system}.default;
in
{
default = pkgs.mkShell {
packages = with pkgs; [
go
gopls
(pkgs.writeShellScriptBin "run-bridge" ''
exec ${bridge}/bin/tonutils-bridge "$@"
'')
];

shellHook = ''
echo "🌉 tonutils-bridge dev shell"
echo " run-bridge [args…] → run the built bridge"
'';
};
}
);
};
}
90 changes: 90 additions & 0 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
schema = 3

[mod]
[mod.'filippo.io/edwards25519']
version = 'v1.1.0'
hash = 'sha256-9ACANrgWZSd5HYPfDZHY8DVbPSC9LOMgy8deq3rDOoc='

[mod.'github.com/beorn7/perks']
version = 'v1.0.1'
hash = 'sha256-h75GUqfwJKngCJQVE5Ao5wnO3cfKD9lSIteoLp/3xJ4='

[mod.'github.com/cespare/xxhash/v2']
version = 'v2.3.0'
hash = 'sha256-7hRlwSR+fos1kx4VZmJ/7snR7zHh8ZFKX+qqqqGcQpY='

[mod.'github.com/golang/snappy']
version = 'v1.0.0'
hash = 'sha256-o/S91mX4ysjuG/oRHLs8qSyfb1Risf/YzMuW5u7d3U4='

[mod.'github.com/gorilla/websocket']
version = 'v1.5.3'
hash = 'sha256-vTIGEFMEi+30ZdO6ffMNJ/kId6pZs5bbyqov8xe9BM0='

[mod.'github.com/kevinms/leakybucket-go']
version = 'v0.0.0-20200115003610-082473db97ca'
hash = 'sha256-moXd9sQs/KcOyHGo8XgZgCPFblnhWQB08NMxdAhzn/w='

[mod.'github.com/mattn/go-colorable']
version = 'v0.1.14'
hash = 'sha256-JC60PjKj7MvhZmUHTZ9p372FV72I9Mxvli3fivTbxuA='

[mod.'github.com/mattn/go-isatty']
version = 'v0.0.20'
hash = 'sha256-qhw9hWtU5wnyFyuMbKx+7RB8ckQaFQ8D+8GKPkN3HHQ='

[mod.'github.com/munnerz/goautoneg']
version = 'v0.0.0-20191010083416-a7dc8b61c822'
hash = 'sha256-79URDDFenmGc9JZu+5AXHToMrtTREHb3BC84b/gym9Q='

[mod.'github.com/prometheus/client_golang']
version = 'v1.22.0'
hash = 'sha256-OJ/9rlWG1DIPQJAZUTzjykkX0o+f+4IKLvW8YityaMQ='

[mod.'github.com/prometheus/client_model']
version = 'v0.6.1'
hash = 'sha256-rIDyUzNfxRA934PIoySR0EhuBbZVRK/25Jlc/r8WODw='

[mod.'github.com/prometheus/common']
version = 'v0.62.0'
hash = 'sha256-UFccvzMJaBrUpnqVgZgohRcgk5SKMi/UJnXNtazCnx8='

[mod.'github.com/prometheus/procfs']
version = 'v0.15.1'
hash = 'sha256-H+WXJemFFwdoglmD6p7JRjrJJZmIVAmJwYmLbZ8Q9sw='

[mod.'github.com/rs/zerolog']
version = 'v1.34.0'
hash = 'sha256-M503WwzPvqbOas3f70FQNXoWG17eV/XU6FubtB6P0uo='

[mod.'github.com/syndtr/goleveldb']
version = 'v1.0.0'
hash = 'sha256-rW7SW6nehede0oMZo4NBatM6Eizbnlb7xYoX/dcDUxA='

[mod.'github.com/ton-blockchain/adnl-tunnel']
version = 'v0.1.8'
hash = 'sha256-2a2lAgB42rtFhWyOKLK1Wb8AGVevV8iYlI59pMMYNiw='

[mod.'github.com/xssnick/raptorq']
version = 'v1.3.0'
hash = 'sha256-lojoKrd1hVNX89FQOuZ/COemkPFGjDZ5A47q2uwgWRc='

[mod.'github.com/xssnick/ton-payment-network']
version = 'v1.2.3'
hash = 'sha256-1ocZtq2/8FoKgnRk79btSxmaHxhGHP2IZAsF9JNmwDk='

[mod.'github.com/xssnick/tonutils-go']
version = 'v1.15.5'
hash = 'sha256-ZuTy3hJsQKvcRUEHzs022UfjJ/xBh/iOo0YIFhjPR2I='

[mod.'golang.org/x/crypto']
version = 'v0.42.0'
hash = 'sha256-qa6cGxZUhVnbkpVzfvLGQQsl/NCqNceJp9SIx5vkyiI='

[mod.'golang.org/x/sys']
version = 'v0.36.0'
hash = 'sha256-9h4SHGnlJzmTENUp6226hC8fQ73QrQC3D85NNMxLuXg='

[mod.'google.golang.org/protobuf']
version = 'v1.36.5'
hash = 'sha256-isupBiQUrKPEFzK94k5cgzM3Ab5fMXp352/zcsXV1JU='