public class Node extends java.lang.Object implements TimeSkewDetectorCallback
Modifier and Type | Class and Description |
---|---|
static class |
Node.AlreadySetPasswordException |
class |
Node.MigrateOldStoreData |
class |
Node.NodeNameCallback |
Modifier and Type | Field and Description |
---|---|
static long |
ALARM_TIME |
FetchContext |
arkFetcherContext
FetchContext for ARKs
|
long |
bootID |
NodeClientCore |
clientCore |
IOStatisticCollector |
collector |
PersistentConfig |
config
Config object for the whole node.
|
static double |
DECREMENT_AT_MAX_PROB |
static double |
DECREMENT_AT_MIN_PROB |
static short |
DEFAULT_MAX_HTL |
Executor |
executor |
static int |
EXTRA_PEER_DATA_TYPE_BOOKMARK |
static int |
EXTRA_PEER_DATA_TYPE_DOWNLOAD |
static int |
EXTRA_PEER_DATA_TYPE_N2NTM |
static int |
EXTRA_PEER_DATA_TYPE_PEER_NOTE |
static int |
EXTRA_PEER_DATA_TYPE_QUEUED_TO_SEND_N2NM |
java.util.Random |
fastWeakRandom
Weak but fast RNG
|
FreenetInetAddress |
fLocalhostAddress |
static boolean |
FORK_ON_CACHEABLE_DEFAULT
Should inserts fork when the HTL reaches cacheability?
|
static int |
HANDSHAKE_TIMEOUT
Time after which a handshake is assumed to have failed.
|
static boolean |
IGNORE_LOW_BACKOFF_DEFAULT
Should inserts ignore low backoff times by default?
|
NodeIPDetector |
ipDetector
IP detector
|
static long |
KEEPALIVE_INTERVAL |
long |
lastBootID
The bootID of the last time the node booted up.
|
int |
lastVersion |
LocationManager |
lm |
java.net.InetAddress |
localhostAddress |
static LoggingConfigHandler |
logConfigHandler
Log config handler
|
static long |
LOW_BACKOFF
Definition of "low backoff times" for above.
|
static long |
MAX_PEER_INACTIVITY |
static int |
MIN_BURSTING_HANDSHAKE_BURST_SIZE |
static int |
MIN_TIME_BETWEEN_BURSTING_HANDSHAKE_BURSTS |
static int |
MIN_TIME_BETWEEN_HANDSHAKE_SENDS |
static int |
MIN_TIME_BETWEEN_VERSION_PROBES |
static int |
MIN_TIME_BETWEEN_VERSION_SENDS |
static int |
N2N_MESSAGE_TYPE_DIFFNODEREF
Type identifier for differential node reference messages, as sent on DMT.nodeToNodeMessage's
|
static int |
N2N_MESSAGE_TYPE_FPROXY
Type identifier for fproxy node to node messages, as sent on DMT.nodeToNodeMessage's
|
static int |
N2N_TEXT_MESSAGE_TYPE_BOOKMARK
Identified within friend feed for the recommendation of a bookmark
|
static int |
N2N_TEXT_MESSAGE_TYPE_DOWNLOAD
Identified within friend feed for the recommendation of a file
|
static int |
N2N_TEXT_MESSAGE_TYPE_FILE_OFFER
Identifier within fproxy messages for an offer to transfer a file
|
static int |
N2N_TEXT_MESSAGE_TYPE_FILE_OFFER_ACCEPTED
Identifier within fproxy messages for accepting an offer to transfer a file
|
static int |
N2N_TEXT_MESSAGE_TYPE_FILE_OFFER_REJECTED
Identifier within fproxy messages for rejecting an offer to transfer a file
|
static int |
N2N_TEXT_MESSAGE_TYPE_USERALERT
Identifier within fproxy messages for simple, short text messages to be displayed on the homepage as useralerts
|
NodeStats |
nodeStats
Stats
|
NodeUpdateManager |
nodeUpdater
NodeUpdater
|
RequestClient |
nonPersistentClientBulk |
RequestClient |
nonPersistentClientRT |
TokenBucket |
outputThrottle |
static int |
PACKET_SIZE |
static int |
PACKETS_IN_BLOCK |
static int |
PEER_NOTE_TYPE_PRIVATE_DARKNET_COMMENT |
PeerManager |
peers
My peers
|
PluginManager |
pluginManager |
static boolean |
PREFER_INSERT_DEFAULT
Should inserts be fairly blatently prioritised on accept by default?
|
PacketSender |
ps |
RandomSource |
random
Strong RNG
|
static int |
RANDOMIZED_BURSTING_HANDSHAKE_BURST_SIZE |
static int |
RANDOMIZED_TIME_BETWEEN_BURSTING_HANDSHAKE_BURSTS |
static int |
RANDOMIZED_TIME_BETWEEN_HANDSHAKE_SENDS |
static int |
RANDOMIZED_TIME_BETWEEN_VERSION_PROBES |
static int |
RANDOMIZED_TIME_BETWEEN_VERSION_SENDS |
java.security.SecureRandom |
secureRandom
JCA-compliant strong RNG.
|
SecurityLevels |
securityLevels |
static int |
sizePerKey
The number of bytes per key total in all the different datastores.
|
long |
startupTime |
long |
swapIdentifier
Semi-unique ID for swap requests.
|
static int |
SYMMETRIC_KEY_LENGTH |
boolean |
throttleLocalData |
PrioritizedTicker |
ticker |
RequestTracker |
tracker |
UptimeEstimator |
uptime |
Modifier and Type | Method and Description |
---|---|
OpennetPeerNode |
addNewOpennetNode(SimpleFieldSet fs,
OpennetManager.ConnectionType connectionType) |
boolean |
addPeerConnection(PeerNode pn) |
boolean |
awaitingPassword() |
ProgramDirectory |
cfgDir() |
void |
changeMasterPassword(java.lang.String oldPassword,
java.lang.String newPassword,
boolean inFirstTimeWizard) |
static boolean |
checkForGCJCharConversionBug() |
<T extends StorableBlock> |
closeOldStore(StoreCallback<T> old) |
void |
connect(Node node,
DarknetPeerNode.FRIEND_TRUST trust,
DarknetPeerNode.FRIEND_VISIBILITY visibility) |
void |
connectToSeednode(SeedServerTestPeerNode node)
Connect this node to another node (for purposes of testing)
|
DarknetPeerNode |
createNewDarknetNode(SimpleFieldSet fs,
DarknetPeerNode.FRIEND_TRUST trust,
DarknetPeerNode.FRIEND_VISIBILITY visibility) |
OpennetPeerNode |
createNewOpennetNode(SimpleFieldSet fs) |
SeedServerTestPeerNode |
createNewSeedServerTestPeerNode(SimpleFieldSet fs) |
MersenneTwister |
createRandom() |
void |
createVisibilityAlert() |
boolean |
darknetDefinitelyPortForwarded() |
short |
decrementHTL(PeerNode source,
short htl)
Decrement the HTL according to the policy of the given
NodePeer if it is non-null, or do something else if it is
null.
|
boolean |
dontDetect()
Should the IP detection code only use the IP address override and the bindTo information,
rather than doing a full detection?
|
void |
dumpStoreHits() |
boolean |
enableNewLoadManagement(boolean realTimeFlag) |
boolean |
enableRoutedPing()
FIXME move to Probe.java?
|
void |
exit(int reason) |
void |
exit(java.lang.String reason) |
SimpleFieldSet |
exportDarknetPrivateFieldSet() |
SimpleFieldSet |
exportDarknetPublicFieldSet() |
SimpleFieldSet |
exportOpennetPrivateFieldSet() |
SimpleFieldSet |
exportOpennetPublicFieldSet() |
SimpleFieldSet |
exportVolatileFieldSet()
Export volatile data about the node as a SimpleFieldSet
|
ClientKeyBlock |
fetch(ClientSSK clientSSK,
boolean canReadClientCache,
boolean canWriteClientCache,
boolean canWriteDatastore) |
KeyBlock |
fetch(Key key,
boolean canReadClientCache,
boolean canWriteClientCache,
boolean canWriteDatastore,
boolean forULPR,
BlockMetadata meta)
Fetch a block from the datastore.
|
CHKBlock |
fetch(NodeCHK key,
boolean dontPromote,
boolean canReadClientCache,
boolean canWriteClientCache,
boolean canWriteDatastore,
boolean forULPR,
BlockMetadata meta) |
SSKBlock |
fetch(NodeSSK key,
boolean dontPromote,
boolean canReadClientCache,
boolean canWriteClientCache,
boolean canWriteDatastore,
boolean forULPR,
BlockMetadata meta) |
ClientKeyBlock |
fetchKey(ClientKey key,
boolean canReadClientCache,
boolean canWriteClientCache,
boolean canWriteDatastore) |
void |
finishPanic() |
int |
getAverageOutgoingSwapTime() |
java.io.File |
getCfgDir() |
PeerNode[] |
getConnectedPeers() |
DarknetPeerNode[] |
getDarknetConnections() |
int |
getDarknetPortNumber() |
byte[] |
getDarknetPubKeyHash() |
java.lang.String |
getDatabasePath() |
java.util.Map<DataStoreInstanceType,DataStoreStats> |
getDataStoreStats()
This method returns all statistics info for our data store stats table
|
java.lang.String |
getExtraPeerDataDir() |
int |
getFNPPort() |
int |
getInputBandwidthLimit() |
double |
getLocation() |
double |
getLocationChangeSession() |
LocationManager |
getLocationManager() |
java.io.File |
getMasterPasswordFile() |
int |
getMaxOpennetPeers() |
long |
getMaxTotalKeys() |
static int |
getMinimumBandwidth() |
int |
getMinimumMTU() |
java.lang.String |
getMyName() |
java.io.File |
getNodeDir() |
NodeStarter |
getNodeStarter() |
NodeUpdateManager |
getNodeUpdater() |
int |
getNoSwaps() |
int |
getNumARKFetchers() |
int |
getNumberOfRemotePeerLocationsSeenInSwaps() |
OpennetManager |
getOpennet() |
int |
getOpennetFNPPort() |
byte[] |
getOpennetPubKeyHash() |
int |
getOutputBandwidthLimit() |
UdpSocketHandler[] |
getPacketSocketHandlers() |
PeerNode |
getPeerNode(java.lang.String nodeIdentifier)
Return a peer of the node given its ip and port, name or identity, as a String
|
PeerNode[] |
getPeerNodes() |
java.io.File |
getPluginDir() |
PluginManager |
getPluginManager() |
byte[] |
getPluginStoreKey(java.lang.String storeIdentifier) |
java.util.Set<ForwardPort> |
getPublicInterfacePorts()
Get the set of public ports that need to be forwarded.
|
java.io.File |
getRunDir() |
long |
getSendSwapInterval() |
int |
getStartedSwaps() |
java.lang.String |
getStatus() |
java.io.File |
getStoreDir() |
long |
getStoreSize() |
int |
getSwaps() |
int |
getSwapsRejectedAlreadyLocked() |
int |
getSwapsRejectedNowhereToGo() |
int |
getSwapsRejectedRateLimit() |
int |
getSwapsRejectedRecognizedID() |
Ticker |
getTicker() |
java.lang.String |
getTMCIPeerList() |
long |
getTotalPayloadSent()
Get the total number of bytes of payload (real data) sent by the node
|
TrafficClass |
getTrafficClass() |
int |
getUnclaimedFIFOSize() |
long |
getUptime()
Get the time since the node was started in milliseconds.
|
java.io.File |
getUserDir() |
boolean |
getUseSlashdotCache() |
MessageCore |
getUSM() |
boolean |
getWriteLocalToDatastore() |
void |
handleNodeToNodeTextMessageSimpleFieldSet(SimpleFieldSet fs,
DarknetPeerNode source,
int fileNumber)
Handle a node to node text message SimpleFieldSet
|
boolean |
hasDatabase() |
boolean |
hasKey(Key key,
boolean canReadClientCache,
boolean forULPR) |
boolean |
isAdvancedModeEnabled() |
boolean |
isFProxyJavascriptEnabled() |
boolean |
isHasStarted() |
boolean |
isOpennetEnabled() |
boolean |
isOudated() |
boolean |
isSeednode() |
boolean |
isStopping()
Returns true if the node is shutting down.
|
static boolean |
isTestnetEnabled() |
boolean |
isUsingWrapper() |
void |
killMasterKeysFile() |
void |
lateSetupDatabase(DatabaseKey databaseKey) |
static void |
main(java.lang.String[] args)
Read the config file from the arguments.
|
CHKInsertSender |
makeInsertSender(NodeCHK key,
short htl,
long uid,
InsertTag tag,
PeerNode source,
byte[] headers,
PartiallyReceivedBlock prb,
boolean fromStore,
boolean canWriteClientCache,
boolean forkOnCacheable,
boolean preferInsert,
boolean ignoreLowBackoff,
boolean realTimeFlag)
Fetch or create an CHKInsertSender for a given key/htl.
|
SSKInsertSender |
makeInsertSender(SSKBlock block,
short htl,
long uid,
InsertTag tag,
PeerNode source,
boolean fromStore,
boolean canWriteClientCache,
boolean canWriteDatastore,
boolean forkOnCacheable,
boolean preferInsert,
boolean ignoreLowBackoff,
boolean realTimeFlag)
Fetch or create an SSKInsertSender for a given key/htl.
|
java.lang.Object |
makeRequestSender(Key key,
short htl,
long uid,
RequestTag tag,
PeerNode source,
boolean localOnly,
boolean ignoreStore,
boolean offersOnly,
boolean canReadClientCache,
boolean canWriteClientCache,
boolean realTimeFlag)
Check the datastore, then if the key is not in the store,
check whether another node is requesting the same key at
the same HTL, and if all else fails, create a new
RequestSender for the key/htl.
|
void |
makeStore(java.lang.String val) |
short |
maxHTL() |
boolean |
noConnectedPeers() |
ProgramDirectory |
nodeDir() |
void |
onAddedValidIP() |
void |
onConnectedPeer() |
boolean |
opennetDefinitelyPortForwarded() |
void |
panic() |
void |
park()
Get the node into a state where it can be stopped safely
May be called twice - once in exit (above) and then again
from the wrapper triggered by calling System.exit().
|
boolean |
passOpennetRefsThroughDarknet() |
boolean |
peersWantKey(Key key) |
ProgramDirectory |
pluginDir() |
void |
queueRandomReinsert(KeyBlock block) |
void |
receivedNodeToNodeMessage(Message m,
PeerNode src)
Handle a received node to node message
|
void |
receivedNodeToNodeMessage(PeerNode src,
int type,
ShortBuffer messageData,
boolean partingMessage) |
void |
registerNodeToNodeMessageListener(int type,
NodeToNodeMessageListener listener) |
void |
removePeerConnection(PeerNode pn) |
int |
routedPing(double loc2,
byte[] pubKeyHash)
Do a routed ping of another node on the network by its location.
|
ProgramDirectory |
runDir() |
void |
sentPayload(int len) |
void |
setDispatcherHook(NodeDispatcher.NodeDispatcherCallback cb) |
void |
setLocation(double loc)
Warning: does not announce change in location!
|
void |
setMasterPassword(java.lang.String password,
boolean inFirstTimeWizard)
Can be called to decrypt client.dat* etc, or can be called when switching from another
security level to HIGH.
|
void |
setName(java.lang.String key) |
void |
setTimeSkewDetectedUserAlert() |
ProgramDirectory |
setupProgramDir(SubConfig installConfig,
java.lang.String cfgKey,
java.lang.String defaultValue,
java.lang.String shortdesc,
java.lang.String longdesc,
java.lang.String moveErrMsg,
SubConfig oldConfig)
Sets up a program directory using the config value defined by the given
parameters.
|
protected ProgramDirectory |
setupProgramDir(SubConfig installConfig,
java.lang.String cfgKey,
java.lang.String defaultValue,
java.lang.String shortdesc,
java.lang.String longdesc,
SubConfig oldConfig) |
boolean |
shallWePublishOurPeersLocation() |
boolean |
shallWeRouteAccordingToOurPeersLocation(int htl) |
boolean |
shouldStoreDeep(Key key,
PeerNode source,
PeerNode[] routedTo)
Should we commit the block to the store rather than the cache?
|
void |
start(boolean noSwaps) |
void |
startProbe(byte htl,
long uid,
Type type,
Listener listener)
Dispatches a probe request with the specified settings
|
void |
store(KeyBlock block,
boolean deep,
boolean canWriteClientCache,
boolean canWriteDatastore,
boolean forULPR)
Store a datum.
|
void |
store(SSKBlock block,
boolean deep,
boolean overwrite,
boolean canWriteClientCache,
boolean canWriteDatastore,
boolean forULPR) |
ProgramDirectory |
storeDir() |
void |
storeInsert(SSKBlock block,
boolean deep,
boolean overwrite,
boolean canWriteClientCache,
boolean canWriteDatastore)
Store the block if this is a sink.
|
void |
storeShallow(CHKBlock block,
boolean canWriteClientCache,
boolean canWriteDatastore,
boolean forULPR) |
void |
storeShallow(SSKBlock block,
boolean canWriteClientCache,
boolean canWriteDatastore,
boolean fromULPR)
Store only to the cache, and not the store.
|
boolean |
updateIsUrgent() |
void |
updateMTU() |
ProgramDirectory |
userDir() |
boolean |
wantAnonAuth(boolean isOpennet)
Returns true if the packet receiver should try to decode/process packets that are not from a peer (i.e.
|
boolean |
wantAnonAuthChangeIP(boolean isOpennet) |
boolean |
wantEncryptedDatabase() |
boolean |
wantNoPersistentDatabase() |
void |
writeNodeFile() |
void |
writeOpennetFile() |
public final NodeStats nodeStats
public final PersistentConfig config
public static LoggingConfigHandler logConfigHandler
public static final int PACKETS_IN_BLOCK
public static final int PACKET_SIZE
public static final double DECREMENT_AT_MIN_PROB
public static final double DECREMENT_AT_MAX_PROB
public static final long KEEPALIVE_INTERVAL
public static final long MAX_PEER_INACTIVITY
public static final int HANDSHAKE_TIMEOUT
public static final int MIN_TIME_BETWEEN_HANDSHAKE_SENDS
public static final int RANDOMIZED_TIME_BETWEEN_HANDSHAKE_SENDS
public static final int MIN_TIME_BETWEEN_VERSION_PROBES
public static final int RANDOMIZED_TIME_BETWEEN_VERSION_PROBES
public static final int MIN_TIME_BETWEEN_VERSION_SENDS
public static final int RANDOMIZED_TIME_BETWEEN_VERSION_SENDS
public static final int MIN_TIME_BETWEEN_BURSTING_HANDSHAKE_BURSTS
public static final int RANDOMIZED_TIME_BETWEEN_BURSTING_HANDSHAKE_BURSTS
public static final int MIN_BURSTING_HANDSHAKE_BURST_SIZE
public static final int RANDOMIZED_BURSTING_HANDSHAKE_BURST_SIZE
public static final long ALARM_TIME
public static final int SYMMETRIC_KEY_LENGTH
public static final int sizePerKey
public final FetchContext arkFetcherContext
public final NodeIPDetector ipDetector
public final RequestTracker tracker
public long swapIdentifier
public final LocationManager lm
public final PeerManager peers
public final RandomSource random
public final java.security.SecureRandom secureRandom
public final java.util.Random fastWeakRandom
public final Executor executor
public final PacketSender ps
public final PrioritizedTicker ticker
public final UptimeEstimator uptime
public final TokenBucket outputThrottle
public boolean throttleLocalData
public static final short DEFAULT_MAX_HTL
public static final boolean IGNORE_LOW_BACKOFF_DEFAULT
public static final long LOW_BACKOFF
public static final boolean PREFER_INSERT_DEFAULT
public static final boolean FORK_ON_CACHEABLE_DEFAULT
public final IOStatisticCollector collector
public static final int N2N_MESSAGE_TYPE_FPROXY
public static final int N2N_MESSAGE_TYPE_DIFFNODEREF
public static final int N2N_TEXT_MESSAGE_TYPE_USERALERT
public static final int N2N_TEXT_MESSAGE_TYPE_FILE_OFFER
public static final int N2N_TEXT_MESSAGE_TYPE_FILE_OFFER_ACCEPTED
public static final int N2N_TEXT_MESSAGE_TYPE_FILE_OFFER_REJECTED
public static final int N2N_TEXT_MESSAGE_TYPE_BOOKMARK
public static final int N2N_TEXT_MESSAGE_TYPE_DOWNLOAD
public static final int EXTRA_PEER_DATA_TYPE_N2NTM
public static final int EXTRA_PEER_DATA_TYPE_PEER_NOTE
public static final int EXTRA_PEER_DATA_TYPE_QUEUED_TO_SEND_N2NM
public static final int EXTRA_PEER_DATA_TYPE_BOOKMARK
public static final int EXTRA_PEER_DATA_TYPE_DOWNLOAD
public static final int PEER_NOTE_TYPE_PRIVATE_DARKNET_COMMENT
public final long lastBootID
public final long bootID
public final long startupTime
public final NodeClientCore clientCore
public int lastVersion
public final NodeUpdateManager nodeUpdater
public final SecurityLevels securityLevels
public final PluginManager pluginManager
public final java.net.InetAddress localhostAddress
public final FreenetInetAddress fLocalhostAddress
public final RequestClient nonPersistentClientBulk
public final RequestClient nonPersistentClientRT
public <T extends StorableBlock> void closeOldStore(StoreCallback<T> old)
public TrafficClass getTrafficClass()
public static int getMinimumBandwidth()
public void startProbe(byte htl, long uid, Type type, Listener listener)
Probe.start(byte, long, Type, Listener)
public void makeStore(java.lang.String val) throws InvalidConfigValueException
InvalidConfigValueException
public void writeNodeFile()
public void writeOpennetFile()
public static void main(java.lang.String[] args) throws java.io.IOException
args
- java.io.IOException
public boolean isUsingWrapper()
public NodeStarter getNodeStarter()
public ProgramDirectory setupProgramDir(SubConfig installConfig, java.lang.String cfgKey, java.lang.String defaultValue, java.lang.String shortdesc, java.lang.String longdesc, java.lang.String moveErrMsg, SubConfig oldConfig) throws NodeInitException
NodeInitException
protected ProgramDirectory setupProgramDir(SubConfig installConfig, java.lang.String cfgKey, java.lang.String defaultValue, java.lang.String shortdesc, java.lang.String longdesc, SubConfig oldConfig) throws NodeInitException
NodeInitException
public void lateSetupDatabase(DatabaseKey databaseKey) throws MasterKeysWrongPasswordException, MasterKeysFileSizeException, java.io.IOException
MasterKeysWrongPasswordException
MasterKeysFileSizeException
java.io.IOException
public void killMasterKeysFile() throws java.io.IOException
java.io.IOException
public void start(boolean noSwaps) throws NodeInitException
NodeInitException
public static boolean checkForGCJCharConversionBug()
public SimpleFieldSet exportVolatileFieldSet()
public int routedPing(double loc2, byte[] pubKeyHash)
loc2
- The location of the other node to ping. It must match
exactly.pubKeyHash
- The hash of the pubkey of the target node. We match
by location; this is just a shortcut if we get close.public java.lang.Object makeRequestSender(Key key, short htl, long uid, RequestTag tag, PeerNode source, boolean localOnly, boolean ignoreStore, boolean offersOnly, boolean canReadClientCache, boolean canWriteClientCache, boolean realTimeFlag)
closestLocation
- The closest location to the key so far.localOnly
- If true, only check the datastore.public KeyBlock fetch(Key key, boolean canReadClientCache, boolean canWriteClientCache, boolean canWriteDatastore, boolean forULPR, BlockMetadata meta)
key
- canReadClientCache
- canWriteClientCache
- canWriteDatastore
- forULPR
- mustBeMarkedAsPostCachingChanges
- If true, the key must have the
ENTRY_NEW_BLOCK flag (if saltedhash), indicating that it a) has been added
since the caching changes in 1224 (since we didn't delete the stores), and b)
that it wasn't added due to low network security caching everything, unless we
are currently in low network security mode. Only applies to main store.public SSKBlock fetch(NodeSSK key, boolean dontPromote, boolean canReadClientCache, boolean canWriteClientCache, boolean canWriteDatastore, boolean forULPR, BlockMetadata meta)
public CHKBlock fetch(NodeCHK key, boolean dontPromote, boolean canReadClientCache, boolean canWriteClientCache, boolean canWriteDatastore, boolean forULPR, BlockMetadata meta)
public java.util.Map<DataStoreInstanceType,DataStoreStats> getDataStoreStats()
public long getMaxTotalKeys()
public void dumpStoreHits()
public void storeShallow(CHKBlock block, boolean canWriteClientCache, boolean canWriteDatastore, boolean forULPR)
public void store(KeyBlock block, boolean deep, boolean canWriteClientCache, boolean canWriteDatastore, boolean forULPR) throws KeyCollisionException
block
- a KeyBlockdeep
- If true, insert to the store as well as the cache. Do not set
this to true unless the store results from an insert, and this node is the
closest node to the target; see the description of chkDatastore.KeyCollisionException
public void storeInsert(SSKBlock block, boolean deep, boolean overwrite, boolean canWriteClientCache, boolean canWriteDatastore) throws KeyCollisionException
KeyCollisionException
public void storeShallow(SSKBlock block, boolean canWriteClientCache, boolean canWriteDatastore, boolean fromULPR) throws KeyCollisionException
KeyCollisionException
public void store(SSKBlock block, boolean deep, boolean overwrite, boolean canWriteClientCache, boolean canWriteDatastore, boolean forULPR) throws KeyCollisionException
KeyCollisionException
public short decrementHTL(PeerNode source, short htl)
public CHKInsertSender makeInsertSender(NodeCHK key, short htl, long uid, InsertTag tag, PeerNode source, byte[] headers, PartiallyReceivedBlock prb, boolean fromStore, boolean canWriteClientCache, boolean forkOnCacheable, boolean preferInsert, boolean ignoreLowBackoff, boolean realTimeFlag)
key
- The key to be inserted.htl
- The current HTL. We can't coalesce inserts across
HTL's.uid
- The UID of the caller's request chain, or a new
one. This is obviously not used if there is already an
CHKInsertSender running.source
- The node that sent the InsertRequest, or null
if it originated locally.ignoreLowBackoff
- preferInsert
- public SSKInsertSender makeInsertSender(SSKBlock block, short htl, long uid, InsertTag tag, PeerNode source, boolean fromStore, boolean canWriteClientCache, boolean canWriteDatastore, boolean forkOnCacheable, boolean preferInsert, boolean ignoreLowBackoff, boolean realTimeFlag)
key
- The key to be inserted.htl
- The current HTL. We can't coalesce inserts across
HTL's.uid
- The UID of the caller's request chain, or a new
one. This is obviously not used if there is already an
SSKInsertSender running.source
- The node that sent the InsertRequest, or null
if it originated locally.ignoreLowBackoff
- preferInsert
- public java.lang.String getStatus()
public java.lang.String getTMCIPeerList()
public ClientKeyBlock fetchKey(ClientKey key, boolean canReadClientCache, boolean canWriteClientCache, boolean canWriteDatastore) throws KeyVerifyException
KeyVerifyException
public ClientKeyBlock fetch(ClientSSK clientSSK, boolean canReadClientCache, boolean canWriteClientCache, boolean canWriteDatastore) throws SSKVerifyException
SSKVerifyException
public void exit(int reason)
public void exit(java.lang.String reason)
public boolean isStopping()
public void park()
public NodeUpdateManager getNodeUpdater()
public DarknetPeerNode[] getDarknetConnections()
public boolean addPeerConnection(PeerNode pn)
public void removePeerConnection(PeerNode pn)
public void onConnectedPeer()
public int getFNPPort()
public boolean isOudated()
public void registerNodeToNodeMessageListener(int type, NodeToNodeMessageListener listener)
public void receivedNodeToNodeMessage(Message m, PeerNode src)
public void receivedNodeToNodeMessage(PeerNode src, int type, ShortBuffer messageData, boolean partingMessage)
public void handleNodeToNodeTextMessageSimpleFieldSet(SimpleFieldSet fs, DarknetPeerNode source, int fileNumber) throws FSParseException
FSParseException
public java.lang.String getMyName()
public MessageCore getUSM()
public LocationManager getLocationManager()
public int getSwaps()
public int getNoSwaps()
public int getStartedSwaps()
public int getSwapsRejectedAlreadyLocked()
public int getSwapsRejectedNowhereToGo()
public int getSwapsRejectedRateLimit()
public int getSwapsRejectedRecognizedID()
public PeerNode[] getPeerNodes()
public PeerNode[] getConnectedPeers()
public PeerNode getPeerNode(java.lang.String nodeIdentifier)
public boolean isHasStarted()
public void queueRandomReinsert(KeyBlock block)
public java.lang.String getExtraPeerDataDir()
public boolean noConnectedPeers()
public double getLocation()
public double getLocationChangeSession()
public int getAverageOutgoingSwapTime()
public long getSendSwapInterval()
public int getNumberOfRemotePeerLocationsSeenInSwaps()
public boolean isAdvancedModeEnabled()
public boolean isFProxyJavascriptEnabled()
public int getNumARKFetchers()
public void sentPayload(int len)
public long getTotalPayloadSent()
public void setName(java.lang.String key) throws InvalidConfigValueException, NodeNeedRestartException
public Ticker getTicker()
public int getUnclaimedFIFOSize()
public void connectToSeednode(SeedServerTestPeerNode node) throws OpennetDisabledException, FSParseException, PeerParseException, ReferenceSignatureVerificationException
public void connect(Node node, DarknetPeerNode.FRIEND_TRUST trust, DarknetPeerNode.FRIEND_VISIBILITY visibility) throws FSParseException, PeerParseException, ReferenceSignatureVerificationException, PeerTooOldException
public short maxHTL()
public int getDarknetPortNumber()
public int getOutputBandwidthLimit()
public int getInputBandwidthLimit()
public long getStoreSize()
public void setTimeSkewDetectedUserAlert()
setTimeSkewDetectedUserAlert
in interface TimeSkewDetectorCallback
public java.io.File getNodeDir()
public java.io.File getCfgDir()
public java.io.File getUserDir()
public java.io.File getRunDir()
public java.io.File getStoreDir()
public java.io.File getPluginDir()
public ProgramDirectory nodeDir()
public ProgramDirectory cfgDir()
public ProgramDirectory userDir()
public ProgramDirectory runDir()
public ProgramDirectory storeDir()
public ProgramDirectory pluginDir()
public DarknetPeerNode createNewDarknetNode(SimpleFieldSet fs, DarknetPeerNode.FRIEND_TRUST trust, DarknetPeerNode.FRIEND_VISIBILITY visibility) throws FSParseException, PeerParseException, ReferenceSignatureVerificationException, PeerTooOldException
public OpennetPeerNode createNewOpennetNode(SimpleFieldSet fs) throws FSParseException, OpennetDisabledException, PeerParseException, ReferenceSignatureVerificationException, PeerTooOldException
public SeedServerTestPeerNode createNewSeedServerTestPeerNode(SimpleFieldSet fs) throws FSParseException, OpennetDisabledException, PeerParseException, ReferenceSignatureVerificationException, PeerTooOldException
public OpennetPeerNode addNewOpennetNode(SimpleFieldSet fs, OpennetManager.ConnectionType connectionType) throws FSParseException, PeerParseException, ReferenceSignatureVerificationException
public byte[] getOpennetPubKeyHash()
public byte[] getDarknetPubKeyHash()
public boolean isOpennetEnabled()
public SimpleFieldSet exportDarknetPublicFieldSet()
public SimpleFieldSet exportOpennetPublicFieldSet()
public SimpleFieldSet exportDarknetPrivateFieldSet()
public SimpleFieldSet exportOpennetPrivateFieldSet()
public boolean dontDetect()
public int getOpennetFNPPort()
public OpennetManager getOpennet()
public boolean passOpennetRefsThroughDarknet()
public java.util.Set<ForwardPort> getPublicInterfacePorts()
public long getUptime()
public UdpSocketHandler[] getPacketSocketHandlers()
public int getMaxOpennetPeers()
public void onAddedValidIP()
public boolean isSeednode()
public boolean wantAnonAuth(boolean isOpennet)
public boolean wantAnonAuthChangeIP(boolean isOpennet)
public boolean opennetDefinitelyPortForwarded()
public boolean darknetDefinitelyPortForwarded()
public boolean hasKey(Key key, boolean canReadClientCache, boolean forULPR)
public void setLocation(double loc)
public boolean peersWantKey(Key key)
public void setDispatcherHook(NodeDispatcher.NodeDispatcherCallback cb)
public boolean shallWePublishOurPeersLocation()
public boolean shallWeRouteAccordingToOurPeersLocation(int htl)
public void setMasterPassword(java.lang.String password, boolean inFirstTimeWizard) throws Node.AlreadySetPasswordException, MasterKeysWrongPasswordException, MasterKeysFileSizeException, java.io.IOException
Node.AlreadySetPasswordException
MasterKeysWrongPasswordException
MasterKeysFileSizeException
java.io.IOException
public void changeMasterPassword(java.lang.String oldPassword, java.lang.String newPassword, boolean inFirstTimeWizard) throws MasterKeysWrongPasswordException, MasterKeysFileSizeException, java.io.IOException, Node.AlreadySetPasswordException
MasterKeysWrongPasswordException
MasterKeysFileSizeException
java.io.IOException
Node.AlreadySetPasswordException
public java.io.File getMasterPasswordFile()
public void panic()
public void finishPanic()
public boolean awaitingPassword()
public boolean wantEncryptedDatabase()
public boolean wantNoPersistentDatabase()
public boolean hasDatabase()
public java.lang.String getDatabasePath() throws java.io.IOException
java.io.IOException
public boolean shouldStoreDeep(Key key, PeerNode source, PeerNode[] routedTo)
We used to check whether we are a sink by checking whether any peer has a closer location than we do. Then we made low-uptime nodes exempt from this calculation: if we route to a low uptime node with a closer location, we want to store it anyway since he may go offline. The problem was that if we routed to a low-uptime node, and there was another option that wasn't low-uptime but was closer to the target than we were, then we would not store in the store. Also, routing isn't always by the closest peer location: FOAF and per-node failure tables change it. So now, we consider the nodes we have actually routed to:
Store in datastore if our location is closer to the target than:
key
- source
- routedTo
- public boolean getWriteLocalToDatastore()
public boolean getUseSlashdotCache()
public void createVisibilityAlert()
public int getMinimumMTU()
public void updateMTU()
public static boolean isTestnetEnabled()
public MersenneTwister createRandom()
public boolean enableNewLoadManagement(boolean realTimeFlag)
public boolean enableRoutedPing()
public boolean updateIsUrgent()
public byte[] getPluginStoreKey(java.lang.String storeIdentifier)
public PluginManager getPluginManager()