This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 80
80
"dependencies" : {
81
81
"@nodeutils/defaults-deep" : " ^1.1.0" ,
82
82
"async" : " ^2.6.1" ,
83
+ "base32.js" : " ~0.1.0" ,
83
84
"big.js" : " ^5.2.2" ,
84
85
"binary-querystring" : " ~0.1.2" ,
85
86
"bl" : " ^2.1.2" ,
Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ const waterfall = require('async/waterfall')
7
7
const Keychain = require ( 'libp2p-keychain' )
8
8
const defaultsDeep = require ( '@nodeutils/defaults-deep' )
9
9
const NoKeychain = require ( './no-keychain' )
10
+
11
+ const IPNS = require ( '../ipns' )
12
+ const OfflineDatastore = require ( '../ipns/routing/offline-datastore' )
13
+
10
14
/*
11
15
* Load stuff from Repo into memory
12
16
*/
@@ -95,6 +99,13 @@ module.exports = function preStart (self) {
95
99
96
100
cb ( )
97
101
} ,
102
+ // Setup offline routing for IPNS.
103
+ ( cb ) => {
104
+ const offlineDatastore = new OfflineDatastore ( self . _repo )
105
+
106
+ self . _ipns = new IPNS ( offlineDatastore , self )
107
+ cb ( )
108
+ } ,
98
109
( cb ) => self . pin . _load ( cb )
99
110
] , callback )
100
111
}
Original file line number Diff line number Diff line change 3
3
const { Key } = require ( 'interface-datastore' )
4
4
const { encodeBase32 } = require ( './utils' )
5
5
6
+ << < << << HEAD
6
7
const errcode = require ( 'err-code' )
7
8
const debug = require ( 'debug' )
8
9
const log = debug ( 'jsipfs:ipns:offline-datastore' )
9
10
log . error = debug ( 'jsipfs:ipns:offline-datastore:error' )
10
11
12
+ === = ===
13
+ >>> > >>> refactor : ipns routing logic moved to instantiation
11
14
// Offline datastore aims to mimic the same encoding as routing when storing records
12
15
// to the local datastore
13
16
class OfflineDatastore {
You can’t perform that action at this time.
0 commit comments