Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Genesis block from config #9

Closed
junbeomlee opened this issue Apr 17, 2018 · 11 comments
Closed

Genesis block from config #9

junbeomlee opened this issue Apr 17, 2018 · 11 comments

Comments

@junbeomlee
Copy link
Member

Genesis block은 config파일로부터 생성되며, 피어들은 같은 genesis.conf로 시작한다.

@ttkmw
Copy link
Collaborator

ttkmw commented Apr 19, 2018

it-chain-Engine/conf/config.yaml 파일에서 데이터를 불러들여서 Genesis block을 생성한다고 이해했는데 맞나용??(꼭 엔진에 있는 config.yaml파일이 아니어도, yaml형식의 파일을 불러들여 Genesis block을 생성하는게 맞나요?) @junbeomlee

@junbeomlee
Copy link
Member Author

넵 config.yaml은 아니고 따로 config파일을 하나 만들고 그 file을 기반으로 만들 계획입니다. 아직 yaml일지 json일지는 생각안해봤습니다!

@ttkmw
Copy link
Collaborator

ttkmw commented Apr 20, 2018

네 감사합니다~

@byron1st
Copy link
Contributor

config도 하나의 Tx로 처리하고, initial Tx의 고유한 Hash 값을 갖고 접근하는 Peer 들은 동일한 genesis block을 갖는 Peer라고 인식하는 것은 어떨까요?

@ttkmw
Copy link
Collaborator

ttkmw commented Apr 21, 2018

그렇게 되면 어떤 장점이 생기는건가용??
genesis block을 생성하기 위해서는initial tx를 먼저 생성해야하는건가요??

@byron1st
Copy link
Contributor

@junk-sound config 파일을 따로 두지 않아도 될 것 같아서 생각해본 것인데요, 일단은 제가 남긴 댓글은 고려하지 않으셔도 될 것 같아요.

@junbeomlee 님과 따로 논의를 좀 해본 부분인데요, yggdrasill 라이브러리는CreateNewBlock 함수만 하나 놔두고, CreateNextBlock, CreateGenesisBlock 함수는 it-chain-Engine 으로 이동하는게 어떨지 제안드립니다. yggdrasill에서는 complete 하게 주어진 파라미터에 따라 DefaultBlock 객체를 생성해서 반환하는 것만 하고, 그 객체가 genesis block 인지, next block 인지 판단해서 사용하는건 it-chain-Engine에서 하는게 맞지 않나 싶습니다. 만약 옮긴다고 하면, @junk-sound 님의 Pull Request #12 에서 CreateGenesisBlock 코드를 it-chain-Engine의 코드로 옮기면 될 것으로 보입니다.

@junbeomlee 님도 의견 주시고, @junk-sound 님도 의견 주세요~!

@junbeomlee
Copy link
Member Author

@junk-sound
yggdrasill은 block과 transaction의 형태가 정해지지않더라도 interface만 맞추면 저장할 수 있는 라이브러리 이기 때문에, config.json으로 부터 block의형태를 지정할 수 가 없습니다. 따라서 yggdrasill라이브러리에서 CreateGensisBlock을 하지 않고 it-chain-Engine에서 사용하는 Block 형태로 config를 만들고 그곳에서 넣어주는것이 맞을 것 같습니다. CreateNextBlock도 같은 방식이라 생각합니다.

@ttkmw
Copy link
Collaborator

ttkmw commented Apr 23, 2018

@junbeomlee 그렇군요!! 알겠습니다. 다시 생각해보고 코드를 짜보겠습니다!
@byron1st 넵 그렇게 하는 것이 라이브러리의 역할을 잘 수행하게 될 것 같네요! 말씀해주신 부분 참고하여 다시 생각해보겠습니다 감사합니다!

@junbeomlee
Copy link
Member Author

@junk-sound
CreateGensisBlock을 blockchain으로 옮기고 api에 넣을지 service에 넣을지 언제 genesisblock을 생성할지 고민해야 할 것 같습니다!! 부담갖지 마시고 자유롭게 코드 올려주세요!!

@ttkmw
Copy link
Collaborator

ttkmw commented Apr 24, 2018

@junbeomlee 네 알겠습니당~~

@junbeomlee
Copy link
Member Author

junbeomlee commented Apr 25, 2018

이부분은 it-chain-Engine으로 옮기고 종료하겠습니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants