Skip to content

config(packages/teatime): Add teatime #233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
Binary file added __pycache__/teatime.cpython-311.pyc
Binary file not shown.
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
inherit self';
};
devShells.ci = import ./shells/ci.nix {pkgs = final;};
devShells.teatime-test = import ./shells/teatime-test.nix {
inherit self';
pkgs = final;
};
};
};
}
2 changes: 1 addition & 1 deletion packages/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
cosmos-theta-testnet = callPackage ./cosmos-theta-testnet {inherit gaiad;};
blst = callPackage ./blst {};
bnb-beacon-node = callPackage ./bnb-beacon-node {};

teatime = callPackage ./teatime/default.nix {inherit python3Packages;};
circom = callPackage ./circom/default.nix {craneLib = craneLib-stable;};
circ = callPackage ./circ/default.nix {craneLib = craneLib-stable;};

Expand Down
26 changes: 26 additions & 0 deletions packages/teatime/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
python3Packages,
fetchPypi,
lib,
}:
python3Packages.buildPythonPackage {
pname = "teatime";
version = "0.3.1";

src = /home/hkrasenov/code/repos/teatime;

build-system = [
python3Packages.setuptools
python3Packages.wheel
];

propagatedBuildInputs = with python3Packages; [loguru requests];

doCheck = false;

meta = with lib; {
description = "A minimal Python tea time application";
homepage = "https://github.com/dmuhs/teatime";
license = licenses.mit;
};
}
10 changes: 10 additions & 0 deletions shells/teatime-test.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
self',
pkgs,
...
}:
pkgs.mkShell {
packages = with pkgs; [
(python3.withPackages (python-pkgs: with python-pkgs; [self'.packages.teatime]))
];
}
23 changes: 23 additions & 0 deletions teatime-test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from teatime.scanner import Scanner
from teatime.plugins.context import NodeType
from teatime.plugins.eth1 import NodeSync, MiningStatus

TARGET_IP = "127.0.0.1"
TARGET_PORT = 8545
INFURA_URL = "Infura API Endpoint"

def get_scanner():
return Scanner(
ip=TARGET_IP,
port=TARGET_PORT,
node_type=NodeType.GETH,
plugins=[
NodeSync(infura_url=INFURA_URL, block_threshold=10),
MiningStatus(should_mine=False)
]
)

if __name__ == '__main__':
scanner = get_scanner()
report = scanner.run()
print(report.to_dict())
Loading