Phot_o_matic Programming

고정 헤더 영역

글 제목

메뉴 레이어

Phot_o_matic Programming

메뉴 리스트

  • 홈
  • 태그
  • 방명록
  • 분류 전체보기
    • Programming
      • TIL
      • Concept
      • Algorithm
      • Hello, stranger
      • Mindchain
      • Python
      • Vue
      • React
      • Git
      • GraphQL
      • Database
      • Twittler
      • Typescript
    • Photography
      • Olympus
      • Canon
    • IT
    • Daily
      • Yummy

검색 레이어

Phot_o_matic Programming

검색 영역

컨텐츠 검색

Programming/Typescript

  • Typescript로 블록체인 만들기 4) Block 만들기

    2019.04.28 by 쌩우

  • Typescript로 블록체인 만들기 3) class와 private, public

    2019.04.26 by 쌩우

  • Typescript로 블록체인 만들기 1) Typescript 환경 설정과 compiling - Typescript

    2019.04.26 by 쌩우

Typescript로 블록체인 만들기 4) Block 만들기

기본적인 Block의 구조를 갖출 수 있도록 class를 만들어준다. index.ts class Block { public index: number; public hash: string; public previousHash: string; public data: string; public timestamp: number; constructor( index: number, hash: string, previousHash: string, data: string, timestamp: number ) { this.index = index; this.hash = hash; this.previousHash = previousHash; this.data = data; this.timestamp = timestamp;..

Programming/Typescript 2019. 4. 28. 18:37

Typescript로 블록체인 만들기 3) class와 private, public

지난 번에는 객체 파라미터를 적용시키기 위하여 interface라는 개념을 도입했다. 하지만 interface는 javascript로 compile 시킬 때에 반영이 되지 않는다. 따라서, compile 후 react 등과 같이 기타 라이브러리에서 사용하고자 한다면 typescript에서부터 class로 정의하는 것이 좋다. index.ts class Human { public name: string; public age: number; public gender: string; constructor(name: string, age: number, gender: string) { this.name = name; this.age = age; this.gender = gender; } } // class의 p..

Programming/Typescript 2019. 4. 26. 19:11

Typescript로 블록체인 만들기 1) Typescript 환경 설정과 compiling - Typescript

Typescript는 기본적으로는 Javascript와 다르지 않다. 하지만 Typescript 파일을 Javascript 파일로 변환하는 과정(compiling)이 있어야 Nodejs 등에서 인식을 할 수 있으므로, 그에 필요한 사전설정이 필요하다. typescript를 사용하기 위한 설치 방법은 다른 사람들이 잘 정리해놓아서 따로 기재하진 않겠다. 블록체인 만들기에서는 "yarn"이라는 패키지 매니저를 사용할 것이므로, 따로 yarn 설치를 해 주었다. 그 후 yarn init으로 package.json 생성 및 기본 정보 설정 index.ts라는 이름의 typescript 파일 생성 package.json의 "scripts"에 "prestart"와 "start" 추가 (yarn start 실행 시,..

Programming/Typescript 2019. 4. 26. 02:28

추가 정보

인기글

최신글

페이징

이전
1
다음
Phot_o_matic Programming © phot_o_matic
페이스북 트위터 인스타그램 유투브 메일

티스토리툴바