匿名用户2021年11月30日
75阅读
所属分类、Web3、区块链
授权协议GPL-3.0 License

作品详情

mixin

TheMixinBFT-DAGnetworkreferenceimplementation,theTrustedExecutionEnvironmentisnotintegratedintothisrepositoryyet.

GetStarted

InstallgolangandsetupGOPATHfollowingthisguidehttps://golang.org/doc/install.

$gitclonehttps://github.com/MixinNetwork/mixin.git$cdmixin$gobuild

ThemixincommandisboththekernelnodeandtoolstocommunicatewiththenodeRPCinterface.

$mixinNAME:mixin-Afree,lightningfastanddecentralizednetworkfortransferringdigitalassets.USAGE:mixin[globaloptions]command[commandoptions][arguments...]VERSION:v0.12.0COMMANDS:kernel,kStarttheMixinKerneldaemoncloneCloneagraphtointializethekernelsetuptestnetSetupthetestnodesandgenesiscreateaddressCreateanewMixinaddressdecodeaddressDecodeanaddressaspublicviewkeyandpublicspendkeydecodesignatureDecodeasignaturedecryptghostkeyDecryptaghostkeywiththeprivateviewkeyupdateheadreferenceUpdatethecacheroundexternalreference,neveruseitunlessagreebyothernodesremovegraphentriesRemovedataentriesbyprefixfromthegraphdatastoragevalidategraphentriesValidatetransactionhashintegrationsignrawtransactionSignaJSONencodedtransactionsendrawtransactionBroadcastahexencodedsignedrawtransactiondecoderawtransactionDecodearawtransactionasJSONbuildnodepledgetransactionBuildthetransactiontopledgeanodebuildnodecanceltransactionBuildthetransactiontocancelapledgingnodedecodenodepledgetransactionDecodetheextrainfoofapledgetransactiongetroundlinkGetthelatestlinkbetweentwonodesgetroundbynumberGetaspecificroundgetroundbyhashGetaspecificroundlistsnapshotsListfinalizedsnapshotsgetsnapshotGetthesnapshotbyhashgettransactionGetthefinalizedtransactionbyhashgetcachetransactionGetthetransactionincachebyhashgetutxoGettheUTXObyhashandindexlistmintworksListmintworkslistmintdistributionsListmintdistributionslistallnodesListallnodeseverexistedgetinfoGetinfofromthenodedumpgraphheadDumpthegraphheadhelp,hShowsalistofcommandsorhelpforonecommandGLOBALOPTIONS:--nodevalue,-nvaluethenodeRPCendpoint(default:"127.0.0.1:8239")--dirvalue,-dvaluethedatadirectory--timeprinttheruntime(default:false)--help,-hshowhelp(default:false)--version,-vprinttheversion(default:false)MixinKernelAddress

MixinKerneladdressareapairofed25519keys,followingtheCryptoNoteprotocol.Tocreateanewaddressusethecreateaddresscommand.

$mixincreateaddressaddress:XINJkpCdwVk3qFqmS3AAAoTmC5Gm2fR3iRF7Rtt7hayuaLXNrtztS3LGPSxTmq5KQh3KJ2qYXYE5a9w8BWXhZAdsJKXqcvUrviewkey:568302b687a2fa3e8853ff35d99ffdf3817b98170de7b51e43d0dcf4fe30470fspendkey:7c2b5c97278ed371d75610cccd9681af31b0d99be4adc2d66983f3c455fc9702

SharetheaddresstoreceiveassetsfromotherMixinKerneladdresses,andkeepviewkeyandspendkeyprivatelyandsecurely.

Boththeviewkeyandspendkeyarerequiredtospendtheassetsreceivedfromothers,andtheviewkeyiteselfissufficienttodecodeandviewallthetransactionssenttoaddress.

SignandSendRawTransaction

BasicMixinKerneltransactionissimilartothetransactioninBitcoin,withfollowingformat.

{"version":1,"asset":"a99c2e0e2b1da4d648755ef19bd95139acbbe6564cfb06dec7cd34931ca72cdc","extra":"34366362393932382d653636632d343966392d386165632d366462366137346666663638","outputs":[{"type":0,"amount":"115.06849309","script":"fffe01","accounts":["XINPXu5NBXszhpZDRJ8iA26TbQ2oWTSq1tXqKKeVeYWgLSz8yXGTtVhMogynYytoMewYVFR541wauLhy1YV33zg445E49YA7"]}],"inputs":[{"hash":"20001842d6eff5129c11f7c053bf1209f0267bf223f1681c9cb9d19fc773a692","index":11}]}

ThisisthesameUTXOmodelusedinBitcoin,butwithdifferentfieldnames.Amongthemversion,typeandscriptshouldnotbemodifiedunlessyouknowsomeadvancedtopics.

CompacttherawtransactionJSONandsignitwiththeprivateviewandspendkeyasfollowing.

$mixinsignrawtransaction-nmixin-node:8239\-key0d48c96d383d325a97eea5295cbf3afa7766c49db477b68fd8032ff7f59b0b00d77e434f96f3f42c2d1796662c7cc90497feaf3863a5815f27ba49fd5e29b906\-raw'{"version":1,"asset":"a99c2e0e2b1da4d648755ef19bd95139acbbe6564cfb06dec7cd34931ca72cdc","extra":"34366362393932382d653636632d343966392d386165632d366462366137346666663638","outputs":[{"type":0,"amount":"115.06849309","script":"fffe01","accounts":["XINPXu5NBXszhpZDRJ8iA26TbQ2oWTSq1tXqKKeVeYWgLSz8yXGTtVhMogynYytoMewYVFR541wauLhy1YV33zg445E49YA7"]}],"inputs":[{"hash":"20001842d6eff5129c11f7c053bf1209f0267bf223f1681c9cb9d19fc773a692","index":11}]}'StartaKernelNode

Tostartanode,createadirectorymixinfortheconfigandnetworkdatafiles,thenputthegenesis.json,nodes.jsonandconfig.tomlfilesinit.

Themainnetgenesis.json,nodes.jsonandanexampleconfig.example.tomlfilescanbeobtainedfromhere,youonlyneedtoputyourownsignerspendkeyintheconfig.tomlfile.

Changetheconsensus-onlyoptiontofalsewillallowthenodetostartinarchivemode,whichsyncsallthegraphdata.

$mixinhelpkernelNAME:mixinkernel-StarttheMixinKerneldaemonUSAGE:mixinkernel[commandoptions][arguments...]OPTIONS:--dirvalue,-dvaluethedatadirectory--portvalue,-pvaluethepeerporttolisten(default:7239)LocalTestNet

Thiswillsetupaminimumlocaltestnet,withallnodesinasingledevice.

$mixinsetuptestnet$mixinkernel-dir/tmp/mixin-7001-port7001$mixinkernel-dir/tmp/mixin-7002-port7002$mixinkernel-dir/tmp/mixin-7003-port7003$mixinkernel-dir/tmp/mixin-7004-port7004$mixinkernel-dir/tmp/mixin-7005-port7005$mixinkernel-dir/tmp/mixin-7006-port7006$mixinkernel-dir/tmp/mixin-7007-port7007
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论