Skip to content

Commit

Permalink
Async OFF, Collection Versions Fixed, New Main Channel Address
Browse files Browse the repository at this point in the history
  • Loading branch information
bmdahmen committed May 6, 2015
1 parent 4caa904 commit fadece1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
6 changes: 3 additions & 3 deletions bitmessage/installfiles/keys.dat
Expand Up @@ -43,11 +43,11 @@ apiusername = username
apipassword = password
daemon = true

[BM-2cXExRht8eiB7anRv8Rc3TvSTm4GcJ2Txx]
[BM-2cUtm3XCJ9tpa3TTVLuoiqSmU2onc8Y4LX]
label = FreeJournal Main Channel
enabled = true
decoy = false
noncetrialsperbyte = 1000
payloadlengthextrabytes = 1000
privsigningkey = 5J3WLPnGPcKxsx8Vk24WH4VLzaEZ3xLTCjsc1xaha9HdZPbgWbT
privencryptionkey = 5KbHD145pnNGcTnZ3kSL3RzHxc3zoUuBWLS8Z51w1dRkj9JVWZf
privsigningkey = 5JpM4gp7Geaectw3tSzfJftKSAENCi7a2hB3HuXVDSwPNekTWh8
privencryptionkey = 5JTi7gTKMJ6Qgoh47j9fPEWTqcdTBxhXLa3p7Y9DRtNXshNLaib
2 changes: 1 addition & 1 deletion config.py
Expand Up @@ -25,7 +25,7 @@

''' Don't change this unless the main channel address is changed in the future '''

MAIN_CHANNEL_ADDRESS = "BM-2cXExRht8eiB7anRv8Rc3TvSTm4GcJ2Txx"
MAIN_CHANNEL_ADDRESS = "BM-2cUtm3XCJ9tpa3TTVLuoiqSmU2onc8Y4LX"

''' Directory to store documents that are downloaded
(Make sure to keep the last '/' at the end of the path)'''
Expand Down
1 change: 0 additions & 1 deletion controllers/collections.py
Expand Up @@ -92,6 +92,5 @@ def update_hash(collection):
return
collection_hash = CollectionVersion(root_hash=root_hash, document_ids = string, collection_version = collection.get_latest_version()+1,
collection_address = collection.address)
session.add(collection_hash)
collection.version_list.append(collection_hash)
session.commit()
4 changes: 3 additions & 1 deletion freenet/FreenetConnection.py
Expand Up @@ -13,7 +13,9 @@ def __init__(self):
'''
def put(self,data):
uri = self.fcpNode.put(data=data, mimetype="text/plain", chkonly=True)
job = self.fcpNode.put(data=data, mimetype="text/plain", async=True)
print("Inserting " + str(uri))
print("Please wait for insert to finish before publishing collection")
job = self.fcpNode.put(data=data, mimetype="text/plain", async=False)
return uri

'''
Expand Down
15 changes: 6 additions & 9 deletions frontend/cli/commands.py
Expand Up @@ -62,8 +62,7 @@ def print_help():
print ("\tlisten")
print ("\tinstall [freenet|bitmessage|all]")
print ("\tshowcollection [index bitmessage ID]")
print ("\tputcollection [address password] [title] [description] [keywords] " \
+ "[Bitcoin address (for rating)]")
print ("\tputcollection [address password] [title] [description] [keywords] ")
print ("\tpublishcollection [address password] [index bitmessage ID]")
print ("\twebapp")
print ("\tuploader")
Expand Down Expand Up @@ -143,7 +142,7 @@ def list_collection_version(collection_address, document_ids):
print("Collection Versions for " + collection_address + ":" )
print ("\t" + "Root hash" + "\t\t\t\t\t\t\t\t" + "Collection Version")
else:
print("Collection not found")
print("Collection is empty")
for version in versions:
print("\t" + version.root_hash + "\t" + str(version.collection_version))
if(document_ids == 'documents'):
Expand Down Expand Up @@ -198,10 +197,8 @@ def put_document(file_path, collection_address, title, description):
cache.insert_new_document(document)
collection = cache.get_collection_with_address(collection_address)
collections.update_hash(collection)
print ("Inserted " + file_path + " successfully with URI " + uri)
print ("Allow up to 10 minutes for file to propogate on the freenet network")

def put_collection(address_password, title, description, keywords, btc):
def put_collection(address_password, title, description, keywords):
""" Create a collection in local cache
:param address_password: The password with which to protect the collection.
Should be at least 20 characters for optimal security and unique. Generates
Expand Down Expand Up @@ -229,7 +226,7 @@ def put_collection(address_password, title, description, keywords, btc):
address=address,
accesses=0,
votes=0,
btc=btc,
btc="btc",
keywords=keywords,
documents=[],
creation_date=datetime.datetime.now(),
Expand Down Expand Up @@ -309,10 +306,10 @@ def process_command(command):
if (validate_cli_arguments(3)):
install_dependencies(sys.argv[2])
elif command == 'putcollection':
if (validate_cli_arguments(7)):
if (validate_cli_arguments(6)):
put_collection(sys.argv[2], \
sys.argv[3], sys.argv[4], \
sys.argv[5], sys.argv[6])
sys.argv[5])
elif command == 'publishcollection':
if (validate_cli_arguments(4)):
publish_collection(sys.argv[2], sys.argv[3])
Expand Down

0 comments on commit fadece1

Please sign in to comment.