Blockchain: ke PoC efe eo re lokelang ho e haha?

Mahlo a hao a tšohile 'me matsoho a hao a hlohlona!

Lihloohong tse fetileng, re ile ra sebetsana le mahlale ao li-blockchains li hahiloeng ho tsona (Seo re lokelang ho se etsa blockchain?) le linyeoe tse ka sebelisoang ka thuso ea bona (Ke hobane'ng ha re lokela ho haha ​​nyeoe?). Ke nako ea ho sebetsa ka matsoho a hau! Ho kenya ts'ebetsong bafofisi ba lifofane le PoC (Bopaki ba Khopolo), ke khetha ho sebelisa maru, hobane ... li ka fumaneha kae kapa kae lefatšeng, 'me hangata, ha ho hlokahale ho senya nako ho kenya tikoloho e tenang, hobane Ho na le litlhophiso tse behiloeng esale pele. Kahoo, a re etse ntho e bonolo, mohlala, marang-rang bakeng sa ho fetisetsa lichelete tsa tšepe pakeng tsa barupeluoa 'me ka boikokobetso re e bitse Bitcoin. Bakeng sa sena re tla sebelisa leru la IBM le universal blockchain Hyperledger Fabric. Taba ea pele, a re bone hore na ke hobane'ng ha Hyperledger Fabric e bitsoa "blockchain" ea bokahohle?

Blockchain: ke PoC efe eo re lokelang ho e haha?

Hyperledger Fabric - blockchain ea bokahohle

Ka kakaretso, sistimi ea tlhahisoleseling e akaretsang ke:

  • Sehlopha sa li-server le setsi sa software se etsang logic ea khoebo;
  • Li-interfaces bakeng sa ho sebelisana le tsamaiso;
  • Lisebelisoa tsa ho ngolisa, ho netefatsa le ho fana ka tumello ea lisebelisoa / batho;
  • Database e boloka data ea ts'ebetso le ea khale:

Blockchain: ke PoC efe eo re lokelang ho e haha?

Phetolelo ea molao ea seo Hyperledger Fabric e leng sona e ka baloa ho sebaka, 'me ka bokhutšoanyane, Hyperledger Fabric ke sethala sa opensource se u lumellang hore u hahe li-blockchains tsa botho le ho etsa likonteraka tse bohlale tse ngotsoeng ka lipuo tsa lenaneo la JS le Go. A re shebeng ka ho qaqileng mohaho oa Hyperledger Fabric mme re netefatse hore ena ke tsamaiso ea bokahohle e nang le lintlha tse tobileng tsa ho boloka le ho rekota data. Ntho e ikhethang ke hore data, joalo ka li-blockchains tsohle, e bolokiloe ka li-block tse behiloeng ho thibela feela haeba barupeluoa ba fihlela tumellano 'me ka mor'a ho rekota data e ke ke ea lokisoa ka khutso kapa ea hlakoloa.

Hyperledger Fabric Architecture

Setšoantšo se bonts'a meralo ea Hyperledger Fabric:

Blockchain: ke PoC efe eo re lokelang ho e haha?

mekhatlo - mekhatlo e na le lithaka, i.e. blockchain e teng ka lebaka la tšehetso ea mekhatlo. Mekhatlo e fapaneng e ka ba karolo ea mocha o le mong.

Channel - sebopeho se utloahalang se kopanyang lithaka ka lihlopha, i.e. blockchain e hlalositsoe. Hyperledger Fabric e ka sebetsa ka nako e le 'ngoe li-blockchains tse ngata ka mabaka a fapaneng a khoebo.

Mofani oa Litšebeletso tsa Litho (MSP) ke CA (Certificate Authority) bakeng sa ho fana ka boitsebiso le ho abela mesebetsi. Ho theha node, o hloka ho sebelisana le MSP.

Lithaka tsa lithaka - netefatsa litšebelisano, boloka blockchain, etsa likonteraka tse bohlale le ho sebelisana le lits'ebetso. Lithaka li na le boitsebiso (setifikeiti sa digital), se fanoang ke MSP. Ho fapana le marang-rang a Bitcoin kapa Etherium, moo li-node tsohle li nang le litokelo tse lekanang, ho Hyperledger Fabric node e bapala likarolo tse fapaneng:

  • Mothaka mohlomong ho tshehetsa methaka (EP) le ho etsa likonteraka tse bohlale.
  • Boitlamo ba lithaka (CP) - boloka data feela ho blockchain mme u ntlafatse "Naha ea Lefatše".
  • Anchor Peer (AP) - haeba mekhatlo e 'maloa e kenya letsoho ho blockchain, joale lithaka tsa anchor li sebelisoa bakeng sa puisano pakeng tsa bona. Mokhatlo o mong le o mong o tlameha ho ba le molekane a le mong kapa ho feta. U sebelisa AP, lithaka life kapa life mokhatlong li ka fumana leseli mabapi le lithaka tsohle mekhatlong e meng. E sebelisoa ho hokahanya tlhahisoleseling lipakeng tsa APs protocol ea lesebo.
  • Moetapele Mothaka - haeba mokhatlo o na le lithaka tse 'maloa, joale ke moetapele oa lithaka feela ea tla fumana li-blocks ho tloha tšebeletsong ea ho laela le ho li fa lithaka tse ling. Moetapele a ka hlalosoa ka mokhoa o tsitsitseng kapa a khethoa ka matla ke lithaka tsa mokhatlo. Protocol ea lesebo e boetse e sebelisoa ho hokahanya tlhahisoleseling mabapi le baetapele.

matlotlo - mekhatlo e nang le boleng mme e bolokiloe ho blockchain. Haholo-holo, ena ke data ea bohlokoa ka sebopeho sa JSON. Ke data ena e tlalehiloeng ho Blockchain. Ba na le histori, e bolokiloeng blockchain, le boemo ba hona joale, bo bolokiloeng sebakeng sa polokelo ea "lefatše". Mehaho ea data e tlatsitsoe ka mokhoa o ikhethileng ho latela mesebetsi ea khoebo. Ha ho na masimo a hlokahalang, khothaletso feela ke hore thepa e tlameha ho ba le mong'a eona 'me e be ea bohlokoa.

Ledger - e na le Blockchain le database ea boemo ba Lentsoe, e bolokang boemo ba hona joale ba thepa. Naha ea lefats'e e sebelisa LevelDB kapa CouchDB.

Konteraka e bohlale - ho sebelisa likonteraka tse bohlale, logic ea khoebo ea tsamaiso e kenngoa ts'ebetsong. Ho Hyperledger Fabric, likonteraka tse bohlale li bitsoa chaincode. Ho sebelisoa chaincode, thepa le litšebelisano holim'a tsona li boletsoe. Ka mantsoe a tekheniki, likonteraka tse bohlale ke li-software modules tse kenngoeng tšebetsong ka lipuo tsa lenaneo la JS kapa Go.

Leano la tumello - bakeng sa chaincode e 'ngoe le e' ngoe, o ka beha leano la hore na ho na le litiisetso tse kae bakeng sa transaction e lokelang ho lebelloa le ho tsoa ho mang. Haeba pholisi e sa hlophisoa, joale ntho ea kamehla ke: "transekshene e tlameha ho netefatsoa ke setho sefe kapa sefe sa mokhatlo ofe kapa ofe oa kanale." Mehlala ea maano:

  • Ts'ebetso e tlameha ho amoheloa ke molaoli ofe kapa ofe oa mokhatlo;
  • E tlameha ho netefatsoa ke setho kapa moreki ofe kapa ofe oa mokhatlo;
  • E tlameha ho netefatsoa ke mokhatlo ofe kapa ofe oa lithaka.

Tšebeletso ea ho odara — e paka li-transaction ho li-block ebe li li romella ho lithaka tsa kanale. E fana ka litiiso tsa ho fana ka melaetsa ho lithaka tsohle tsa marang-rang. E sebelisoa bakeng sa litsamaiso tsa indasteri Kafka molaetsa broker, bakeng sa ntshetsopele le teko Solo.

CallFlow

Blockchain: ke PoC efe eo re lokelang ho e haha?

  • Sesebelisoa se buisana le Hyperledger Fabric se sebelisa Go, Node.js kapa Java SDK;
  • Moreki o etsa tx transaction mme o e romella ho lithaka tse lumellanang;
  • Peer e netefatsa mosaeno oa moreki, e phethe khoebo, ebe e khutlisetsa tekeno ea tumello ho moreki. Chaincode e etsoa feela ho lithaka tse tšehetsang, 'me phello ea ts'ebetso ea eona e romelloa ho lithaka tsohle. Algorithm ena ea mosebetsi e bitsoa tumellano ea PBFT (Practical Byzantine Fault Tolerant). E fapane le BFT ea khale taba ea hore molaetsa o rometsoe le ho tiisoa ha ho lebeletsoe eseng ho barupeluoa bohle, empa ho tsoa ho sete e itseng feela;
  • Ka mor'a hore mofani a fumane palo ea likarabo tse lumellanang le leano la tumello, o romela transaction ho tšebeletso ea ho laela;
  • Ts'ebeletso ea ho Odara e etsa block ebe e e romella ho lithaka tsohle tse itlamang. Ts'ebeletso ea ho odara e netefatsa ho rekota ka tatellano ea li-block, tse felisang seo ho thoeng ke fereko ea ledger (sheba karolo "Forks");
  • Lithaka li fumana thibela, hlahloba leano la ho fana ka tumello hape, ngola thibela ho thibela 'me u fetole boemo ba "World state" DB.

Tseo. Sena se fella ka karohano ea mesebetsi lipakeng tsa li-node. Sena se tiisa hore blockchain e ka senyeha ebile e bolokehile:

  • Likonteraka tse bohlale (chaincode) li etsa lithaka tse lumellanang. Sena se tiisa lekunutu la likonteraka tse bohlale, hobane ha e bolokoe ke bohle ba nkang karolo, empa e bolokoa feela ke lithaka tsa eona.
  • Ho laela ho lokela ho sebetsa kapele. Sena se netefatsoa ke taba ea hore Ho laela ho theha feela thibela 'me ho e romela ho sehlopha se tsitsitseng sa lithaka tsa moetapele.
  • Lithaka tse itlamang li boloka blockchain feela - ho ka ba le tse ngata tsa tsona mme ha li hloke matla a mangata le ts'ebetso ea hang-hang.

Lintlha tse ling mabapi le tharollo ea meralo ea Hyperledger Fabric le hore na ke hobane'ng ha e sebetsa ka tsela ena mme eseng ka tsela e 'ngoe e ka fumanoa mona: Tšimoloho ea Meaho kapa mona: Lesela la Hyperledger: Tsamaiso ea Ts'ebetso e Ajoang bakeng sa Li-blockchains tse lumelletsoeng.

Kahoo, Hyperledger Fabric ke sistimi ea bokahohle eo u ka e etsang:

  • Ho kenya ts'ebetsong mabaka a sa utloahaleng a khoebo ka mokhoa o bohlale oa konteraka;
  • Rekota le ho amohela data ho tsoa ho database ea blockchain ka sebopeho sa JSON;
  • Fana le ho netefatsa phihlello ea API u sebelisa Bolaoli ba Setifikeiti.

Kaha joale re utloisisa hanyenyane ka lintlha tse tobileng tsa Hyperledger Fabric, ha re qetelle re etsa ho hong ho molemo!

Ho tsamaisa blockchain

Mokhoa oa bothata

Mosebetsi ke ho kenya ts'ebetsong marang-rang a Citcoin ka mesebetsi e latelang: theha akhaonto, ho fumana tekanyo, ho tlatsa akhaonto ea hau, ho fetisetsa lichelete tsa tšepe ho tloha akhaonteng e 'ngoe ho ea ho e' ngoe. Ha re toroeng mohlala oa ntho, eo re tla e sebelisa hape ka konteraka e bohlale. Kahoo, re tla ba le litlaleho tse khetholloang ka mabitso 'me li na le tekanyo, le lethathamo la litlaleho. Liakhaonto le lethathamo la li-account, ho latela thepa ea Hyperledger Fabric. Ka lebaka leo, ba na le histori le boemo ba hona joale. Ke tla leka ho taka sena ka ho hlaka:

Blockchain: ke PoC efe eo re lokelang ho e haha?

Lipalo tse holimo ke boemo ba hajoale, bo bolokiloeng polokelong ea "World state". Ka tlase ho tsona ho na le lipalo tse bonts'ang nalane e bolokiloeng ho blockchain. Boemo ba hona joale ba thepa bo fetotsoe ke transaction. Thepa e fetoha feela ka kakaretso, kahoo ka lebaka la ts'ebetso, ntho e ncha e thehoa, 'me boleng ba hona joale ba thepa bo kena historing.

IBM Cloud

Re theha ak'haonte ho Leru la IBM. Ho sebelisa sethala sa blockchain, se tlameha ho ntlafatsoa ho Pay-As-You-Go. Ts'ebetso ena e kanna ea se potlake, hobane ... IBM e kopa tlhahisoleseding e eketsehileng mme e e netefatsa ka letsoho. Ka mokhoa o motle, nka re IBM e na le lisebelisoa tse ntle tsa koetliso tse u lumellang hore u sebelise Hyperledger Fabric marung a bona. Ke ratile letoto le latelang la lihlooho le mehlala:

Lintlha tse latelang ke li-screenshots tsa sethala sa IBM Blockchain. Ena ha se taelo ea ho theha blockchain, empa ke pontšo ea boholo ba mosebetsi. Kahoo, molemong oa rona, re etsa Mokhatlo o le mong:

Blockchain: ke PoC efe eo re lokelang ho e haha?

Re theha li-node ho eona: Orderer CA, Org1 CA, Orderer Peer:

Blockchain: ke PoC efe eo re lokelang ho e haha?

Re theha basebelisi:

Blockchain: ke PoC efe eo re lokelang ho e haha?

Theha Channel 'me u e bitse citcoin:

Blockchain: ke PoC efe eo re lokelang ho e haha?

Ha e le hantle Channel ke blockchain, kahoo e qala ka block zero (Genese block):

Blockchain: ke PoC efe eo re lokelang ho e haha?

Ho Ngola Konteraka e Bohlale

/*
 * Citcoin smart-contract v1.5 for Hyperledger Fabric
 * (c) Alexey Sushkov, 2019
 */
 
'use strict';
 
const { Contract } = require('fabric-contract-api');
const maxAccounts = 5;
 
class CitcoinEvents extends Contract {
 
    async instantiate(ctx) {
        console.info('instantiate');
        let emptyList = [];
        await ctx.stub.putState('accounts', Buffer.from(JSON.stringify(emptyList)));
    }
    // Get all accounts
    async GetAccounts(ctx) {
        // Get account list:
        let accounts = '{}'
        let accountsData = await ctx.stub.getState('accounts');
        if (accountsData) {
            accounts = JSON.parse(accountsData.toString());
        } else {
            throw new Error('accounts not found');
        }
        return accountsData.toString()
    }
     // add a account object to the blockchain state identifited by their name
    async AddAccount(ctx, name, balance) {
        // this is account data:
        let account = {
            name: name,
            balance: Number(balance),       
            type: 'account',
        };
        // create account:
        await ctx.stub.putState(name, Buffer.from(JSON.stringify(account)));
 
        // Add account to list:
        let accountsData = await ctx.stub.getState('accounts');
        if (accountsData) {
            let accounts = JSON.parse(accountsData.toString());
            if (accounts.length < maxAccounts)
            {
                accounts.push(name);
                await ctx.stub.putState('accounts', Buffer.from(JSON.stringify(accounts)));
            } else {
                throw new Error('Max accounts number reached');
            }
        } else {
            throw new Error('accounts not found');
        }
        // return  object
        return JSON.stringify(account);
    }
    // Sends money from Account to Account
    async SendFrom(ctx, fromAccount, toAccount, value) {
        // get Account from
        let fromData = await ctx.stub.getState(fromAccount);
        let from;
        if (fromData) {
            from = JSON.parse(fromData.toString());
            if (from.type !== 'account') {
                throw new Error('wrong from type');
            }   
        } else {
            throw new Error('Accout from not found');
        }
        // get Account to
        let toData = await ctx.stub.getState(toAccount);
        let to;
        if (toData) {
            to = JSON.parse(toData.toString());
            if (to.type !== 'account') {
                throw new Error('wrong to type');
            }  
        } else {
            throw new Error('Accout to not found');
        }
 
        // update the balances
        if ((from.balance - Number(value)) >= 0 ) {
            from.balance -= Number(value);
            to.balance += Number(value);
        } else {
            throw new Error('From Account: not enought balance');          
        }
 
        await ctx.stub.putState(from.name, Buffer.from(JSON.stringify(from)));
        await ctx.stub.putState(to.name, Buffer.from(JSON.stringify(to)));
                 
        // define and set Event
        let Event = {
            type: "SendFrom",
            from: from.name,
            to: to.name,
            balanceFrom: from.balance,
            balanceTo: to.balance,
            value: value
        };
        await ctx.stub.setEvent('SendFrom', Buffer.from(JSON.stringify(Event)));
 
        // return to object
        return JSON.stringify(from);
    }
 
    // get the state from key
    async GetState(ctx, key) {
        let data = await ctx.stub.getState(key);
        let jsonData = JSON.parse(data.toString());
        return JSON.stringify(jsonData);
    }
    // GetBalance   
    async GetBalance(ctx, accountName) {
        let data = await ctx.stub.getState(accountName);
        let jsonData = JSON.parse(data.toString());
        return JSON.stringify(jsonData);
    }
     
    // Refill own balance
    async RefillBalance(ctx, toAccount, value) {
        // get Account to
        let toData = await ctx.stub.getState(toAccount);
        let to;
        if (toData) {
            to = JSON.parse(toData.toString());
            if (to.type !== 'account') {
                throw new Error('wrong to type');
            }  
        } else {
            throw new Error('Accout to not found');
        }
 
        // update the balance
        to.balance += Number(value);
        await ctx.stub.putState(to.name, Buffer.from(JSON.stringify(to)));
                 
        // define and set Event
        let Event = {
            type: "RefillBalance",
            to: to.name,
            balanceTo: to.balance,
            value: value
        };
        await ctx.stub.setEvent('RefillBalance', Buffer.from(JSON.stringify(Event)));
 
        // return to object
        return JSON.stringify(from);
    }
}
module.exports = CitcoinEvents;

Ka tlhaho, tsohle li lokela ho hlaka mona:

  • Ho na le mesebetsi e mengata (AddAccount, GetAccounts, SendFrom, GetBalance, RefillBalance) eo lenaneo la demo le tla le bitsa ho sebelisa Hyperledger Fabric API.
  • Mesebetsi ea SendFrom le RefillBalance e hlahisa Liketsahalo tseo lenaneo la demo le tla li fumana.
  • Mosebetsi oa hang-hang o bitsoa hang ha konteraka e bohlale e kenngoa. Ha e le hantle, ha e bitsoe hang feela, empa nako le nako ha phetolelo e bohlale ea konteraka e fetoha. Ka hona, ho qala lenane ka lethathamo le se nang letho ke mohopolo o mobe, hobane Joale, ha re fetola mofuta oa konteraka e bohlale, re tla lahleheloa ke lenane la hajoale. Empa ho lokile, ke ntse ke ithuta).
  • Liakhaonto le lethathamo la liakhaonto ke libopeho tsa data tsa JSON. JS e sebelisetsoa ho qhekella data.
  • U ka fumana boleng ba hajoale ba letlotlo u sebelisa mohala oa ts'ebetso ea getState, 'me u e ntlafatse u sebelisa putState.
  • Ha u theha Account, mosebetsi oa AddAccount o bitsoa, ​​moo papiso e etsoang bakeng sa palo e kholo ea li-account ho blockchain (maxAccounts = 5). 'Me mona ho na le jamb (na u hlokometse?), E leng se lebisang keketsehong e sa feleng ea palo ea litlaleho. Liphoso tse joalo li lokela ho qojoa)

