{"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\/ro\/blog\/administrirovanie\/kak-ya-proektiroval-bloki-i-tranzakczii-v-svoem-blokchejne-na-go","title":{"rendered":"Cum am proiectat blocurile \u0219i tranzac\u021biile \u00een blockchain-ul meu pe Go","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Pentru ca, \u00een cele din urm\u0103, s\u0103 avem un blockchain \u0219i nu doar o baz\u0103 de date, trebuie s\u0103 ad\u0103ug\u0103m \u00een proiectul nostru 3 elemente importante: <\/p>\n<ul>\n<li> Descrierea structurii datelor \u0219i metodelor blocului<\/li>\n<li> Descrierea structurii datelor \u0219i metodelor tranzac\u021biei<\/li>\n<li> Func\u021biile blockchain-ului care salveaz\u0103 blocurile \u00een baza de date \u0219i le g\u0103sesc acolo dup\u0103 hash-ul sau \u00een\u0103l\u021bimea lor (sau altfel).<\/li>\n<\/ul>\n<p>\n<img decoding=\"async\" alt=\"Cum am proiectat blocurile \u0219i tranzac\u021biile \u00een blockchain-ul meu pe Go\" 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 \/>\nAceasta este a doua articol despre blockchain pentru industrie, prima <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/499732\/\">aici<\/a><\/noindex>.<\/p>\n<p>Amintind \u00eentreb\u0103rile pe care mi le-au adresat cititorii articolului precedent din acest ciclu, trebuie s\u0103 men\u021bionez: pentru stocarea datelor blockchain-ului, \u00een acest caz se folose\u0219te baza de date LevelDB, dar nimic nu ne \u00eempiedic\u0103 s\u0103 utiliz\u0103m orice alt\u0103, s\u0103 zicem aceea\u0219i MySQL. Acum s\u0103 analiz\u0103m structura acestor date.<\/p>\n<p>S\u0103 \u00eencepem cu tranzac\u021biile: <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>Iat\u0103 structura sa de date:<\/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>\n\u00cen TX sunt stocate tipul de date (pentru tranzac\u021bie 2), hash-ul acestei tranzac\u021bii, tipul tranzac\u021biei, marca de timp, precum \u0219i intr\u0103rile \u0219i ie\u0219irile. Intr\u0103rile TxIn stocheaz\u0103 hash-ul tranzac\u021biei la care fac referire, num\u0103rul acestei ie\u0219iri \u0219i codul \u00een bytes, iar ie\u0219irile TxOut stocheaz\u0103 o valoare \u0219i, de asemenea, codul \u00een bytes.<\/p>\n<p>Acum s\u0103 vedem ce ac\u021biuni poate realiza tranzac\u021bia asupra datelor sale, adic\u0103 s\u0103 analiz\u0103m metodele.<\/p>\n<p>Func\u021bia care serve\u0219te pentru crearea unei tranzac\u021bii este transaction.NewTransaction(txtype byte) *TX.<\/p>\n<p>Metoda AddTxIn(thattxhash []byte, txoutn int, code []byte) (*TxIn, error) adaug\u0103 o intrare la tranzac\u021bie.<\/p>\n<p>Metoda AddTxOut(value int, data []byte) (*TxOut, error) adaug\u0103 o ie\u0219ire la tranzac\u021bie.<\/p>\n<p>Metoda ToBytes() []byte transform\u0103 tranzac\u021bia \u00eentr-un slice de bytes.<\/p>\n<p>Func\u021bia intern\u0103 preByteHash(bytes []byte) string este utilizat\u0103 \u00een Build() \u0219i Check() pentru a asigura compatibilitatea hash-ului tranzac\u021biilor create cu hash-urile tranzac\u021biilor generate de aplica\u021bii JavaScript.<\/p>\n<p>Metoda Build() seteaz\u0103 hash-ul tranzac\u021biei astfel: tx.TxHash = preByteHash(tx.ToBytes()).<\/p>\n<p>Metoda ToJSON() string transform\u0103 tranzac\u021bia \u00eentr-un \u0219ir JSON.<\/p>\n<p>Metoda FromJSON(data []byte) error \u00eencarc\u0103 tranzac\u021bia din formatul JSON, transmis ca un slice de bytes.<\/p>\n<p>Metoda Check() bool compar\u0103 hash-ul ob\u021binut din c\u00e2mpul hash-ului tranzac\u021biei cu hash-ul ob\u021binut \u00een urma hash-\u0103rii acestei tranzac\u021bii (f\u0103r\u0103 a lua \u00een considerare c\u00e2mpul hash).<\/p>\n<p>Tranzac\u021biile sunt ad\u0103ugate \u00een bloc: <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>Structura de date a blocului este mai cuprinz\u0103toare:<\/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 stocheaz\u0103 tipul de date, iar nodul le distinge \u00eentre blocuri \u0219i tranzac\u021bii sau alte date. Pentru un bloc, aceast\u0103 valoare este 1.<\/p>\n<p>BlockHeight stocheaz\u0103 \u00een\u0103l\u021bimea blocului.<br \/>\nTimestamp este un marcaj temporar.<br \/>\nHeaderSize este dimensiunea blocului \u00een bytes.<br \/>\nPrevBlockHash este hash-ul blocului anterior, iar SelfBlockHash este hash-ul curent.<br \/>\nTxsHash este hash-ul total al tranzac\u021biilor.<br \/>\nMerkleRoot este r\u0103d\u0103cina copacului Merkle.<\/p>\n<p>Urm\u0103toarele c\u00e2mpuri con\u021bin cheia public\u0103 a creatorului blocului, semn\u0103tura creatorului, versiunea blocului, num\u0103rul de tranzac\u021bii \u00een bloc \u0219i, de fapt, aceste tranzac\u021bii.<\/p>\n<p>S\u0103 examin\u0103m metodele sale:<br \/>\nPentru a crea un bloc, se folose\u0219te func\u021bia block.NewBlock(): NewBlock(prevBlockHash string, height int) *Block, care prime\u0219te hash-ul blocului anterior \u0219i \u00een\u0103l\u021bimea stabilit\u0103 pentru blocul creat \u00een blockchain. De asemenea, se seteaz\u0103 tipul blocului din constanta pachetului types: <\/p>\n<pre><code class=\"go\">b.DataType = types.BLOCK_TYPE.<\/code><\/pre>\n<p>Metoda AddTx(tx *transaction.TX) adaug\u0103 o tranzac\u021bie \u00een bloc.<\/p>\n<p>Metoda Build() \u00eencarc\u0103 valorile \u00een c\u00e2mpurile blocului \u0219i genereaz\u0103 \u0219i stabile\u0219te hash-ul s\u0103u curent.<\/p>\n<p>Metoda ToBytesHeader() []byte converte\u0219te antetul blocului (f\u0103r\u0103 tranzac\u021bii) \u00eentr-un slice de bytes.<\/p>\n<p>Metoda ToJSON() string converte\u0219te blocul \u00een format JSON sub form\u0103 de \u0219ir de date.<\/p>\n<p>Metoda FromJSON(data []byte) error \u00eencarc\u0103 datele din JSON \u00een structura blocului.<\/p>\n<p>Metoda Check() bool genereaz\u0103 hash-ul blocului \u0219i \u00eel compar\u0103 cu cel specificat \u00een c\u00e2mpul hash-ului blocului.<\/p>\n<p>Metoda GetTxsHash() string returneaz\u0103 hash-ul total al tuturor tranzac\u021biilor din bloc.<\/p>\n<p>Metoda GetMerkleRoot() stabile\u0219te r\u0103d\u0103cina copacului Merkle pentru tranzac\u021biile din bloc.<\/p>\n<p>Metoda Sign(privk string) semneaz\u0103 blocul cu cheia privat\u0103 a creatorului blocului.<\/p>\n<p>Metoda SetHeight(height int) scrie \u00een\u0103l\u021bimea blocului \u00een c\u00e2mpul structurii blocului.<\/p>\n<p>Metoda GetHeight() int returneaz\u0103 \u00een\u0103l\u021bimea blocului a\u0219a cum este specificat \u00een c\u00e2mpul corespunz\u0103tor al structurii blocului.<\/p>\n<p>Metoda ToGOBBytes() []byte codeaz\u0103 blocul \u00een format GOB \u0219i \u00eel returneaz\u0103 sub form\u0103 de slice de bytes.<\/p>\n<p>Metoda FromGOBBytes(data []byte) error scrie datele blocului \u00een structura blocului din slice-ul de bytes transmis \u00een format GOB.<\/p>\n<p>Metoda GetHash() string returneaz\u0103 hash-ul acestui bloc.<\/p>\n<p>Metoda GetPrevHash() string returneaz\u0103 hash-ul blocului anterior.<\/p>\n<p>Metoda SetPublicKey(pubk string) scrie \u00een bloc cheia public\u0103 a creatorului blocului.<\/p>\n<p>Astfel, folosind metodele obiectului Block, putem converti cu u\u0219urin\u021b\u0103 \u00eentr-un format pentru transfer pe re\u021bea \u0219i salvare \u00een baza de date LevelDB.<\/p>\n<p>Func\u021biile pachetului blockchain sunt responsabile pentru salvarea \u00een blockchain: <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>Pentru aceasta, blocul trebuie s\u0103 implementeze interfa\u021ba 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>\nConectarea la baza de date se creeaz\u0103 o singur\u0103 dat\u0103 la ini\u021bializarea pachetului \u00een func\u021bia init(): <\/p>\n<pre><code class=\"go\">db, err = leveldb.OpenFile(BLOCKCHAIN_DB_DEBUG, nil).<\/code><\/pre>\n<p>\nCloseDB() este o interfa\u021b\u0103 pentru db.Close() \u2014 este apelat\u0103 dup\u0103 utilizarea func\u021biilor pachetului pentru a \u00eenchide conexiunea la baza de date.<\/p>\n<p>Func\u021bia SetTargetBlockHash(hash string) error scrie \u00een baza de date hash-ul blocului curent cu cheia furnizat\u0103 de constanta BLOCK_HASH.<\/p>\n<p>Func\u021bia GetTargetBlockHash() (string, error) returneaz\u0103 hash-ul blocului curent stocat \u00een baza de date.<\/p>\n<p>Func\u021bia SetTargetBlockHeight(height int) error scrie \u00een baza de date valoarea \u00een\u0103l\u021bimii blockchain-ului pentru nodul cu cheia furnizat\u0103 de constanta BLOCK_HEIGHT.<\/p>\n<p>Func\u021bia GetTargetBlockHeight() (int, error) returneaz\u0103 \u00een\u0103l\u021bimea blockchain-ului pentru acest nod, stocat\u0103 \u00een baza de date.<\/p>\n<p>Func\u021bia CheckBlock(block IBlock) bool efectueaz\u0103 verificarea blocului pentru validitate \u00eenainte de a-l ad\u0103uga \u00een blockchain.<\/p>\n<p>Func\u021bia AddBlock(block IBlock) error adaug\u0103 blocul \u00een blockchain.<\/p>\n<p>Func\u021biile pentru a ob\u021bine \u0219i vizualiza blocurile se afl\u0103 \u00een fi\u0219ierul explore.go al pachetului blockchain:<\/p>\n<p>Func\u021bia GetBlockByHash(hash string) (*block.Block, error) creeaz\u0103 un obiect de bloc gol, \u00eencarc\u0103 un bloc din baza de date ai c\u0103rui hash este furnizat \u0219i returneaz\u0103 un pointer c\u0103tre el.<\/p>\n<p>Crearea blocului genesis se realizeaz\u0103 prin func\u021bia Genesis() error din fi\u0219ierul genesis.go al pachetului blockchain.<\/p>\n<p>\u00cen urm\u0103torul articol, vom discuta despre conectarea la nodul clien\u021bilor prin intermediul mecanismului WebSocket.<br \/>\n<br \/>Sursa: <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 5.0.2.1 - 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.\" \/>\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\/ro\/blog\/administrirovanie\/kak-ya-proektiroval-bloki-i-tranzakczii-v-svoem-blokchejne-na-go\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"ro_RO\" \/>\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.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/ro\/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\udd47Cum am proiectat blocurile \u0219i tranzac\u021biile \u00een blockchain-ul meu pe Go | ProHoster","description":"Pentru a ob\u021bine, \u00een cele din urm\u0103, un blockchain \u0219i nu doar o baz\u0103 de date, trebuie s\u0103 ad\u0103ug\u0103m \u00een proiectul nostru 3 elemente importante: Descrierea structurii de date \u0219i a metodelor blocului.","canonical_url":"https:\/\/prohoster.info\/ro\/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":"ro_RO","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.","og:url":"https:\/\/prohoster.info\/ro\/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","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/posts\/80122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/comments?post=80122"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/posts\/80122\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/media\/80123"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/media?parent=80122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/categories?post=80122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/ro\/wp-json\/wp\/v2\/tags?post=80122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}