Sets up empty project

This commit is contained in:
Ben 2025-02-04 10:50:46 +01:00
commit 765bc66162
No known key found for this signature in database
GPG Key ID: 0F16E812E736C24B
8 changed files with 98 additions and 0 deletions

16
.gitignore vendored Normal file
View File

@ -0,0 +1,16 @@
*
!*.*
!*/
coverage
nimcache
tests/testAll
nimble.develop
nimble.paths
nim.cfg
nimbus-build-system.paths
vendor/*
NimBinaries
.update.timestamp
*.dSYM
.vscode/*
*.exe

24
README.md Normal file
View File

@ -0,0 +1,24 @@
# Codex Network Crawler
[![License: Apache](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Stability: experimental](https://img.shields.io/badge/stability-experimental-orange.svg)](#stability)
[![CI (GitHub Actions)](https://github.com/codex-storage/nim-codex-dht/workflows/CI/badge.svg?branch=master)](https://github.com/codex-storage/nim-codex-dht/actions/workflows/ci.yml?query=workflow%3ACI+branch%3Amaster)
[![codecov](https://codecov.io/gh/codex-storage/nim-codex-dht/branch/master/graph/badge.svg?token=tlmMJgU4l7)](https://codecov.io/gh/codex-storage/nim-codex-dht)
# !! Work in Progress !!
This project uses nim-codex-dht, nim-libp2p, nim-ethers, and nim-metrics to create a metrics service. The crawler will traverse the Codex network and produce metrics such as:
- Number of DHT nodes (alive vs total)
- P2P connectivity (percentage)
- Storage contract statistics (created, total size, average size, average duration, pricing information??)
Metrics are published from a scrape target.
# Usage
```sh
nimble build
nimble test
nimble run
```

5
codexcrawler.nim Normal file
View File

@ -0,0 +1,5 @@
import
./codexcrawler/todo
when isMainModule:
run()

27
codexcrawler.nimble Normal file
View File

@ -0,0 +1,27 @@
# Package
version = "0.0.1"
author = "Codex core contributors"
description = "Crawler for Codex networks"
license = "MIT"
skipDirs = @["tests"]
bin = @["codexcrawler"]
# Dependencies
# requires "secp256k1#2acbbdcc0e63002a013fff49f015708522875832" # >= 0.5.2 & < 0.6.0
# requires "protobuf_serialization" # >= 0.2.0 & < 0.3.0
# requires "nimcrypto >= 0.5.4"
# requires "bearssl == 0.2.5"
# requires "chronicles >= 0.10.2 & < 0.11.0"
# requires "chronos >= 4.0.3 & < 5.0.0"
# requires "libp2p == 1.5.0"
# requires "metrics"
# requires "stew#head"
# requires "stint"
# requires "https://github.com/codex-storage/nim-datastore >= 0.1.0 & < 0.2.0"
# requires "questionable"
task test, "Run tests":
exec "nimble install -d -y"
withDir "tests":
exec "nimble test"

2
codexcrawler/todo.nim Normal file
View File

@ -0,0 +1,2 @@
proc run*() =
echo "Run!"

View File

@ -0,0 +1,7 @@
import pkg/asynctest/chronos/unittest
suite "Example tests":
test "Example":
echo "Woo!"
check:
1 == 1

3
tests/test.nim Normal file
View File

@ -0,0 +1,3 @@
import ./codexcrawler/exampletest
{.warning[UnusedImport]: off.}

14
tests/test.nimble Normal file
View File

@ -0,0 +1,14 @@
# Package
version = "0.0.1"
author = "Codex core contributors"
description = "Tests for crawler for Codex networks"
license = "MIT"
installFiles = @["build.nims"]
# Dependencies
requires "asynctest >= 0.5.2 & < 0.6.0"
requires "unittest2 <= 0.0.9"
task test, "Run tests":
exec "nim c -r test.nim"