Skip to content

Commit e8850f1

Browse files
committed
snowbridge build support, abigen package
1 parent 6273772 commit e8850f1

File tree

10 files changed

+27261
-7
lines changed

10 files changed

+27261
-7
lines changed

flake.lock

Lines changed: 28 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,23 @@
44
inputs = {
55
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05";
66
flake-utils.url = github:numtide/flake-utils;
7+
8+
rust-overlay.url = "github:oxalica/rust-overlay";
9+
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
10+
rust-overlay.inputs.flake-utils.follows = "flake-utils";
711
};
812

913
outputs = {
1014
self,
1115
nixpkgs,
1216
flake-utils,
17+
rust-overlay,
1318
}:
1419
flake-utils.lib.simpleFlake {
1520
inherit self nixpkgs;
1621
name = "meta-craft-labs";
1722
shell = ./shell.nix;
1823
overlay = ./overlay.nix;
24+
preOverlays = [(import rust-overlay)];
1925
};
2026
}

overlay.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,7 @@ in {
4040
};
4141

4242
snowbridge-relayer = prevNixpkgs.callPackage ./packages/snowbridge-relayer {};
43+
snowbridge-parachain = prevNixpkgs.callPackage ./packages/snowbridge-parachain {};
44+
abigen = prevNixpkgs.callPackage ./packages/abigen {};
4345
};
4446
}

packages/abigen/default.nix

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
pkgs,
3+
fetchFromGitHub,
4+
buildGoModule,
5+
}:
6+
with pkgs;
7+
buildGoPackage rec {
8+
pname = "abigen";
9+
version = "1.10.17";
10+
src = fetchFromGitHub {
11+
owner = "ethereum";
12+
repo = "go-ethereum";
13+
rev = "v${version}";
14+
sha256 = "sha256-GBlrg4wOiqEQTZC3CtfAZbIvS16/pSjEedEDrPGNUtY=";
15+
};
16+
17+
goPackagePath = "github.com/ethereum/go-ethereum/cmd/abigen";
18+
19+
nativeBuildInputs = [autoPatchelfHook];
20+
buildInputs = with pkgs; [
21+
zlib
22+
stdenv.cc.cc
23+
openssl
24+
];
25+
26+
goDeps = ./deps.nix;
27+
28+
meta = with lib; {
29+
homepage = "https://github.com/ethereum/go-ethereum/";
30+
platforms = platforms.linux;
31+
};
32+
}

