TheMixinBFT-DAGnetworkreferenceimplementation,theTrustedExecutionEnvironmentisnotintegratedintothisrepositoryyet.
GetStartedInstallgolangandsetupGOPATHfollowingthisguidehttps://golang.org/doc/install.
$gitclonehttps://github.com/MixinNetwork/mixin.git$cdmixin$gobuildThemixincommandisboththekernelnodeandtoolstocommunicatewiththenodeRPCinterface.
$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)MixinKernelAddressMixinKerneladdressareapairofed25519keys,followingtheCryptoNoteprotocol.Tocreateanewaddressusethecreateaddresscommand.
$mixincreateaddressaddress:XINJkpCdwVk3qFqmS3AAAoTmC5Gm2fR3iRF7Rtt7hayuaLXNrtztS3LGPSxTmq5KQh3KJ2qYXYE5a9w8BWXhZAdsJKXqcvUrviewkey:568302b687a2fa3e8853ff35d99ffdf3817b98170de7b51e43d0dcf4fe30470fspendkey:7c2b5c97278ed371d75610cccd9681af31b0d99be4adc2d66983f3c455fc9702SharetheaddresstoreceiveassetsfromotherMixinKerneladdresses,andkeepviewkeyandspendkeyprivatelyandsecurely.
Boththeviewkeyandspendkeyarerequiredtospendtheassetsreceivedfromothers,andtheviewkeyiteselfissufficienttodecodeandviewallthetransactionssenttoaddress.
SignandSendRawTransactionBasicMixinKerneltransactionissimilartothetransactioninBitcoin,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}]}'StartaKernelNodeTostartanode,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)LocalTestNetThiswillsetupaminimumlocaltestnet,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
评论