# 서비스체인 개발 디버깅 방법에 관해 질문 드리고자 합니다

**URL:** <https://devforum.kaia.io/t/topic/2356>\
**Category:** Kaia\
**Created:** [11월 11, 2021, 12:56오전 UTC](https://devforum.kaia.io/t/topic/2356 "2021-11-11T00:56:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BaSELab](https://yyz1.discourse-cdn.com/flex035/user_avatar/devforum.kaia.io/baselab/32/3079_2.png) [@BaSELab](https://devforum.kaia.io/u/BaSELab)\
**Post date:** [11월 11, 2021, 12:56오전 UTC](https://devforum.kaia.io/t/topic/2356/1 "2021-11-11T00:56:09Z")

</div>

안녕하세요. 현재 KIR 프로그램에 참여중인 BaSE Lab 입니다.

연구를 진행하는 과정에서 질문드리고 싶은 내용이 있어 글을 작성하였습니다. 확인하시면 답변 한 번 부탁드립니다.

서비스 체인을 저희 나름대로 구축해서 블록생성이 잘 되는것 까지 확인했습니다.

서비스 체인을 구축한 상태에서 코드를 수정하고자 하는데 코드 수정할때마다 수정된 코드 기반으로 네트워크를 다시 구축해야되는 어려움이 있는데 매번 네트워크를 새롭게 구축하는것이 아닌 방법이 있을지 궁금합니다.

또한, 자체적으로 개발을 하실때 어떻게 디버깅을 진행하면서 개발을 진행하는지 궁금합니다.

---

<div class="post-metadata">

**Author:** ![Ethan](https://yyz1.discourse-cdn.com/flex035/user_avatar/devforum.kaia.io/ethan/32/18_2.png) [@Ethan](https://devforum.kaia.io/u/Ethan)\
**Post date:** [11월 11, 2021, 11:53오후 UTC](https://devforum.kaia.io/t/topic/2356/2 "2021-11-11T23:53:15Z")

</div>

안녕하세요.

블록체인 코어를 수정하시더라도 기존 로직과 호환이 된다면 블록체인 네트워크를 다시 구축(다시 제네시스부터 시작) 하실 필요는 없습니다. 흔히 이야기하는 하드포크와 같이 기존 로직(블록 처리, 합의)과 호환이 안되는 경우에는 특정 블록 번호부터 새로운 로직을 적용하도록 코드를 작성하여 진행함으로써 블록처리/합의에 있어서 문제가 없도록 해야합니다.

Klaytn의 경우 BFT를 사용하기에 비호환 변경으로 fork가 발생하진 않으나 업데이트가 과반수 이상 되지 않으면 합의를 못하고 멈출수 있습니다.

Klaytn도 현재 이더리움 istanbul, london 하드포크에 대비하여 변경을 하고 바오밥에는 적용을 해놓았습니다  
아래 변경 점을 참고 부탁드립니다.

> <https://github.com/klaytn/klaytn/pull/901>
>
> \## Proposed changes
> \* renamed hardfork name -\> IstanbulCompatible
> \* renamed Pr…ecompiledContractsCypress -\> PrecompiledContractsConstantinople
> \* indicate TODO-IstanbulCompatible
> 
> \## Types of changes
> 
> Please put an x in the boxes related to your change.
> 
> \- \[\] Bugfix
> \- \[\] New feature or enhancement
> \- \[x\] Others
> 
> \## Checklist
> 
> \*Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.\*
> 
> \- \[x\] I have read the \[CONTRIBUTING GUIDELINES\](https://github.com/klaytn/klaytn/blob/master/CONTRIBUTING.md) doc
> \- \[x\] I have signed the \[CLA\](https://cla-assistant.io/klaytn/klaytn)
> \- \[x\] Lint and unit tests pass locally with my changes (\`$ make test\`)
> \- \[\] I have added tests that prove my fix is effective or that my feature works
> \- \[\] I have added necessary documentation (if appropriate)
> \- \[\] Any dependent changes have been merged and published in downstream modules
> 
> \## Related issues
> 
> \- Please leave the issue numbers or links related to this PR here.
> 
> \## Further comments
> 
> If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

> <https://github.com/klaytn/klaytn/pull/1031/files>
>
> \## Proposed changes
> 
> 
> The Istanbul compatible change will be activated at 697…50560 block number with this change. 
> The estimation date of the block number is \`Nov 15th 10:02:58\`.
> It is calculated as the following.
> \- 69670912: Sep 10th 10:02:58 
> \- 69670912 + 5702400 = 69670912 + 3600 \* 24 \* 66: (66 days from Sep 10th 10:02:58)
> \- 75373312: Nov 15th 10:02:58 (estimation)
> 
> 
> \## Types of changes
> 
> Please put an x in the boxes related to your change.
> 
> \- \[\] Bugfix
> \- \[\] New feature or enhancement
> \- \[x\] #1032
> 
> \## Checklist
> 
> \*Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.\*
> 
> \- \[x\] I have read the \[CONTRIBUTING GUIDELINES\](https://github.com/klaytn/klaytn/blob/master/CONTRIBUTING.md) doc
> \- \[x\] I have signed the \[CLA\](https://cla-assistant.io/klaytn/klaytn)
> \- \[\] Lint and unit tests pass locally with my changes (\`$ make test\`)
> \- \[\] I have added tests that prove my fix is effective or that my feature works
> \- \[\] I have added necessary documentation (if appropriate)
> \- \[\] Any dependent changes have been merged and published in downstream modules

---

<div class="post-metadata">

**Author:** ![BaSELab](https://yyz1.discourse-cdn.com/flex035/user_avatar/devforum.kaia.io/baselab/32/3079_2.png) [@BaSELab](https://devforum.kaia.io/u/BaSELab)\
**Post date:** [11월 18, 2021, 12:54오후 UTC](https://devforum.kaia.io/t/topic/2356/5 "2021-11-18T12:54:04Z")

</div>

추가 질문입니다.

저희가 지금 서비스체인 작동 방식을 상세하게 코드 수준으로 파악하기 위해서 디버깅 모드로 실행을 해보려고 하고 있습니다.

서비스체인용 별도 실행 쉘스크립트 없이 바로 main.go를 실행할 때 필요한 옵션이나 launch.json 파일 같은 것이 있다면 알려주실 수 있을까요?

참고로, main.go 실행 파라미터값을 아래와 같이 하고 디버깅하려고 했지만 잘 안되었습니다. 그냥 참고용으로 공유드립니다.

```auto
 "args": [
            "--metrics",  
            "--prometheus",
            "--multichannel",
            "--rpc",
            "--rpcapi=\"admin,debug,klay,miner,net,personal,rpc,txpool,web3\"",
            "--rpcport=8500",
            "--rpcaddr=\"0.0.0.0\"",
            "--rpccorsdomain=\"*\"",
            "--rpcvhosts=\"*\"",
            "--ws",
            "--wsapi=\"admin,debug,klay,miner,net,personal,rpc,txpool,web3\"",
            "--wsport=8900",
            "--wsaddr=\"0.0.0.0\"",
            "--wsorigins=\"*\"",
            "--networkid=1234",
            "--datadir=/Users/jaesunkim/Projects/klaytn_proj/node/en/data",
            "--port=51000",
            "--subport=51001",
            "--srvtype=\"fasthttp\"",
            "--verbosity=3",
            "--txpool.exec-slots.all=4096",
            "--txpool.nonexec-slots.all=4096",
            "--txpool.exec-slots.account=4096",
            "--txpool.nonexec-slots.account=4096",
            "--syncmode=\"full\"",
            "--maxconnections=10",
            "--vtrecovery"
        ]

```
