이슈 1)

cmdμ—μ„œ go build

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/7957003c-bfa0-4fc5-a4e5-0863d280150c/Untitled.png

β†’ goκ°€ μ„€μΉ˜ μ•ˆλ˜μ–΄ μžˆλ‹€λŠ” μ—λŸ¬


λŒ€μ‘ 1)

vscode(μ΅μŠ€ν…μ…˜μœΌλ‘œ goμ„€μΉ˜)μ—μ„œ go build

β†’ 성곡 : contract 생성

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a73dabf3-0250-4c3b-aa90-51c63e7245ba/Untitled.png

but

cliSA μ»¨ν…Œμ΄λ„ˆλ₯Ό ν†΅ν•΄μ„œ 1 μ²΄μΈμ½”λ“œ μ„€μΉ˜ν•˜κΈ° μ•ˆλ¨

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/1c379b23-561d-4737-bf63-8ca782a04215/Untitled.png

β†’ /opt/gopath/src 경둜 쀑볡 μ—λŸ¬

λŒ€μ‘ 2)

μš°λΆ„νˆ¬μš© GO λ‹€μš΄λ‘œλ“œ

λŒ€μ‘ 3)

ꡬ글링

cmdμ—μ„œ μ„€μΉ˜ : sudo apt-get install golang

λ‹€μ‹œ μ‹œλ„,

contract ν΄λ”λ‘œ 이동

cmdμ—μ„œ go build

β†’ 성곡 : contract 생성

configuration ν΄λ”λ‘œ 이동

μ•„κΉŒ μ„€μΉ˜ν•˜κ³  μ΄μš©ν•˜λ‹€ μ€‘λ‹¨λœ cliSAμ»¨ν…Œμ΄λ„ˆ 제거

docker rm -f cliSA

β†’ 성곡 : cliSA

λ‹€μ‹œ μ»¨ν…Œμ΄λ„ˆ μˆ˜ν–‰

docker-compose -f docker-compose.yml up -d cliSA

β†’ 성곡 : Creating cliSA ... done

μ²΄μΈμ½”λ“œ λ°°ν¬ν•˜κΈ°

docker exec cliSA peer chaincode instantiate -n simpleasset -v v1 -C mychannel -c '{"Args":[]}' -P 'AND ("Org1MSP.member")'

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/4d09acd2-c78e-4b8b-be10-edd5c97a460d/Untitled.png

β†’ 성곡 but μƒˆλ‘œμš΄ 이슈

Error: could not assemble transaction, err proposal response was not successful, error code 500, msg cannot get package for chaincode (simpleasset:v1)

λŒ€μ‘ 4)

μ²΄μΈμ½”λ“œ(simpleasset)의 버전 이슈둜 νŒλ‹¨ν•˜μ—¬ μ½”λ“œ 리뷰

ν™•μΈν•΄λ³΄λ‹ˆ, v1.1 μ½”λ“œλΌμ„œ v1으둜 λ³€κ²½

λ‹€μ‹œ μ‹œλ„

이전 contract μ‚­μ œ ν›„, v1버전 μ²΄μΈμ½”λ“œ(simpleasset)둜 λ‹€μ‹œ go build

cliSAμ»¨ν…Œμ΄λ„ˆ 제거 ν›„, λ‹€μ‹œ cliSA μ»¨ν…Œμ΄λ„ˆ μˆ˜ν–‰

cliSA에 μ²΄μΈμ½”λ“œ 배포

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/4d09acd2-c78e-4b8b-be10-edd5c97a460d/Untitled.png

β†’ λ™μΌν•œ μ—λŸ¬

λŒ€μ‘ 5)

κ·Έλž˜λ„ μ•ˆλ˜λ„€?

go build둜 μƒμ„±ν•œ contractλ₯Ό μ‹€ν–‰ν•΄μ•Όν•˜λŠ” 건데 λ‚΄κ°€ λ†“μΉœκ±΄κ°€? ν˜Ήμ‹œλͺ°λΌμ„œ μ‹€ν–‰ν•΄λ΄„

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/f1a5a597-d13f-44dc-908a-8581e1585e9b/Untitled.png

β†’ μ•ˆλ¨. Error starting SimpleAsset chainocode: error chaincode id not provided

β†’ μ²΄μΈμ½”λ“œ 코딩에 λ¬Έμ œκ°€ μžˆλ‹€κ³  ν•˜λŠ” 것 같은데.. 이거.. 받은 코든데..?

ν•œνŽΈ,

μ§€κΈˆ 가상 μ»΄ν“¨νŒ… μƒνƒœλŠ” ...

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/60296a49-66a6-46b6-bc68-8e64aad539aa/Untitled.png

**μ΅œκ΄‘ν›ˆ λ°•μ‚¬λ‹˜ SOS)**

<aside> πŸ’‘ λ°°ν¬λŠ” ν•΄λ‹Ή peer에 μ„€μΉ˜λœ μ²΄μΈμ½”λ“œμ΄λ¦„κ³Ό λ²„μ „μœΌλ‘œλ§Œ κ°€λŠ₯ν•©λ‹ˆλ‹€. ν•œλ²ˆ 배포된 μ²΄μΈμ½”λ“œλŠ” 같은 μ΄λ¦„μœΌλ‘œ λ‹€μ‹œ λ°°ν¬λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€

</aside>

  1. μƒˆλ‘œμš΄ 폴더 v1을 λ§Œλ“€κ³  이전에 있던 goνŒŒμΌμ„ v1으둜 이동.

  2. docker exec cliSA peer chaincode install -n simpleasset -v v1 -p github.com/contract λͺ…령을 β†’ docker exec cliSA peer chaincode install -n simpleasset -v v1 -p [github.com/contract/v1](<http://github.com/contract/v1>) 둜 μˆ˜μ •ν•΄μ„œ μ‹€ν–‰

κ²°κ³Ό : "OK~ "

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/22e326e0-4a30-4d51-b2eb-42e5c822ba24/Untitled.png