This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private byte[] ObjectToByteArray(Object obj) | |
{ | |
using (var ms = new MemoryStream()) | |
{ | |
BinaryFormatter b = new BinaryFormatter(); | |
b.Serialize(ms, obj); | |
return ms.ToArray(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private object ByteArrayToObject(byte[] source) | |
{ | |
using (var ms = new MemoryStream(source, false)) | |
{ | |
BinaryFormatter b = new BinaryFormatter(); | |
return b.Deserialize(ms); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Aug 28 13:47:37 vmi181373 haproxy[29054]: 127.0.0.1:59508 [28/Aug/2018:13:47:36.265] iri_front iri_pow_back/powsrv 0/0/44/861/906 200 5827 - - ---- 1/1/0/0/0 0/0 0 {#7B#22branchTransaction#22: #22BNVXXLHJLMVHCICLXKSFWVKRAXNLPKMSFWK9DYGHAVAAMMVJIIDTEGRHXVSOP9NPSPHJWGADCYCCZ9999#22, #22trunkTransaction#22: #22|} 28 "POST / HTTP/1.1" - - | |
Aug 28 14:06:12 vmi181373 haproxy[29054]: 127.0.0.1:34356 [28/Aug/2018:14:06:12.031] iri_front iri_pow_back/powsrv 0/0/42/-1/743 -1 5821 - - SD-- 1/1/0/0/0 0/0 0 {#7B#22branchTransaction#22:#22LSOJSAVD9DAEDIOBDNNTNWWN9VIWWBUUJJIUC9DIVOCUEDILMJM9GEGLNLMGQYOKKXTTIUWVNZFB99999#22,#22trunkTransaction#22:#22FDK|} 267 "POST http://XXX.XXX.XXX.XXX:21310/ HTTP/1.1" - - | |
Aug 28 14:14:24 vmi181373 haproxy[29054]: 127.0.0.1:35714 [28/Aug/2018:14:14:23.829] iri_front iri_pow_back/powsrv 0/0/33/-1/732 -1 5827 - - SD-- 1/1/0/0/0 0/0 0 {#7B#22branchTransaction#22:#22JGSLMRWJRK9SEQKUAMYZ9YFJJZNTRQUIUPINTWLHYDDNSANEJLQNAEEJ9PFN9CDQIEF9BPMFAIHSA9999#22,#22trunkTransaction#22:#22QGE|} 376 "POST h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The snippet is a part of the IOTA Developer Essentials project. You can reach it at https://hribek25.github.io/IOTA101/ | |
# Complete description and story behind the snippet is available at: https://hribek25.github.io/IOTA101/Allchapters_python.ipynb.html#3BB8C879CCAE | |
# Requirement: PyOTA library (!pip install pyota) | |
import iota #importing PyOTA library to interact with | |
from pprint import pprint | |
TrytesAsBytes = b"YZJEATEQ9JKLZ" # some data encoded in Trytes (byte string in Python, not unicode string) | |
Trytes = iota.TryteString(TrytesAsBytes) # initializing TryteString type from the PyOTA library - great help while dealing with Trytes/Trits, etc. | |
pprint(Trytes) # getting the same data however using TryteString type of PyOTA library |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The snippet is a part of the IOTA Developer Essentials project. You can reach it at https://hribek25.github.io/IOTA101/ | |
# Complete description and story behind the snippet is available at: https://hribek25.github.io/IOTA101/Allchapters_python.ipynb.html#696A395DC61B | |
# Requirement: PyOTA library (!pip install pyota) | |
import iota #importing PyOTA library to interact with | |
from pprint import pprint | |
NodeURL = "https://nodes.thetangle.org:443" | |
api=iota.Iota(NodeURL) # ctor initialization of the PyOTA library |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The snippet is a part of the IOTA Developer Essentials project. You can reach it at https://hribek25.github.io/IOTA101/ | |
# Complete description and story behind the snippet is available at: https://hribek25.github.io/IOTA101/Allchapters_python.ipynb.html#67D98D069B61 | |
import random | |
chars=u'9ABCDEFGHIJKLMNOPQRSTUVWXYZ' #27 characters - max number you can express by one Tryte - do you remember? | |
rndgenerator = random.SystemRandom() #cryptographically secure pseudo-random generator | |
NewSeed = u''.join(rndgenerator.choice(chars) for _ in range(81)) #generating 81-chars long seed. This is Python 3.6+ compatible | |
print(NewSeed) | |
print("Length: %s" % len(NewSeed)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The snippet is a part of the IOTA Developer Essentials project. You can reach it at https://hribek25.github.io/IOTA101/ | |
# Complete description and story behind the snippet is available at: https://hribek25.github.io/IOTA101/Allchapters_python.ipynb.html#65788F1C3FCB | |
# Requirement: PyOTA library (!pip install pyota) | |
from iota.crypto.types import Seed #importing PyOTA library to interact with | |
NewSeed = Seed.random() | |
print(NewSeed) | |
print("Length: %s" % len(NewSeed)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The snippet is a part of the IOTA Developer Essentials project. You can reach it at https://hribek25.github.io/IOTA101/ | |
# Complete description and story behind the snippet is available at: https://hribek25.github.io/IOTA101/Allchapters_python.ipynb.html#0FF479CB6C0A | |
# Requirement: PyOTA library (!pip install pyota) | |
import iota | |
from pprint import pprint | |
# For this particular task the Node URL is not important as it will not be contacted at all | |
# However it has to be well-formatted URI | |
NodeURL = "https://nodes.thetangle.org:443" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The snippet is a part of the IOTA Developer Essentials project. You can reach it at https://hribek25.github.io/IOTA101/ | |
# Complete description and story behind the snippet is available at: https://hribek25.github.io/IOTA101/Allchapters_python.ipynb.html#2508A6FF9241 | |
# Requirement: PyOTA library (!pip install pyota) | |
from iota.crypto.addresses import AddressGenerator | |
from pprint import pprint | |
MySeed = b"WKQDUZTGFKSSLACUCHHLZRKZBHSDSCEBHKUPDLKFBQALEBKDMFRPUQGZRXAADPG9TSRTZGGBZOFRJCFMM" | |
#security level is defined during generator init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The snippet is a part of the IOTA Developer Essentials project. You can reach it at https://hribek25.github.io/IOTA101/ | |
# Complete description and story behind the snippet is available at: https://hribek25.github.io/IOTA101/Allchapters_python.ipynb.html#39B011574CF0 | |
# Requirement: PyOTA library (!pip install pyota) | |
import iota | |
from pprint import pprint | |
# some IOTA address | |
Adr = iota.Address(b"CYJV9DRIE9NCQJYLOYOJOGKQGOOELTWXVWUYGQSWCNODHJAHACADUAAHQ9ODUICCESOIVZABA9LTMM9RW") |
OlderNewer