ãã®éšåã§ã¯ãSMSããããé»è©±ããªãã§ãç§ã«æçŽãæžããªãã§ãã ãã!!!!ã
æåã®éšåã¯ããã«ã2çªç®ã¯ããã«ãããŸã ã
4.5幎åãç§ã¯ãã®ããžãã¹ã«å®å šã«äžé©åãªèšèªãã€ãŸãPHPã§æå·é貚ãæžãå§ããã®ã¯ç¡è¬ã§ããã çµå±ãç§ã¯æžããŸããïŒç§ã¯é åºã§ãïŒããæŸèæã§æŸèæãæã«å ¥ããŸããããããäžè¬çã«æ©èœãããšããäºå®ã¯ãããçš®ã®éæ³ã§ããã
ç§ã¯ããã«ããªãã«èŠåããããšæããŸããç§ã¯ç¬åŠã®ããã°ã©ããŒã§ãååŠæŽã®ããããã°ã©ããŒã§ãããããŠããããç©ããã«èšãã°ãã³ãŒããæžãããšã¯çæ³çã§ã¯ãããŸããã
ããã¯ãã¹ãŠãç§ãã«ãã£ã¢ãšããååã®å¥³ã®åãšå¥ããåãæ¥ã«ïŒ2015幎4æ4æ¥ïŒGoãå匷ããŠæå·é貚ãæžãæããããšã«ãããšããäºå®ããå§ãŸããŸããã ãã¿ãã¬ã®äžã§ã«ãã£ã¢ã«ã€ããŠæžãããšã¯ã§ããŸããã ããã«ãããããããHabrã¯ãææç©èªã§ã¯ãªãITèšäºã®ããã«ããããŠGoããŒãã«èå³ã®ããå³ããITã®äººã ã®ããã«ãåã«ãã«ãã£ã¢ã«ã€ããŠããã¿ãã¬ã«æ³šæãæããªããããããŸããã
8ãæã®çµæïŒã¢ããªã±ãŒã·ã§ã³ã¯ãWinïŒ 64/32 ïŒãOSXïŒ64/32ïŒãLinuxïŒ64/32ïŒãFreeBSDïŒ64/32ïŒã Android ã IOS ïŒèª°ããApp Storeã«ãããããããšã¯ãŒã«ã«ãªããŸãïŒã§å®è¡ãããŸãïŒ
åèšã³ãŒãã¯çŽ73kè¡ã§ãç°ãªãOSã®ã³ãŒãã¯æ°çŸè¡çšåºŠã§ãã
40k-åŠç/ãããã¯çæ/ tr-17ã17.5k-ã€ã³ã¿ãŒãã§ãŒã¹çšã³ã³ãããŒã©ãŒã15.5k-ãã³ãã¬ãŒã
PostgreSQLãSQLiteãMySQLããµããŒããããŠããŸãã
ç§ã®äœåããã¹ããã人ã«èŠåããŸã-ãã°ããããããããŸãããæéãããã°ã darwin @ dcoin.clubãŸãã¯ããã®PMã§ãããã«ã€ããŠæžããŠãã ããã ææ¡ãã¢ããã€ã¹ãæè¿ããŸãã
æåã®2ã€ã®ããŒãã§ã¯ãWebãµãŒããŒãdcoinã§ã©ã®ããã«æ©èœããããããã³html / templateã«ã€ããŠèª¬æããŸããã
ãã®èšäºã§ã¯ãããŒã¿ããŒã¹ãã¢ããªã±ãŒã·ã§ã³ã®ã¹ã ãŒãºãªã·ã£ããããŠã³ããããã¯ã®æå·åãšè§£æã«ã€ããŠèª¬æããŸã
Katyaã«ã€ããŠ
äžæ©äžãç§ã圌女ãç ãããšãã§ããã圌ãã¯ãã éãã«æšªããããŸããã ç§ã®é ã®äžã«ã¯ãã圌女ãèŠãŠãç§ã¯å¥ã®ãã®ãèŠã€ããã ããã圌女ã¯äžååã ããšããèãããããŸããã 圌女ãèããŠããããšã¯ãç§ã«ã¯ããããŸããã
æããªãããã®çç±ã§ãç§ã¯åã³åœŒå¥³ãžã®æãæããŸããã 圌ã¯æé£ãé£ã¹ãã¹ãŒãã容åšã«è©°ããŠã«ãã£ã¢ãä»äºã§é£ã¹ãããã«ããã
æããªãããã®çç±ã§ãç§ã¯åã³åœŒå¥³ãžã®æãæããŸããã 圌ã¯æé£ãé£ã¹ãã¹ãŒãã容åšã«è©°ããŠã«ãã£ã¢ãä»äºã§é£ã¹ãããã«ããã
ããŒã¿ããŒã¹
dcoinã§ã¯ãsqliteãpostgresãmysqlããµããŒãããŸããã éåžžã®ãã¹ã¯ãããã¢ããªã±ãŒã·ã§ã³ã§ã¯ãããã©ã«ãã§sqliteãéžæãããŸãã äœåãªãã®ãè¿œå ããå¿ èŠã¯ãããŸããã dcoinããŒã«ãäžãã人ã¯ãpostgresãšmysqlã®ã©ã¡ãããéžã¶æ¹ãè¯ãã§ãããã
golangã§SQLããŒã¿ããŒã¹ãæäœããã«ã¯ãããã±ãŒãžããŒã¿ããŒã¹/ sqlã責任ãè² ããŸãã sqlite ã postgresql ã mysqlããŒã¿ããŒã¹ãã©ã€ããŒãæ¥ç¶ããå¿ èŠããããŸãã
æåã¯sqliteã®ã¿ã䜿çšããŠãããpostgresqlãšmysqlãæ¥ç¶ããããšã«ããŸããã ããã»ã©é£ãããªãããšãå€æããŸããã sql.OpenïŒïŒã§ããŒã¿ããŒã¹ã«æ¥ç¶ããããã®ãã©ã¡ãŒã¿ãŒã®ã¿ãå€æŽããSQLã¯ãšãªã®æ§æã®éããèæ ®ããå¿ èŠããããŸããã
ãããããŒã¿ããŒã¹ãžã®æ¥ç¶ã®å®è£ ã§ãã
ããŒã¿ããŒã¹ã®æäœã«ã©ãããŒã䜿çšããªãã£ãã®ã¯ã å€ãããŒãžã§ã³ã®Dcoinãããã¢sqlã¯ãšãªã転éããæ¹ã䟿å©ã§ãããåãçç±ã§ãããŒã¿ããŒã¹ããåãåã£ãããŒã¿åã®å€æã䌎ãã³ãŒãã®æ§æãããªã貧匱ã§ãã
ç§ãèžãã çæïŒ
1. db.QueryïŒ "sql"ïŒã®åŸã«rows.CloseïŒïŒãåŒã³åºãããšãå¿ããå ŽåãéããããŠããªãæ¥ç¶ããããããããŸãã
2.ãšã©ãŒåŠçã®åã«deferãåŒã³åºãããšã¯ã§ããŸããã ãšã©ãŒãããå Žåãrowã¯nilã«ãªããrows.CloseïŒïŒãåŒã³åºããšãããã¯ãçºçããŸãã ããã¯ã§ããŸããïŒ
rows, err := db.Query("SELECT * FROM table") defer rows.Close() if err != nil { return err }
ããã¯æ¬åœã§ãïŒ
rows, err := db.Query("SELECT * FROM table") if err != nil { return err } defer rows.Close()
Katyaã«ã€ããŠ
ãã®åŸã圌女ã¯äœåºŠãäŒè°ã®ã¹ã±ãžã¥ãŒã«ãå€æŽããŸããã çç±ã¯ããããŸããããæ¯æ¥åœŒå¥³ã«æãããããã«ãªããŸããã ç§ã¯åœŒå¥³ã ãã欲ããã£ããç§ã¯åœŒå¥³ã ããèããã ããæç¹ã§ãç§ã¯åœŒå¥³ãšçµå©ããããšæãããã«ãªããŸããã ç§ã¯å¶ç¶stiehi.ruã§ã±ã€ãã£ã®è©©ãèŠã€ããŸãããç§ãå«ãã äžç¯ã®åŸã§ãããã¯åœŒå¥³ã®å
ããŒã€ãã¬ã³ãã圌女ãã²ã©ãæ±ã£ãæ¹æ³ã«ã€ããŠã§ããã ç§ã¯å€¢äžã«ãªããŸããã圌女ã®ããã«ç§ãæããæ°æã¡ã¯å¥åŠã§ãç§ã«ã¯ã¯ã£ããããŠããŸããã§ãããç§ã¯ãã®ãããªç¶æ
ãæã£ãŠããããšããããŸããã
ãžã§ã³ãœã³
type minersDataType struct { hosts string `json:"hosts"` } func main() { result_ := minersDataType{hosts: "pool.dcoin.club"} result, _ := json.Marshal(result_) }
çµæã«ã¯ã{}ããå«ãŸããŸã
ãã¹ãããã¹ãã«çœ®ãæãããšããã¹ãŠãæ©èœããçµæã«{"hosts"ïŒ "111111"}ã衚瀺ãããŸãã
type minersDataType struct { Hosts string `json:"hosts"` } func main() { result_ := minersDataType{Hosts: "pool.dcoin.club"} result, _ := json.Marshal(result_) }
ç§ã¯ããã«é·ãé銬鹿ã ã£ãã®ã§ã誰ããåãçæãèžãŸãªãããã«æ å ±ãäœã£ãŠããŸã
Katyaã«ã€ããŠ
圌ã¯ã«ãã£ã¢ã«ç§ã圌女ãæããŠãããšæžãããç§ã¯åœŒå¥³ãšäžç·ã«ãããã ãšã«ãã圌女ã¯ããŒãã«èãç¶ããã ç²ããŠãç§ã¯åœŒå¥³ã®å¥œããªè±ãè²·ã£ãŠãäŒãã«åœŒå¥³ã«è¡ããŸããã äœããã®çç±ã§ãç§ã¯åœŒå¥³ã®è©©ã®1ã€ãåŠã³ããããŸããã å°çããŠã誰ã家ã«ããŸããã é»è©±ãå¿çããŠããŸããã
ä¿¡å·
ãããã¯ã®è§£æããã»ã¹ã§ããã°ã©ã ãçµäºãããšãããŒã¿ãå®å šã«å ¥åããããéåæåãçºçããå ŽåããããŸãã ããšãã°ãèŠè¶ãã©ã³ã¶ã¯ã·ã§ã³ã¯åŠçãããŠããŸãããååŽãã©ã³ã¶ã¯ã·ã§ã³ã¯åŠçãããŠããŸããã ãããã£ãŠãã¢ããªã±ãŒã·ã§ã³ãéããããã®ä¿¡å·ãããå Žåã¯ãã¹ã ãŒãºã«çµäºããããšãéèŠã§ã
SigChan = make(chan os.Signal, 1) C.waitSig() // go func() { signal.Notify(SigChan, os.Interrupt, os.Kill, syscall.SIGTERM) // , <-SigChan // , for i := 0; i < countDaemons; i++ { daemons.DaemonCh <- true answer := <-daemons.AnswerDaemonCh } // , DB.Close() }()
C.waitSigïŒïŒ-ããã¯ãŠã£ã³ããŠã«å¿ èŠã§ãã Windows Goã®ä¿¡å·ã¯è¡šç€ºãããŸããã
/* #include <stdio.h> #include <signal.h> extern void go_callback_int(); static inline void SigBreak_Handler(int n_signal){ go_callback_int(); } static inline void waitSig() { #if (WIN32 || WIN64) signal(SIGBREAK, &SigBreak_Handler); signal(SIGINT, &SigBreak_Handler); #endif } */ import ( "C" ) //export go_callback_int func go_callback_int() { SigChan <- syscall.Signal(1) }
SIGBREAKãŸãã¯SIGINTãå°çãããšãSigBreak_HandlerãåŒã³åºãããgo_callback_intãåŒã³åºãããå®äºã®ã·ã°ãã«ããã£ãããšãSigChanãã£ãã«ã«éä¿¡ãããŸãã
Dcoinã§ã¯ãä¿¡å·åŠçãããã«å®è£ ãããŠããŸãã
Katyaã«ã€ããŠ
ç§ã¯VKã§åœŒå¥³ã«æçŽãæžãã圌女ã¯å®¶ã§éºäœãå¿ããŠãããšèšããŸããããããŠä»ã圌女ã«ã¯å人ãããŸããã ç§ã¯åœŒå¥³ãåŸ
ã€ãšæžããã ãã®åŸã圌ã¯ãåã³ç§ã«é»è©±ãããæžãããããªãã§ãã ãã!!!!ããåãåããŸããã 質åã¯ããŸããã§ãããé£ã®ã¢ããŒãã«é»è©±ããã«ãã£ã¢ã家ã«ãããšãã«è±ãèŽãããã«é Œã¿ãŸããã 圌ã¯æ°æéåŸã«Dcoin on Goãæžãæããããšã決ããåŸã家ã«çããŸããã
æå·å
Goã§AESã䜿çšããŠããŒãæå·åããJSã§åŸ©å·åããå¿ èŠããããŸããã ç§ã¯çŽ2æ¥éèŠãããããŸããã æå·åãããããã¹ãèªäœãšãšãã«IVãéä¿¡ããå¿ èŠãããããšãããããŸãã ããã«ãã®æ©èœããããŸã
func Encrypt(password, text []byte) ([]byte, error) { iv := []byte(RandSeq(aes.BlockSize)) c, err := aes.NewCipher(password) if err != nil { return nil, ErrInfo(err) } plaintext := PKCS5Padding([]byte(text), c.BlockSize()) cfbdec := cipher.NewCBCEncrypter(c, iv) EncPrivateKeyBin := make([]byte, len(plaintext)) cfbdec.CryptBlocks(EncPrivateKeyBin, plaintext) EncPrivateKeyBin = append(iv, EncPrivateKeyBin...) return EncPrivateKeyBin, nil }
ããã³JSã§ã®åŸ©å·åïŒ
ivAndText = atob(text); iv = ivAndText.substr(0, 16); encText = ivAndText.substr(16); cipherParams = CryptoJS.lib.CipherParams.create({ ciphertext: CryptoJS.enc.Base64.parse(btoa(encText)) }); password = CryptoJS.enc.Latin1.parse(hex_md5(password)); var decrypted = CryptoJS.AES.decrypt(cipherParams, password, {mode: CryptoJS.mode.CBC, iv: CryptoJS.enc.Utf8.parse(iv), padding: CryptoJS.pad.Iso10126 }); var decryptedText = hex2a(decrypted.toString());
workerã§åŸ©å·åãè¡ããŸããããããªããšãåæã®ããã«ãã©ãŠã¶ãŒãäžæçã«ãã³ã°ããŸãã
解æãããã¯
dcparserããã±ãŒãžã¯ããããã¯ãçŽæ¥è§£æããããŒãã«ã«ããŒã¿ãå ¥åããŸã
ããšãã°ãæ°ãããŠãŒã¶ãŒããŒãåºæ¬çã«ã¯æ°ããDcoinãŠãŒã¶ãŒ-new_user.goãç»é²ãããã©ã³ã¶ã¯ã·ã§ã³ãèããŸãã
NewUserInitã¯ããã®ãã©ã³ã¶ã¯ã·ã§ã³ã®ããŒã¿ãå«ãå€æ°ãèšå®ããŸãã ãããã¯2ã€ã ãã§ã-public_keyãšsign
NewUserFrontã¯ãããŒã¿ã®ãã§ãã¯ãæ åœããŸãã ç¹ã«ããã®ãã©ã³ã¶ã¯ã·ã§ã³ãçæãããŠãŒã¶ãŒããã€ããŒã§ãããã©ããã確èªããŸãã å¶éãè¶ ããŠãããã©ããã確èªããŸãã
NewUserã¯ããŒã¿ããŒã¹ã«ããŒã¿ãæžã蟌ã¿ãŸã
NewUserRollbackFrontã¯ãNewUserFrontã¡ãœããã«ãã£ãŠè¡ãããå€æŽãããŒã«ããã¯ããŸã
NewUserRollbackã¯ãNewUserã¡ãœããã«ãã£ãŠå ¥åãããããŒã¿ãããŒã«ããã¯ããŸã
70çš®é¡ã®ãã©ã³ã¶ã¯ã·ã§ã³ã®ããããã«å¯ŸããŠãåæ§ã®4ã€ã®æ¹æ³ããããŸãã
270,000ãããã¯ãã©ã®ããã«è§£æãããããã¡ãã£ãšæ³åããŠã¿ãŠãã ããã 70åã®ã¡ãœããã180åã®ããŒãã«ãš1100åã®ç°ãªãåã«ããŒã¿ãå ¥åããŸãã ãããŠãç§ãæãé äºããŠããã®ã¯ãRollbackãšRollbackFrontãä»ããŠãéã®é åºã§1ã€ã®ãããã¯ã®ãã¹ãŠã®ããŒã¿ãããŒã«ããã¯ããããšã§ãã ãã®ãããªå®å šãªããŒã«ããã¯ã¯ãdcparserã®æ£ããåäœããã¹ãããããã«è¡ãããŸãã ã©ããã§ããŒã¿ã誀ã£ãŠå ¥åãããå Žåãããã¯ããã«è¡šç€ºãããŸãã
Katyaã«ã€ããŠ
æ°æ¥åŸãç§ã¯åœŒå¥³ã«ãæ°ã¶æéãèªåã®ãããžã§ã¯ãã«åãã£ãŠãããšæžããŠãäœãããŠãããªãããã«ãšé Œã¿ãŸããã 1é±éåŸãã«ãã£ã¢ããããã¹ãã¡ãã»ãŒãžãå±ããŸããã
ãããã«
次ã®èšäºã§ã¯ãgomobileãå°ãå€æŽããéç¥ãè¿œå ããiOSããã³Androidã¢ããªã±ãŒã·ã§ã³ã®ããã¯ã°ã©ãŠã³ãã§äœæ¥ããæ¹æ³ã«ã€ããŠèª¬æããŸãã