packages/abigen/deps.nix

Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
let
2+
version = "1.10.17";
3+
goEthereum = {
4+
type = "git";
5+
url = "https://github.com/ethereum/go-ethereum/";
6+
rev = "v${version}";
7+
sha256 = "sha256-uIMV36f5B8VrZFmbULdyYj9CQom/CNgMHywu1PNNHUI=";
8+
};
9+
protobuf = {
10+
type = "git";
11+
url = "https://github.com/golang/protobuf";
12+
rev = "v1.5.2";
13+
sha256 = "sha256-E/6Qh8hWilaGeSojOCz8PzP9qnVqNG2DQLYJUqN3BdY=";
14+
};
15+
16+
genGoPackages = list: prefix:
17+
map (x: {
18+
goPackagePath = prefix + x;
19+
fetch = goEthereum;
20+
})
21+
list;
22+
23+
generateGoEthereum = list: genGoPackages list "github.com/ethereum/go-ethereum/";
24+
generateProtobuf = list: genGoPackages list "github.com/golang/protobuf/";
25+
in
26+
generateGoEthereum [
27+
"accounts/abi/bind"
28+
"accounts/keystore"
29+
"cmd/utils"
30+
# "common"
31+
"common/bitutil"
32+
"common/compiler"
33+
"common/math"
34+
"common/mclock"
35+
"consensus/ethash"
36+
"core/asm"
37+
"core/rawdb"
38+
"core/state"
39+
# "core/types"
40+
"core/vm"
41+
"core/vm/runtime"
42+
"crypto"
43+
"crypto/bn256/cloudflare"
44+
"crypto/secp256k"
45+
"eth/filters"
46+
"eth/protocols/snap"
47+
"ethdb"
48+
"ethdb/memorydb"
49+
"event"
50+
"internal/flags"
51+
"les"
52+
"log"
53+
"metrics"
54+
"p2p"
55+
"p2p/enode"
56+
"params"
57+
"rlp"
58+
"rlp/internal/rlpstruct"
59+
"rpc"
60+
"signer/core/apitypes"
61+
"signer/core/types"
62+
"signer/fourbyte"
63+
"tests"
64+
"tests/fuzzers/difficulty"
65+
"tests/fuzzers/les"
66+
"tests/fuzzers/rangeproof"
67+
"tests/fuzzers/snap"
68+
"tests/fuzzers/stacktrie"
69+
"trie"
70+
]
71+
++ generateProtobuf [
72+
"proto"
73+
"protoc-gen-go/descriptor"
74+
]
75+
++ [
76+
# goDeps is a list of Go dependencies.
77+
{
78+
goPackagePath = "gopkg.in/urfave/cli.v1";
79+
fetch = {
80+
type = "git";
81+
url = "https://gopkg.in/urfave/cli.v1";
82+
rev = "v1.20.0";
83+
sha256 = "sha256-8nkQOnmfE15Ha4L+UbftHB+G5I5xlUBXzzzG+Zcmzng=";
84+
};
85+
}
86+
{
87+
goPackagePath = "golang.org/x/crypto/sha3";
88+
fetch = {
89+
type = "git";
90+
url = "https://go.googlesource.com/crypto";
91+
rev = "05595931fe9d3f8894ab063e1981d28e9873e2cb"; #originally v0.0.0-20210921155107-089bfa567519
92+
sha256 = "sha256-F6T2lYfK/qAnxDe3bxkBIrXDGkCQiuKTn2Tczbp30Co=";
93+
};
94+
}
95+
{
96+
goPackagePath = "golang.org/x/crypto/openpgp";
97+
fetch = {
98+
type = "git";
99+
url = "https://go.googlesource.com/crypto";
100+
rev = "05595931fe9d3f8894ab063e1981d28e9873e2cb"; #originally v0.0.0-20210921155107-089bfa567519
101+
sha256 = "sha256-F6T2lYfK/qAnxDe3bxkBIrXDGkCQiuKTn2Tczbp30Co=";
102+
};
103+
}
104+
{
105+
goPackagePath = "golang.org/x/crypto/ripemd160";
106+
fetch = {
107+
type = "git";
108+
url = "https://go.googlesource.com/crypto";
109+
rev = "05595931fe9d3f8894ab063e1981d28e9873e2cb"; #originally v0.0.0-20210921155107-089bfa567519
110+
sha256 = "sha256-F6T2lYfK/qAnxDe3bxkBIrXDGkCQiuKTn2Tczbp30Co=";
111+
};
112+
}
113+
{
114+
goPackagePath = "golang.org/x/sys/cpu";
115+
fetch = {
116+
type = "git";
117+
url = "https://go.googlesource.com/sys";
118+
rev = "87e55d71481061dc6dcfb9a4953c896af893c130"; #originally v0.0.0-20220520151302-bc2c85ada10a
119+
sha256 = "sha256-+l8a8PegBgYU5Q1MAt+3JI6n6a5tT5iid33s+sI+SIU=";
120+
};
121+
}
122+
{
123+
goPackagePath = "github.com/mattn/go-colorable";
124+
fetch = {
125+
type = "git";
126+
url = "https://github.com/mattn/go-colorable";
127+
rev = "v0.1.8";
128+
sha256 = "sha256-VOR27AXaHO3QzEPvqzuJ4x6NzJCwIoxaFUdTuzj+ZGA=";
129+
};
130+
}
131+
{
132+
goPackagePath = "github.com/mattn/go-isatty";
133+
fetch = {
134+
type = "git";
135+
url = "https://github.com/mattn/go-isatty";
136+
rev = "v0.0.12";
137+
sha256 = "sha256-hJf8or1kLXlyfMzALSNzQmd3BRqi/lot+JWL0o6A2rU=";
138+
};
139+
}
140+
{
141+
goPackagePath = "github.com/mattn/go-runewidth";
142+
fetch = {
143+
type = "git";
144+
url = "https://github.com/mattn/go-runewidth";
145+
rev = "v0.0.9";
146+
sha256 = "sha256-kl6WPGmIvNlBL78NALFGwosz4fFGYy4WunyDzBvrdNc=";
147+
};
148+
}
149+
{
150+
goPackagePath = "github.com/peterh/liner";
151+
fetch = {
152+
type = "git";
153+
url = "https://github.com/peterh/liner";
154+
rev = "v1.2.0"; #originally v1.1.1-0.20190123174540-a2c9a5303de7
155+
sha256 = "sha256-Ml2WNaFOL77XxZpc3AtXQKc04wR2MPubwPbXZhr9c6M=";
156+
};
157+
}
158+
{
159+
goPackagePath = "github.com/hashicorp/golang-lru";
160+
fetch = {
161+
type = "git";
162+
url = "https://github.com/hashicorp/golang-lru";
163+
rev = "80c98217689d6df152309d574ccc682b21dc802c";
164+
sha256 = "sha256-w5utLMR7p5pF9xX+mI3N9NyfQ8ixNXNTgfXDu8fudmc=";
165+
};
166+
}
167+
{
168+
goPackagePath = "github.com/graph-gophers/graphql-go";
169+
fetch = {
170+
type = "git";
171+
url = "https://github.com/graph-gophers/graphql-go";
172+
rev = "v1.3.0";
173+
sha256 = "sha256-hmti9giYJO088M9ZnPY5xyNbWwFXz1ZiH/2TywNjXBw=";
174+
};
175+
}
176+
{
177+
goPackagePath = "github.com/opentracing/opentracing-go";
178+
fetch = {
179+
type = "git";
180+
url = "https://github.com/graph-gophers/graphql-go";
181+
rev = "v1.1.0";
182+
sha256 = "sha256-hmti9giYJO088M9ZnPY5xyNbWwFXz1ZiH/2TywNjXBw=";
183+
};
184+
}
185+
{
186+
goPackagePath = "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob";
187+
fetch = {
188+
type = "git";
189+
url = "https://github.com/Azure/azure-sdk-for-go/";
190+
rev = "sdk/storage/azblob/v0.3.0";
191+
sha256 = "sha256-pu+YMJnHbSQW7lP1B7Lvy3pV2K05fQgmesDTp1P/rtw=";
192+
};
193+
}
194+
{
195+
goPackagePath = "github.com/opentracing/opentracing-go/ext";
196+
fetch = {
197+
type = "git";
198+
url = "https://github.com/opentracing/opentracing-go";
199+
rev = "v1.1.0";
200+
sha256 = "sha256-7j8mpJ3kleYHxC9c1n33KTkP7EMfFkFLDE//IOpiSSo=";
201+
};
202+
}
203+
{
204+
goPackagePath = "github.com/docker/docker/pkg/reexec";
205+
fetch = {
206+
type = "git";
207+
url = "https://github.com/docker/docker/";
208+
rev = "v1.6.2";
209+
sha256 = "sha256-6hHOz6kdV3revMjoFpQAE23srRx1qgjCPkAevdKQSnY=";
210+
};
211+
}
212+
{
213+
goPackagePath = "github.com/go-stack/stack";
214+
fetch = {
215+
type = "git";
216+
url = "https://github.com/go-stack/stack/";
217+
rev = "v1.8.0";
218+
sha256 = "sha256-26RlTEcAkbewMUtmirKrDGQ1WJlNousp69v7HMopYnI=";
219+
};
220+
}
221+
{
222+
goPackagePath = "github.com/influxdata/influxdb/client";
223+
fetch = {
224+
type = "git";
225+
url = "https://github.com/influxdata/influxdb";
226+
rev = "v1.8.3";
227+
sha256 = "sha256-h8VUKmLnMzDfPUEqYW2YPYt/f9chbSc7vPL6c18YO+o=";
228+
};
229+
}
230+
{
231+
goPackagePath = "github.com/influxdata/influxdb-client-go/v2/api";
232+
fetch = {
233+
type = "git";
234+
url = "https://github.com/influxdata/influxdb-client-go";
235+
rev = "v2.4.0";
236+
sha256 = "sha256-fq6oaxLrHl/49qNR8uyHj4uDvV0p8jAI3XRTcIbRiKc=";
237+
};
238+
}
239+
{
240+
goPackagePath = "github.com/btcsuite/btcd/btcec/v2";
241+
fetch = {
242+
type = "git";
243+
url = "https://github.com/btcsuite/btcd";
244+
rev = "btcec/v2.2.0";
245+
sha256 = "sha256-wn9cp5XTBC65W8j8YrEmiWrWigkf4ssfPhDBJRmcvI8=";
246+
};
247+
}
248+
{
249+
goPackagePath = "github.com/google/gofuzz";
250+
fetch = {
251+
type = "git";
252+
url = "https://github.com/google/gofuzz";
253+
rev = "v1.2.0";
254+
sha256 = "sha256-T6Gz741l45L3F6Dt7fiAuQvQQg59Qtap3zG05M2cfqU=";
255+
};
256+
}
257+
]

0 commit comments

Comments
 (0)