{"id":80122,"date":"2020-05-03T13:42:34","date_gmt":"2020-05-03T11:42:34","guid":{"rendered":"https:\/\/prohoster.info\/blog\/administrirovanie\/kak-ya-proektiroval-bloki-i-tranzakczii-v-svoem-blokchejne-na-go"},"modified":"2020-05-03T13:42:34","modified_gmt":"2020-05-03T11:42:34","slug":"kak-ya-proektiroval-bloki-i-tranzakczii-v-svoem-blokchejne-na-go","status":"publish","type":"post","link":"https:\/\/prohoster.info\/et\/blog\/administrirovanie\/kak-ya-proektiroval-bloki-i-tranzakczii-v-svoem-blokchejne-na-go","title":{"rendered":"Kuidas ma projekteerisin plokid ja tehingud oma plokiahelas Go keeles","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Kuna saaksime l\u00f5puks luua plokiahela, mitte lihtsalt andmebaasi, peame lisama oma projekti kolm olulist elementi: <\/p>\n<ul>\n<li> Andmestruktuuri ja blokimeetodite kirjeldus<\/li>\n<li> Tehingustruktuuri ja meetodite kirjeldus<\/li>\n<li> Plokiahela funktsioonid, mis salvestavad plokid andmebaasi ja leiavad need seal nende r\u00e4siv\u00e4\u00e4rtuse v\u00f5i k\u00f5rguse (v\u00f5i muul viisil) j\u00e4rgi.<\/li>\n<\/ul>\n<p>\n<img decoding=\"async\" alt=\"Kuidas ma projekteerisin plokid ja tehingud oma plokiahelas Go keeles\" src=\"\/wp-content\/uploads\/2020\/05\/75099a735419b5c2bfbffa82865d1d4a.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><br \/>\nSee on teine artikkel plokiahela kohta t\u00f6\u00f6stuses, esimene <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/499732\/\">siin<\/a><\/noindex>.<\/p>\n<p>K\u00e4ies l\u00e4bi k\u00fcsimusi, mida lugejad k\u00fcsisid eelneva artikli kohta, tuleb m\u00e4rkida: plokiahela andmete salvestamiseks kasutatakse antud juhul LevelDB andmebaasi, kuid pole midagi, mis takistaks kasutada m\u00f5nda muud, n\u00e4iteks MySQL-i. N\u00fc\u00fcd vaatame nende andmete struktuuri.<\/p>\n<p>Alustame tehingutest: <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/Rusldv\/bcstartup\/blob\/master\/transaction\/builder.go\">github.com\/Rusldv\/bcstartup\/blob\/master\/transaction\/builder.go<\/a><\/noindex><\/p>\n<p>Siin on selle andmestruktuur:<\/p>\n<pre><code class=\"go\">type TX struct {\n\tDataType byte\t\t\n\tTxHash string \n\tTxType byte\t\n\tTimestamp int64\t\t\n\tINs []TxIn\n\tOUTs []TxOut\n}\n\ntype TxIn struct {\n\tThatTxHash string\n\tTxOutN int\n\tByteCode string\n}\n\ntype TxOut struct {\n\tValue int\n\tByteCode string\n}<\/code><\/pre>\n<p>\nTX-s hoitavad andmet\u00fc\u00fcbid (tehingu 2 jaoks), selle tehingu hash, tehingu t\u00fc\u00fcp, ajatempli kood ning sisendid ja v\u00e4ljundid. Sisendid TxIn sisaldavad selle tehingu hash'i, millele viidatakse, selle v\u00e4ljundi numbrit ja bytekoodi, samas kui v\u00e4ljundid TxOut hoiavad mingit v\u00e4\u00e4rtust ja ka bytekoodi.<\/p>\n<p>Vaadakem n\u00fc\u00fcd, milliseid toiminguid saab tehing oma andmetega teha, st uurime meetodeid.<\/p>\n<p>Tehingu loomiseks kasutatakse funktsiooni transaction.NewTransaction(txtype byte) *TX.<\/p>\n<p>Meetod AddTxIn(thattxhash []byte, txoutn int, code []byte) (*TxIn, error) lisab tehingule sisendi.<\/p>\n<p>Meetod AddTxOut(value int, data []byte) (*TxOut, error) lisab tehingule v\u00e4ljundi.<\/p>\n<p>Meetod ToBytes() []byte muudab tehingu byte-slice'iks.<\/p>\n<p>Sisemine funktsioon preByteHash(bytes []byte) string rakendatakse Build() ja Check() funktsioonides, et tagada loodud tehingu hash'i \u00fchilduvus JavaScript'i rakendustest genereeritud tehingu hash'idega.<\/p>\n<p>Meetod Build() m\u00e4\u00e4rab tehingu hash'i j\u00e4rgmiselt: tx.TxHash = preByteHash(tx.ToBytes()).<\/p>\n<p>Meetod ToJSON() string muundab tehingu JSON stringiks.<\/p>\n<p>Meetod FromJSON(data []byte) error laadib tehingu JSON-formaadist, mis on edastatud byte-slice'ina.<\/p>\n<p>Meetod Check() bool v\u00f5rreldab saadud hash'i tehingu hash'alalt tehingu hash'iga, mis saadakse selle tehingu hash'imise tulemusena (ilma hash'i alampunktita).<\/p>\n<p>Tehingud lisatakse plokki: <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/Rusldv\/bcstartup\/blob\/master\/block\/builder.go\">github.com\/Rusldv\/bcstartup\/blob\/master\/block\/builder.go<\/a><\/noindex><\/p>\n<p>Ploki andmestruktuur on suurem:<\/p>\n<pre><code class=\"go\">type Block struct {\n\tDataType byte\t\t\t\t\n\tBlockHeight int\t\t\t\t\t\n        Timestamp int64\t\t\t\t \n        HeaderSize int\t\t\t\t\t\n        PrevBlockHash string\t\t\t\t \n        SelfBlockHash string\t\t\t\n\tTxsHash string\t\t\t\n\tMerkleRoot string\n\tCreatorPublicKey string\t\t\t\n\tCreatorSig string\n\tVersion int\n\tTxsN int\n\tTxs []transaction.TX\n}<\/code><\/pre>\n<p>\nDataType hoiab andmet\u00fc\u00fcpi, mille p\u00f5hjal node eristab plokki tehingust v\u00f5i muudest andmetest. Ploki puhul on see v\u00e4\u00e4rtus 1.<\/p>\n<p>BlockHeight hoiab ploki k\u00f5rgust.<br \/>\nTimestamp ajatemplit.<br \/>\nHeaderSize ploki suurust baitides.<br \/>\nPrevBlockHash on eelmise ploki hash ja SelfBlockHash on praegune.<br \/>\nTxsHash on tehingute koguhash.<br \/>\nMerkleRoot on Merkle puu juur.<\/p>\n<p>Edasi, v\u00e4listes v\u00e4ljadest, on ploki looja avalik v\u00f5ti, looja allkiri, ploki versioon, tehingute arv plokis ja muidugi ise need tehingud.<\/p>\n<p>Vaadakem tema meetodeid:<br \/>\nPloki loomisel kasutatakse funktsiooni block.NewBlock(): NewBlock(prevBlockHash string, height int) *Block, mis v\u00f5tab vastu eelmise ploki hash'i ja k\u00f5rguse, mis on m\u00e4\u00e4ratud loodud plokile plokiahelas. Samuti m\u00e4\u00e4ratakse ploki t\u00fc\u00fcp paketist types konstantide abil: <\/p>\n<pre><code class=\"go\">b.DataType = types.BLOCK_TYPE.<\/code><\/pre>\n<p>Meetod AddTx(tx *transaction.TX) lisab plokki tehingu.<\/p>\n<p>Meetod Build() laadib ploki v\u00e4ljadele v\u00e4\u00e4rtused ja genereerib ning m\u00e4\u00e4rab selle hetke hash'i.<\/p>\n<p>Meetod ToBytesHeader() []byte muundab ploki p\u00e4ise (ilma tehinguteta) baitide l\u00f5iguks.<\/p>\n<p>Meetod ToJSON() string muundab ploki JSON-vormingusse stringi kujul.<\/p>\n<p>Meetod FromJSON(data []byte) error laadib andmed JSON'ist ploki struktuuri.<\/p>\n<p>Meetod Check() bool genereerib ploki hash'i ja v\u00f5rdleb seda ploki hash'i v\u00e4ljas m\u00e4\u00e4ratud v\u00e4\u00e4rtusega.<\/p>\n<p>Meetod GetTxsHash() string tagastab k\u00f5igi plokis olevate tehingute koguhash'i.<\/p>\n<p>Meetod GetMerkleRoot() m\u00e4\u00e4rab plokis olevate tehingute Merkle puu juure.<\/p>\n<p>Meetod Sign(privk string) allkirjastab ploki looja privaatsuse v\u00f5tmega.<\/p>\n<p>Meetod SetHeight(height int) salvestab ploki k\u00f5rguse ploki struktuuri v\u00e4ljal.<\/p>\n<p>Meetod GetHeight() int tagastab ploki k\u00f5rguse, nagu on m\u00e4\u00e4ratud ploki struktuuri vastavas v\u00e4ljas.<\/p>\n<p>Meetod ToGOBBytes() []byte kodeerib ploki GOB formaati ja tagastab selle baitide l\u00f5iguna.<\/p>\n<p>Meetod FromGOBBytes(data []byte) error kirjutab ploki andmed struktuuri plokist edastatud baitide l\u00f5igus GOB formaadis.<\/p>\n<p>Meetod GetHash() string tagastab selle ploki r\u00fcmba.<\/p>\n<p>Meetod GetPrevHash() string tagastab eelmise ploki r\u00fcmba.<\/p>\n<p>Meetod SetPublicKey(pubk string) kirjutab plokki looja avaliku v\u00f5tme.<\/p>\n<p>Nii et, objektide Block meetodite abil saame kergesti konverteerida need formaati edastamiseks v\u00f5rgu kaudu ja salvestamiseks LevelDB andmebaasi.<\/p>\n<p>Bloki salvestamise eest vastutavad blockchain paketi funktsioonid: <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/Rusldv\/bcstartup\/tree\/master\/blockchain\">github.com\/Rusldv\/bcstartup\/tree\/master\/blockchain<\/a><\/noindex><\/p>\n<p>Selleks peab plokk rakendama liidest IBlock:<\/p>\n<pre><code class=\"go\">type IGOBBytes interface {\n\tToGOBBytes() []byte\n\tFromGOBBytes(data []byte) error\n}\n\ntype IBlock interface {\n\tIGOBBytes\n\tGetHash() string\n\tGetPrevHash() string\n\tGetHeight() int\n\tCheck() bool\n\n}<\/code><\/pre>\n<p>\nAndmebaasi \u00fchendus luuakse \u00fcks kord paketi initsialiseerimise ajal funktsioonis init(): <\/p>\n<pre><code class=\"go\">db, err = leveldb.OpenFile(BLOCKCHAIN_DB_DEBUG, nil).<\/code><\/pre>\n<p>\nCloseDB() on db.Cloce() \u00fcmbrik \u2014 kutsutakse v\u00e4lja p\u00e4rast paketi funktsioonidega t\u00f6\u00f6tamist, et sulgeda \u00fchendus andmebaasiga.<\/p>\n<p>Funktsioon SetTargetBlockHash(hash string) error salvestab andmebaasi praeguse ploki r\u00fcmbas v\u00f5ti, mille on m\u00e4\u00e4ranud konstandi BLOCK_HASH.<\/p>\n<p>GetTargetBlockHash() (string, error) funktsioon tagastab praeguse ploki hash'i, mis on salvestatud andmebaasi.<\/p>\n<p>SetTargetBlockHeight(height int) error funktsioon kirjutab andmebaasi blockchain'i k\u00f5rguse v\u00e4\u00e4rtuse s\u00f5lmele, mille v\u00f5ti on m\u00e4\u00e4ratud konstant BLOCK_HEIGHT.<\/p>\n<p>GetTargetBlockHeight() (int, error) funktsioon tagastab blockchain'i k\u00f5rguse selle s\u00f5lme jaoks, mis on salvestatud andmebaasi.<\/p>\n<p>CheckBlock(block IBlock) bool funktsioon kontrollib ploki korrektsust enne, kui see plokk lisatakse blockchain'i.<\/p>\n<p>AddBlock(block IBlock) error funktsioon lisab ploki blockchain'i.<\/p>\n<p>Plokkide saamise ja vaatamise funktsioonid on failis explore.go blockchain'i paketis:<\/p>\n<p>GetBlockByHash(hash string) (*block.Block, error) funktsioon loob t\u00fchja ploki objekti, laadib sinna ploki andmebaasist, mille hash on edastatud, ja tagastab sellele n\u00e4itaja.<\/p>\n<p>Genesis() error funktsioon, mis asub failis genesis.go blockchain'i paketis, vastutab geenesisploki loomise eest.<\/p>\n<p>J\u00e4rgmises artiklis k\u00e4sitletakse, kuidas \u00fchendada klientide s\u00f5lmega WebSocket'i mehhanismi abil.<br \/>\n<br \/>Allikas: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/499930\/\">habr.com<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0441\u0447\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u044f\u0441\u044f \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 3 \u0432\u0430\u0436\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430: \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0431\u043b\u043e\u043a\u0430 \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442 \u0431\u043b\u043e\u043a\u0438 \u0432 \u0411\u0414 \u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442 \u0438\u0445 \u0442\u0430\u043c \u043f\u043e \u0438\u0445 \u0445\u0435\u0448\u0443 \u0438\u043b\u0438 \u0432\u044b\u0441\u043e\u0442\u0435 (\u0438\u043b\u0438 \u0435\u0449\u0435 \u043a\u0430\u043a \u043d\u0438\u0431\u0443\u0434\u044c). \u042d\u0442\u043e [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":80123,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-80122","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0441\u0447\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u044f\u0441\u044f \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 3 \u0432\u0430\u0436\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430: \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0431\u043b\u043e\u043a\u0430 \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442 \u0431\u043b\u043e\u043a\u0438 \u0432 \u0411\u0414 \u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442 \u0438\u0445 \u0442\u0430\u043c \u043f\u043e \u0438\u0445 \u0445\u0435\u0448\u0443 \u0438\u043b\u0438 \u0432\u044b\u0441\u043e\u0442\u0435 (\u0438\u043b\u0438 \u0435\u0449\u0435 \u043a\u0430\u043a \u043d\u0438\u0431\u0443\u0434\u044c). \u042d\u0442\u043e\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/et\/blog\/administrirovanie\/kak-ya-proektiroval-bloki-i-tranzakczii-v-svoem-blokchejne-na-go\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"et_EE\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u041a\u0430\u043a \u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0431\u043b\u043e\u043a\u0438 \u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0432 \u0441\u0432\u043e\u0435\u043c \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u0435 \u043d\u0430 Go | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0441\u0447\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u044f\u0441\u044f \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 3 \u0432\u0430\u0436\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430: \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0431\u043b\u043e\u043a\u0430 \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442 \u0431\u043b\u043e\u043a\u0438 \u0432 \u0411\u0414 \u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442 \u0438\u0445 \u0442\u0430\u043c \u043f\u043e \u0438\u0445 \u0445\u0435\u0448\u0443 \u0438\u043b\u0438 \u0432\u044b\u0441\u043e\u0442\u0435 (\u0438\u043b\u0438 \u0435\u0449\u0435 \u043a\u0430\u043a \u043d\u0438\u0431\u0443\u0434\u044c). \u042d\u0442\u043e\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/et\/blog\/administrirovanie\/kak-ya-proektiroval-bloki-i-tranzakczii-v-svoem-blokchejne-na-go\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-05-03T11:42:34+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-05-03T11:42:34+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47 Kuidas ma kavandasin plokke ja tehinguid oma plokiahelas Go-s | ProHoster","description":"Kuna l\u00f5ppkokkuv\u00f5ttes saada plokiahel, mitte lihtsalt andmebaas, peame meie projektile lisama 3 olulist elementi: Bloki andmestruktuuri ja meetodite kirjeldus Tehingu andmestruktuuri ja meetodite kirjeldus Plokiahela funktsioonid, mis salvestavad plokid andmebaasi ja leiavad need seal nende r\u00e4si v\u00f5i k\u00f5rguse (v\u00f5i muul viisil). See","canonical_url":"https:\/\/prohoster.info\/et\/blog\/administrirovanie\/kak-ya-proektiroval-bloki-i-tranzakczii-v-svoem-blokchejne-na-go","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"et_EE","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u041a\u0430\u043a \u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0431\u043b\u043e\u043a\u0438 \u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0432 \u0441\u0432\u043e\u0435\u043c \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u0435 \u043d\u0430 Go | ProHoster","og:description":"\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0441\u0447\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u044f\u0441\u044f \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 3 \u0432\u0430\u0436\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430: \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0431\u043b\u043e\u043a\u0430 \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442 \u0431\u043b\u043e\u043a\u0438 \u0432 \u0411\u0414 \u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442 \u0438\u0445 \u0442\u0430\u043c \u043f\u043e \u0438\u0445 \u0445\u0435\u0448\u0443 \u0438\u043b\u0438 \u0432\u044b\u0441\u043e\u0442\u0435 (\u0438\u043b\u0438 \u0435\u0449\u0435 \u043a\u0430\u043a \u043d\u0438\u0431\u0443\u0434\u044c). \u042d\u0442\u043e","og:url":"https:\/\/prohoster.info\/et\/blog\/administrirovanie\/kak-ya-proektiroval-bloki-i-tranzakczii-v-svoem-blokchejne-na-go","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2020-05-03T11:42:34+00:00","article:modified_time":"2020-05-03T11:42:34+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"80122","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 16:23:29","updated":"2022-09-30 17:12:23"},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/et\/wp-json\/wp\/v2\/posts\/80122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/et\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/et\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/et\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/et\/wp-json\/wp\/v2\/comments?post=80122"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/et\/wp-json\/wp\/v2\/posts\/80122\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/et\/wp-json\/wp\/v2\/media\/80123"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/et\/wp-json\/wp\/v2\/media?parent=80122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/et\/wp-json\/wp\/v2\/categories?post=80122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/et\/wp-json\/wp\/v2\/tags?post=80122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}