Ka mor'a moo, re kenya konteraka e bohlale ho Channel ebe rea e tiisa:

Blockchain: ke PoC efe eo re lokelang ho e haha?

Ha re shebeng tšebetso ea ho kenya Smart Contract:

Blockchain: ke PoC efe eo re lokelang ho e haha?

Ha re shebeng lintlha tse mabapi le Channel ea rona:

Blockchain: ke PoC efe eo re lokelang ho e haha?

Ka lebaka leo, re fumana setšoantšo se latelang sa marang-rang a blockchain ka leru la IBM. Setšoantšo se boetse se bontša lenaneo la demo le sebetsang lerung la Amazon ho seva sa sebele (ho feta ka sona karolong e latelang):

Blockchain: ke PoC efe eo re lokelang ho e haha?

Ho theha GUI bakeng sa mehala ea Hyperledger Fabric API

Hyperledger Fabric e na le API e ka sebelisoang ho:

  • Theha mocha;
  • Lihokelo li shebane le kanale;
  • Ho kenya le ho kenya likonteraka tse bohlale ho kanaleng;
  • Ho letsetsa litšebelisano;
  • Kopa tlhahisoleseling ho blockchain.

Ntlafatso ea kopo

Lenaneong la rona la demo re tla sebelisa API feela ho letsetsa litšebelisano le ho kopa tlhahisoleseling, hobane Re se re qetile mehato e setseng re sebelisa sethala sa blockchain sa IBM. Re ngola GUI re sebelisa stack e tloaelehileng ea theknoloji: Express.js + Vue.js + Node.js. U ka ngola sengoloa se arohaneng mabapi le mokhoa oa ho qala ho theha lits'ebetso tsa sejoale-joale tsa webo. Mona ke tla siea sehokelo sa letoto la lipuo tseo ke li ratileng haholo: Sesebelisoa se felletseng sa Stack Web se sebelisa Vue.js & Express.js. Sephetho ke sesebelisoa sa li-client-server se nang le sebopeho se tloaelehileng sa litšoantšo ka mokhoa oa Google Material Design. REST API pakeng tsa moreki le seva e na le mehala e mengata:

  • HyperledgerDemo/v1/init - qala blockchain;
  • HyperledgerDemo/v1/accounts/list - fumana lethathamo la li-account tsohle;
  • HyperledgerDemo/v1/account?name=Bob&balance=100 — theha akhaonto ya Bob;
  • HyperledgerDemo/v1/info?account=Bob — fumana lesedi mabapi le akhaonto ya Bob;
  • HyperledgerDemo/v1/transaction?from=Bob&to=Alice&volume=2 — fetisetsa lichelete tsa tšepe tse peli ho tloha ho Bob ho ea ho Alice;
  • HyperledgerDemo/v1/disconnect - koala sehokelo ho blockchain.

