Skip to content

Commit cd1c80a

Browse files
committed
refactor(packages): Migrate packages from nix-blockchain-development
1 parent 34283e8 commit cd1c80a

File tree

56 files changed

+14744
-16
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+14744
-16
lines changed

checks/packages-ci-matrix.nix

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,33 @@
1515
inherit (lib) optionalAttrs;
1616
inherit (pkgs) system;
1717
inherit (pkgs.hostPlatform) isLinux;
18+
19+
reexportedPackages = {
20+
ethereum_nix =
21+
{
22+
# geth = inputs'.ethereum_nix.packages.geth; # TODO: re-enable when flake show/check passes
23+
}
24+
// lib.optionalAttrs (pkgs.hostPlatform.isx86 && pkgs.hostPlatform.isLinux) {
25+
# nimbus = inputs'.ethereum_nix.packages.nimbus-eth2; # TODO: re-enable when flake show/check passes
26+
};
27+
# noir = {
28+
# nargo = inputs'.noir.packages.nargo;
29+
# noirc_abi_wasm = inputs'.noir.packages.noirc_abi_wasm;
30+
# acvm_js = inputs'.noir.packages.acvm_js;
31+
# };
32+
};
33+
34+
disabledPackages = [
35+
"circ"
36+
"leap"
37+
"go-opera"
38+
];
1839
in
1940
rec {
2041
checks =
21-
self'.packages
42+
(builtins.removeAttrs self'.packages disabledPackages)
43+
// reexportedPackages.ethereum_nix
2244
// {
23-
inherit (self'.legacyPackages) rustToolchain;
2445
inherit (self'.legacyPackages.inputs.dlang-nix) dub;
2546
inherit (self'.legacyPackages.inputs.nixpkgs)
2647
cachix

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@
210210
self,
211211
nixpkgs,
212212
flake-parts,
213+
crane,
213214
...
214215
}:
215216
let

packages/avalanche-cli/default.nix

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
lib,
3+
buildGoModule,
4+
fetchFromGitHub,
5+
blst,
6+
libusb1,
7+
}:
8+
buildGoModule rec {
9+
pname = "avalanche-cli";
10+
version = "unstable-2024-11-23";
11+
12+
src = fetchFromGitHub {
13+
owner = "ava-labs";
14+
repo = "avalanche-cli";
15+
rev = "6debe4169dce2c64352d8c9d0d0acac49e573661";
16+
hash = "sha256-kYEgKpR6FM3f6Lq3Wxhi8MVh8ojxyqFYgjeu2E8lNcs=";
17+
};
18+
19+
proxyVendor = true;
20+
vendorHash = "sha256-FLuu2Q9O4kPtdT1LWaClv+96G0m0PFpZx22506V+Sts=";
21+
22+
doCheck = false;
23+
24+
ldflags = [
25+
"-X=github.com/ava-labs/avalanche-cli/cmd.Version=${version}"
26+
];
27+
28+
buildInputs = [
29+
blst
30+
libusb1
31+
];
32+
33+
meta = {
34+
description = "";
35+
homepage = "https://github.com/ava-labs/avalanche-cli";
36+
# FIXME: nix-init did not find a license
37+
maintainers = with lib.maintainers; [ ];
38+
mainProgram = "avalanche-cli";
39+
};
40+
}

packages/blst/builder.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
source $stdenv/setup
2+
3+
buildPhase() {
4+
./build.sh
5+
}
6+
7+
installPhase() {
8+
mkdir -p $out/{include/elf,lib}
9+
cp libblst.a $out/lib/
10+
cp bindings/*.{h,hpp} $out/include/
11+
cp build/assembly.S $out/include/
12+
cp build/elf/* $out/include/elf/
13+
cp src/*.h $out/include/
14+
cp src/*.c $out/include/
15+
}
16+
17+
genericBuild

packages/blst/default.nix

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
stdenv,
3+
fetchFromGitHub,
4+
}:
5+
stdenv.mkDerivation rec {
6+
pname = "blst";
7+
version = "0.3.11";
8+
9+
src = fetchFromGitHub {
10+
owner = "supranational";
11+
repo = "blst";
12+
rev = "v${version}";
13+
hash = "sha256-oqljy+ZXJAXEB/fJtmB8rlAr4UXM+Z2OkDa20gpILNA=";
14+
};
15+
16+
builder = ./builder.sh;
17+
18+
meta = {
19+
description = "Multilingual BLS12-381 signature library";
20+
homepage = "https://github.com/supranational/blst";
21+
platforms = [
22+
"x86_64-linux"
23+
"aarch64-linux"
24+
"x86_64-darwin"
25+
"aarch64-darwin"
26+
];
27+
};
28+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"type": "auth/StdTx",
3+
"value": {
4+
"msg": [
5+
{
6+
"type": "cosmos-sdk/MsgCreateValidatorProposal",
7+
"value": {
8+
"MsgCreateValidator": {
9+
"Description": {
10+
"moniker": "node0",
11+
"identity": "",
12+
"website": "",
13+
"details": ""
14+
},
15+
"Commission": {
16+
"rate": "0",
17+
"max_rate": "0",
18+
"max_change_rate": "0"
19+
},
20+
"delegator_address": "bnb16sju6kxjcz7sxa2g3kf6kp3zvzf4g84jwvjh0h",
21+
"validator_address": "bva16sju6kxjcz7sxa2g3kf6kp3zvzf4g84jwsn83n",
22+
"pubkey": {
23+
"type": "tendermint/PubKeyEd25519",
24+
"value": "UaSCGHI+ZgEU+HPpPjtoWzro9k05g0UIdI8G/QrPFDs="
25+
},
26+
"delegation": {
27+
"denom": "BNB",
28+
"amount": "9000000000000"
29+
}
30+
},
31+
"proposal_id": "0"
32+
}
33+
}
34+
],
35+
"signatures": [
36+
{
37+
"pub_key": {
38+
"type": "tendermint/PubKeySecp256k1",
39+
"value": "A/oj5bQgZ8GduPeclMYVH4ARYtg7cBQWnDLL8oTSwDDv"
40+
},
41+
"signature": "kNT3hPTKMUhEqOS7F6VjQSZY8w5zTfmSM1merVgMOcIEoeqXYiWUSxWUzwBcIL7FfI2LOWHbUnrj5i4nZWR8pQ==",
42+
"account_number": "0",
43+
"sequence": "0"
44+
}
45+
],
46+
"memo": "[email protected]:26656",
47+
"source": "0",
48+
"data": null
49+
}
50+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"secret":"paddle bullet neck stage bottom link require hawk rough consider fold zebra tissue wreck cake produce subway double cram cereal open ice element salt"}
Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
# This is a TOML config file.
2+
# For more information, see https://github.com/toml-lang/toml
3+
4+
[base]
5+
# Interval blocks of breathe block, if breatheBlockInterval is 0, breathe block will be created every day.
6+
breatheBlockInterval = 0
7+
# Size of account cache
8+
accountCacheSize = 30000
9+
# Size of signature cache
10+
signatureCacheSize = 30000
11+
# Running mode when start up, 0: Normal, 1: TransferOnly, 2: RecoverOnly
12+
startMode = 0
13+
# Concurrency of OrderKeeper, should be power of 2
14+
orderKeeperConcurrency = 2
15+
# Days count back for breathe block
16+
breatheBlockDaysCountBack = 7
17+
18+
[upgrade]
19+
# Block height of BEP6 upgrade
20+
BEP6Height = 1
21+
# Block height of BEP9 upgrade
22+
BEP9Height = 1
23+
# Block height of BEP10 upgrade
24+
BEP10Height = 1
25+
# Block height of BEP19 upgrade
26+
BEP19Height = 1
27+
# Block height of BEP12 upgrade
28+
BEP12Height = 1
29+
# Block height of BEP3 upgrade
30+
BEP3Height = 1
31+
# Block height of FixSignBytesOverflow upgrade
32+
FixSignBytesOverflowHeight = 1
33+
# Block height of LotSizeOptimization upgrade
34+
LotSizeUpgradeHeight = 1
35+
# Block height of changing listing rule upgrade
36+
ListingRuleUpgradeHeight = 1
37+
# Block height of FixZeroBalanceHeight upgrade
38+
FixZeroBalanceHeight = 1
39+
# Block height of smart chain upgrade
40+
LaunchBscUpgradeHeight = 1
41+
# Block height of BEP8 upgrade
42+
BEP8Height = 1
43+
# Block height of BEP67 upgrade
44+
BEP67Height = 1
45+
# Block height of BEP70 upgrade
46+
BEP70Height = 1
47+
# Block height of BEP82 upgrade
48+
BEP82Height = 9223372036854775807
49+
# Block height of BEP84 upgrade
50+
BEP84Height = 9223372036854775807
51+
# Block height of BEP87 upgrade
52+
BEP87Height = 9223372036854775807
53+
# Block height of FixFailAckPackage upgrade
54+
FixFailAckPackageHeight = 9223372036854775807
55+
# Block height of EnableAccountScriptsForCrossChainTransferHeight upgrade
56+
EnableAccountScriptsForCrossChainTransferHeight = 9223372036854775807
57+
# Block height of BEP128 upgrade
58+
BEP128Height = 9223372036854775807
59+
# Block height of BEP151 upgrade
60+
BEP151Height = 9223372036854775807
61+
# Block height of BEP153 upgrade
62+
BEP153Height = 9223372036854775807
63+
# Block height of BEP159 upgrade
64+
BEP159Height = 9223372036854775807
65+
# Block height of BEP159Phase2 upgrade
66+
BEP159Phase2Height = 9223372036854775807
67+
# Block height of LimitConsAddrUpdateInterval upgrade
68+
LimitConsAddrUpdateIntervalHeight = 9223372036854775807
69+
# Block height of BEP173 upgrade
70+
BEP173Height = 9223372036854775807
71+
# Block height of FixDoubleSignChainIdHeight upgrade
72+
FixDoubleSignChainIdHeight = 9223372036854775807
73+
# Block height of BEP126 upgrade
74+
BEP126Height = 9223372036854775807
75+
# Block height of BEP255 upgrade
76+
BEP255Height = 9223372036854775807
77+
78+
[query]
79+
# ABCI query interface black list, suggested value: ["custom/gov/proposals", "custom/timelock/timelocks", "custom/atomicSwap/swapcreator", "custom/atomicSwap/swaprecipient"]
80+
ABCIQueryBlackList = []
81+
82+
[addr]
83+
# Bech32PrefixAccAddr defines the Bech32 prefix of an account's address
84+
bech32PrefixAccAddr = "bnb"
85+
# Bech32PrefixAccPub defines the Bech32 prefix of an account's public key
86+
bech32PrefixAccPub = "bnbp"
87+
# Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address
88+
bech32PrefixValAddr = "bva"
89+
# Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key
90+
bech32PrefixValPub = "bvap"
91+
# Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address
92+
bech32PrefixConsAddr = "bca"
93+
# Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key
94+
bech32PrefixConsPub = "bcap"
95+
96+
##### publication related configurations #####
97+
[publication]
98+
# configurations ends with Kafka can be a semi-colon separated host-port list
99+
# Whether we want publish market data (this includes trades and order)
100+
publishOrderUpdates = false
101+
orderUpdatesTopic = "orders"
102+
orderUpdatesKafka = "127.0.0.1:9092"
103+
104+
# Whether we want publish account balance to notify browser db indexer persist latest account balance change
105+
publishAccountBalance = false
106+
accountBalanceTopic = "accounts"
107+
accountBalanceKafka = "127.0.0.1:9092"
108+
109+
# Whether we want publish order book changes
110+
publishOrderBook = false
111+
orderBookTopic = "orders"
112+
orderBookKafka = "127.0.0.1:9092"
113+
114+
# Whether we want publish block fee changes
115+
publishBlockFee = false
116+
blockFeeTopic = "accounts"
117+
blockFeeKafka = "127.0.0.1:9092"
118+
119+
# Whether we want publish transfers
120+
publishTransfer = false
121+
transferTopic = "transfers"
122+
transferKafka = "127.0.0.1:9092"
123+
124+
# Whether we want publish block
125+
publishBlock = false
126+
blockTopic = "block"
127+
blockKafka = "127.0.0.1:9092"
128+
129+
# Whether we want publish distribution
130+
publishDistributeReward = false
131+
distributeRewardTopic = "distribution"
132+
distributeRewardKafka = "127.0.0.1:9092"
133+
134+
# Whether we want publish staking
135+
publishStaking = false
136+
stakingTopic = "staking"
137+
stakingKafka = "127.0.0.1:9092"
138+
139+
# Whether we want publish slashing
140+
publishSlashing = false
141+
slashingTopic = "slashing"
142+
slashingKafka = "127.0.0.1:9092"
143+
144+
# Whether we want publish cross transfer
145+
publishCrossTransfer = false
146+
crossTransferTopic = "crossTransfer"
147+
crossTransferKafka = "127.0.0.1:9092"
148+
149+
# Whether we want publish mirror events
150+
publishMirror = false
151+
mirrorTopic = "mirror"
152+
mirrorKafka = "127.0.0.1:9092"
153+
154+
# Whether we want publish side proposals
155+
publishSideProposal = false
156+
sideProposalTopic = "sideProposal"
157+
sideProposalKafka = "127.0.0.1:9092"
158+
159+
# Whether we want publish breatheBlock
160+
publishBreatheBlock = false
161+
breatheBlockTopic = "breatheBlock"
162+
breatheBlockKafka = "127.0.0.1:9092"
163+
164+
# Global setting
165+
publicationChannelSize = 10000
166+
publishKafka = false
167+
publishLocal = false
168+
# max size in megabytes of marketdata json file before rotate
169+
localMaxSize = 1024
170+
# max days of marketdata json files to keep before deleted
171+
localMaxAge = 7
172+
173+
# whether the kafka open SASL_PLAINTEXT auth
174+
auth = false
175+
kafkaUserName = ""
176+
kafkaPassword = ""
177+
178+
# stop process when publish to Kafka failed
179+
stopOnKafkaFail = false
180+
181+
# please modify the default value into the version of Kafka you are using
182+
# kafka broker version, default (and most recommended) is 2.1.0. Minimal supported version could be 0.8.2.0
183+
kafkaVersion = "2.1.0"
184+
185+
[log]
186+
187+
# Write logs to console instead of file
188+
logToConsole = true
189+
190+
## The below parameters take effect only when logToConsole is false
191+
# Log file root, if not set, use home path
192+
logFileRoot = ""
193+
# Log file path relative to log file root path
194+
logFilePath = "bnc.log"
195+
# Number of logs keep in memory before writing to file
196+
logBuffSize = 10000
197+
198+
[cross_chain]
199+
# IBC chain-id for current chain
200+
ibcChainId = 1
201+
# chain-id for bsc chain
202+
bscChainId = "bsc"
203+
# IBC chain-id for bsc chain
204+
bscIbcChainId = 2
205+
206+
[dex]
207+
# The suffixed symbol of BUSD
208+
BUSDSymbol = ""

0 commit comments

Comments
 (0)