chore: remove record-store, it is old

This commit is contained in:
Jacob Heun 2019-10-18 14:31:00 +02:00
parent 606d6a6815
commit 46eac39626
No known key found for this signature in database
GPG Key ID: CA5A94C15809879F
10 changed files with 0 additions and 283 deletions

View File

@ -17,7 +17,6 @@
- [Content Routing](./src/content-routing)
- [Peer Discovery](./src/peer-discovery)
- [Peer Routing](./src/peer-routing)
- [Record Store](./src/record-store)
- [Stream Muxer](./src/stream-muxer)
- [Transport](./src/transport)
@ -28,7 +27,6 @@ For posterity, here are links to the original repositories for each of the inter
- [Content Routing](https://github.com/libp2p/interface-content-routing)
- [Peer Discovery](https://github.com/libp2p/interface-peer-discovery)
- [Peer Routing](https://github.com/libp2p/interface-peer-routing)
- [Record Store](https://github.com/libp2p/interface-record-store)
- [Stream Muxer](https://github.com/libp2p/interface-stream-muxer)
- [Transport](https://github.com/libp2p/interface-transport)

View File

@ -1,27 +0,0 @@
# Logs
logs
*.log
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

View File

@ -1,22 +0,0 @@
The MIT License (MIT)
Copyright (c) 2015 David Dias
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,87 +0,0 @@
interface-record-store
=====================
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://protocol.ai)
[![](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
[![](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p)
[![Discourse posts](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg)](https://discuss.libp2p.io)
> A test suite and interface you can use to implement a a [IPRS compliant](/IPRS.md) Record Store.
The primary goal of this module is to enable developers to pick and swap their Record Store module as they see fit for their libp2p installation, without having to go through shims or compatibility issues. This module and test suite were heavily inspired by [`abstract-blob-store`](https://github.com/maxogden/abstract-blob-store) and [`interface-stream-muxer`](https://github.com/libp2p/interface-stream-muxer).
Publishing a test suite as a module lets multiple modules all ensure compatibility since they use the same test suite.
The API is presented with both Node.js and Go primitives, however, there is not actual limitations for it to be extended for any other language, pushing forward the cross compatibility and interop through diferent stacks.
## Lead Maintainer
[Vasco Santos](https://github.com/vasco-santos).
# Modules that implement the interface
- [ipfs-distributed-record-store](https://github.com/libp2p/js-libp2p-distributed-record-store)
- [ipfs-kad-record-store](https://github.com/libp2p/js-libp2p-kad-record-store)
# Badge
Include this badge in your readme if you make a module that is compatible with the interface-record-store API. You can validate this by running the tests.
![](https://raw.githubusercontent.com/diasdavid/interface-record-store/master/img/badge.png)
# How to use the battery of tests
## Node.js
```
var tape = require('tape')
var tests = require('interface-record-store/tests')
var YourRecordStore = require('../src')
var common = {
setup: function (t, cb) {
cb(null, YourRecordStore)
},
teardown: function (t, cb) {
cb()
}
}
tests(tape, common)
```
## Go
> WIP
# API
A valid (read: that follows this abstraction) stream muxer, must implement the following API.
### Obtain a Record
- `Node.js` rs.get(key, function (err, records) {})
This method returns an array of records, found in the Record Store.
If `err` is passed, `records` will be a `undefined` value.
`key` is a multihash value that represents any arbitraty random value, that may have records associated with it.
### Store a Record
- `Node.js` rs.put(key, recordSignatureMultiHash, function (err) {})
`recordSignatureMultihash` is multihash of the Record Signature MerkleDAG obj, as described by IPRS - InterPlanetary Record Spec
if `err` is passed, means that the record wasn't stored properly or it was unvalid.
### Implementation considerations
- the key is a multihash but not necessarily the hash of the record signature object.
- a DRS instance must have a mapping of key->[hash(recordSignature)] to know which records belong to a given key (provided value)
- DRS implements the interface-record-store interface
- DRS may levarage other implementations of interface-record-store to find records in the network or other storage mechanisms
- DRS should return every valid record it can find in a query
- all unvalid records detected in the process should be discarded/deleted

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 20 KiB

View File

@ -1,31 +0,0 @@
{
"name": "interface-record-store",
"version": "0.1.3",
"description": "A test suite and interface you can use to implement a a IPRS compliant(https://github.com/ipfs/specs/tree/master/records) Record Store",
"leadMaintainer": "Vasco Santos <vasco.santos@moxy.studio>",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/libp2p/interface-record-store.git"
},
"keywords": [
"IPFS"
],
"engines": {
"node": "^4.0.0"
},
"author": "David Dias <daviddias@ipfs.io>",
"license": "MIT",
"bugs": {
"url": "https://github.com/libp2p/interface-record-store/issues"
},
"homepage": "https://github.com/libp2p/interface-record-store",
"dependencies": {
"ecdsa": "~0.7.0",
"ipld": "~0.22.0",
"multihashing": "~0.3.3",
"timed-tape": "~0.1.1"
}
}

View File

@ -1,90 +0,0 @@
var crypto = require('crypto')
var multihashing = require('multihashing')
var ipld = require('ipld')
var ecdsa = require('ecdsa')
module.exports.all = function (test, common) {
test('Store a valid record', function (t) {
common.setup(test, function (err, recordStore) {
t.ifError(err, 'Should not throw')
var mdagStore = recordStore.mdagStore
var ecdh = crypto.createECDH('secp256k1')
ecdh.generateKeys()
var mdagObj_pubKey = {
'@context': ipld.context.merkleweb,
algorithm: {
mlink: 'secp256k1'
},
encoding: {
mlink: 'raw'
},
bytes: ecdh.getPublicKey()
}
var mdagObj_pubKey_encoded = ipld.marshal(mdagObj_pubKey)
var mdagObj_pubKey_mh = multihashing(mdagObj_pubKey_encoded, 'sha2-256')
mdagStore.put(mdagObj_pubKey, mdagObj_pubKey_mh)
var current = new Date()
var mdagObj_record = {
'@context': ipld.context.merkleweb,
scheme: {
mlink: 'type-a'
},
expires: (new Date()).setDate(current.getDate() + 1),
value: 'aaah the data!'
}
var mdagObj_record_encoded = ipld.marshal(mdagObj_record)
var mdagObj_record_mh = multihashing(mdagObj_record_encoded, 'sha2-256')
mdagStore.put(mdagObj_record, mdagObj_record_mh)
var mdagObj_record_encoded_hash = crypto.createHash('sha256').update(mdagObj_record_encoded).digest()
var record_signed = ecdsa.sign(mdagObj_record_encoded_hash, ecdh.getPrivateKey())
var mdagObj_record_signature = {
'@context': ipld.context.merkleweb,
pubKey: {
mlink: mdagObj_pubKey_mh
},
algorithm: {
mlink: 'secp256k1'
},
encoding: {
mlink: 'binary'
},
signee: {
mlink: mdagObj_record_mh
},
bytes: record_signed
}
var mdagObj_record_signature_encoded = ipld.marshal(mdagObj_record_signature)
var mdagObj_record_signature_encoded_mh = multihashing(mdagObj_record_signature_encoded, 'sha2-256')
mdagStore.put(mdagObj_record_signature, mdagObj_record_signature_encoded_mh)
recordStore.put('bananas', mdagObj_record_signature, function (err) {
t.ifError(err, 'Should not throw')
recordStore.get('bananas', function (err, records) {
t.ifError(err, 'Should not throw')
t.equal(records.length, 1)
t.pass('record was stored successfully')
t.end()
})
})
})
})
// test('Store an unvalid record')
// test('Store and retrieve a valid record')
// test('Store a bunch of valid and unvalid records and check what gets retrieved')
// test('Store a bunch of records with variable validity, wait for some to expire, check what gets retrieved')
}

View File

@ -1,6 +0,0 @@
var timed = require('timed-tape')
module.exports = function (test, common) {
test = timed(test)
require('./base-test.js').all(test, common)
}