Tlhaloso ea API e nang le mehlala e kenyelelitsoeng ho Sebaka sa marang-rang sa poso - lenaneo le tsebahalang la ho hlahloba HTTP API.

Sesebelisoa sa demo ho Amazon cloud

Ke kentse kopo ho Amazon hobane... IBM e ntse e sa khone ho ntlafatsa ak'haonte ea ka le ho ntumella ho theha li-server tsa sebele. Mokhoa oa ho eketsa cherry sebakeng sa marang-rang: www.citcoin.info. Ke tla boloka seva ka nakoana, ebe ke e tima, hobane ... lisente tsa khiriso lia rotha, 'me chelete ea tšepe ea citcoin ha e so thathamisitsoe ho stock exchange) Ke kenyelletsa li-screenshots tsa demo sengolong e le hore mohopolo oa mosebetsi o hlake. Sesebelisoa sa demo se ka:

  • Qala blockchain;
  • Theha Account (empa joale u ke ke ua theha Akhaonto e ncha, hobane palo e kholo ea li-account tse boletsoeng ho konteraka e bohlale e fihlile ho blockchain);
  • Fumana lethathamo la Liakhaonto;
  • Fetisetsa lichelete tsa tšepe tsa citcoin pakeng tsa Alice, Bob le Alex;
  • Amohela liketsahalo (empa hona joale ha ho na mokhoa oa ho bontša liketsahalo, kahoo bakeng sa ho nolofatsa, sebopeho se bolela hore liketsahalo ha li tšehetsoe);
  • Liketso tsa log.

