mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-05-21 02:39:28 +00:00
chore: update nim 2.2.10 (#1425)
This commit is contained in:
parent
4b82d7f82d
commit
cf2f40f559
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -9,7 +9,7 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
cache_nonce: 0 # Allows for easily busting actions/cache caches
|
cache_nonce: 0 # Allows for easily busting actions/cache caches
|
||||||
nim_version: v2.2.8
|
nim_version: v2.2.10
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
|
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
|
||||||
|
|||||||
2
Makefile
2
Makefile
@ -15,7 +15,7 @@
|
|||||||
#
|
#
|
||||||
# If NIM_COMMIT is set to "nimbusbuild", this will use the
|
# If NIM_COMMIT is set to "nimbusbuild", this will use the
|
||||||
# version pinned by nimbus-build-system.
|
# version pinned by nimbus-build-system.
|
||||||
PINNED_NIM_VERSION := v2.2.8
|
PINNED_NIM_VERSION := v2.2.10
|
||||||
|
|
||||||
ifeq ($(NIM_COMMIT),)
|
ifeq ($(NIM_COMMIT),)
|
||||||
NIM_COMMIT := $(PINNED_NIM_VERSION)
|
NIM_COMMIT := $(PINNED_NIM_VERSION)
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
{.pragma: callback, cdecl, raises: [], gcsafe.}
|
{.pragma: callback, cdecl, raises: [], gcsafe.}
|
||||||
{.passc: "-fPIC".}
|
{.passc: "-fPIC".}
|
||||||
|
|
||||||
import std/[options, locks, atomics]
|
import std/[locks, atomics]
|
||||||
import chronicles
|
import chronicles
|
||||||
import chronos
|
import chronos
|
||||||
import chronos/threadsync
|
import chronos/threadsync
|
||||||
@ -152,7 +152,7 @@ proc runStorage(ctx: ptr StorageContext) {.async: (raises: []).} =
|
|||||||
# synchronously until the first await
|
# synchronously until the first await
|
||||||
asyncSpawn (
|
asyncSpawn (
|
||||||
proc() {.async.} =
|
proc() {.async.} =
|
||||||
await sleepAsync(0)
|
await sleepAsync(0.milliseconds)
|
||||||
await StorageThreadRequest.process(request, addr storage)
|
await StorageThreadRequest.process(request, addr storage)
|
||||||
)()
|
)()
|
||||||
|
|
||||||
|
|||||||
@ -52,15 +52,14 @@ proc getDebug(
|
|||||||
let node = storage[].node
|
let node = storage[].node
|
||||||
let table = RestRoutingTable.init(node.discovery.protocol.routingTable)
|
let table = RestRoutingTable.init(node.discovery.protocol.routingTable)
|
||||||
|
|
||||||
let json =
|
let json = %*{
|
||||||
%*{
|
"id": $node.switch.peerInfo.peerId,
|
||||||
"id": $node.switch.peerInfo.peerId,
|
"addrs": node.switch.peerInfo.addrs.mapIt($it),
|
||||||
"addrs": node.switch.peerInfo.addrs.mapIt($it),
|
"spr":
|
||||||
"spr":
|
if node.discovery.dhtRecord.isSome: node.discovery.dhtRecord.get.toURI else: "",
|
||||||
if node.discovery.dhtRecord.isSome: node.discovery.dhtRecord.get.toURI else: "",
|
"announceAddresses": node.discovery.announceAddrs,
|
||||||
"announceAddresses": node.discovery.announceAddrs,
|
"table": table,
|
||||||
"table": table,
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return ok($json)
|
return ok($json)
|
||||||
|
|
||||||
|
|||||||
@ -15,13 +15,11 @@
|
|||||||
## the onChunk handler for each chunk and / or writing to a file if filepath is set.
|
## the onChunk handler for each chunk and / or writing to a file if filepath is set.
|
||||||
## - CANCEL: cancels the download session
|
## - CANCEL: cancels the download session
|
||||||
|
|
||||||
import std/[options, streams]
|
|
||||||
import chronos
|
import chronos
|
||||||
import chronicles
|
import chronicles
|
||||||
import libp2p/stream/[lpstream]
|
import libp2p/stream/[lpstream]
|
||||||
import serde/json as serde
|
import serde/json as serde
|
||||||
import ../../alloc
|
import ../../alloc
|
||||||
import ../../../storage/units
|
|
||||||
import ../../../storage/storagetypes
|
import ../../../storage/storagetypes
|
||||||
|
|
||||||
from ../../../storage/storage import StorageServer, node
|
from ../../../storage/storage import StorageServer, node
|
||||||
@ -185,7 +183,7 @@ proc streamData(
|
|||||||
while not stream.atEof:
|
while not stream.atEof:
|
||||||
## Yield immediately to the event loop
|
## Yield immediately to the event loop
|
||||||
## It gives a chance to cancel request to be processed
|
## It gives a chance to cancel request to be processed
|
||||||
await sleepAsync(0)
|
await sleepAsync(0.milliseconds)
|
||||||
|
|
||||||
let read = await stream.readOnce(addr buf[0], buf.len)
|
let read = await stream.readOnce(addr buf[0], buf.len)
|
||||||
buf.setLen(read)
|
buf.setLen(read)
|
||||||
@ -213,7 +211,7 @@ proc stream(
|
|||||||
local: bool,
|
local: bool,
|
||||||
filepath: cstring,
|
filepath: cstring,
|
||||||
onChunk: OnChunkHandler,
|
onChunk: OnChunkHandler,
|
||||||
): Future[Result[string, string]] {.raises: [], async: (raises: []).} =
|
): Future[Result[string, string]] {.async: (raises: []).} =
|
||||||
## Stream the file identified by cid, calling the onChunk handler for each chunk
|
## Stream the file identified by cid, calling the onChunk handler for each chunk
|
||||||
## and / or writing to a file if filepath is set.
|
## and / or writing to a file if filepath is set.
|
||||||
##
|
##
|
||||||
@ -252,7 +250,7 @@ proc stream(
|
|||||||
|
|
||||||
proc cancel(
|
proc cancel(
|
||||||
storage: ptr StorageServer, cCid: cstring
|
storage: ptr StorageServer, cCid: cstring
|
||||||
): Future[Result[string, string]] {.raises: [], async: (raises: []).} =
|
): Future[Result[string, string]] {.async: (raises: []).} =
|
||||||
## Cancel the download session identified by cid.
|
## Cancel the download session identified by cid.
|
||||||
## This operation is not supported when using the stream mode,
|
## This operation is not supported when using the stream mode,
|
||||||
## because the worker will be busy downloading the file.
|
## because the worker will be busy downloading the file.
|
||||||
@ -280,7 +278,7 @@ proc cancel(
|
|||||||
|
|
||||||
proc manifest(
|
proc manifest(
|
||||||
storage: ptr StorageServer, cCid: cstring
|
storage: ptr StorageServer, cCid: cstring
|
||||||
): Future[Result[string, string]] {.raises: [], async: (raises: []).} =
|
): Future[Result[string, string]] {.async: (raises: []).} =
|
||||||
let cid = Cid.init($cCid)
|
let cid = Cid.init($cCid)
|
||||||
if cid.isErr:
|
if cid.isErr:
|
||||||
return err("Failed to fetch manifest: cannot parse cid: " & $cCid)
|
return err("Failed to fetch manifest: cannot parse cid: " & $cCid)
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
import std/[options, json, strutils, net, os]
|
import std/[options, json, strutils, net, os]
|
||||||
import codexdht/discv5/spr
|
import codexdht/discv5/spr
|
||||||
import stew/shims/parseutils
|
import std/parseutils
|
||||||
import contractabi/address
|
import contractabi/address
|
||||||
import chronos
|
import chronos
|
||||||
import chronicles
|
import chronicles
|
||||||
|
|||||||
@ -8,10 +8,8 @@
|
|||||||
## - SPACE: get the amount of space used by the local node.
|
## - SPACE: get the amount of space used by the local node.
|
||||||
## - EXISTS: check the existence of a cid in a node (local store).
|
## - EXISTS: check the existence of a cid in a node (local store).
|
||||||
|
|
||||||
import std/[options]
|
|
||||||
import chronos
|
import chronos
|
||||||
import chronicles
|
import chronicles
|
||||||
import libp2p/stream/[lpstream]
|
|
||||||
import serde/json as serde
|
import serde/json as serde
|
||||||
import ../../alloc
|
import ../../alloc
|
||||||
import ../../../storage/units
|
import ../../../storage/units
|
||||||
|
|||||||
2
vendor/logos-storage-nim-dht
vendored
2
vendor/logos-storage-nim-dht
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 67dbc3fe137144f07d6088c44906bf29fc317fae
|
Subproject commit 1af8dcf50447b5f68d1843e321c71dd871ecf245
|
||||||
Loading…
x
Reference in New Issue
Block a user