Documentation ¶
Index ¶
- Variables
- func GenerateRSAKey(seed int64) (crypto.PrivKey, error)
- func GetNodeID(seed int64) (peer.ID, error)
- func GetRSAKey(seed int64) (p crypto.PrivKey, e error)
- func PollReportConnectionsToNetwork(host rhost.RoutedHost, config DHTConnectionConfig, interval time.Duration)
- func StringToCid(key string) (cid.Cid, error)
- func StringsToCids(keys []string) ([]cid.Cid, error)
- type ArchonDHT
- type ArchonDHTs
- func (a *ArchonDHTs) AddLayer(permissionLayerId permLayer.PermissionLayerID, rh *rhost.RoutedHost, ...)
- func (a *ArchonDHTs) GetArchonSPProfilesForMarketplace(permissionLayerID permLayer.PermissionLayerID) (c []RegisteredSp, e error)
- func (a *ArchonDHTs) GetUrls(nodeIDs []string, permissionLayerID permLayer.PermissionLayerID, ...) (map[string]string, error)
- func (a *ArchonDHTs) GetUrlsOfNodesHoldingKeysFromAllLayers(keys []string, timeoutInSeconds time.Duration) (PermissionLayer2UrlArray, error)
- func (a *ArchonDHTs) Init()
- func (a *ArchonDHTs) RunTestTriggerServer()
- func (a ArchonDHTs) Stored(key string, versionData *permLayer.VersionData) error
- type ArchonValidator
- type DHTConnectionConfig
- type IdOutput
- type NodeIDAndUrl
- type PermissionLayer2ArchonDHT
- type PermissionLayer2UrlArray
- type ReportConnectionsLog
- type UrlArray
- type UrlsStruct
- type UrlsVersionedStruct
- type WrappedLog
Constants ¶
This section is empty.
Variables ¶
var ( AutoNATServiceDialTimeout = 15 * time.Second AutoNATServiceResetInterval = 1 * time.Minute AutoNATServiceThrottle = 3 )
var SpFilenames = permLayer.SpFilenames
Functions ¶
func GenerateRSAKey ¶
Generate RSAKey generates a new RSA key based on config.Seed
func GetRSAKey ¶
GetRSAKey returns the key from the "rsa_key.priv" file. If needed creates a new key and file
func PollReportConnectionsToNetwork ¶
func PollReportConnectionsToNetwork(host rhost.RoutedHost, config DHTConnectionConfig, interval time.Duration)
func StringToCid ¶
func StringsToCids ¶
Types ¶
type ArchonDHT ¶
type ArchonDHT struct { PermissionLayerId permLayer.PermissionLayerID Config DHTConnectionConfig // contains filtered or unexported fields }
func (*ArchonDHT) GetUrlsOfNodesHoldingKeys ¶
func (a *ArchonDHT) GetUrlsOfNodesHoldingKeys(keys []string, timeoutInSeconds time.Duration) (UrlArray, error)
each key is some pre-image of the cid mapping. depending on implementation, this can be an archonNamedUrl + <shardIdx>, archonHashUrl + <shardIdx>, etc
type ArchonDHTs ¶
type ArchonDHTs struct {
Layers PermissionLayer2ArchonDHT
}
func Init ¶
func Init(configArr []DHTConnectionConfig, basePort int) (*ArchonDHTs, error)
Init is essentially the main entrypoint to archon-dht, see README for suggestions on populating and collating configArr and setting basePort For each config in configArr, initializes a dht layer corresponding to respective permissionLayer of config
func (*ArchonDHTs) AddLayer ¶
func (a *ArchonDHTs) AddLayer(permissionLayerId permLayer.PermissionLayerID, rh *rhost.RoutedHost, d *dht.IpfsDHT, c DHTConnectionConfig)
Used to build up ArchonDHTs. See Init(...) in init.go
func (*ArchonDHTs) GetArchonSPProfilesForMarketplace ¶
func (a *ArchonDHTs) GetArchonSPProfilesForMarketplace(permissionLayerID permLayer.PermissionLayerID) (c []RegisteredSp, e error)
The returned collection of registeredSps are to populate a local marketplace instance to optimally match an upload to a within a collection of storage providers.
func (*ArchonDHTs) GetUrls ¶
func (a *ArchonDHTs) GetUrls(nodeIDs []string, permissionLayerID permLayer.PermissionLayerID, timeout time.Duration) (map[string]string, error)
func (*ArchonDHTs) GetUrlsOfNodesHoldingKeysFromAllLayers ¶
func (a *ArchonDHTs) GetUrlsOfNodesHoldingKeysFromAllLayers(keys []string, timeoutInSeconds time.Duration) (PermissionLayer2UrlArray, error)
each key is some pre-image of the cid mapping. depending on implementation, this can be an archonNamedUrl + <shardIdx>, archonHashUrl + <shardIdx>, etc
func (*ArchonDHTs) Init ¶
func (a *ArchonDHTs) Init()
func (*ArchonDHTs) RunTestTriggerServer ¶
func (a *ArchonDHTs) RunTestTriggerServer()
func (ArchonDHTs) Stored ¶
func (a ArchonDHTs) Stored(key string, versionData *permLayer.VersionData) error
Called by sp to broadcast to dht contentID:{url, versionData}, so that downloaders, given contentID, can regtrieve the (download)url. The versionData is input to a preference function on routing. i.e. archon's versioning system
type ArchonValidator ¶
type ArchonValidator struct {
PermissionLayer permLayer.PermissionLayer
}
Validator validates and orders by preference nodes, or keys:value pairs in the in the dht
type DHTConnectionConfig ¶
type DHTConnectionConfig struct { Seed int64 // seed to initialize fresh dht rsa keyset and id Global bool // bootstrap to global set IAmBootstrap bool // declare if self is a bootstrap node OptInToNetworkLogging bool // self-explanatory CountryCode gountries.Codes // self-reported country code PermissionLayer permLayer.PermissionLayer Url string // this should be copied from archonSP config // MyPartialMultiAddress string BootstrapPeers []string }
type IdOutput ¶
type IdOutput struct { ID string PublicKey string Addresses []string AgentVersion string ProtocolVersion string }
Borrowed from ipfs code to parse the results of the command `ipfs id`
type NodeIDAndUrl ¶
type NodeIDAndUrl struct {
// contains filtered or unexported fields
}
type PermissionLayer2ArchonDHT ¶
type PermissionLayer2ArchonDHT map[permLayer.PermissionLayerID]*ArchonDHT
type PermissionLayer2UrlArray ¶
type PermissionLayer2UrlArray map[permLayer.PermissionLayerID]UrlArray
type ReportConnectionsLog ¶
type ReportConnectionsLog struct { PermLayerID permLayer.PermissionLayerID NodeId peer.ID `json: "nodeid` // type will be specific to the id of the host ConnectionIds []peer.ID `json: "connectionids"` // type will be specific to the ids of connections Time time.Time `json: "time"` CountryCode gountries.Codes `json: countrycode` }
type UrlsStruct ¶
type UrlsVersionedStruct ¶
type UrlsVersionedStruct struct { Urls string `json:download_urls` Versioning permLayer.VersionData `json:versioning` Signature []byte `json:signature` PublicKey []byte `json:public_key` }
type WrappedLog ¶
type WrappedLog struct {
Log ReportConnectionsLog
}