Pele, re qala blockchain:

Blockchain: ke PoC efe eo re lokelang ho e haha?

Ka mor'a moo, re theha ak'haonte ea rona, u se ke oa senya nako ka chelete:

Blockchain: ke PoC efe eo re lokelang ho e haha?

Re fumana lethathamo la li-account tsohle tse fumanehang:

Blockchain: ke PoC efe eo re lokelang ho e haha?

Re khetha moromeli le moamoheli, 'me re fumana litekanyo tsa bona. Haeba motho ea rometseng le moamoheli a tšoana, akhaonte ea hae e tla tlatsoa hape:

Blockchain: ke PoC efe eo re lokelang ho e haha?

Ka har'a log re beha leihlo ts'ebetso ea transactions:

Blockchain: ke PoC efe eo re lokelang ho e haha?

Haele hantle, ke tsohle ka lenaneo la demo. Ka tlase o ka bona khoebo ea rona ho blockchain:

Blockchain: ke PoC efe eo re lokelang ho e haha?

Le lenane le akaretsang la transaction:

Blockchain: ke PoC efe eo re lokelang ho e haha?

Ka sena, re atlehile ho phethahatsa ts'ebetsong ea PoC ho theha marang-rang a Citcoin. Ke eng hape e lokelang ho etsoa hore Citcoin e be marang-rang a feletseng bakeng sa ho fetisetsa lichelete tsa tšepe? E nyane haholo:

  • Boemong ba ho theha ak'haonte, kenya ts'ebetso ea ho hlahisa senotlolo sa poraefete / sechaba. Senotlolo sa lekunutu se tlameha ho bolokoa le mosebelisi oa akhaonto, senotlolo sa sechaba se tlameha ho bolokoa ho blockchain.
  • Etsa chelete ea tšepe eo ho eona ho sebelisoang senotlolo sa sechaba, ho e-na le lebitso, ho khetholla mosebedisi.
  • Encrypt transactions ho tloha ho mosebelisi ho ea ho seva ka senotlolo sa hae sa lekunutu.

