Commit Graph

34 Commits

Author SHA1 Message Date
Mark Spanbroek d4dd15734e Remove double bookkeeping in peerHave and peerPrices 2021-06-07 09:50:17 +02:00
Mark Spanbroek e3b68f96d8 Remove debt ratio
Rationale: selecting peers based on debt ratio in bytes
is no longer needed when the bandwidth for each chunk is
compensated.
2021-06-07 09:50:17 +02:00
Mark Spanbroek fa05bffeac Pay per-block price instead of per-peer price 2021-06-07 09:50:17 +02:00
Mark Spanbroek f69827d582 Send block prices 2021-06-07 09:50:17 +02:00
Mark Spanbroek 0a28338136 Simplify test 2021-06-07 09:50:17 +02:00
Mark Spanbroek 0e34b69d7d Add block prices to peer context 2021-06-07 09:50:17 +02:00
Mark Spanbroek 0ac876dbc3 Add pricing to block presence messages 2021-06-07 09:50:17 +02:00
Mark Spanbroek 11da2339de Hard-code asset address
We're only going to support a single asset for now.
2021-06-07 09:50:17 +02:00
Mark Spanbroek 811b29fb5e Receive payments for blocks that were sent 2021-06-07 09:50:17 +02:00
Mark Spanbroek 5160b267b6 Use reference semantics for wallets 2021-06-07 09:50:17 +02:00
Mark Spanbroek 2d4a735e5f Update to latest versions of nitro and questionable 2021-06-07 09:50:17 +02:00
Mark Spanbroek ee978f354e Engine sends payments for received blocks 2021-06-07 09:50:17 +02:00
Mark Spanbroek 9512bbc50b Add proc to engine that pays peers for bytes 2021-06-07 09:50:17 +02:00
Mark Spanbroek ad48f55aaa Update to latest versions of nitro and questionable 2021-06-07 09:50:17 +02:00
Mark Spanbroek 4ce3f6d3da Add nitro wallet to BitswapEngine 2021-06-07 09:50:17 +02:00
Mark Spanbroek 22f4c277dd Revert "Add nitro wallet to BitswapNetwork"
This reverts commit e55ac4e9de.
2021-06-07 09:50:17 +02:00
Mark Spanbroek 3c4d4dc29f Exchange pricing when connecting to new peer 2021-06-07 09:50:17 +02:00
Mark Spanbroek 0897e615e6 Broadcast payment 2021-06-07 09:50:17 +02:00
Mark Spanbroek 6e7220efbb Broadcast pricing 2021-06-07 09:50:17 +02:00
Mark Spanbroek e02c40db80 Add handler for payment messages 2021-06-07 09:50:17 +02:00
Mark Spanbroek 5f9215a371 Add handler for pricing messages 2021-06-07 09:50:17 +02:00
Mark Spanbroek 364d3a9277 Fix typo 2021-06-07 09:50:17 +02:00
Mark Spanbroek 9635f26b90 Fix tests on 32 bit platforms 2021-06-07 09:50:17 +02:00
Mark Spanbroek c819ba1be1 protobuf message for state channel updates 2021-06-07 09:50:17 +02:00
Mark Spanbroek 1f2a9f90d5 protobuf message for bandwidth pricing 2021-06-07 09:50:17 +02:00
Mark Spanbroek 8adea94196 Add nitro wallet to BitswapNetwork 2021-06-07 09:50:17 +02:00
Mark Spanbroek 5cd714ea83 Remove deprecated libp2p import 2021-06-07 09:50:17 +02:00
Mark Spanbroek 339f7f04bc Fix warnings 2021-06-07 09:50:17 +02:00
Dmitriy Ryajov 6c92b3dc25
Poc 2 (#7)
* moving protobuf into bitswap

* adding block type

* reworking bitswap

* adding chunker

* adding license header

* use 1.2.6

* adding fixed size chunker

* add blockstore

* add iterator to chunker

* more bitswap changes

* rename ipfs to dagger

* rename to dagger

* blockstore inherits from BlockProvider

* wip - add core block handling logic

* smal changes

* use proper block store methods

* adding asynq heapqueue

* wip prepare for bitswap task runner

* adding `$`

* adding memory store and tests

* fixed chunking

* extracted desicion engine from bitswap

* added helper random funcs

* adding testing helpers

* only handle seqs

* add peer events

* cleanup pending blocks on blockstore event

* allow nil handlers

* move protobuf type helpers

* allow initializing block from Cid

* testing and fixes

* small fixes

* expose `<`

* spelling

* default value

* spelling

* pending blocks manager

* adding stores manager

* more tests a wip around bitswap

* small changes

* merge bitswap and engine for now

* for now run only the new poc's tests

* add a more complete ci setup

* use template in map

* remove p2pd

* remove go

* dont use asyncCheck

* few small changes

* adding ability to update items

* adding multiple task runners

* handle cancelation properly

* use Result instead of throwing

* wip bitswap tests

* moving things around

* split out engine again

* add request and handlers interface

* fix tests

* wip - engine tests

* remove unused imports

* fix tests

* cleanup block requesting logic

* add block request tests

* more block requests

* add support for max heap

* don't use result

* use max heap & send block presence in task handler

* add task handler tests

* rename store to localStore

* cleanup & logging

* cancel task on stop

* don't depend on local store for events

* dont use heap queue for wants

* add chronicles

* fix issue with peer wants

* add test for delayed block sends

* remove obsolete tests

* wip chunker

* run all tests

* add todo

* misc

* remove irrelevant files

* removing more files

* adding helpers for bitswap tests

* moved bitswap file

* misc

* make blocks timeout longer

* adjust block timeout

* speedup test

* compile with threads

* import missing crypto

* misc

* disable threads for now

* fix 32 bit platforms

* re-enable threads support in tests
2021-02-25 18:23:22 -06:00
Mark Spanbroek 05a7f47113 Rename dagger->ipfs
This is a storage engine based on IPFS, which is only a part of Dagger
2021-02-02 19:29:52 +01:00
Mark Spanbroek dd18f50ec6 Replace root hash by root content id 2021-02-02 19:29:52 +01:00
Mark Spanbroek 096fe0e40d Repo for storing and retrieving Merkle DAGs 2021-02-02 19:29:52 +01:00
Mark Spanbroek ecc4e50d28 Add root hash to Merkle DAG 2021-02-02 19:29:52 +01:00
Mark Spanbroek c795c698fe Compile all tests in one go 2021-02-02 19:29:52 +01:00