fihlela qeto e

Re kentse tšebetsong marang-rang a Citcoin ka mesebetsi e latelang: eketsa ak'haonte, fumana tekanyo, eketsa akhaonto ea hau, fetisetsa lichelete tsa tšepe ho tloha akhaonteng e 'ngoe ho ea ho e' ngoe. Joale, ho ile ha re jella eng ho aha PoC?

  • U hloka ho ithuta blockchain ka kakaretso le Hyperledger Fabric haholo-holo;
  • Ithute ho sebelisa IBM kapa maru a Amazon;
  • Ithute puo ea lenaneo la JS le moralo o mong oa webo;
  • Haeba lintlha tse ling li hloka ho bolokoa eseng ka har'a blockchain, empa sebakeng sa database se arohaneng, joale ithute ho kopanya, mohlala, le PostgreSQL;
  • 'Me qetellong empa bonyane - u ke ke ua phela lefatšeng la sejoale-joale ntle le tsebo ea Linux!)

Ha e le hantle, ha se saense ea rocket, empa u tla tlameha ho sebetsa ka thata!

Mehloli ho GitHub

Mehloli e kentsoeng GitHub. Tlhaloso e khuts'oane ea polokelo:
Catalog «seva»- Seva ea Node.js
Catalog «Mookameli»- mofani oa Node.js
Catalog «blockchain"(litekanyetso le linotlolo, ha e le hantle, ha li sebetse 'me li fanoa feela e le mohlala):

  • konteraka - khoutu ea mohloli oa konteraka e bohlale
  • sepache - linotlolo tsa mosebelisi bakeng sa ho sebelisa Hyperledger Fabric API.
  • *.cds - mefuta e hlophisitsoeng ea likonteraka tse bohlale
  • *.json lifaele - mehlala ea lifaele tsa tlhophiso bakeng sa ho sebelisa Hyperledger Fabric API

Ke qalo feela!

Source: www.habr.com

Eketsa ka tlhaloso